From 812d2b6d138263beb91683983bd1b1fe82bb40d5 Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Tue, 27 Nov 2018 23:05:53 +0800
Subject: [PATCH 001/119] Translating 7 command-line tools for writers.
---
...line tools for writers - Opensource.com.md | 73 +++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
new file mode 100644
index 0000000000..4d2edb8472
--- /dev/null
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -0,0 +1,73 @@
+给写作者们的 7 个命令行工具 | Opensource.com
+======
+扔掉你的打字机,然后使用这些开源工具在命令行上编辑吧。
+
+
+对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有很多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。
+
+在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等——无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。
+
+下面是一些在任何写作情况下都有用的命令行工具。
+
+### 编辑器
+
+Yes, you _can_ do actual writing at the command line. I know writers who do their work using editors like [Nano][2], [Vim][3], [Emacs][4], and [Jove][5] in a terminal window. And those editors [aren't the only games in town][6]. Text editors are great because they (at a basic level, anyway) are easy to use and distraction free. They're perfect for tapping out a first draft of anything or even completing a long and complicated writing project.
+
+If you want a more word processor-like experience at the command line, take a look at [WordGrinder][7] . WordGrinder is a bare-bones word processor, but it has more than enough features for writing and publishing your work. It supports basic formatting and styles, and you can export your writing to formats like Markdown, ODT, LaTeX, and HTML.
+
+### 拼写检查
+
+Every writer does (or at least should do) a spelling check on their work at least once. Why? An immutable law of the writing universe states that, no matter how many times you look over your manuscript, a spelling mistake or typo will creep in.
+
+My favorite command-line spelling checker is [GNU Aspell][8], which I previously [looked at][9] in detail. Aspell checks plaintext documents interactively and not only highlights errors but often puts the best correction at the top of its list of suggestions. Aspell also ignores many markup languages while doing its thing.
+
+A much older but still useful alternative is [Ispell][10]. It's a bit slower than Aspell, but both utilities work the same way. As you interact with your text file, Ispell suggests corrections. Ispell also has good support for foreign languages.
+
+### Prose linters
+
+Software developers use [linters][11] to check their code for errors or bugs. There are also linters for prose that check for style and syntax errors; think of them as the _Elements of Style_ for the command line. While any writer can (and probably should) use one, a prose linter is especially useful for team documentation projects that require a consistent voice and style.
+
+[Proselint][12] is a comprehensive tool for checking what you're writing. It looks for jargon, hyperbole, incorrect date and time format, misused terms, and [much more][13]. It's also easy to run and ignores markup in a plaintext file.
+
+[Alex][14] is a simple yet powerful prose linter. Run it against a plaintext document or one formatted with Markdown or HTML. Alex pumps out warnings of "gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing in text." If you want to give Alex a test drive, there's an [online demo][15].
+
+### 其他工具
+
+Sometimes you just can't find the right synonym for a word. But you don't need to grab a "dead tree" thesaurus or go to a dedicated website to perfect your word choice. Just run [Aiksaurus][16] against the word you want to replace, and it does the work for you. This utility's main drawback, though, is that it supports English only.
+
+Even writers with few (if any) technical skills are embracing [Markdown][17] to quickly and easily format their work. Sometimes, though, you need to convert files formatted with Markdown to something else. That's where [Pandoc][18] comes in. You can use it to convert your documents to HTML, Word, LibreOffice Writer, LaTeX, EPUB, and other formats. You can even use Pandoc to produce books and [research papers][19].
+
+Do you have a favorite command-line tool for writing? Share it with the Opensource.com community by leaving a comment.
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/11/command-line-tools-writers
+
+作者:[Scott Nesbitt][a]
+选题:[lujun9972][b]
+译者:[LazyWolfLin](https://github.com/LazyWolfLin)
+校对:[校对者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://plaintextproject.online
+[2]: https://www.nano-editor.org/
+[3]: https://www.vim.org
+[4]: https://www.gnu.org/software/emacs/
+[5]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim
+[6]: https://en.wikipedia.org/wiki/List_of_text_editors#Text_user_interface
+[7]: https://cowlark.com/wordgrinder/
+[8]: http://aspell.net/
+[9]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell
+[10]: https://www.cs.hmc.edu/~geoff/ispell.html
+[11]: https://en.wikipedia.org/wiki/Lint_(software)
+[12]: http://proselint.com/
+[13]: http://proselint.com/checks/
+[14]: https://github.com/get-alex/alex
+[15]: https://alexjs.com/#demo
+[16]: http://aiksaurus.sourceforge.net/
+[17]: https://en.wikipedia.org/wiki/Markdown
+[18]: https://pandoc.org
+[19]: https://opensource.com/article/18/9/pandoc-research-paper
From 4addde62288e64711a8108ec17683b1061106afa Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Thu, 29 Nov 2018 13:32:03 +0800
Subject: [PATCH 002/119] Translating 7 command-line tools for writers.
---
...81119 7 command-line tools for writers - Opensource.com.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index 4d2edb8472..74a03b9ab8 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -11,9 +11,9 @@
### 编辑器
-Yes, you _can_ do actual writing at the command line. I know writers who do their work using editors like [Nano][2], [Vim][3], [Emacs][4], and [Jove][5] in a terminal window. And those editors [aren't the only games in town][6]. Text editors are great because they (at a basic level, anyway) are easy to use and distraction free. They're perfect for tapping out a first draft of anything or even completing a long and complicated writing project.
+没错,你_可以_在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器并不是[aren't the only games in town][6]。文本编辑器的优势在于它们简单易用和专注。它们非常适合于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。
-If you want a more word processor-like experience at the command line, take a look at [WordGrinder][7] . WordGrinder is a bare-bones word processor, but it has more than enough features for writing and publishing your work. It supports basic formatting and styles, and you can export your writing to formats like Markdown, ODT, LaTeX, and HTML.
+如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下[WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown, ODT, LaTeX, 以及 HTML等格式导出。
### 拼写检查
From 63f6e041b4b70f85faa4d5bf91e4a04f40668ec0 Mon Sep 17 00:00:00 2001
From: darksun
Date: Fri, 30 Nov 2018 12:59:11 +0800
Subject: [PATCH 003/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Top=20Comma?=
=?UTF-8?q?nd=20Tutorial=20With=20Examples=20For=20Beginners?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...nd Tutorial With Examples For Beginners.md | 192 ++++++++++++++++++
1 file changed, 192 insertions(+)
create mode 100644 sources/tech/20181129 The Top Command Tutorial With Examples For Beginners.md
diff --git a/sources/tech/20181129 The Top Command Tutorial With Examples For Beginners.md b/sources/tech/20181129 The Top Command Tutorial With Examples For Beginners.md
new file mode 100644
index 0000000000..df932ebb83
--- /dev/null
+++ b/sources/tech/20181129 The Top Command Tutorial With Examples For Beginners.md
@@ -0,0 +1,192 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (The Top Command Tutorial With Examples For Beginners)
+[#]: via: (https://www.ostechnix.com/the-top-command-tutorial-with-examples-for-beginners/)
+[#]: author: ([SK](https://www.ostechnix.com/author/sk/))
+[#]: url: ( )
+
+The Top Command Tutorial With Examples For Beginners
+======
+
+
+
+As a Linux administrator, you may need to need to know some basic details of your Linux system, such as the currently running processes, average system load, cpu and memory usage etc., at some point. Thankfully, we have a command line utility called **“top”** to get such details. The top command is a well-known and most widely used utility to display dynamic real-time information about running processes in Unix-like operating systems. In this brief tutorial, we are going to see some common use cases of top command.
+
+### Top Command Examples
+
+**Monitor all processes**
+
+To start monitoring the running processes, simply run the top command without any options:
+
+```
+$ top
+```
+
+Sample output:
+
+
+
+As you see in the above screenshot, top command displays the list of processes in multiple columns. Each column displays details such as pid, user, cpu usage, memory usage. Apart from the list of processes, you will also see the brief stats about average system load, number of tasks, cpu usage, memory usage and swap usage on the top.
+
+Here is the explanation of the parameters mentioned above.
+
+ * **PID** – Process id of the task.
+ * **USER** – Username of the the task’s owner.
+ * **PR** – Priority of the task.
+ * **NI** – Nice value of the task. If the nice value is negative, the process gets higher priority. If the nice value is positive, the priority is low. Refer [**this guide**][1] to know more about nice.
+ * **VIRT** – Total amount of virtual memory used by the task.
+ * **RES** – Resident Memory Size, the non-swapped physical memory a task is currently using.
+ * **SHR** – Shared Memory Size. The amount of shared memory used by a task.
+ * **S** – The status of the process (S=sleep R=running Z=zombie).
+ * **%CPU** – CPU usage. The task’s share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time.
+ * **%MEM** – Memory Usage. A task’s currently resident share of available physical memory.
+ * **TIME+** – Total CPU time used by the task since it has started, precise to the hundredths of a second.
+ * **COMMAND** – Name of the running program.
+
+
+
+**Display path of processes**
+
+If you want to see the absolute path of the running processes, just press **‘c’**. Now you will see the actual path of the programs under the COMMAND column in the below screenshot.
+
+![][3]
+
+**Monitor processes owned by a specific user**
+
+If you run top command without any options, it will list all running processes owned by all users. How about displaying processes owned by a specific user? It is easy! To show the processes owned by a given user, for example **sk** , simply run:
+
+```
+$ top -u sk
+```
+
+
+
+**Do not show idle/zombie processes**
+
+Instead of viewing all processes, you can simply ignore the idle or zombie processes. The following command will not show any idle or zombie processes:
+
+```
+$ top -i
+```
+
+**Monitor processes with PID**
+
+If you know the PID of any processes, for example 21180, you can monitor that process using **-p** flag.
+
+```
+$ top -p 21180
+```
+
+You can specify multiple PIDs with comma-separated values.
+
+**Monitor processes with process name**
+
+I don’t know PID, but know only the process name. How to monitor it? Simple!
+
+```
+$ top -p $(pgrep -d ',' firefox)
+```
+
+Here, **firefox** is the process name and **‘pgrep -d’** picks the respective PID from the process name.
+
+**Display processes by CPU usage**
+
+Sometimes, you might want to display processes sorted by CPU usage. If so, use the following command:
+
+```
+$ top -o %CPU
+```
+
+![][4]
+
+The processes with higher CPU usage will be displayed on the top. Alternatively, you sort the processes by CPU usage by pressing **SHIFT+p**.
+
+**Display processes by Memory usage**
+
+Similarly, to order processes by memory usage, the command would be:
+
+```
+$ top -o %MEM
+```
+
+**Renice processes**
+
+You can change the priority of a process at any time using the option **‘r’**. Run the top command and press **r** and type the PID of a process to change its priority.
+
+![][5]
+
+Here, **‘r’** refers renice.
+
+**Set update interval**
+
+Top program has an option to specify the delay between screen updates. If want to change the delay-time, say 5 seconds, run:
+
+```
+$ top -d 5
+```
+
+The default value is **3.0** seconds.
+
+If you already started the top command, just press **‘d’** and type delay-time and hit ENTER key.
+
+![][6]
+
+**Set number of iterations (repetition)**
+
+By default, top command will keep running until you press **q** to exit. However, you can set the number of iterations after which top will end. For instance, to exit top command automatically after 5 iterations, run:
+
+```
+$ top -n 5
+```
+
+**Kill running processes**
+
+To kill a running process, simply press **‘k’** and type its PID and hit ENTER key.
+
+![][7]
+
+Top command supports few other options as well. For example, press **‘z’** to switch between mono and color output. It will help you to easily highlight running processes.
+
+![][8]
+
+Press **‘h’** to view all available keyboard shortcuts and help section.
+
+To quit top, just press **q**.
+
+At this stage, you will have a basic understanding of top command. For more details, refer man pages.
+
+```
+$ man top
+```
+
+As you can see, using Top command to monitor the running processes isn’t that hard. Top command is easy to learn and use!
+
+And, that’s all for now. More good stuffs to come. Stay tuned!
+
+Cheers!
+
+
+
+--------------------------------------------------------------------------------
+
+via: https://www.ostechnix.com/the-top-command-tutorial-with-examples-for-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/change-priority-process-linux/
+[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
+[3]: http://www.ostechnix.com/wp-content/uploads/2018/11/top-command-2.png
+[4]: http://www.ostechnix.com/wp-content/uploads/2018/11/top-command-4.png
+[5]: http://www.ostechnix.com/wp-content/uploads/2018/11/top-command-8.png
+[6]: http://www.ostechnix.com/wp-content/uploads/2018/11/top-command-7.png
+[7]: http://www.ostechnix.com/wp-content/uploads/2018/11/top-command-5.png
+[8]: http://www.ostechnix.com/wp-content/uploads/2018/11/top-command-6.png
From 94ad0cc124c723fd15d0ce57867f6cbbe098a70c Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Fri, 30 Nov 2018 13:36:22 +0800
Subject: [PATCH 004/119] Translating 7 command-line tools for writers.
---
...119 7 command-line tools for writers - Opensource.com.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index 74a03b9ab8..ad76bc2d4e 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -17,11 +17,11 @@
### 拼写检查
-Every writer does (or at least should do) a spelling check on their work at least once. Why? An immutable law of the writing universe states that, no matter how many times you look over your manuscript, a spelling mistake or typo will creep in.
+每个写作者在完成他们的工作前至少要(或者说应该要)进行一次拼写检查。为什么呢?在写作的世界里有个永恒的定律,无论你检查了多少次手稿,拼写错误和错字依然会存在。
-My favorite command-line spelling checker is [GNU Aspell][8], which I previously [looked at][9] in detail. Aspell checks plaintext documents interactively and not only highlights errors but often puts the best correction at the top of its list of suggestions. Aspell also ignores many markup languages while doing its thing.
+我曾经详细[介绍][9]过我最喜欢的命令行拼写检查工具 [GNU Aspell][8]。交互式检测文本文档的 Aspell 不仅能够高亮显示拼写错误还能在拼写错误的上方提供正确的拼写建议。Aspell 在进行拼写检查同样能够忽略许多标记语言文本。
-A much older but still useful alternative is [Ispell][10]. It's a bit slower than Aspell, but both utilities work the same way. As you interact with your text file, Ispell suggests corrections. Ispell also has good support for foreign languages.
+另一个够老但仍然有用的代替品是 [Ispell][10]。虽然它比 Aspell 稍慢一点,但它们都以相同的方式工作。当你在你的文本文件上工作时,Ispell 将提供正确的建议。Ispell 同样也对英语以外的语言提供了良好的支持。
### Prose linters
From a8c0c02c6dd3bc23c4183b33ff76417938a36860 Mon Sep 17 00:00:00 2001
From: darksun
Date: Tue, 4 Dec 2018 12:59:18 +0800
Subject: [PATCH 005/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20bring?=
=?UTF-8?q?=20good=20fortune=20to=20your=20Linux=20terminal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ing good fortune to your Linux terminal.md | 86 +++++++++++++++++++
1 file changed, 86 insertions(+)
create mode 100644 sources/tech/20181203 How to bring good fortune to your Linux terminal.md
diff --git a/sources/tech/20181203 How to bring good fortune to your Linux terminal.md b/sources/tech/20181203 How to bring good fortune to your Linux terminal.md
new file mode 100644
index 0000000000..7549dc0249
--- /dev/null
+++ b/sources/tech/20181203 How to bring good fortune to your Linux terminal.md
@@ -0,0 +1,86 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (How to bring good fortune to your Linux terminal)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-fortune)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+[#]: url: ( )
+
+How to bring good fortune to your Linux terminal
+======
+Bring quotes and quips to the command line with the fortune utility.
+
+
+It's December, and if you haven't found a [tech advent calendar][1] that sparks your fancy yet, well, maybe this one will do the trick. Every day, from now to the 24th, we're bringing you a different Linux command-line toy. What's a command-line toy, you ask? It could be a game or any simple diversion to bring a little happiness to your terminal.
+
+You may have seen some of these before. We hope you'll find something new, too. Either way, we hope you have fun following along.
+
+Today's toy, **fortune** , is an old one. Versions of it date back to the 1980s when it was included with Unix. The version I installed in Fedora was available under a BSD license, and I grabbed it with the following.
+
+```
+$ sudo dnf install fortune-mod -y
+```
+
+Your distribution may be different. On some, you may need to install the fortunes separately from **fortune** itself (try searching your package manager for "fortunes*"). You can also check out the source code on [GitHub][2]. Then, just run **fortune** to get, well, a fortune.
+
+```
+$ fortune
+"Time is an illusion. Lunchtime doubly so."
+-- Ford Prefect, _Hitchhiker's Guide to the Galaxy_
+```
+
+So why do you need fortunes at the terminal? For fun, of course. Perhaps you'd like to add them to the message of the day on your system?
+
+Personally, I like using the **fortune** command as a built-in piece of dummy data when I'm using the terminal to parse text, particularly with [regular expressions][3], and want something simple to try it out on.
+
+For example, let's say I was testing our a transformation with the **tr** command to replace letter the letter e with a numeral 3.
+
+```
+$ fortune | tr 'eE' '3'
+Unix 3xpr3ss:
+All pass3ng3r bring a pi3c3 of th3 a3roplan3 and a box of tools with th3m to
+th3 airport. Th3y gath3r on th3 tarmac, arguing constantly about what kind
+of plan3 th3y want to build and how to put it tog3th3r. 3v3ntually, th3
+pass3ng3rs split into groups and build s3v3ral diff3r3nt aircraft, but giv3
+th3m all th3 sam3 nam3. Som3 pass3ng3rs actually r3ach th3ir d3stinations.
+All pass3ng3rs b3li3v3 th3y got th3r3.
+```
+
+So what fortunes come with your distribution? Take a look in your **/usr/share/games/fortune** directory to find them all. Here are a few of my favorites.
+
+```
+Never laugh at live dragons.
+ -- Bilbo Baggins [J.R.R. Tolkien, "The Hobbit"]
+
+I dunno, I dream in Perl sometimes...
+ -- Larry Wall in <8538@jpl-devvax.JPL.NASA.GOV>
+
+I have an existential map. It has "You are here" written all over it.
+ -- Steven Wright
+```
+
+Looking for more on **fortune**? You can, of course, always check out the man page to learn more about the options, or read a little bit more about the history of the command on [Wikipedia][4].
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Drive a locomotive through your Linux terminal][5], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-fortune
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://opensource.com/article/16/11/7-tech-advent-calendars-holiday-season
+[2]: https://github.com/shlomif/fortune-mod
+[3]: https://opensource.com/article/18/5/getting-started-regular-expressions
+[4]: https://en.wikipedia.org/wiki/Fortune_%28Unix%29
+[5]: https://opensource.com/article/18/12/linux-toy-sl
From c718a2e2f4f192fc1a3eb62ff8c6e57fbc25e9b2 Mon Sep 17 00:00:00 2001
From: darksun
Date: Tue, 4 Dec 2018 13:02:12 +0800
Subject: [PATCH 006/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20ANGRYsearch=20?=
=?UTF-8?q?=E2=80=93=20Quick=20Search=20GUI=20Tool=20for=20Linux?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...earch - Quick Search GUI Tool for Linux.md | 108 ++++++++++++++++++
1 file changed, 108 insertions(+)
create mode 100644 sources/tech/20181203 ANGRYsearch - Quick Search GUI Tool for Linux.md
diff --git a/sources/tech/20181203 ANGRYsearch - Quick Search GUI Tool for Linux.md b/sources/tech/20181203 ANGRYsearch - Quick Search GUI Tool for Linux.md
new file mode 100644
index 0000000000..7c8952549f
--- /dev/null
+++ b/sources/tech/20181203 ANGRYsearch - Quick Search GUI Tool for Linux.md
@@ -0,0 +1,108 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (ANGRYsearch – Quick Search GUI Tool for Linux)
+[#]: via: (https://itsfoss.com/angrysearch/)
+[#]: author: (John Paul https://itsfoss.com/author/john/)
+[#]: url: ( )
+
+ANGRYsearch – Quick Search GUI Tool for Linux
+======
+
+A search application is one of the most important tools you can have on your computer. Most are slow to indexes your system and find results. However, today we will be looking at an application that can display results as you type. Today, we will be looking at ANGRYsearch.
+
+### What is ANGRYsearch?
+
+![][1]
+Newly installed ANGRYsearch
+
+[ANGRYsearch][2] is a Python-based application that delivers results as you type your search query. The overall idea and design of the application are both inspired by [Everything][3] a search tool for Windows. (I discovered Everything ad couple of years ago and install it wherever I use Windows.)
+
+ANGRYsearch is able to display the search results so quickly because it only indexes filenames. After you install ANGRYsearch, you create a database of filenames by indexing your system. ANGRYsearch then quickly filters filenames as you type your query.
+
+Even though there is not much to ANGRYsearch, there are several things you can do to customize the experience. First, ANGRYsearch has two different display modes: lite and full. Lite mode only shows the filename and path. Full mode displays filename, path, size, and date of the last modification. Full mode, obviously, takes longer to display. The default is lite mode. In order to switch to full mode, you need to edit the config file at `~/.config/angrysearch/angrysearch.conf`. In that file change the `angrysearch_lite` value to false.
+
+ANGRYsearch also has three different search modes: fast, slow, and regex. Fast mode displays filenames that start with your search term. For example, if you had a folder full of the latest releases of a bunch of Linux distros and you searched “Ubuntu”, ANGRYsearch would display Ubuntu, Ubuntu Mate, Ubuntu Budgie, but not Kubuntu, Xubuntu, or Lubuntu. Fast mode is on by default and can be turned off by unchecking the checkbox next to the “update” button. Slow mode is slightly slower (obviously), but it will display files that have your search term anywhere in their name. In the previous example, ANGRYsearch would show all Ubuntu distros. Regex mode is the slowest and most precise. It uses [regular expressions][4] and is case insensitive. Regex mode is activated by pressing F8.
+
+You can also tell ANGRYsearch to ignore certain folders when it indexes your system. Just click the “update” button and enter the names of the folders you want to be ignored in the space provided. You can also choose from several icon themes, though it doesn’t make that much difference.
+
+![][5]Fast mode results
+
+### Installing ANGRYsearch on Linux
+
+ANGRYsearch is available in the [Arch User Repository][6]. It has also been packaged for [Fedora and openSUSE][7].
+
+To install on other distros, follow these instructions. Instructions are written for a Debian or Ubuntu based system.
+
+ANGRYsearch depends on `python3-pyqt5` and`xdg-utils` so you will need to install them first. Most distros have `xdg-utils`already installed.
+
+`sudo apt install python3-pyqt5`
+
+Next. download the latest version (1.0.1).
+
+`wget https://github.com/DoTheEvo/ANGRYsearch/archive/v1.0.1.zip`
+
+Now, unzip the archive file.
+
+`unzip v1.0.1.zip`
+
+Next, we will navigate to the new folder (ANGRYsearch-1.0.1) and run the installer.
+
+`cd ANGRYsearch-1.0.1`
+
+`chmod +x install.sh`
+
+`sudo ./install.sh`
+
+The installation process is very quick, so don’t be surprised when a new command line is displayed as soon as you hit `Enter`.
+
+The first time that you start ANGRYsearch, you will need to index your system. ANGRYsearch does not automatically keep its database updated. You can use `crontab` to schedule a system scan.
+
+To open a text editor to create a new cronjob, use `crontab -e`. To make sure that the ANGRYsearch database is updated every 6 hours, use this command `0 */6 选题模板.txt 中文排版指北.md core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LCTT翻译规范.md LICENSE published README.md scripts sources translated 选题模板.txt 中文排版指北.md core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LCTT翻译规范.md LICENSE published README.md scripts sources translated 选题模板.txt 中文排版指北.md core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LCTT翻译规范.md LICENSE published README.md scripts sources translated /usr/share/angrysearch/angrysearch_update_database.py`. `crontab` does not run the job if it is powered off when the timer does off. In some case, you may need to manually update the database, but it should not take long.
+
+![][8]ANGRYsearch update/options menu
+
+### Experience
+
+In the past, I was always frustrated by how painfully slow it was to search my computer. I knew that Windows had the Everything app, but I thought Linux out of luck. It didn’t even occur to me to look for something similar on Linux. I’m glad I accidentally stumbled upon ANGRYsearch.
+
+I know there will be quite a few people complaining that ANGRYsearch only searches filenames, but most of the time that is all I need. Thankfully, most of the time I only need to remember part of the name to find what I am looking for.
+
+The only thing that annoys me about ANGRYsearch is that fact that it does not automatically update its database. You’d think there would be a way for the installer to create a cron job when you install it.
+
+![][9]Slow mode results
+
+### Final Thoughts
+
+Since ANGRYsearch is basically a Linux port of one of my favorite Windows apps, I’m pretty happy with it. I plan to install it on all my systems going forward.
+
+I know that I have ragged on other Linux apps for not being packaged for easy install, but I can’t do the same for ANGRYsearch. The installation process is pretty easy. I would definitely recommend it for Linux noobs.
+
+Have you ever used [ANGRYsearch][2]? If not, what is your favorite Linux search application? 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][10].
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/angrysearch/
+
+作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2018/11/angrysearch3.jpg?resize=800%2C627&ssl=1
+[2]: https://github.com/dotheevo/angrysearch/
+[3]: https://www.voidtools.com/
+[4]: http://www.aivosto.com/articles/regex.html
+[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/angrysearch1.jpg?resize=800%2C627&ssl=1
+[6]: https://aur.archlinux.org/packages/angrysearch/
+[7]: https://software.opensuse.org/package/angrysearch
+[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/angrysearch2.jpg?resize=800%2C626&ssl=1
+[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/angrysearch4.jpg?resize=800%2C627&ssl=1
+[10]: http://reddit.com/r/linuxusersgroup
From d41d6a1487a308542e649918f50642a106c61f51 Mon Sep 17 00:00:00 2001
From: darksun
Date: Thu, 6 Dec 2018 09:07:11 +0800
Subject: [PATCH 007/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Fix=20?=
=?UTF-8?q?Broken=20Ubuntu=20OS=20Without=20Reinstalling=20It?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...roken Ubuntu OS Without Reinstalling It.md | 78 +++++++++++++++++++
1 file changed, 78 insertions(+)
create mode 100644 sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
diff --git a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
new file mode 100644
index 0000000000..a00541b536
--- /dev/null
+++ b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
@@ -0,0 +1,78 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It)
+[#]: via: (https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/)
+[#]: author: (SK https://www.ostechnix.com/author/sk/)
+[#]: url: ( )
+
+How To Fix Broken Ubuntu OS Without Reinstalling It
+======
+
+
+
+Today, I was upgrading my Ubuntu 18.04 LTS system. Unfortunately, the power has gone in mid-way and the system powered off while updating Ubuntu OS. When the power is back, I boot the system again. Right after entering the password at the login screen, it’s gone blank and didn’t respond. Keyboard and mouse also didn’t work. All I see is just a blank screen! Thankfully, It’s just a test machine and there were no important data in it. I can simply wipe off the entire OS and install it again. But, I don’t want to do that. Since I have nothing to lose, I just wanted to repair my broken Ubuntu system without reinstalling it completely and it worked!!! If you ever find yourself in a situation like mine, don’t panic. This brief tutorial describes how to easily fix broken Ubuntu OS without losing data and without reinstalling it completely.
+
+### Fix Broken Ubuntu OS
+
+First of all, try to login with live cd and **backup your data** in an external drive. Just in case, if this method didn’t work, you can still have your data and reinstall everything!
+
+At the login screen, press **CTRL+ALT+F1** to switch to **tty1**. You can learn more about switching between TTYs [**here**][1].
+
+Now, type the following commands one by one to fix the broken Ubuntu Linux.
+
+```
+$ sudo rm /var/lib/apt/lists/lock
+
+$ sudo rm /var/lib/dpkg/lock
+
+$ sudo rm /var/lib/dpkg/lock-frontend
+
+$ sudo dpkg --configure -a
+
+$ sudo apt clean
+
+$ sudo apt update --fix-missing
+
+$ sudo apt install -f
+
+$ sudo dpkg --configure -a
+
+$ sudo apt upgrade
+
+$ sudo apt dist-upgrade
+```
+
+Finally, reboot the system using command:
+
+```
+$ sudo reboot
+```
+
+You can now be able to login to your Ubuntu system as usual.
+
+After I followed these steps, all of my data in Ubuntu 18.04 test system was there and everything is the same as I left it. This method may not work for everyone. However, this small tip worked for me and saved a couple minutes from reinstalling. If you know any other better way, please let me know in the comment section. I will add them in this guide as well.
+
+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-fix-broken-ubuntu-os-without-reinstalling-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/how-to-switch-between-ttys-without-using-function-keys-in-linux/
From b38cabaf2a6971e7e82cf21432b004a7e7a1001e Mon Sep 17 00:00:00 2001
From: darksun
Date: Thu, 6 Dec 2018 09:08:23 +0800
Subject: [PATCH 008/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20F-Words=20in=20Li?=
=?UTF-8?q?nux=20Kernel=20Code=20Replaced=20with=20"Hug"=3F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...in Linux Kernel Code Replaced with -Hug.md | 81 +++++++++++++++++++
1 file changed, 81 insertions(+)
create mode 100644 sources/talk/20181205 F-Words in Linux Kernel Code Replaced with -Hug.md
diff --git a/sources/talk/20181205 F-Words in Linux Kernel Code Replaced with -Hug.md b/sources/talk/20181205 F-Words in Linux Kernel Code Replaced with -Hug.md
new file mode 100644
index 0000000000..821b81d29e
--- /dev/null
+++ b/sources/talk/20181205 F-Words in Linux Kernel Code Replaced with -Hug.md
@@ -0,0 +1,81 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (F-Words in Linux Kernel Code Replaced with "Hug"?)
+[#]: via: (https://itsfoss.com/swear-words-linux-kernel/)
+[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+[#]: url: ( )
+
+F-Words in Linux Kernel Code Replaced with "Hug"?
+======
+
+**Brief: To comply with the new code of conduct, a developer from Intel proposes to replace F-words in the Linux kernel code with “hug”.**
+
+![Polite Linus Torvalds after Code of Conduct][1]
+
+Change is in air for the Linux Kernel Community.
+
+Ever since the introduction of the [Linux code of conduct][2], things are going in a ‘polite direction’.
+
+To refresh your memory, a few months back a new code of conduct was introduced for the Linux kernel developers. This code of conduct asks the developers to be nice and welcoming to other developers and be more open to diversity.
+
+The new code of conduct caused a huge controversy as many Linux users and developers saw it as a conspiracy by Social Justice Warriors (SJW) to infiltrate Linux. The rumors were especially boosted by the [controversial past of the Contributor Covenant creator Coraline Ada Ehmke][2]. The Linux code of conduct is based on the same Contributor Covenant.
+
+Right after signing the new code of conduct, Linux creator [Linus Torvalds took a month-long break to improve his behavior][3].
+
+Torvalds who is known for being ruthless against poor code is a changed man now. After [coming back from the break][4], Torvalds controlled his rage and instead of lashing out against a developer, he replied nicely and pointed his mistake in a polite way.
+
+### No more F-words in the Linux Kernel code?
+
+There have been F-words in the Linux kernel code. To be clear, these F-words are in the code comments, not in the actual code.
+
+You might expect that there will be way too many F-words in the 15+ millions of lines of Linux kernel code but that’s not the case.
+
+Jarkko Sakkinen from Intel pushed [these patches][5] that replace the F-words 33 times in the 3.3 million lines of code comments.
+
+Interestingly, the patch email is titled “ **Zero ****s, hugload of hugs <3**“:
+
+> In order to comply with the CoC, replace 选题模板.txt 中文排版指北.md core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LCTT翻译规范.md LICENSE published README.md scripts sources translated with a hug.
+
+So now comments have become:
+
+ * Only Sun can take such nice parts and **hug** up the programming interface like this
+ * IOC3 is **hugging** **hugged** beyond belief
+ * **Hug** , we are miserable poor guys…
+
+
+
+### Do you give a ‘hug’ about these changes?
+
+At this point, it’s not clear if this ‘hugging’ patch has been accepted or not. It’s more of an attempt to bring attention to profanity inside the kernel code.
+
+So, we have to wait and watch if this patch sets a trend for removing offensive words from the Linux kernel code.
+
+What do you think of it? Is using ‘hug’ a good choice or do you have a better word for replacing the F-words?
+
+And what do you think of these changes altogether. Do you think all these are unnecessary and futile exercises?
+
+And when you comment, please replace your F-words with hugs :)
+
+Story source: [Phoronix][6]
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/swear-words-linux-kernel/
+
+作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/hug-you-linus-torvalds.jpeg?resize=800%2C450&ssl=1
+[2]: https://itsfoss.com/linux-code-of-conduct/
+[3]: https://itsfoss.com/torvalds-takes-a-break-from-linux/
+[4]: https://itsfoss.com/torvalds-is-back/
+[5]: https://lists.freedesktop.org/archives/dri-devel/2018-November/198581.html
+[6]: https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Hugs
From bba744b4260ccd5f815f064b137cd914605055ba Mon Sep 17 00:00:00 2001
From: darksun
Date: Thu, 6 Dec 2018 09:10:21 +0800
Subject: [PATCH 009/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20reasons=20to?=
=?UTF-8?q?=20give=20Linux=20for=20the=20holidays?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
... reasons to give Linux for the holidays.md | 78 +++++++++++++++++++
1 file changed, 78 insertions(+)
create mode 100644 sources/talk/20181205 5 reasons to give Linux for the holidays.md
diff --git a/sources/talk/20181205 5 reasons to give Linux for the holidays.md b/sources/talk/20181205 5 reasons to give Linux for the holidays.md
new file mode 100644
index 0000000000..2bcd6d642c
--- /dev/null
+++ b/sources/talk/20181205 5 reasons to give Linux for the holidays.md
@@ -0,0 +1,78 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (5 reasons to give Linux for the holidays)
+[#]: via: (https://opensource.com/article/18/12/reasons-give-linux-holidays)
+[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
+[#]: url: ( )
+
+5 reasons to give Linux for the holidays
+======
+If a computer is on your gift-giving list, here's why it should be Linux.
+
+
+Every year around this time, people ask me about the best computer to give (or get) for the holidays. I always give the same answer: Linux. After all, if you want your recipients to be happy, why wouldn't you give them the best operating system on the planet?
+
+Many people don't realize they have options when it comes to computer operating systems. Just recently, two friends (who didn't do their research) fell for the clever marketing and bought brand-new systems at premium prices. I'm willing to bet that within six months they'll be dissatisfied with those expensive computers.
+
+In contrast, I recently purchased a four-year-old computer with an i5 processor, 4GB of RAM, and a 128GB SSD drive, and I love it. It's fast and has all the applications I need to be successful and happy. That's because I'm running Linux. Whether I'm using Firefox or Chrome, all my websites load quickly and the video is great. In fact, the web is faster on Linux than it is on MacOS or Windows.
+
+So, if you're in the mood to give a computer for the holidays, here are five good reasons it should be Linux.
+
+### 1\. Linux is easy to use
+
+Linux distributions like [Fedora][1], [Ubuntu][2], [PopOS][3], [Linux Mint][4], and [Raspbian][5] come with loads of documentation and access to a user community eager to help. And desktop environments such as [GNOME][6], [KDE][7], and [LXDE][8] mean the Linux operating system is just plain easy. If you have a problem with a Linux operating system, you won't have to wait in a long telephone queue for an answer—you can tap into the community's knowledge.
+
+### 2\. Free applications for practically anything you need
+
+There are hundreds of high-quality, free software packages available for Linux. My favorites are [LibreOffice][9] and [GnuCash][10]. I cannot imagine any writing task that is beyond the scope of LibreOffice. I use it and recommend it to everyone I know. Why spend money on a name-brand productivity suite when LibreOffice, the best one out there, is free? (If you agree and you're able, you really ought to consider contributing to the project.)
+
+### 3\. Security
+
+Linux is secure, an important fact in an age when security tops most people's essential features list. On Linux, viruses and malware are minimal. I spend many days each year helping friends recover their Windows systems that have been hacked or infected with malware. That's rare on Linux, and if you want to be doubly sure no one gains improper access to your computer, there are plenty of open source solutions that can help prevent it. My favorites are [ClamAV][11] and [Rootkit Hunter][12]. Linux respects your privacy. It does not upload user data to Redmond or Cupertino.
+
+### 4\. Freedom
+
+Linux gives me the freedom to use my operating system however I choose, whether that is as a standalone workstation for personal productivity, a content server, a firewall for my home network, or something else. Unlike proprietary desktop operating systems, you don't have to purchase an upgrade or extension to expand your system's capabilities. There are no limitations. Best of all, I can give all of this knowledge away and encourage others to do the same. Isn't giving to others the spirit of holiday traditions?
+
+### 5\. Stability
+
+Linux is reliable and stable. The operating system does not crash. When you get updates, they don't require you to reboot while you're in the middle of doing something else. If you're using an older version of Fedora, Ubuntu, or Linux Mint and are happy with the status quo, you don't have to upgrade. Linux also offers more support for drivers of legacy printers and other peripherals than other operating systems.
+
+### How to give Linux
+
+Linux could be the best present your friends ever receive. Instead of buying holiday gifts from your favorite retailer, buy some 8GB or 16GB USB drives, download your favorite distribution, and [make some bootable USB][13] drives to give away. Volunteer your time (or include instructions) to help your friends to explore the "live" editions of these distributions before they install the operating system. Or, if you have an old, unused laptop or desktop, consider installing Linux and loaning it out for training purposes. Most of your friends will have no idea what a wonderful gift you are giving them—in the process, you will discover the joy of giving yourself to others.
+
+If you really want to buy a new computer, this year I recommend you look at [System 76][14] or Dell's [XPS Developer][15] edition. If you don't want a new model, there are plenty of great offerings on [eBay][16], [DellRefurbished.com][17], and other sites that sell good-quality older laptops that are great candidates for an easy Linux install.
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/reasons-give-linux-holidays
+
+作者:[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://getfedora.org/
+[2]: https://www.ubuntu.com/
+[3]: https://system76.com/pop
+[4]: https://linuxmint.com/
+[5]: https://www.raspbian.org/
+[6]: https://www.gnome.org/
+[7]: https://www.kde.org/
+[8]: https://lxde.org/
+[9]: https://www.libreoffice.org/
+[10]: https://www.gnucash.org/
+[11]: https://www.clamav.net/
+[12]: http://rkhunter.sourceforge.net/
+[13]: https://opensource.com/article/18/7/getting-started-etcherio
+[14]: https://system76.com/
+[15]: https://www.dell.com/en-us/work/shop/dell-laptops-and-notebooks/xps-13-developer-edition/spd/xps-13-9370-laptop?appliedRefinements=302
+[16]: https://www.ebay.com/b/Computers-Tablets-Network-Hardware/58058/bn_1865247
+[17]: http://DellRefurbished.com
From f3e363cffd009d0fe5060396e3dcb820cb2fb138 Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Thu, 6 Dec 2018 13:36:55 +0800
Subject: [PATCH 010/119] Translating 7 command-line tools for writers.
---
...0181119 7 command-line tools for writers - Opensource.com.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index ad76bc2d4e..04d6af4dfd 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -25,7 +25,7 @@
### Prose linters
-Software developers use [linters][11] to check their code for errors or bugs. There are also linters for prose that check for style and syntax errors; think of them as the _Elements of Style_ for the command line. While any writer can (and probably should) use one, a prose linter is especially useful for team documentation projects that require a consistent voice and style.
+软件开发人员使用[linters][11]来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的linters;而命令行会认为这些错误是_样式元素_。任何写作者都可以(也应该)使用它,一个文本 linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
[Proselint][12] is a comprehensive tool for checking what you're writing. It looks for jargon, hyperbole, incorrect date and time format, misused terms, and [much more][13]. It's also easy to run and ignores markup in a plaintext file.
From dcbf6a5bb65d92ec31668813bcc214dd7773a56f Mon Sep 17 00:00:00 2001
From: darksun
Date: Fri, 7 Dec 2018 12:56:18 +0800
Subject: [PATCH 011/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Bring=20some=20co?=
=?UTF-8?q?lor=20to=20your=20Linux=20terminal=20with=20lolcat?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...olor to your Linux terminal with lolcat.md | 60 +++++++++++++++++++
1 file changed, 60 insertions(+)
create mode 100644 sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
diff --git a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
new file mode 100644
index 0000000000..740e95c3bf
--- /dev/null
+++ b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
@@ -0,0 +1,60 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Bring some color to your Linux terminal with lolcat)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+[#]: url: ( )
+
+Bring some color to your Linux terminal with lolcat
+======
+With this simple utility, you can add a rainbow of color to the output of any program you want.
+
+
+Today marks the fifth day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal.
+
+It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.
+
+Today's selection, **lolcat** , is the first utility I'm including that wasn't packaged for my Linux distribution, but it was still an easy install. It's a Ruby program that you ought to be able to easily add to your system with the following.
+
+```
+$ gem install lolcat
+```
+
+After that, simply pipe some text to it to see the output in the colors of the rainbow. For example, using a couple of utilities from earlier days in our advent calendar, try the following:
+
+```
+$ fortune | boxes -a c -d parchment | lolcat
+```
+
+Depending on what good fortune you have, you'll likely get something like this:
+
+
+There are a few parameters you can pass to **lolcat** , and rather than repeat them all here, I'd suggest you either visit the **lolcat** [GitHub page][1] or just see them at the terminal by typing **lolcat --help**. But generally, they're helpful to set the spread and frequency of your rainbow, and my personal favorite, enabling animation. Who doesn't like animated rainbow printing at the terminal? Let's try the above again, with a different box (cat-themed, of course) and a cat-appropriate fortune that was in my fortunes list, with the following.
+
+```
+fortune -m "nine tails" | boxes -a c -d cat | lolcat -a
+```
+
+**lolcat** is open source under a BSD license.
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Have a cow at the Linux command line][2], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-lolcat
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://github.com/busyloop/lolcat
+[2]: https://opensource.com/article/18/12/linux-toy-cowsay
From 4043edcf66401cd99d6e31afa73585eff01786c3 Mon Sep 17 00:00:00 2001
From: darksun
Date: Fri, 7 Dec 2018 12:57:50 +0800
Subject: [PATCH 012/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Bash=20Variables:?=
=?UTF-8?q?=20Environmental=20and=20Otherwise?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
... Variables- Environmental and Otherwise.md | 222 ++++++++++++++++++
1 file changed, 222 insertions(+)
create mode 100644 sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
diff --git a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
new file mode 100644
index 0000000000..11397f9b80
--- /dev/null
+++ b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
@@ -0,0 +1,222 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Bash Variables: Environmental and Otherwise)
+[#]: via: (https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise)
+[#]: author: (Paul Brown https://www.linux.com/users/bro66)
+[#]: url: ( )
+
+Bash Variables: Environmental and Otherwise
+======
+
+
+Bash variables, including those pesky _environment variables_ , have been popped up several times in previous articles, and it’s high time you get to know them better and how they can help you.
+
+So, open your terminal window and let's get started.
+
+### Environment Variables
+
+Consider `HOME`. Apart from the cozy place where you lay down your hat, in Linux it is a variable that contains the path to the current user's home directory. Try this:
+
+```
+echo $HOME
+```
+
+This will show the path to your home directory, usually _/home/_.
+
+As the name indicates, variables can change according to the context. Indeed, each user on a Linux system will have a `HOME` variable containing a different value. You can also change the value of a variable by hand:
+
+```
+HOME=/home//Documents
+```
+
+will make `HOME` point to your _Documents/_ folder.
+
+There are three things to notice here:
+
+ 1. There are no spaces between the name of the variable and the `=` or between the `=` and the value you are putting into the variable. Spaces have their own meaning in the shell and cannot be used any old way you want.
+ 2. If you want to put a value into a variable or manipulate it in any way, you just have to write the name of the variable. If you want to see or use the contents of a variable, you put a `$` in front of it.
+ 3. Changing `HOME` is risky! A lot programs rely on `HOME` to do stuff and changing it can have unforeseeable consequences. For example, just for laughs, change `HOME` as shown above and try typing `cd` and then [Enter]. As we have seen elsewhere in this series, you use `cd` to _c_ hange to another _d_ irectory. Without any parameters, `cd` takes you to your home directory. If you change the `HOME` variable, `cd` will take you to the new directory `HOME` points to.
+
+
+
+Changes to environment variables like the one described in point 3 above are not permanent. If you close your terminal and open it back up, or even open a new tab in your terminal window and move there, `echo $HOME` will show its original value.
+
+Before we go on to how you make changes permanent, let's look at another environment variable that it does make sense changing.
+
+### PATH
+
+The `PATH` variable lists directories that contain executable programs. If you ever wondered where your applications go when they are installed and how come the shell seems to magically know which programs it can run without you having to tell it where to look for them, `PATH` is the reason.
+
+Have a look inside `PATH` and you will see something like this:
+
+```
+$ echo $PATH
+/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
+```
+
+Each directory is separated by a colon (`:`) and if you want to run an application installed in any directory other than the ones listed in `PATH`, you will have to tell the shell where to find it:
+
+```
+/home//bin/my_program.sh
+```
+
+This will run a program calle _my_program.sh_ you have copied into a _bin/_ directory in your home directory.
+
+This is a common problem: you don't want to clutter up your system's _bin/_ directories, or you don't want other users running your own personal scripts, but you don't want to have to type out the complete path every time you need to run a script you use often. The solution is to create your own _bin/_ directory in your home directory:
+
+```
+mkdir $HOME/bin
+```
+
+And then tell `PATH` all about it:
+
+```
+PATH=$PATH:$HOME/bin
+```
+
+After that, your _/home//bin_ will show up in your `PATH` variable. But... Wait! We said that the changes you make in a given shell will not last and will lose effect when that shell is closed.
+
+To make changes permanent for your user, instead of running them directly in the shell, put them into a file that gets run every time a shell is started. That file already exists and lives in your home directory. It is called _.bashrc_ and the dot in front of the name makes it a hidden file -- a regular `ls` won't show it, but `ls -a` will.
+
+You can open it with a text editor like [kate][1], [gedit][2], [nano][3], or [vim][4] (NOT LibreOffice Writer -- that's a word processor. Different beast entirely). You will see that _.bashrc_ is full of shell commands the purpose of which are to set up the environment for your user.
+
+Scroll to the bottom and add the following on a new, empty line:
+
+```
+export PATH=$PATH:$HOME/bin
+```
+
+Save and close the file. You'll be seeing what `export` does presently. In the meantime, to make sure the changes take effect immediately, you need to `source` _.bashrc_ :
+
+```
+source .bashrc
+```
+
+What `source` does is execute _.bashrc_ for the current open shell, and all the ones that come after it. The alternative would be to log out and log back in again for the changes to take effect, and who has the time for that?
+
+From now on, your shell will find every program you dump in _/home//bin_ without you having to specify the whole path to the file.
+
+### DYI Variables
+
+You can, of course, make your own variables. All the ones we have seen have been written with ALL CAPS, but [you can call a variable more or less whatever you want][5].
+
+Creating a new variables is straightforward: just set a value within it:
+
+```
+new_variable="Hello"
+```
+
+And you already know how to recover a value contained within a variable:
+
+```
+echo $new_variable
+```
+
+You often have a program that will require you set up a variable for things to work properly. The variable may set an option to "on", or help the program find a library it needs, and so on. When you run a program in Bash, the shell spawns a daughter process. This means it is not exactly the same shell that executes your program, but a related mini-shell that inherits some of the mother's characteristics. Unfortunately, variables, by default, are not one of them. This is because, by default again, variables are _local_. This means that, for security reasons, a variable set in one shell cannot be read in another, even if it is a daughter shell.
+
+To see what I mean, set a variable:
+
+```
+robots="R2D2 & C3PO"
+```
+
+... and run:
+
+```
+bash
+```
+
+You just ran a Bash shell program within a Bash shell program.
+
+Now see if you can read the contents of you variable with:
+
+```
+echo $robots
+```
+
+You should draw a blank.
+
+Still inside your bash-within-bash shell, set `robots` to something different:
+
+```
+robots="These aren't the ones you are looking for"
+```
+
+Check `robots`' value:
+
+```
+$ echo $robots
+These aren't the ones you are looking for
+```
+
+Exit the bash-within-bash shell:
+
+```
+exit
+```
+
+And re-check the value of `robots`:
+
+```
+$ echo $robots
+R2D2 & C3P0
+```
+
+This is very useful to avoid all sorts of messed up configurations, but this presents a problem also: if a program requires you set up a variable, but the program can't access it because Bash will execute it in a daughter process, what can you do? That is exactly what `export` is for.
+
+Try doing the prior experiment, but, instead of just starting off by setting `robots="R2D2 & C3PO"`, export it at the same time:
+
+```
+export robots="R2D2 & C3PO"
+```
+
+You'll notice that, when you enter the bash-within-bash shell, `robots` still retains the same value it had at the outset.
+
+**Interesting fact:** While the daughter process will "inherit" the value of an exported variable, if the variable is changed within the daughter process, changes will not flow upwards to the mother process. In other words, changing the value of an exported variable in a daughter process does not change the value of the original variable in the mother process.
+
+You can see all exported variables by running
+
+```
+export -p
+```
+
+The variables you create should be at the end of the list. You will also notice some other interesting variables in the list: `USER`, for example, contains the current user's user name; `PWD` points to the current directory; and `OLDPWD` contains the path to the last directory you visited and since left. That's because, if you run:
+
+```
+cd -
+```
+
+You will go back to the last directory you visited and `cd` gets the information from `OLDPWD`.
+
+You can also see all the environment variables using the `env` command.
+
+To un-export a variable, use the `-n` option:
+
+```
+export -n robots
+```
+
+### Next Time
+
+You have now reached a level in which you are dangerous to yourself and others. It is time you learned how to protect yourself from yourself by making your environment safer and friendlier through the use of _aliases,_ and that is exactly what we'll be tackling in the next episode. See you then.
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise
+
+作者:[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.kde.org/applications/utilities/kate/
+[2]: https://help.gnome.org/users/gedit/stable/
+[3]: https://www.nano-editor.org/
+[4]: https://www.vim.org/
+[5]: https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name
From 6db45d39b42a786d6af0c65f95ff2254e4e5a64b Mon Sep 17 00:00:00 2001
From: darksun
Date: Fri, 7 Dec 2018 12:59:35 +0800
Subject: [PATCH 013/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Take=20a=20break?=
=?UTF-8?q?=20at=20the=20Linux=20command=20line=20with=20Nyan=20Cat?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...at the Linux command line with Nyan Cat.md | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)
create mode 100644 sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md
diff --git a/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md b/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md
new file mode 100644
index 0000000000..7f642b5496
--- /dev/null
+++ b/sources/tech/20181206 Take a break at the Linux command line with Nyan Cat.md
@@ -0,0 +1,61 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Take a break at the Linux command line with Nyan Cat)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-nyancat)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+[#]: url: ( )
+
+Take a break at the Linux command line with Nyan Cat
+======
+Rainbows, Pop-Tarts, and cats in space: What more could you want at your terminal?
+
+
+We're now on day six of the Linux command-line toys advent calendar, where we explore some of the fun, entertaining, and in some cases, utterly useless toys available for your Linux terminal. All are available under an open source license.
+
+Will they all be unique? Yes. Will they all be unique to you? I don't know, but, chances are you'll find at least one new toy to play with by the time our advent calendar is done.
+
+Today's selection is a continuation on the [theme][1] we started yesterday: cats and rainbows. Wait, there's more cat-related rainbow fun to be had at the Linux command line? You bet there is.
+
+So let's make a throwback all the way to 2011's [Nyan Cat][2] with a command-line toy call, not surprisingly, **nyancat**. Did you miss the cultural phenomenon that was Nyan Cat? Watch the embed below, I'll wait.
+
+
+
+Now, let's recreate that amazing experience in your terminal. **Nyancat** is packaged for many distributions (Arch, Debian, Gentoo, Ubuntu, etc.) but not for mine (Fedora), but compiling from source was simple. In fact, I grabbed the source, built it, and launched it in one line:
+
+```
+git clone https://github.com/klange/nyancat.git && cd nyancat && make && cd src && ./nyancat
+```
+
+This launched straight into a **nyancat** experience complete with a counter of how long I had been enjoying the **nyancat** magic for.
+
+
+
+You can find the source for **nyancat** [on GitHub][3] under an [NCSA open source license][4].
+
+The command-line version of Nyan Cat used to be [accessible by a public Telnet server][5] (or, for even more pun, with [netcat][6]) so that you didn't even have to install it, but sadly was shut down due to bandwidth limitations. Nevertheless, the [gallery][5] from the old Telnet server running Nyan Cat on a variety of old devices is well-worth checking out, and maybe you'd like to do the community a favor by launching your own public mirror and letting the author know so that they may share it with the public yet again?
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Bring some color to your Linux terminal with lolcat][1], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-nyancat
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://opensource.com/article/18/12/linux-toy-lolcat
+[2]: https://en.wikipedia.org/wiki/Nyan_Cat
+[3]: https://github.com/klange/nyancat
+[4]: http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License
+[5]: http://nyancat.dakko.us/
+[6]: http://netcat.sourceforge.net/
From 2af678dbb8e1f1909e0c785bd1d6672e7b3367cd Mon Sep 17 00:00:00 2001
From: Valonia Kim <34000495+Valoniakim@users.noreply.github.com>
Date: Mon, 10 Dec 2018 09:35:49 +0800
Subject: [PATCH 014/119] Update 20180508 Person with diabetes finds open
source and builds her own medical device.md
---
...betes finds open source and builds her own medical device.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md b/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md
index f5377736d0..3131746c07 100644
--- a/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md
+++ b/sources/talk/20180508 Person with diabetes finds open source and builds her own medical device.md
@@ -1,3 +1,5 @@
+translating by valoniakim
+
Person with diabetes finds open source and builds her own medical device
======

From ece861b0cb14814483bbb4be41793b281bb533e7 Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Mon, 10 Dec 2018 10:06:43 +0800
Subject: [PATCH 015/119] Translating 7 command-line tools for writers.
---
...9 7 command-line tools for writers - Opensource.com.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index 04d6af4dfd..8feec80f41 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -19,17 +19,17 @@
每个写作者在完成他们的工作前至少要(或者说应该要)进行一次拼写检查。为什么呢?在写作的世界里有个永恒的定律,无论你检查了多少次手稿,拼写错误和错字依然会存在。
-我曾经详细[介绍][9]过我最喜欢的命令行拼写检查工具 [GNU Aspell][8]。交互式检测文本文档的 Aspell 不仅能够高亮显示拼写错误还能在拼写错误的上方提供正确的拼写建议。Aspell 在进行拼写检查同样能够忽略许多标记语言文本。
+我曾经详细[介绍][9]过我最喜欢的命令行拼写检查工具 [GNU Aspell][8]。交互式检测文本文档的 Aspell 不仅能够高亮显示拼写错误还能在拼写错误的上方提供正确的拼写建议。Aspell 在进行拼写检查时同样能够忽略许多语法标记。
另一个够老但仍然有用的代替品是 [Ispell][10]。虽然它比 Aspell 稍慢一点,但它们都以相同的方式工作。当你在你的文本文件上工作时,Ispell 将提供正确的建议。Ispell 同样也对英语以外的语言提供了良好的支持。
### Prose linters
-软件开发人员使用[linters][11]来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的linters;而命令行会认为这些错误是_样式元素_。任何写作者都可以(也应该)使用它,一个文本 linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
+软件开发人员使用[linters][11]来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的linters;而命令行会认为这些错误是_样式元素_。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
-[Proselint][12] is a comprehensive tool for checking what you're writing. It looks for jargon, hyperbole, incorrect date and time format, misused terms, and [much more][13]. It's also easy to run and ignores markup in a plaintext file.
+[Proselint][12]是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。
-[Alex][14] is a simple yet powerful prose linter. Run it against a plaintext document or one formatted with Markdown or HTML. Alex pumps out warnings of "gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing in text." If you want to give Alex a test drive, there's an [online demo][15].
+[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为Markdown或HTML的文档使用它。 Alex 会对 “性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞” 产生警告。 如果你想要试试看 Alex,这里有一个在线[demo][15].
### 其他工具
From aa2ef6cc5606694e108c499ecf309229739b74c3 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 10 Dec 2018 18:56:27 +0800
Subject: [PATCH 016/119] PRF:20180328 What NASA Has Been Doing About Open
Science.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@Valoniakim 翻译完之后,还需要自己审读一遍。
---
... NASA Has Been Doing About Open Science.md | 64 +++++++++++--------
1 file changed, 36 insertions(+), 28 deletions(-)
diff --git a/translated/talk/20180328 What NASA Has Been Doing About Open Science.md b/translated/talk/20180328 What NASA Has Been Doing About Open Science.md
index 6bc8f4204d..56628fed21 100644
--- a/translated/talk/20180328 What NASA Has Been Doing About Open Science.md
+++ b/translated/talk/20180328 What NASA Has Been Doing About Open Science.md
@@ -1,70 +1,78 @@
-当 NASA 开始应用开放科学
+NASA 在开放科学方面做了些什么
======
+
![][1]
-最近我们刚为 NASA 在它的自由开源软件上新开放了[科学][2]板块。其中发表的最新一篇文章名为:[开源手段是怎样影响科学的][3]。在这篇文章中我们主要讨论的是 [NASA][4] 在鼓励使用开源工具之后,是怎样在大量的科研机构潮流中保持自身的动态角色,实现快速发展的。
+最近我们刚为开设了一个新的“[科学类][2]”的文章分类。其中发表的最新一篇文章名为:[开源是怎样影响科学的][3]。在这篇文章中我们主要讨论了 [NASA][4] 的积极努力,这些努力包括他们通过开源实践来促进科学研究的积极作用。
### NASA 是怎样使用开源手段促进科学研究的
-NASA 将他们的整个研究库对整个公共域开放,这是一项[壮举][5]。
+NASA 将他们的整个研究库对整个公共领域开放,这是一项[壮举][5]。
-没错!每个人都能访问他们的研究库,并能从他们的研究中获益。
+没错!每个人都能访问他们的整个研究库,并能从他们的研究中获益。
-他们现已开放的资料可以大致分为一下三类:
+他们现已开放的资料可以大致分为以下三类:
- * 开放的 NASA 资源
- * 开放的应用程序编程接口
- * 开放的资料
+ * 开源 NASA
+ * 开放 API
+ * 开放数据
+### 1、开源 NASA
+这里有一份 [GitHub][7] 的联合创始人之一和执行总裁 [Chris Wanstrath][6] 的采访,他向我们介绍道,一切都是从很多年前开始的。
-#### 1\.开放的 NASA 资源
+- [Chris Wanstrath on NASA, open source and Github](https://youtu.be/dUFzMe8GM3M)
-采访 [GitHub][7] 的联合创始人之一和执行总裁 [Chris Wanstrath][6] 时,他向我们介绍道,一切都是从很多年前开始的。
+该项目名为 “[code.nasa.gov][8]”,截至本文发表为止,NASA 已经[通过 GitHub 开源][9]了 365 个科学软件(LCTT 译注:本文原文发表于 2018/3/28,截止至本译文发布,已经有 454 个项目了)。对于一位热爱程序的开发者来说,即使一天研究一个软件,想把 NASA 的这些软件全部研究过来也要整整一年的时间。
-NASA 的账号叫做 “[code.nasa.gov][8]“, 截至现在为止,NASA 已经[通过 GitHub 开放][9]了365个科学软件,对于一位热爱程序的开发者来说,即使一天研究一个软件,想把NASA的这些软件全部研究过来也要整整一年的时间。
+即使你不是一位开发者,你也可以在这个门户网站浏览这个壮观的软件合集。
-即使你不是一位开发者,你也可以在入口网站浏览这些壮观软件合集的统计列表。
+其中就有[阿波罗 11 号][10]的制导计算机的源代码。阿波罗 11 号空间飞行器[首次将两名人类带上月球][11],分别是 [Neil Armstrong][12] 和 [Edwin Aldrin][13] 。如果你对 Edwin Aldrin 感兴趣,可以点击[这里][14]了解更多。
-其中就有[阿波罗11号][10]的制导计算机的源代码。阿波罗11号空间飞行器[首次将两名人类带上月球][11],分别是 [Neil Armstrong][12] 和 [Edwin Aldrin][13] 。如果你对 Edwin Aldrin 感兴趣,可以点击[这里][14]了解更多。
+#### NASA 开源代码促进会使用的开源代码许可
-##### NASA 开源代码促进会使用的开源代码许可:
+它们采用了几种[开源许可证][15],其分类如下:
-这里有几种[开源代码许可][15],其分类如下:
+- [Apache 许可证 2.0](https://www.apache.org/licenses/LICENSE-2.0)
+- [Nasa 开源许可证 3.0](https://opensource.org/licenses/NASA-1.3)
+- [GPL v3](https://www.gnu.org/licenses/gpl.html)
+- [MIT 许可证](https://en.wikipedia.org/wiki/MIT_License)
-#### 2\.开放的应用程序编程接口(API)
+### 2、开放 API
-开放的[应用程序设计接口][16]或者应用程序编程接口在推行开源技术中起到了很大作用。与[开源代码促进会][17]类似,开放的应用程序编程接口有它们的[开放平台促进会][18]。下面这张示意图可以告诉你 API 是怎样将应用程序和它的开发者连接起来的。
+开放 [API][16] 在推行开放科学中起到了很大作用。与[开源促进会][17]类似,对于 API,也有一个 [开放 API 促进会][18]。下面这张示意图可以告诉你 API 是怎样将应用程序和它的开发者连接起来的。
![][19]
-记得点击图片上面的链接看看。链接内的文章使用了简单易懂的方法解读 API ,文末将 API 总结为五种架构。
+记得点击这个[链接](https://sproutsocial.com/insights/what-is-an-api/)看看。链接内的文章使用了简单易懂的方法解读了 API ,文末总结了五大要点。
![][20]
-这让人忍不住想象由专有 API 变成开放 API 会有多么大的不同。
+这会让你感受到专有 API 和开放 API 会有多么大的不同。
![][22]
-[NASA 的开放 API][23] 主要针对应用程序开发者,大大提高了包括图片内容在内的数据可及性,这是前所未有的。网站设有活动编辑器,为需要查阅[每日天文一图][24]板块 [API][16] 的用户们授权。
+[NASA 的 Open API][23] 主要针对应用程序开发者,旨在显著改善数据的可访问性,也包括图片内容在内。该网站有一个实时编辑器,可供你调用[每日天文一图(APOD)][24] 的 API。
-#### 3\.开放的资料
+#### 3、开放数据
![][25]
-在[我们发布的第一篇科学文章][3]中,我们介绍了“开放科学”板块下提到的三个国家——法国,印度和美国的多种开放资料形式。NASA 有着类似的想法和行为。这种意识形态已经被[多个国家][26]所接受。
+在[我们发布的第一篇开放科学的文章][3]中,我们在“开放科学”段落下提到的三个国家 —— 法国、印度和美国的多种开放数据形式。NASA 有着类似的想法和行为。这种重要的意识形态已经被[多个国家][26]所接受。
-[NASA 的开放数据门户][27]致力于不断扩大的可供大众使用的开放数据目录。这个数据集的内容对于任何研究活动来说都是必要且重要的。NASA 还在他们的门户网站上征集各方的数据,以一同收录在他们的数据库中。这一行为不仅是领先的,创新的,还顺应了[数据科学][28]和 [AI 深度学习][29]的趋势。
+[NASA 的开放数据门户][27]致力于开放,拥有不断增长的可供大众自由使用的开放数据。将数据集纳入到这个数据集对于任何研究活动来说都是必要且重要的。NASA 还在他们的门户网站上征集各方的数据需求,以一同收录在他们的数据库中。这一举措不仅是领先的、创新的,还顺应了[数据科学][28]、[AI 和深度学习][29]的趋势。
-下面的视频讲的是学者和学生们是怎样通过大量研究得出对数据科学的定义的。这个过程十分的激动人心。瑞尔森大学罗杰斯商学院的 [Murtaza Haider 教授][30]在视频中提到了开源的出现对数据科学的改变,尤其让是旧有的封闭发展模式逐渐变得开放。而这也确实成为了现实。
+下面的视频讲的是学者和学生们是怎样通过大量研究得出对数据科学的定义的。这个过程十分的激动人心。瑞尔森大学罗杰斯商学院的 [Murtaza Haider 教授][30]在视频结尾中提到了开源的出现对数据科学的改变,尤其让是旧有的闭源方式逐渐变得开放。而这也确实成为了现实。
+
+- [What is Data Science? Data Science 101](https://youtu.be/z1kPKBdYks4)
![][31]
-现在任何人都能在 NASA 上提交数据。正如视频中所说, NASA 的领先方案很大程度上与征集和分析优化数据有关。
+现在任何人都能在 NASA 上征集数据。正如前面的视频中所说,NASA 的举措很大程度上与征集和分析优化数据有关。
![][32]
-你只需要进行免费注册。考虑到论坛上的公开讨论走向和在任何统计分析环境下都能运行的数据集,这个方案在未来会有非常积极的影响,对数据的统计分析当然也会大幅进展。在之后的文章中我们还会具体讨论这些细节,还有他们和开源模式之间的相关性。
+你只需要免费注册即可。考虑到论坛上的公开讨论以及数据集在可能存在的每一类分析领域中的重要性,这一举措在未来会有非常积极的影响,对数据的统计分析当然也会大幅进展。在之后的文章中我们还会具体讨论这些细节,还有它们和开源模式之间的相关性。
以上就是对 NASA 开放科学模式的一些探索成就,希望您能继续关注我们接下来的相关文章!
@@ -73,9 +81,9 @@ NASA 的账号叫做 “[code.nasa.gov][8]“, 截至现在为止,NASA 已经[
via: https://itsfoss.com/nasa-open-science/
作者:[Avimanyu Bandyopadhyay][a]
-译者:[Valoniakim](https://github.com/Valoniakim)
-校对:[校对者ID](https://github.com/校对者ID)
选题:[lujun9972](https://github.com/lujun9972)
+译者:[Valoniakim](https://github.com/Valoniakim)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 70f9f312b99187103c67f017d45c89c46518187f Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 10 Dec 2018 18:56:57 +0800
Subject: [PATCH 017/119] PUB:20180328 What NASA Has Been Doing About Open
Science.md
@Valoniakim https://linux.cn/article-10330-1.html
---
.../20180328 What NASA Has Been Doing About Open Science.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/talk => published}/20180328 What NASA Has Been Doing About Open Science.md (100%)
diff --git a/translated/talk/20180328 What NASA Has Been Doing About Open Science.md b/published/20180328 What NASA Has Been Doing About Open Science.md
similarity index 100%
rename from translated/talk/20180328 What NASA Has Been Doing About Open Science.md
rename to published/20180328 What NASA Has Been Doing About Open Science.md
From 710fc6ef7d353e9e8c8f06ef98a828bed08e1012 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 19:21:22 +0800
Subject: [PATCH 018/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Powers=20of=20two?=
=?UTF-8?q?,=20powers=20of=20Linux:=202048=20at=20the=20command=20line?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...wers of Linux- 2048 at the command line.md | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 sources/tech/20181209 Powers of two, powers of Linux- 2048 at the command line.md
diff --git a/sources/tech/20181209 Powers of two, powers of Linux- 2048 at the command line.md b/sources/tech/20181209 Powers of two, powers of Linux- 2048 at the command line.md
new file mode 100644
index 0000000000..da1b241713
--- /dev/null
+++ b/sources/tech/20181209 Powers of two, powers of Linux- 2048 at the command line.md
@@ -0,0 +1,52 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Powers of two, powers of Linux: 2048 at the command line)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-2048)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+
+Powers of two, powers of Linux: 2048 at the command line
+======
+Looking for a terminal-based game to pass the time? Look no further than 2048-cli.
+
+
+Hello and welcome to today's installment of the Linux command-line toys advent calendar. Every day, we look at a different toy for your terminal: it could be a game or any simple diversion that helps you have fun.
+
+Maybe you have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.
+
+Today's toy is a [command-line version][1] of one of my all-time favorite casual games, [2048][2] (which itself is a clone of another clone).
+
+To play, you just slide blocks up, down, left, and right to combine matching pairs and increment numbers, until you've made a block that is 2048 in size. The catch (and the challenge), is that you can't just move one block; instead, you move every block on the screen.
+
+It's simple, fun, and easy to get lost in it for hours. This 2048 clone, [2048-][1][cli][1], is by Marc Tiehuis and written in C, and made available as open source under an MIT license. You can find the source code [on GitHub][1], where you can also get installation instructions for your platform. Since it was packaged for Fedora, for me, installing it was as simple as:
+
+```
+$ sudo dnf install 2048-cli
+```
+
+That's it, have fun!
+
+
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Play Tetris at your Linux terminal][3], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-2048
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://github.com/tiehuis/2048-cli
+[2]: https://github.com/gabrielecirulli/2048
+[3]: https://opensource.com/article/18/12/linux-toy-tetris
From 7c5b28cc409917fd8a7580a8d1fc3434d127ff7f Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 19:25:02 +0800
Subject: [PATCH 019/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Update?=
=?UTF-8?q?=20Ubuntu=20[Terminal=20&=20GUI=20Methods]=20It's=20FOSS?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...untu -Terminal - GUI Methods- It-s FOSS.md | 174 ++++++++++++++++++
1 file changed, 174 insertions(+)
create mode 100644 sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
diff --git a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
new file mode 100644
index 0000000000..50ba70c073
--- /dev/null
+++ b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
@@ -0,0 +1,174 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How to Update Ubuntu [Terminal & GUI Methods] It's FOSS)
+[#]: via: (https://itsfoss.com/update-ubuntu/)
+[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+
+How to Update Ubuntu [Terminal & GUI Methods] It's FOSS
+======
+
+**This tutorial shows you how to update Ubuntu for both server and desktop versions. It also explains the difference between update and upgrade along with a few other things you should know about updates in Ubuntu Linux.**
+
+If you are a new user and have been using Ubuntu for a few days or weeks, you might be wondering how to update your [Ubuntu][1] system for security patches, bug fixes and application upgrades.
+
+Updating Ubuntu is absolutely simple. I am not exaggerating. It’s as simple as running two commands. Let me give you more details on it.
+
+Please note that the tutorial is valid for Ubuntu 18.04, 16.04 or any other version. The command line way is also valid for Ubuntu-based distributions like Linux Mint, Linux Lite, elementary OS etc.
+
+### Update Ubuntu via Command Line
+
+![How to Update Ubuntu][2]
+
+On the desktop, open the terminal. You can find it in the menu or use the Ctrl+Alt+T [keyboard shortcut][3]. If you are logged on to an [Ubuntu server][4], you already have access to a terminal.
+
+In the terminal, you just have to use the following command:
+
+```
+sudo apt update && sudo apt upgrade -y
+```
+
+It will ask for password and you can use your account’s password. You won’t see the anything on the screen while typing so keep on typing your password and hit enter.
+
+Now let me explain the above command.
+
+Actually, it’s not a single command. It’s a combination of two commands. The && is a way to combine two commands in a way that the second command runs only when the previous command ran successfully.
+
+The ‘-y’ in the end automatically enters yes when the command ‘apt upgrade’ ask for your confirmation before installing the updates.
+
+Note that you can also use the two commands separately, one by one:
+
+```
+sudo apt update
+sudo apt upgrade
+```
+
+It will take a little longer because you have to wait for one command to finish and then enter the second command.
+
+#### Explanation: sudo apt update
+
+This command updates the local database of available packages. If you won’t run this command, the local database won’t be updated and your system will not know if there are any new versions available.
+
+This is why when you run the sudo apt update, you’ll see lots of URLs in the output. The command fetches the package information from the respective repositories (the URLs you see in the output).
+
+![Updating Ubuntu Linux][5]
+
+At the end of the command, it tells you how many packages can be upgraded. You can see these packages by running the following command:
+
+```
+apt list --upgradable
+```
+
+**Additional Reading:** Read this article to learn [what is Ign, Hit and Get in the apt update command output][6].
+
+#### Explanation: sudo apt upgrade
+
+This command matches the versions of installed packages with the local database. It collects all of them and then it will list all of the packages that have a newer version available. At this point, it will ask if you want to upgrade (the installed packages to the newer version).
+
+![Update Ubuntu Linux via Command Line][7]
+
+You can type ‘yes’, ‘y’ or just press enter to confirm the installation of updates.
+
+So the bottom line is that the sudo apt update checks for the availability of new versions while as the sudo apt upgrade actually performs the update.
+
+The term update might be confusing as you might expect the apt update command to update the system by installing the updates but that doesn’t happen.
+
+### Update Ubuntu via GUI [For Desktop Users]
+
+If you are using Ubuntu as a desktop, you don’t have to go to terminal just for updating the system. You can still use the command line but it’s optional for you.
+
+In the menu, look for ‘Software Updater’ and run it.
+
+![Run Software Updater in Ubuntu][8]
+
+It will check if there are updates available for your system.
+
+![Checking if updates are available for Ubuntu][9]
+
+If there are updates available, it will give provide you with options to install the updates.
+
+![Install Updates via Update Manager in Ubuntu][10]
+
+Click on Install Now, it may ask for your password.
+
+![Installing Updates in Ubuntu Linux via GUI][11]
+
+Once you enter your password, it will start installing the updates.
+
+![Updating Ubuntu via GUI][12]
+
+In some cases, you may need to reboot the system for the installed updates to work properly. You’ll be notified at the end of the update if you need to restart the system.
+
+![Updating Ubuntu via GUI][12]
+
+You can choose to restart later if you don’t want to reboot your system straightaway.
+
+![Installing updates via GUI in Ubuntu][13]
+
+Tip: If the software updater returns an error, you should use the command ‘sudo apt update’ in the terminal. The last few lines of the output will contain the actual error message. You can search on the internet for that error and fix the problem.
+
+### Few things to keep in mind abou updating Ubuntu
+
+You just learned how to update your Ubuntu system. If you are interested, you should also know these few things around Ubuntu updates.
+
+#### Clean up after an update
+
+Your system will have some unnecessary packages that won’t be required after the updates. You can remove such packages and [free up some space][14] using this command:
+
+```
+sudo apt autoremove
+```
+
+#### Live patching kernel in Ubuntu Server to avoid rebooting
+
+In case of a Linux kernel updates, you’ll have to restart the system after the update. This is an issue when you don’t want downtime for your server.
+
+[Live patching][15] feature allows the patching of Linux kernel while the kernel is still running. In other words, you don’t have to reboot your system.
+
+If you manage servers, you may want to [enable live patching in Ubuntu][16].
+
+#### Version upgrades are different
+
+The updates discussed here is to keep your Ubuntu install fresh and updated. It doesn’t cover the [version upgrades][17] (for example upgrading Ubuntu 16.04 to 18.04).
+
+[Ubuntu version][18] upgrades are entirely a different thing. It updates the entire operating system core. You need to make proper backups before starting this lengthy process.
+
+### Conclusion
+
+I hope you liked this tutorial on updating the Ubuntu system and you learned a few new things.
+
+If you have any questions, please fee free to ask. If you are an experienced Linux users and have some tip that can make this tutorial more useful, please share it with the rest of us.
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/update-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://www.ubuntu.com/
+[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/how-to-update-ubuntu.png?resize=800%2C450&ssl=1
+[3]: https://itsfoss.com/ubuntu-shortcuts/
+[4]: https://www.ubuntu.com/download/server
+[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubunt-1.jpeg?resize=800%2C357&ssl=1
+[6]: https://itsfoss.com/apt-get-linux-guide/
+[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubunt-2.jpeg?ssl=1
+[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-via-GUI-1.jpeg?resize=800%2C250&ssl=1
+[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-via-GUI-2.jpeg?resize=800%2C250&ssl=1
+[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/update-ubuntu-GUI-3.jpeg?resize=800%2C365&ssl=1
+[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/install-update-ubuntu-1.jpg?resize=800%2C450&ssl=1
+[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/installing-updates-ubuntu.jpg?ssl=1
+[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/installing-updates-ubuntu-2.jpeg?ssl=1
+[14]: https://itsfoss.com/free-up-space-ubuntu-linux/
+[15]: https://www.ubuntu.com/livepatch
+[16]: https://www.cyberciti.biz/faq/howto-live-patch-ubuntu-linux-server-kernel-without-rebooting/
+[17]: https://itsfoss.com/upgrade-ubuntu-version/
+[18]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
From 8277fd6d2cc840d76a7e455b42e1892e515a6de8 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 19:31:28 +0800
Subject: [PATCH 020/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Play=20Tetris=20a?=
=?UTF-8?q?t=20your=20Linux=20terminal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...1208 Play Tetris at your Linux terminal.md | 57 +++++++++++++++++++
1 file changed, 57 insertions(+)
create mode 100644 sources/tech/20181208 Play Tetris at your Linux terminal.md
diff --git a/sources/tech/20181208 Play Tetris at your Linux terminal.md b/sources/tech/20181208 Play Tetris at your Linux terminal.md
new file mode 100644
index 0000000000..d3a94bcaf6
--- /dev/null
+++ b/sources/tech/20181208 Play Tetris at your Linux terminal.md
@@ -0,0 +1,57 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Play Tetris at your Linux terminal)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-tetris)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+
+Play Tetris at your Linux terminal
+======
+
+Recreate the magic of the 1980s with everyone's favorite tile-matching game, Tetris.
+
+
+
+Thanks for joining us for today's installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game or any simple diversion that helps you have fun at the terminal.
+
+It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.
+
+I promised when I started this series I'd be including games, but so far I've neglected to, so let's fix that with today's selection: Tetris.
+
+Tetris and I are almost exactly the same age, having first come into the world in the summer of 1984. Instead of rural North Carolina, though, Tetris originated in Moscow in what was at the time the Soviet Union.
+
+After taking the world by storm, Tetris was cloned many, many times. I would suspect you could find a Tetris clone for just about any operating system in any language you looked for. Seriously, go look. There are some fun ones out there.
+
+The [version][1] I'm bringing you for today's command-line toy is [written in Haskell,][1] and it's one of the better-done versions I've seen, with on-screen preview, score, help, and a clean look.
+
+If you're willing to run a compiled binary from an untrusted source (I wouldn't recommend it), you can grab that directly, but for a safer approach, it's also easy to use a containerized version with [dex][2], or to install from source with [stack][3].
+
+This particular Tetris clone is by Sam Tay and available under a BSD license. [Check it out][1]!
+
+
+
+If you've got your own favorite Tetris clone (or maybe you've written your own?), let us know!
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Plan your own holiday calendar at the Linux command line][4], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-tetris
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://github.com/samtay/tetris
+[2]: https://github.com/dockerland/dex
+[3]: https://docs.haskellstack.org/en/stable/README/#how-to-install
+[4]: https://opensource.com/article/18/12/linux-toy-cal
From e40e6ed915277a24f3aec68daf5c762087d0b846 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 19:40:16 +0800
Subject: [PATCH 021/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=206=20steps=20to=20?=
=?UTF-8?q?optimize=20software=20delivery=20with=20value=20stream=20mappin?=
=?UTF-8?q?g?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ware delivery with value stream mapping.md | 94 +++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 sources/talk/20181206 6 steps to optimize software delivery with value stream mapping.md
diff --git a/sources/talk/20181206 6 steps to optimize software delivery with value stream mapping.md b/sources/talk/20181206 6 steps to optimize software delivery with value stream mapping.md
new file mode 100644
index 0000000000..29dc0ce63c
--- /dev/null
+++ b/sources/talk/20181206 6 steps to optimize software delivery with value stream mapping.md
@@ -0,0 +1,94 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (6 steps to optimize software delivery with value stream mapping)
+[#]: via: (https://opensource.com/article/18/12/optimizing-delivery-value-stream-mapping)
+[#]: author: (Dominika Bula https://opensource.com/users/dominika)
+
+6 steps to optimize software delivery with value stream mapping
+======
+Learn how VSM can help you streamline processes, boost efficiency, and better meet customer expectations.
+
+
+Do your efforts to improve software development fall short due to confusion and too much debate? Does your organization have a clear picture of what is achievable, and are you sure you’re moving in the right direction? Can you determine how much business value you've delivered so far? Are the bottlenecks in your process known? Do you know how to optimize your current process?
+
+If you are looking for a tool that will help you answer these questions, consider integrating [value stream mapping][1] and [lean concepts][2] into the way you deliver software.
+
+### What is value stream mapping (VSM)?
+
+Popularized in the ‘90s by James Womack and Daniel Jones, value stream mapping is a lean enterprise technique that is currently used by many organizations. In short, the value stream is the sequence of activities that are performed by the organization to deliver customer requests. Value stream mapping helps determine what is valuable and what doesn’t bring value by identifying activities that matter to your customer. The ultimate benefit of using VSM is a better understanding of how to improve your current development process to generate more value and impact.
+
+### 6 steps to optimizing software delivery
+
+ 1. **Select the process**
+
+Any process can be modeled as a sequence of activities. For example, a [system development life cycle][3] is a value stream consisting of product specification, design, development, deployment, operation and maintenance, and finally, disposition. In this example, product design can be viewed as a value stream segment.
+
+ 2. **Identify the parties involved in the project**
+
+Select a project sponsor and team. Keep in mind that each area of the process should be represented. Holistic thinking helps identify and set expectations, which in turn reduces resistance to change.
+
+ 3. **Create the current state map**
+
+Creating the current state map helps establish a better understanding of how work is currently done. Documenting your current process is key to success at this stage. The goal is to identify the specific items that flow through your value stream.
+
+ 4. **Challenge the current thinking**
+
+Make sure that what you are doing adds value—if there are actions in your process that do not add value, stop doing them. Look at the [software development waste types][2] for ideas. Mary Poppendieck and Tom Poppendieck identify these and transfer them from manufacturing to software engineering in their book, [Lean Software Development: An Agile Toolkit][4]. The waste types are:
+
+ * Partially done work
+ * Extra processes
+ * Extra features
+ * Task switching
+ * Waiting
+ * Motion
+ * Defects
+ * Management activities
+
+
+ 5. **Generate the future state map and execute improvements**
+
+Think of what can be done to reduce or ideally eliminate the identified wastes.
+
+While working on the future state map, follow the principle that humans should do only what they can do best, and the rest should be [automated][5]. The future state design should aim to eliminate hands-on work and deliver completed software projects in less time with higher quality.
+
+Talk about the changes, let people ask questions—this will help reduce resistance to change. As you start executing improvements, remember that value stream mapping is an evolutionary process, and you might need to adjust the original plan. The value stream should be continuously improved; it will not be perfect the first time.
+
+ 6. ****Measure benefits****
+
+Karen Martin and Mike Osterling identify key performance metrics for software delivery in their book, [Value Stream Mapping][6]:
+
+ * Total lead time: the total time it takes to deliver on a customer request
+
+ * Total process time: the total work effort required by all functions on the timeline critical path of the value stream
+
+ * Activity ratio: the degree of flow in the value stream
+
+ * Compounded effect: the quality of output across the value stream
+
+
+Well-executed value stream mapping not only improves the way work gets delivered, but it also provides a transformational opportunity for your organization and a tool to facilitate a shift in mindsets and behaviors.
+
+### What to read next
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/optimizing-delivery-value-stream-mapping
+
+作者:[Dominika Bula][a]
+选题:[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/dominika
+[b]: https://github.com/lujun9972
+[1]: https://en.wikipedia.org/wiki/Value_stream_mapping
+[2]: https://en.wikipedia.org/wiki/Lean_software_development
+[3]: https://en.wikipedia.org/wiki/Systems_development_life_cycle
+[4]: https://www.oreilly.com/library/view/lean-software-development/0321150783/
+[5]: https://xkcd.com/1205/
+[6]: https://mhebooklibrary.com/doi/book/10.1036/9780071828949
From 609f3bcf23d97598d714f113eb6723047041f2dd Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 19:48:46 +0800
Subject: [PATCH 022/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Introduction=20to?=
=?UTF-8?q?=20Clojure=20=E2=80=93=20Modern=20dialect=20of=20Lisp=20(Part?=
=?UTF-8?q?=201)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ojure - Modern dialect of Lisp (Part 1).md | 1784 +++++++++++++++++
1 file changed, 1784 insertions(+)
create mode 100644 sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md
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
new file mode 100644
index 0000000000..5e5f4df763
--- /dev/null
+++ b/sources/tech/20131228 Introduction to Clojure - Modern dialect of Lisp (Part 1).md
@@ -0,0 +1,1784 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Introduction to Clojure – Modern dialect of Lisp (Part 1))
+[#]: via: (https://www.creativeapplications.net/tutorials/introduction-to-clojure-part-1/)
+[#]: author: (Karsten Schmidt and Ricardo Sanchez https://www.creativeapplications.net/author/karstenricardo/)
+
+Introduction to Clojure – Modern dialect of Lisp (Part 1)
+======
+
+
+
+### Foreword by [Ricardo Sanchez][1]
+
+Back in March I had the pleasure to attend Karsten’s workshop at the 2013 [Resonate][2] conference in Belgrade, in it we learned how to work with audio and music while coding live using the Clojure programming language. It was great! I got so addicted to this new way of programming that it made me work on a little tutorial so I can share my experience with newcomers. After I finished my first draft I asked Karsten to do a technical review of it and he very kindly accepted. A couple of weeks months later we managed to expand & transform it into a comprehensive introductory article to Clojure and functional programming with a few very cool examples I hope you’ll enjoy. Without Karsten’s input this tutorial would never have been what it is today – so for that a big THANKS is due to him and the Resonate team for putting together such an awesome event.
+
+### Foreword by [Karsten Schmidt][3]
+
+Getting (back) into the [magical world of Lisp][4] had been on my to-do list for a long while, though my first encounter with Clojure in 2011 was through sheer coincidence (if you believe in such things!). It took me only a few hours to realise how this encounter was impeccable timing since there was this nagging feeling that I had become too accustomed to the status quo of the languages I’d been using for the last decade. Most importantly, I instinctively knew, I wanted to learn & use this language for my own work, badly & ASAP. And indeed, I’ve been fortunate enough to be able to use Clojure on several large projects since, from cloud based server apps/renderfarms to OpenGL/CL desktop apps and a [festival identity][5]. What I wasn’t quite prepared for were the many doors (of perception and inquiry) Clojure has opened wide in terms of process, thinking & learning about code from outside the boxes of our so beloved, popular languages & frameworks. Now, having been using it almost daily for 2.5 years, this tutorial, this labour of love, is largely meant to share some findings of this journey so far (though admittedly this first part is more of a crash course) – all in the hope to inspire some like-minded souls from this community, keen to help realising the untapped potential this language & its philosophy bring to the creative drafting table…
+
+Since this tutorial has grown well beyond the scope of a single article and there’s no [TL;DR][6] version, we will be releasing it in stages over the coming weeks…
+
+### Introduction
+
+This tutorial aims at giving you a taste of functional programming with [Clojure][7], a modern dialect of [Lisp][8] designed to run as an hosted language on the Java Virtual Machine (and an increasing number of other host platforms). Based on the [lambda calculus][9] theory developed by [Alonzo Church][10] in 1930s, the family of functional languages has a long history and forms one of the major branches in the big tree of available programming languages today. Largely through developments in hardware and the increasing numbers of cores in CPU chip designs, as well as through the appearance of languages like [Erlang][11], [F#][12], [Haskell][13], [Scala][14] & Clojure, the [functional philosophy][15] has been re-gaining traction in recent years, since it offers a solid and plausible approach to writing safe & scalable code on these modern hardware architectures. Core functional ideas are also slowly infiltrating long established bastions of the [Kingdom of Nouns][16], i.e. through the inclusion of lambda expressions in both the latest versions of [Java 8][17] and [C++11][18]. However, Clojure goes much further and its combined features (e.g. [immutability][19], [laziness][20], [sequence abstractions][21], extensible [protocols][22], [multimethods][23], [macros][24], [async constructs][25], choice of [concurrency primitives][26]) make it an interesting choice for approaching data intensive or distributed applications with a fresh mindset around lightweight modelling.
+
+### Sections:
+1\. Getting to know Clojure
+2\. Setting up an environment
+3\. Hello world, Hello REPL!
+4\. Clojure syntax summarized
+5\. Symbols
+6\. Vars & namespaces
+7\. Functions
+8\. Metadata
+9\. Truthiness, conditionals & predicates
+10\. Data structures
+11\. Common data manipulation functions
+12\. Sequences
+13\. Looping, iteration & recursive processing
+14\. Common sequence processing functions
+15\. Destructuring
+16\. Further reading & references
+
+### Getting to know Clojure
+
+Clojure is a young (first release in 2007) and opinionated language whose philosophy challenges/contrasts (just as much as [Rich Hickey][27], Clojure’s author, does) some commonly accepted assumptions about programming and software design. It therefore requires some serious unlearning and rethinking for anyone who’s ever only programmed in Processing, Java, C++ etc. (JavaScript programmers will find some of the ideas more familiar though, since that language too was heavily influenced by older Lisp implementations). So even if after working through this tutorial series you decide Clojure isn’t for you, the new perspectives should provide you with some food for thought and useful knowledge to continue on your journey.
+
+[As a reward for taking on this learning curve][28], you’ll gain access to ideas and tools, which (not just in our opinion) should excite anyone interested in a more “creative” computing process: a truly interactive programming environment without a write/compile/run cycle and live coding & manipulation even of long running complex systems, a language, which by design, removes an entire class of possible bugs, a super active, helpful community of thousands of users/seekers – and at the very least it will give you some alternative insights to common programming problems, regardless your chosen language. With the JVM as its current main host platform and Clojure’s seamless Java interop features, you’ll have full access to that language’s humungous ecosystem of open source libraries, often in [an easier way than Java itself][29]. Clojure’s sister project [ClojureScript][30] is equally making headway in the JavaScript world and there’re a number of efforts underway to port Clojure to other platforms (incl. [Android][31] and [native compilation via LLVM][32]).
+
+Clojure’s (and Lisp’s) syntax is a bit like [Marmite][33]: There’re probably as many people who love it as there’re who hate it, though in this case the objections are usually just caused by unfamiliarity. The seemingly large amount of parantheses present is one of the most immediately obvious and eye-grabbing aspects to any novice looking at Clojure/Lisp code. However, being a programming language, this a) is obviously by design, b) not strictly true, and c) is the result of [stripping out most other syntax][34] and special characters known from other languages: I.e. there’re no semicolons, no operator overloading, no curly brackets for defining scope etc. – even commas are optional and considered whitespace! All this leads to some concise, yet readable code and is further enhanced by the number of powerful algorithmic constructs the language offers.
+
+Whereas in a C-like language a simple function/method definition looks like this:
+
+```
+// C
+void greetings(char *fname, char *lname) {
+ printf("hello %s %s\n", fname, lname);
+}
+
+// C++
+void greetings(const char *fname, const char *lname) {
+ std::cout << "hello " << fname << " " << lname << std::endl;
+}
+
+// Java
+public void greetings(String fname, String lname) {
+ System.out.println("hello " + name);
+}
+```
+
+...in Clojure it is:
+
+```
+(defn greetings [fname lname]
+ (println "hello" fname lname))
+```
+
+Calling this function then:
+
+```
+// C-style
+greetings("Doctor", "Evil");
+
+; Clojure
+(greetings "Doctor" "Evil")
+```
+
+Clojure's philosophy to syntax is pure minimalism and boils down to the understanding that every piece of source code, as in any programming language, is merely a definition of an executable tree structure. Writing Clojure is literally defining the nested branches of that tree (identified by brackets, also called [S-expressions][35] or sexp, short for symbolic expressions). Even after a short while, you'll find these brackets seem to become automatic and mentally disappear (especially when using an appropriate text editor w/ support for [bracket matching][36], [rainbow brackets][37] and [structural editing features][38]).
+
+Also because this tutorial is more of a crash course and limited in scope, we can only provide you with a basic overview of core language features. Throughout the tutorial you will find lots of links for further reading and a list of Clojure related books at the end. Now, without much further ado, let's dive in...
+
+### Setting up an environment
+
+As with any programming language, we first need to ensure we've got some proper tooling in place, before we can begin our journey through unknown lands. Since Clojure is just a language and runtime environment, it doesn't have any specific requirements for editors and other useful tools. However, the Clojure community has developed and adopted a number of such tools, which make working with Clojure (even) more fun and the first one we introduce right away:
+
+### Leiningen
+
+These days most software projects are using a large number of open source libraries, which themselves often have further dependencies of their own. To anyone having ever worked with a language with an active community, life without a package manager seems like pure hell, trying to manage & install dependencies manually. [Leiningen][39] is the de-facto build tool used by the Clojure community, with its name being an [humorous take][40] on [Ant][41], the former de-facto build tool in the Java world. Lein calls itself a tool for "automating Clojure projects without setting your hair on fire". It's truly one of the easiest ways to get started with Clojure and is so much more than just a package manager, even though in this tutorial we'll be mainly using it as such. So please head over to the [Leiningen][39] website and follow the simple 3-step install procedure (or check your system package manager, e.g. [Homebrew][42] for OSX: `brew install leiningen`). **Regardless, you'll need to have an existing[Java installation][43] (Java 6 or newer) on your machine, before installing Leiningen...**
+
+> The Clojure community has developed integration plug-ins for several popular editors & IDEs and we will start working with one of them [Counterclockwise][44] in the next part of this tutorial. A list of other options can be found on the [Clojuredoc website][45].
+
+### Hello world, Hello REPL!
+
+As briefly mentioned in the beginning, Clojure provides us with a fully dynamic programming environment, called the REPL: The **(R)**ead, **(E)**valuate, **(P)**rint, **(L)**oop. The REPL reads input from the user, executes it, prints the result of the process, then rinse & repeat...
+
+The "read" phase converts source code into a data structure (mostly a nested list of lists). During "evaluation" this data structure is first compiled into Java byte code and then executed by the JVM. So unlike some other dynamic languages running on the JVM (e.g. [JRuby][46], [Rhino][47]), Clojure is a compiled language and in many cases can have similar performance characteristics as Java.
+
+The REPL quickly becomes the main sketch pad and development tool for many Clojure users, a space in which complex code is slowly built up from small parts, which can be immediately tested and experimented with, providing an uninterrupted experience.
+
+To start a REPL with leiningen, simply type `lein repl` on your command line and after a few moments, you should see a prompt like this:
+
+```
+$ lein repl
+nREPL server started on port 51443
+REPL-y 0.1.10
+Clojure 1.5.1
+Exit: Control+D or (exit) or (quit)
+Commands: (user/help)
+ Docs: (doc function-name-here)
+ (find-doc "part-of-name-here")
+ Source: (source function-name-here)
+ (user/sourcery function-name-here)
+Javadoc: (javadoc java-object-or-class-here)
+Examples from clojuredocs.org: [clojuredocs or cdoc]
+ (user/clojuredocs name-here)
+ (user/clojuredocs "ns-here" "name-here")
+user=> _
+```
+
+> Btw. The first time `lein` is run, it will download Clojure and possibly a number of other files/libraries. This only happens once and all files are stored/cached in this folder `~/.m2/repository`. REPL startup time will always take a few seconds due to the JVM initializations needed, however a REPL usually doesn't need to be restarted often, so in practice isn't an huge issue.
+>
+> Should ever end up triggering an action which will make the REPL hang (e.g. trying to display an infinite sequence), you can press `Control+C` to cancel this action.
+>
+> **If you don't want to (or can't) install Clojure/Leiningen, you can try out all of the examples in this part of the tutorial using the online REPL at[Try Clojure][48].**
+
+As is traditional, our first piece of Clojure code should be `(println "Hello World")`. So please go ahead and type it at the prompt. Once you hit `Enter`, the **(R)**ead phase of the REPL begins, turning our entered text into a stream of symbols. Provided there're no errors, these symbols are then **(E)**valuated according to the rules of the language, followed by **(P)**rinting the result of that code and **(L)**oop giving us a new prompt for input.
+
+```
+user=> (println "Hello World")
+Hello World
+nil
+user=> _
+```
+
+> **Input - > Process -> Output**
+>
+> ...is one of the fundamental concepts in programming, especially in functional programming. If you look closely, you might be wondering where that `nil` came from? `nil` is Clojure's equivalent of `null` and here indicates that our `println` actually didn't produce any computational result. In fact, the display of "Hello World" was simply a side-effect of executing `println` (by pushing that string to your system's output stream), but the `println` function gave us no actual value back, which we might pass to another process. We will return to this important distinction later on when we'll talk about truthiness, predicates and pure functions.
+
+Some other brief examples:
+
+```
+(+ 1 2)
+; 3
+(+ (+ 1 2) (+ 3 4))
+; 10
+(+ 1 2 3 4)
+; 10
+```
+
+Looks weird, huh? At least no more `nil` is to be seen (of course we expected some results from an addition), and maybe you can already spot a pattern:
+
+ 1. Operations seem to come first (this is called [prefix notation][49]) and
+ 2. it seems the number of parameters/arguments doesn't matter...
+
+
+
+These are the kind of assumptions, you might make coming from an imperative programming background (Java/C etc.), where symbols like `+`, `-`, `/`, `*` or `=` actually are operators, basically symbols with pre-defined, hardcoded meanings and can only appear in certain places within the code. In Clojure however, there're no such operators and `+` is just defined as a standard function and that function accepts indeed a flexible number of params (as do all other basic math operators).
+
+### Clojure syntax summarized
+
+The syntax of Clojure/Lisp boils down to just this **one rule** and any Clojure form has this overall structure (no exceptions!):
+
+```
+(function param1 param2 ... paramN)
+```
+
+**Note:** Functions are processes and parameters (also called arguments) are their inputs. The number of params depends of course on the function, with some not requiring arguments at all.
+
+The parentheses define the scope of an S-expression (technically a list, but also a branch in the tree of our program), with its first element interpreted as a function to call. An important thing to consider at this stage is that all the elements (incl. the first) of such an expression can be (and often are) results of other function calls.
+
+Here we calculate the sum of two products, the [Pythagorean][50] (c2 = a2 + b2) of a fixed triangle with sides a = 4 and b = 8:
+
+```
+(+ (* 4 4) (* 8 8))
+; 80
+```
+
+![AST visualized][51]
+
+The image shows a visualization of the encoded tree structure we've written. The tree needs to be evaluated from the bottom to the top: The inner forms `(* 4 4)` and `(* 8 8)` are evaluated first before their sum can be computed. Clojure is read inside out. At first this might seem alien, but really just takes getting used to and doesn't prove problematic in practice, since most Clojure functions are often less than 10 lines long.
+
+### Symbols
+
+Symbols are used to name things and are at the heart of Clojure. Clojure code is evaluated as a tree of symbols, each of which can be bound to a value, but doesn't need to be. Of course in practice, it mostly means a symbol must have a bound value in order to work with it. Yet there're situations in Clojure when a symbol must remain unevaluated (as is) and we'll describe some of these in more detail when we discuss the `list` data type further below.
+
+Imagine for a moment to be in Clojure's shoes and we have to evaluate the form `(+ 1 2)`. The Reader simply provides us with a list of 3 symbols `+`, `1` and `2`. The latter two are easily identified as numbers and need no further treatment. The `+` however is a symbol we don't know and therefore need to look up first to obtain its value. Since that symbol is part of the core language, we find out it's bound to a function and then can call it with `1` and `2` as its arguments. Once the function returns, we can replace the whole form `(+ 1 2)` with its result, the value `3`. If this form was part of a larger form/computation, this result is then inserted back into it and the whole process repeats until all remaining forms & symbols have been resolved and a final value has been computed.
+
+Symbols are conceptually similar to variables in that both provide reusable, named references to data (and code). Yet, variables don't really exist in Clojure. The biggest difference to variables in other languages, is that by default a symbol is bound to a fixed value once, after which it can't be changed. This concept is called...
+
+#### Immutability
+
+[Immutability][19] isn't a well known concept among the (imperative) languages, which readers of this blog might be more familiar with. In fact, these languages are mainly built around its opposite, mutability - the ability to define data, pass it around via references/pointers and then change it (usually impacting multiple places of the codebase). The fact, that immutable data is read-only once it's been defined, provides the key feature for truly enabling safe multi-threaded applications and simplifies other programming tasks (e.g. easy comparison of nested values, general testability and the ability to safely reason over a function's behaviour). The presence of immutable data also leads to fundamental questions about the actual need for key topics in object oriented programming, e.g. the need for hiding data through encapsulation and all the resulting complexity is only required if a language doesn't provide features protecting data from direct 3rd party (i.e. user code) manipulation. This problem simply doesn't exist in Clojure! On the other hand immutability too provides one of the most challenging unlearning tasks for people coming from a world of mutable state, since it seems paradoxical to work it into any realworld system requiring constant changes to our data.
+
+Since no real application can exist without changing its internal state, throughout the course of this tutorial we will show how a) Clojure makes the most of immutability using persistent data structures, b) how actual mutable behaviour can be achieved where it is beneficial and c) show how mutable state can be easily avoided in most parts of a Clojure program. But for now please remember: **Clojure data is immutable by default.**
+
+> As an aside, unlike other functional languages like [Haskell][52] or [Scheme][53] where all data is truly 100% immutable and changing state can only be achieved through [Closures][54] & [Monads][55], Clojure takes a more pragmatic route and provides a number of mutable data types. However, each of those is intended for certain usage scenarios and we will only discuss two of them (Vars and Atoms) further below.
+
+#### Symbol bindings
+
+In most programming languages variables are based on [lexical scope][56]: Depending on the level at which a variable has been declared in a program, its binding is either global or local (e.g. local within a function or class). Clojure also provides lexical scope binding using the `let` form, giving us local, symbolic value bindings only existing within its body.
+
+The [`let`][57] form has this general structure and the last (often only) expression of its body becomes the final result:
+
+```
+(let [symbol value
+ symbol value ...]
+ body-expressions)
+```
+
+> Btw. The name `let` comes from mathematical texts, where we often say things like: "Let C be the sum of A and B" etc. To anyone with a previous career in BASIC, this should be familiar too...
+
+Sticking with our pythagorean example from above, we could wrap the computation inside a `let` form and introduce two symbols `a` and `b`:
+
+```
+(let [a 4 ; bind symbol a to 4
+ b 8] ; bind symbol b to 8
+ (+ (* a a) (* b b))) ; use symbols
+; 80
+
+a ; outside the let form symbol a is undefined
+CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context
+```
+
+We will deal with `let` several more times throughout this tutorial.
+
+### Vars & namespaces
+
+Being restricted to only lexical scoped symbols defined with `let` is of course a painstaking way of programming, but thankfully isn't the whole truth. The basis of programming is "[Don't repeat yourself][58]" and that implies we need some form of mechanism to refer to existing values/processes defined elsewhere. In Clojure, this mechanism is implemented using Vars, named storage containers holding our data. Vars are named using symbols and can keep any datatype. They're always global within a given namespace, meaning they're visible from anywhere within that namespace and possibly others too.
+
+Namespaces are an important concept (not only) in Clojure to manage modularity and avoid naming conflicts. They're conceptually similar to [namespaces in C++][59], [packages in Java][60] or [modules in Python][61], although in Clojure have additional dynamic features. All Clojure code is evaluated as namespaced symbols and the language provides a rich set of functions to create, link and manipulate them. You can read more about them on the [Clojure website][62]. In the REPL the prompt will always show which namespace we're currently working in (default `user`).
+
+Back to Vars now, they're the closest thing to "traditional" variables in other languages, though are not equal: Whereas in many other languages a variable is a direct mapping from a named symbol to a value, in Clojure, symbols are mapped to Var objects, and only the Vars themselves provide a reference to their current values. This is an additional level of indirection, important for working in the dynamic environment of the REPL and in multi-threaded scenarios. For the latter, Vars provide a mechanism to be dynamically rebound to a new value on a per-thread basis and is one of Clojure's concurrency features we will discuss in a future part of this tutorial.
+
+![Clojure Vars explained][63]
+
+[`def`][64] is the general form used to define Vars. It is a special form which takes two arguments, but doesn't evaluate the first one and instead takes it literally to create a new Var of that name, which then holds the given value (if any). Vars can also be defined without a value, which keeps them initially unbound and is less common, but is sometimes needed to declare a Var for future reference.
+
+We used Vars a couple of times already: the `+`, `*` and `let` symbols are all bound to Vars defined in the [`clojure.core`][65] namespace. But let's define two vars ourselves and then pass their values to a process:
+
+```
+(def a 4)
+; #'user/a ; def returns the created var object
+a ; just providing a Var's name will return its value
+; 4
+(def b 8)
+; #'user/b
+b
+; 8
+(+ (* a a) (* b b)) ; Vars used in a computation
+; 80
+```
+
+> If we want to refer to a Var itself, rather than its value, we can use the `#'` prefix or the `var` function.
+
+To explain some more how Vars are used in the light of immutability, let's look at another example: In imperative languages like C, Java, JS etc. we have the `++` operator to increment a variable by one. Clojure has the [`inc`][66] function: It too takes a value and returns the value + 1. So we can apply this to our `a` and see what happens:
+
+```
+(inc a) ; returns a + 1
+; 5
+```
+
+Correct answer. But printing out `a` shows its value is still 4...
+
+```
+a
+; 4
+```
+
+This is because `inc` does not operate on the Var `a`, but only is given `a`'s current value `4`. The value returned by `inc` is entirely distinct and our `a` is never touched (apart from reading its value).
+
+**Vars should only be used to define values in the interactive programming context of the REPL or for pre-defined values in Clojure source files.** When we said that Vars are mutable, then this is only true in that they can be redefined with `def` (and some other advanced functions we won't cover here) to have new values, but practically, a Var should be considered unchangeable. Of course, one could write a function which uses `def` within its body to re-define a var with a new value, however this is considered non-idiomatic, generally bad form and is never seen in the wild. Just don't do it! If this is still confusing, we hope things will make more sense, once we've discussed Clojure's data structures and have seen how mutation of variables is actually not needed in practice.
+
+### Functions
+
+In stark contrast to object oriented languages like Java, where classes and objects are the primary unit of computation, Clojure is a functional language with functions at its heart. They're "first class", standalone entities in this language and should be considered equal to any other type of data/value. They're accepted as arguments to other functions and can also be constructed or returned as result from a function call. With functions playing such a key role in Clojure, they can be defined in different ways and be given a name, but don't need to.
+
+When defining a re-usable function, we most likely want to also give it a name so that we can easily refer to it again. To define a named function we use the built-in form [`defn`][67] (`def`'s sibling and short for "define function") and provide it with all the important things needed: a name, a list of inputs (parameters) and the body of the function (the actual code). In pseudo-code this then looks like this:
+
+```
+(defn name [parameters] body-expressions)
+```
+
+...applied to our above example this could be written like this:
+
+```
+(defn hypot
+ [a b]
+ (let [a (* a a)
+ b (* b b)
+ c (+ a b)]
+ (Math/sqrt c)))
+```
+
+This implementation is not the most concise, but shows how we can use `let` to split up a computation into smaller steps and temporarily redefine symbols. We also make use of [Java interop features][68] to refer to Java's built-in [`Math`][69] class and compute the square root of that expression. According to Pythogoras, this is the actual length of the third side (the [Hypotenuse][70]) of the right-angled triangle given by `a` and `b`. A shorter alternative would be just this:
+
+```
+(defn hypot [a b] (Math/sqrt (+ (* a a) (* b b))))
+```
+
+If you're coming from a C-style language, you might wonder where we define the actual result (or return value) of this function. In Clojure this is implicitly given: **Just as with`let`, the result of the last expression in a function's path of execution is the result.**
+
+Now that we have defined our first function, we can call it like this:
+
+```
+(hypot 9 12) ; call fn with 9 & 12
+; 15.0
+(hypot a b) ; call fn with our Vars a=4 & b=8
+; 8.94427190999916
+```
+
+#### Anonymous functions
+
+A function without a name is called an anonymous function. In this case they're defined via the special form [`fn`][71], like this:
+
+```
+(fn [params] body-expressions)
+```
+
+Just like `defn`, this form takes a number of parameter names and body expressions. So another alternative would be to use `def` and the `fn` form to achieve the same function definition as above (`defn` is really just a short form of this combo):
+
+```
+(def hypot (fn [a b] (Math/sqrt (+ (* a a) (* b b)))))
+```
+
+Anonymous functions are often used with Cloure's data processing features (see further below), for callbacks or if the result of a function is another function, e.g. to pre-configure functions as explained next (readers with a JS background should also find the following familiar):
+
+Let's take another brief look at the `greetings` function we showed at the beginning of this tutorial:
+
+```
+(defn greetings [name] (println "hello" name))
+```
+
+Now, we assume such a greeting exists in other languages too, so we might want to define a German version as well:
+
+```
+(defn greetings-de [name] (println "hallo" name))
+```
+
+The only difference between the two is the first part of the greeting, so a more reusable alternative would be to redefine `greeting` to use two arguments:
+
+```
+(defn greetings [hello name] (println hello name))
+; #'user/greetings
+(greetings "hello" "toxi")
+; hello toxi
+```
+
+This is one of the situations where anonymous functions come into play, since we could define a `make-greetings` function which takes a single parameter (a greeting) and returns an anonymous function which then only requires a name, instead of a greeting **and** a name. Instead of using `println` we make use of the [`str`][72] function to concatenate values into a single string and return it as result.
+
+```
+(defn make-greetings
+ [hello]
+ (fn [name]
+ (str hello " " name "!"))) ; str concatenates strings
+```
+
+With this in place, we can now define a couple of Vars holding such greeters for different languages and then use these directly:
+
+```
+(def greetings-es (make-greetings "Hola"))
+(def greetings-de (make-greetings "Guten Tag,"))
+```
+
+The new Vars `greetings-es` & `greetings-de` now contain the pre-configured functions returned by `make-greetings` and we can use them like this:
+
+```
+(greetings-es "Ricardo")
+; "Hola Ricardo!"
+(greetings-de "Toxi")
+; "Guten Tag, Toxi!"
+```
+
+> We call functions which consume or produce functions [Higher Order functions][73] (HOF) and they play a crucial role in the functional programming world. HOFs like the one above are used to achieve a concept called [Partial application][74] and the mechanism enabling it is called a [Closure][75], which should also explain Clojure's naming. We could also use the [`partial`][76] function to achieve what we've done here manually.
+
+#### Multiple arities & varargs
+
+Even though this isn't the place to go into details just yet, Clojure allows functions to provide multiple implementations based on the number of arguments/parameters given. This features enables a function to adjust itself to different usage contexts and also supports functions with a flexible number of parameters (also called varargs, discussed at the end of this article).
+
+#### Guards
+
+Errors are an intrinsic aspect of programming, but taking a defensive stance can help catching many of them early on during the design stage, also articulated through the "[Fail fast][77]" philosophy popular amongst software folk. Clojure supports this form of [Design-by-contract][78] approach, allowing us to specify arbitrary guard expressions for our functions and uses them to pre-validate inputs (parameters) and/or the output (post-validation). E.g. we might want to constrain the parameter to our `make-greetings` function to only allow strings with less than 10 characters and ensures the function returns a string...
+
+```
+(defn make-greetings
+ [hello]
+ {:pre [(string? hello) (< (count hello) 10)] ; pre-validation guards
+ :post [(string? %)]} ; result validation
+ (fn [name]
+ (str hello " " name "!")))
+```
+
+Guards are given as a Clojure map (discussed further below) with `:pre`/`:post` keys, each containing a vector of boolean-valued expressions (also discussed further below; in our case it's a call to [`string?`][79], a so called predicate function, which only returns `true` if its argument is a string). Since the result of a function is an unnamed value, we use the `%` symbol to refer to it in the post-validatator. Attempting to call this guarded function with a non-string or too long greeting string will now result in an error even before the function executes:
+
+```
+(make-greetings nil)
+; AssertionError Assert failed: (string? hello) ...
+(make-greetings "Labas vakaras") ; apologies to Lithuanians...
+; AssertionError Assert failed: (< (count hello) 10)
+```
+
+[Mr. Fogus][80] and [Ian Rumford][81] have some further examples...
+
+### Metadata
+
+Before moving on to more exciting topics, let's briefly mention some more optional features of functions: metadata, documentation & type hints. The following function is an extended version of our `make-greetings` fn with these all of these things included:
+
+```
+(defn make-greetings
+ "Takes a single argument (a greeting) and returns a fn which also
+ takes a single arg (a name). When the returned fn is
+ called, prints out a greeting message to stdout and returns nil."
+ [^String greeting]
+ (fn [^String name]
+ (str greeting " " name "!")))
+```
+
+The string given between the function name and parameter list is a doc string and constitutes metadata added to the Var `make-greetings` defined by `defn`. Doc strings are defined for all built-in Clojure functions and generally can be read in the REPL using [`doc`][82]:
+
+```
+(doc make-greetings)
+; ([greeting])
+; Takes a single argument (a greeting) and returns a fn which also
+; takes a single arg (a name). When the returned fn is called,
+; prints out a greeting message to stdout and returns nil.
+```
+
+Clojure allows arbitrary metadata to be added to any datatype and this data can be created, read and manipulated with functions like [`meta`][83], [`with-meta`][84] and [`alter-meta`][85]. Please see the [Clojure website][86] for more information. E.g. to show us the complete metadata map for our `make-greetings` Var we can use:
+
+```
+(meta (var make-greetings))
+; {:arglists ([greeting]),
+; :ns #,
+; :name make-greetings,
+; :doc "Takes a single argument (a greeting)..."
+; :line 1,
+; :column 1,
+; :file "/private/var/..."}
+```
+
+Type hints attached to the function parameters were the other addition (and form of compiler metadata) used above. By specifying `^String` we indicate to the compiler that the following argument is supposed to be a String. Specifying type hints is optional and is an advanced topic, but can be very important for performance critical code. Again, we will have to refer you to the [Clojure website][87] for further details.
+
+### Truthiness, conditionals & predicates
+
+The concept of branching is one of the fundamental aspects in programming. Branching is required whenever we must make a decision at runtime based on some given fact and respond accordingly. In many programming languages, we use the Boolean values `true` and `false` to indicate the success or general "truth" value of something. These values exist in Clojure too, of course. However, in many places **Clojure applies a more general term for what constitutes truth (or "success") and considers any value apart from`false` or `nil` as `true`.** This includes **any** datatype!
+
+As you might expect, the basic boolean logic operations in Clojure are [`and`][88], [`or`][89] and [`not`][90]. The first two can take any number of arguments and each will be either `truthy` or not:
+
+```
+(or nil false true)
+; true
+(or 1 false) ; `or` bails at the first truthy value encountered
+; 1
+
+(and true nil false) ; `and` bails at the first falsy value encountered
+; nil
+(and true "foo") ; if all arguments are truthy, `and` returns the last
+; "foo"
+
+(not false)
+; true
+(not nil)
+; true
+(not 1)
+; false
+```
+
+An important aspect of `and` & `or` is that both are lazy, i.e. their arguments are only evaluated if any preceeding ones were falsy. Combined with Clojure's definition of truthiness and `and`/`or` returning not just boolean values, it's often possible avoid traditional branching in our code.
+
+For the cases where we do need proper branching, we can use the `if` and `when` forms:
+
+[`if`][91] takes a test expression and one or two body expressions of which only one will be executed based on the test result, in pseudo code:
+
+```
+(if test true-body-expression false-body-expression)
+```
+
+...in real terms:
+
+```
+(def age 16)
+
+(if (>= age 21)
+ "beer"
+ "lemonade")
+; "lemonade"
+```
+
+Being restricted to a single form for both the "truthy" and "falsy" branch is one important limitation of the `if` form, but is a reflection of Clojure's focus on using functions and an encouragement to limit side effects (i.e. I/O operations) to be only contained within functions. The second, falsy branch of `if` is also optional and if not needed, it is more idiomatic to use `when` instead. [`when`][92] is somewhat more flexible in these cases, since its body can contain any number of forms to be executed if the test succeeds:
+
+```
+(when (and (>= age 21) (< age 25))
+ (println "Are you sure you're 21?")
+ (println "Okay, here's your beer. Cheers!"))
+```
+
+To achieve a similar effect using `if` we can either wrap these two `println`'s in a function or use the [`do`][93] form, which is used as an invisible container for grouping (often side-effecting) actions and it returns the result of its last expression:
+
+```
+(do
+ (expression-1)
+ (expression-2)
+ ...)
+```
+
+### Data structures
+
+Data lies at the heart of any application, big or small. Apart from dealing with primitive data like individual numbers, characters and strings, one of the biggest differences between programming languages (and therefore one of the most important factors for choosing one language over another) is in the ways complex data can be defined and manipulated. As we will see next, this aspect is one of Clojure's highlights, as the language not only provides a rich set of primitives (incl. ratios, big integers, arbitrary precision decimals, unicode characters, regular expressions), but also truly powerful approaches to model & process data, of which we can unfortunately only outline some in the scope of this tutorial.
+
+Before we discuss the various common data structures, we also need to point out once more that Clojure is an untyped, dynamic, yet compiled language. All of the following data structures can be fully recursive and contain any mixture of data types.
+
+For reference, a full list of Clojure data structures is available on the [Clojure Website][94]
+
+#### Lists
+
+Lists are sequential data containers of multiple values and form the heart of Clojure (and Lisp in general). In fact, the name "Lisp" is short for List Processing. We actually already know by now how lists are defined, having done so many times in the previous sections: Lists can take any number of elements and are defined with `(` and `)` or using the function [`list`][95]. We also know by now that lists are usually evaluated as a function calls, so trying to define a list of only numbers will not work as expected:
+
+```
+(1 2 3 4)
+; ClassCastException java.lang.Long cannot be cast to clojure.lang.IFn
+```
+
+Because the first element of our list is the number `1` (not a function!), Clojure will give us this error... Here's how & why:
+
+##### Homoiconicity
+
+Long story short: **In Clojure, code is data and data is (can be) code.** Languages using the same data structures for code and data are called homoiconic and all Lisps share this feature, as well as other languages like [R][96], [XSLT][97], [PostScript][98] etc.
+
+To treat code as data, we somehow need to circumvent the evaluation of our list as function call. To that purpose Clojure provides us with a `quote` mechanism to evaluate a data structure literally (as symbolic data). We can do this with any Clojure data structure to recursively stop evaluation of a form as code:
+
+```
+(quote (1 2 3 4))
+; (1 2 3 4)
+'(1 2 3 4) ; the apostrophe is a shorthand for `quote`
+; (1 2 3 4)
+'(+ 1 2)
+; (+ 1 2)
+(println "the result is" (+ 1 2))
+; the result is 3
+(println "the result of" '(+ 1 2) "is" (+ 1 2))
+; the result of (+ 1 2) is 3
+```
+
+The diagram below shows the impact of quoting and the difference of the resulting trees:
+
+![AST differences through quoting][99]
+
+We could also use the `list` function to programatically assemble a list/function (using our previously defined vars `a` and `b`) and then evaluate it with `eval`:
+
+```
+; first construct a function call using a list of individually quoted symbols
+(def a-plus-b (list '+ 'a 'b))
+; #'user/a-plus-b
+
+a-plus-b ; show resulting list
+; (+ a b)
+
+(eval a-plus-b) ; treat data as code: evaluate...
+; 12
+
+; treat code as data structure & look at the first item of that list
+(first a-plus-b)
+; # ; internal representation of `+` fn
+
+; next treat code as data: replace all occurrences of a & b w/ their square values
+; the {...} structure is a map of key => value pairs (discussed below):
+; any keys found in the original list are replaced with their values
+; so `a` is replaced with (* a a) and `b` with (* b b)
+; the map is also quoted to avoid the evaluation of its contents
+(replace '{a (* a a) b (* b b)} a-plus-b)
+; (+ (* a a) (* b b))
+
+; btw. if the map would *not* be quoted, it would be evaluated as:
+{a (* a a) b (* b b)}
+; {4 16, 8 64}
+
+(eval (replace '{a (* a a) b (* b b)} a-plus-b)) ; data as code again...
+; 80
+```
+
+> We will discuss the `first` function in more detail below.
+
+Right now, you might wonder why this is all worth pointing out. The most dramatic implication of homoiconicity is the enabling of [metaprogramming][100], the programmatic generation & manipulation of code at run time and by doing this, being able to define our own language constructs. It also opens the door to lazy evaluation of code or skipping code entirely depending on context (e.g. what happens with `and`/`or`). Unlike C's pre-processor, which only operates on the original textual representation of the source code (before the compile step and hence is severely limited and potentially more error prone), Lisps give us full access to the actual data structures as they're consumed by the machine. For example this makes Clojure an ideal candidate for [genetic programming][101] or to implement your own [domain specific language][102]. The main forms responsible for these kinds of code transformations are [macros][24] and we will leave them for another tutorial...
+
+Clojure lists have another important detail to know about: Because they're implemented as independent, linked elements, they can only be efficiently accessed at their head (the beginning of the list) and they don't provide direct, random access to any other elements. This restriction makes them less flexible than the next data structure, but still has some concrete use cases where this limitation doesn't matter: e.g. to implement [stacks][103].
+
+#### Vectors
+
+Since lists in Clojure are both limited in terms of access and are semantically overloaded (as containers of code), it's often more convenient to use another similar data type to store multiple values: vectors. Vectors are literally defined using `[` and `]` or the [`vector`][104] function and are, like lists, a sequential data structure. We already encountered vectors when defining the parameters for our functions above, but just for kicks, here we define a vector with each element using a different data type: number, string, character & keyword (the latter is explained in more detail in the next section)
+
+```
+[1 "2" \3 :4]
+; [1 "2" \3 :4]
+```
+
+Like lists, vectors can contain any number of elements. Unlike lists, but very much like arrays and vectors in others languages, they can also be accessed randomly using an element index. This can be done in multiple ways:
+
+```
+(def v [1 2 3 4])
+; #user/v
+(get v 0) ; using the `get` function with index 0
+; 1
+(get v 10 -1) ; using `get` with a default value -1 for missing items
+; -1
+(v 0) ; using the vector itself as function with index 0 as param
+; 1
+```
+
+#### Maps & keywords
+
+Maps are one of the most powerful data structures in Clojure and provide an associative mapping of key/value pairs. They're similar to [HashMaps][105] in Java or some aspects of [JavaScript objects][106], however both keys and values can of course be of any data type (incl. `nil`, functions or maps themselves). The most common data type for map keys however, are keywords.
+
+Keywords are simply symbols which evaluate to themselves (i.e. they have no other value attached). Within a given namespace only a single instance exists for each defined keyword. They can be created by prefixing a name with `:` or with the [`keyword`][107] function. Keywords can contain almost any character, but no spaces!
+
+```
+:my-key
+; :my-key
+(keyword (str "my-" "key")) ; kw built programmatically
+; :my-key
+```
+
+Back to maps now. They are defined with `{` and `}` or the [`hash-map`][108] function (plus a few other variations we will skip here). Here's a map with 3 keys (`:a :b :c`), each having a different data type as its value (also note that `:c`'s map uses strings as keys, much like [JSON][109] objects):
+
+```
+(def m {:a 23 :b [1 2 3] :c {"name" "toxi" "age" 38}})
+; {:a 23 :b [1 2 3] :c {"name" "toxi" "age" 38}}
+```
+
+Having defined a map structure, we can now lookup its values using keys. Once again many roads lead to Rome:
+
+```
+(m :a) ; use the map as function with :a as lookup key
+; 23
+(:b m) ; use key :b as function applied to m
+; [1 2 3]
+(get m :c) ; use get function with :c as key
+; {"name" "toxi", "age" 38}
+(:foo m) ; lookup a missing key returns nil
+; nil
+(get m :foo "nada") ; use get with default value for missing keys
+; "nada"
+```
+
+> Note, we can use both maps & keywords as functions, because both implement Clojure's mechanism for function calls. Depending on context, it's good to have both as an option.
+
+Since the values for `:b` and `:c` are nested data structures, we can continue this further...
+
+```
+((:b m) 2)
+; 3
+((:c m) "name")
+; "toxi"
+```
+
+Although this works, Clojure offers an alternative (nicer) approach, which becomes especially handy if our nesting increases: The [`get-in`][110] function allows us to specify a "path" (as vector) into our data structure to look up a nested value. As we saw already with `get`, this function can be applied to both vectors and maps (or a mixture of both):
+
+```
+(def db {:toxi {:name "Karsten"
+ :address {:city "London"}
+ :urls ["http://toxiclibs.org" "http://thi.ng"]}
+ :nardove {:name "Ricardo"
+ :urls ["http://nardove.com"]}})
+
+(get-in db [:toxi :address :city])
+; "London"
+(get-in db [:nardove :address :city] "I think Bournemouth")
+; "I think Bournemouth"
+(get-in db [:nardove :urls 0])
+; "http://nardove.com"
+```
+
+[`select-keys`][111] can be used to extract a sub-set of keys from a map. The new map only contains the keys listed as arguments (if present in the map):
+
+```
+(select-keys m [:a :b :foo]) ; :foo isn't present in `m` so won't be in result...
+; {:a 23 :b [1 2 3]}
+```
+
+#### Sets
+
+Sets are incredibly useful whenever we must deal with unique values, but don't care about their ordering. The name comes from [Set theory][112] in Mathematics. A Clojure set is (usually) unordered and will never contain more than a single instance of a given value. We will exploit this fact in the next part of the tutorial to build up our first full example application. Sets are defined like this:
+
+```
+#{1 2 3 4}
+; #{1 2 3 4}
+#{1 1 2 3 4}
+; IllegalArgumentException Duplicate key: 1
+```
+
+Be aware, that the literal definition syntax of sets **doesn't allow duplicate values**. However we can use it's functional equivalent:
+
+```
+(hash-set 1 1 2 3 4)
+; #{1 2 3 4}
+```
+
+...or we could use the [`set`][113] or [`into`][114] functions to convert another data structure into a set and hence filter out any duplicate values from the original (of course without destroying the original!):
+
+```
+(def lucky-numbers [1 2 3 4 4 2 1 3])
+; #user/my-vals
+(set lucky-numbers)
+; #{1 2 3 4}
+(into #{} lucky-numbers)
+; #{1 2 3 4}
+lucky-numbers
+; [1 2 3 4 4 2 1 3]
+```
+
+Since a set can be considered a special kind of map in which keys have no values, but are simply mapped to themselves, we can use the same lookup approaches to check if a value is present or not.
+
+```
+(get #{1 2 3 4} 3)
+; 3
+(#{1 2 3 4} 5)
+; nil
+(get #{1 2 3 4} 5 :nope)
+; :nope
+```
+
+As a slightly more practical example, let's define a nested set of sets to encode the following mini social graph:
+
+![Dummy undirected social graph][115]
+
+```
+(def g
+ #{#{:toxi :ricardo}
+ #{:mia :toxi}
+ #{:filip :toxi}
+ #{:filip :ricardo}})
+```
+
+Let's also define a simple lookup function (a predicate) to check if two people know each other:
+
+```
+(defn knows?
+ "Takes a graph and two node names, returns true if the graph contains
+ a relationship between the nodes (ignoring direction)"
+ [graph a b]
+ (not (nil? (graph #{a b}))))
+```
+
+> The [`nil?`][116] function returns true if its given argument is `nil`.
+
+Now we can use this function to get some answers (the order of names doesn't matter):
+
+```
+(knows? g :toxi :filip)
+; true
+(knows? g :ricardo :toxi)
+; true
+(knows? g :filip :mia)
+; false
+```
+
+### Common data manipulation functions
+
+Even in the face of immutability, what good is a data structure, if it can't be manipulated? One of the most often quoted and popular sayings amongst Clojurians is:
+
+> "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures."
+> \-- Alan J. Perlis
+
+It neatly sums up Clojure's approach to data processing and is achieved through a number of elegant abstraction mechanisms, allowing dozens of core language functions to work polymorphically with different types of data. [Polymorphism][117] allows for a very small, but powerful API and so reduces cognitive load for the programmer. Because each of the above mentioned data structures has its own peculiarities, the concrete behaviour of the functions discussed below slightly varies and adjusts to each data type.
+
+#### Adding elements
+
+Adding new data to existing collections is one of the most common programming tasks and in Clojure is usually done with [`conj`][118].
+
+For vectors, new elements are added to the end/tail:
+
+```
+(conj [1 2 3] 4 5 6)
+; [1 2 3 4 5 6]
+```
+
+For lists, new elements are added to the beginning/head (because it's most efficient), therefore resulting in the opposite value order:
+
+```
+(conj '(1 2 3) 4 5 6)
+; (6 5 4 1 2 3)
+```
+
+Maps are unordered collections and consist of key/value pairs. To add new pairs to a map, we need to define each as vector:
+
+```
+(conj {:a 1 :b 2} [:c 3] [:d 4])
+; {:d 4, :c 3, :a 1, :b 2}
+```
+
+Sets are also unordered and don't allow duplicates, so adding duplicate values will have no effect:
+
+```
+(conj #{1 2 3} 1 2 4 5) ; only 4 and 5 are added
+; #{1 2 3 4 5}
+```
+
+Another often used alternative exists for maps and vectors, both of which are associative collections: Maps associate keys with values. Vectors associate numeric indices with values. Therefore Clojure provides us with the [`assoc`][119] function to add new or replace existing associations (`assoc` too takes a flexible number of parameters so that more than one such association can be changed in one go):
+
+```
+(assoc {:a 23} :b 42 :a 88) ; override :a, add :b
+; {:a 88 :b 42}
+(assoc [1 2 3] 0 10, 3 40) ; override 1st element, add new one (comma is optional)
+; [10 2 3 40]
+```
+
+**Important:** For vectors you can only add new indices directly at the tail position. I.e. if a vector has 3 elements we can add a new value at position 3 (with indices starting at 0, this is actually the 4th element, therefore growing the vector by one). Attempting to `assoc` a greater index will result in an error, be careful:
+
+```
+(assoc [1 2 3] 10 -1)
+; IndexOutOfBoundsException...
+```
+
+##### Nested data manipulations
+
+When dealing with nested structures we can use [`assoc-in`][120] and [`update-in`][121] to manipulate elements at any level. E.g. we might want to add Ricardo's current home town to our above mini DB map:
+
+```
+(assoc-in db [:nardove :address :city] "Bournemouth")
+; {:toxi ......
+; :nardove
+; {:name "Ricardo",
+; :urls ["http://nardove.com"],
+; :address {:city "Bournemouth"}}}
+```
+
+Like `get-in`, `assoc-in` takes a path into the datastructure and adds (or replaces) the value for that key. Whilst doing that it also creates any missing nesting levels automatically (i.e. `:nardove`'s map did not even contain an `:address` key beforehand).
+
+`update-in` is similar to `assoc-in`, however instead of a fixed value to be inserted into the collection, it takes a function (incl. any additional params) which is being applied to the current value for the key and then uses the result of that function as the new value. E.g. here we use `update-in` and `conj` to add another URL to `:toxi`'s DB entry:
+
+```
+(update-in db [:toxi :urls] conj "http://toxi.co.uk")
+; {:toxi
+; {:name "Karsten",
+; :urls ["http://toxiclibs.org" "http://thi.ng" "http://toxi.co.uk"],
+; :address {:city "London"}} ....
+```
+
+#### Removing elements
+
+To remove items from a collection, we can use [`dissoc`][122] (for maps) or [`disj`][123] (disjoin) for sets. If a key to be removed isn't present, both functions have no effect.
+
+```
+(dissoc {:a 23 :b 42} :b)
+; {:a 23}
+(disj #{10 20 30} 20)
+; #{10 30}
+```
+
+Lists and vectors only allow for the direct removal near the head or tail, but don't support removing random items: [`pop`][124] applied to a list removes the first item, for vectors the last item. If the collection is empty, `pop` will throw an exception.
+
+```
+(pop '(1 2 3))
+; (2 3)
+(pop [1 2 3])
+; [1 2]
+```
+
+#### Immutability, one more time
+
+We've just seen how we can add & remove elements from collections, thus seemingly modifying them - which technically would make them mutable, not immutable. However, as we've seen earlier, **the modified results returned by these functions are not the original collections.** To clarify:
+
+```
+(def v [1 2 3 4])
+; #'user/v
+(def v2 (conj v 5))
+; #'user/v2
+v2
+; [1 2 3 4 5]
+v
+; [1 2 3 4]
+```
+
+Our original `v` still exists even though we've added `5` to it! Under the hood Clojure has created a new data structure (bound to `v2`) which is the original collection `v` with `5` added. Thinking like a programmer, your next questions should be immediately: Isn't that incredibly inefficient? What happens if I want to add a value to a vector with 10 million elements? Doesn't it become super slow & memory hungry to copy all of them each time? The short answer is: No. And here's why:
+
+#### Persistent data structures
+
+All Clojure data structures are so called [persistent data structures][125] (largely based on the [paper by Chris Okasaki][126]). Internally they're implemented as a tree and therefore can easily provide structural sharing without the need to copy data, which would be the naive solution to achieve immutability. The following diagram illustrates what happens internally for the above example:
+
+![Structural sharing in persistent datastructures][127]
+
+Using trees as the internal data structure, our `v2` can share the original contents of `v` and simply add a new leaf to its tree, pointing to the added value `5`. This is very cheap and doesn't cause a huge loss of performance, regardless of the size of the collection. The same principle is applied to all of the mentioned data structures and it's this uniform approach which both enables & requires immutability.
+
+### Sequences
+
+This section discusses Clojure's uniform approach to data processing using sequence abstractions. A sequence is a logical view of a data structure. All Clojure data structures can be treated as sequences, but the concept is extended even further and Clojure sequences include Java collections, strings, streams, directory structures and XML trees etc. You can even build your own ones by implementing an interface. The name for sequences in Clojure is [`seq`][128] and any compatible data structure can be explicitly turned into a `seq` using the function with the same name.
+
+#### The sequence API
+
+The sequence API is a minimal, low level interface consisting largely of only these four functions: [`first`][129], [`next`][130] to read and [`cons`][131] & [`seq`][128] to create sequences. All of the following functions are built on top of these, but before we get there let's first illustrate their role using a vector and a hash map as an example:
+
+```
+(def my-vec ["1st" "2nd" "3rd"])
+(def my-map {:a "1st" :b "2nd" :c "3rd"})
+```
+
+Any Clojure collection can be turned into a seq, using the `seq` function. If the original collection is empty, `seq` will return `nil`.
+
+```
+(seq my-vec)
+; ("1st" "2nd" "3rd)
+(seq my-map)
+; ([:a "1st"] [:c "3rd"] [:b "2nd"])
+(seq "creativeapplications.net") ; a string's seq is its characters
+; (\c \r \e \a \t \i \v \e \a \p \p \l \i \c \a \t \i \o \n \s \. \n \e \t)
+(seq [])
+; nil
+```
+
+Since a map consists of key/value pairs, a map's seq is a seq of its pairs (vectors of 2 elements). And since a map is an unordered collection, the order of elements in its seq is undefined...
+
+![Sequence API][132]
+
+##### first
+
+...returns the first element of a seq (or `nil` if the sequence is empty):
+
+```
+(first my-vec)
+; "1st"
+(first my-map)
+; [:a "1st"]
+(first "hello") ; a string can be turned into a seq as well...
+; \h
+(first []) ; first of an empty vector/seq returns nil
+; nil
+```
+
+##### next & rest
+
+As you might have guessed already, `next` returns a seq of all the remaining elements, excluding the first one. Again, if there're no further elements in the seq, `next` also returns `nil`.
+
+```
+(next my-vec)
+; ("2nd" "3rd")
+(next my-map)
+; ([:c "3rd"] [:b "2nd"])
+```
+
+We could now also combine the use of `first` and `next` to retrieve other elements, e.g. the 2nd element is the first element of the seq returned by `next`:
+
+```
+(first (next my-vec))
+; "2nd"
+(first (next (next my-vec)))
+; "3rd"
+```
+
+`rest` is almost identical to `next`, however will always return a seq: If there're no more elements, it will simply return an empty seq instead of `nil`.
+
+##### cons
+
+This function is used to prepend elements to a seq. `cons` takes two arguments, a value and an existing seq (or seqable collection) and adds that value at the front. If `nil` is given as the 2nd argument, a new seq is produced:
+
+```
+(cons 1 nil)
+; (1)
+(cons 2 (cons 1 nil))
+; (2 1)
+(cons \c "ab")
+; (\c \a \b)
+```
+
+### Looping, iteration & recursive processing
+
+At this point you might be wondering what use these above functions have in practice. Since Clojure offers far more high-level approaches to work with data collections, direct use of these functions in Clojure is actually less common. Yet, before we discuss these higher level functions, please bear with us as we want to illustrate some other important core operations common to all programming languages, one to which Clojure adds its own twist (again): Iteration & recursion. Meet the `loop` construct.
+
+#### loop & recur
+
+[`loop`][133] defines a body of code which can be executed repeatedly, e.g. to iterate over the elements of a sequence. This is best illustrated by an example, a loop which takes a vector and produces a seq of the vector's elements in reverse order (Clojure actually provides the [`reverse`][134] function to do the same for us, but we're focussed on `loop` here):
+
+```
+(loop [result nil, coll [1 2 3 4]]
+ (if (seq coll)
+ (let [x (first coll)]
+ (recur (cons x result) (rest coll)))
+ ; no more elements, just return result...
+ result))
+; (4 3 2 1)
+```
+
+The vector following the `loop` keyword is a binding vector just as we know from `let` and it can be used to bind any number of symbols. In our case we only require two: the initially non-existing `result` sequence (set to `nil`) and `coll`, a vector of numbers to be processed. The other code is the loop's body which is executed repeatedly: At each iteration we first check if our `coll` contains any more elements by calling `seq` (remember, `seq` returns `nil` (and is therefore falsy) when given an empty collection). If there're any elements remaining, we bind `coll`'s `first` element to `x`. What follows next is a call to [`recur`][135], the actual mechanism to trigger the recursive re-execution of the loop, however each time with new values given for the loop's `result` and `coll` symbols. These new values are the updated result sequence (with `x` prepended) and the remainder of the current collection produced via `rest`. Once `rest` returns an empty seq, the loop is finished and `result` is "returned" as final value.
+
+The combined application of `loop` & `recur` is the most low-level and verbose construct to create iterative behavior in Clojure, but because of that is also the most flexible. The most important restriction however is that `recur` can only be used at the end (tail) of a `loop`'s execution path, meaning there can be no further expressions following `recur` (hence the concept is called [Tail recursion][136]. In the above example you might think the final occurance of `result` violates this restriction, but that is not true: `recur` is the last expression of the "truth branch" of the enclosing `if`, whereas the returned `result` is on its other branch and therefore independent.
+
+#### doseq
+
+A more concise way of completely iterating the elements of a collection is offered by [`doseq`][137], however this form is designed to work with/trigger side effects and only returns `nil`. The example iterates over a vector of hashmaps and displays each person's age with some extra formatting:
+
+```
+(doseq [p [{:name "Ben" :age 42} {:name "Alex"} {:name "Boris" :age 26}]]
+ (let [name (:name p)
+ suffix (if (#{\s \x} (last name)) "'" "'s")
+ age (or (:age p) "rather not say")]
+ (println (str name suffix " age: " age))))
+; Ben's age: 42
+; Alex' age: rather not say
+; Boris' age: 26
+; nil
+```
+
+The value of `suffix` is based on the [`last`][138] letter of a person's name and is usually `'s` (unless the last letter is in the set `#{\s \x}`). We'd also like the `:age` to be optional and provide a default value if missing...
+
+#### dotimes
+
+[`dotimes`][139] is yet another looping construct used for side effects, this time just for simply binding a symbol to a number of iterations:
+
+```
+(dotimes [i 3] (println i))
+; 0
+; 1
+; 2
+```
+
+### Common sequence processing functions
+
+Now that we've discussed some of the underlying forms and mechanisms, it's time to focus on the more commonly used features of Clojure's sequence processing.
+
+Loops and iterators are the de-facto tools/patterns to process collections in many imperative languages. This is where idiomatic Clojure probably differs the most, since its functional approach is more focused on the transformation of sequences using a combination of higher order functions and so called:
+
+#### Pure functions
+
+A pure function's does not depend on any other data than its inputs and causes no side effects (i.e. I/O operations). This makes them [referentially transparent][140], meaning a function could be replaced with its result without any impact, or in other words, a function is consistently providing the same value, given the same inputs. Pure functions can also be [idempotent][141], meaning a function, if applied multiple times, has no other effects than applying it once. E.g. `(Math/abs -1)` will always provide `1` as a result and `(Math/abs (Math/abs -1))` will not change it, nor will it cause any other effect.
+
+Pure functions play a key role in functional programming. Their characteristics allow us to compose small, primitive functions into more complex constructs with predictable behaviors.
+
+##### Memoization of pure functions
+
+The caching of results of previous calls to a function is called [memoization][142]. This technique is especially useful if these results are produced by a complex/slow process. Clojure provides the [`memoize`][143] HOF to allow any function be memoized, however safe memoization requires those functions to be pure. We can demonstrate this caching effect by simulating a slow function using Java interop and [`Thread/sleep`][144]:
+
+```
+; simulate long process by sleeping for x 选题模板.txt 中文排版指北.md core.md Dict.md lctt2014.md lctt2016.md lctt2018.md LCTT翻译规范.md LICENSE published README.md scripts sources translated 1000 milliseconds
+(defn slow-fn [x] (Thread/sleep (* x 1000)) x)
+
+(def not-so-slow-fn (memoize slow-fn))
+
+(not-so-slow-fn 3)
+; 3
+```
+
+#### Map-Reduce
+
+Several years ago, Google published a [paper][145] about their use of the [Map-Reduce algorithm][146]. Whereas this paper was focused on the distributed application of that algorithm running in parallel on thousands of machines, the general approach itself has been around for decades and plays an important role in many functional languages, where it is the de-facto pattern to process data without the need for explicit loops.
+
+The idea of Map-Reduce is to first transform the elements of an input collection into an intermediate new collection of values, which is then passed to a reduction function, producing a single final result value. This result could be any data type, though, incl. a new collection.
+
+Even though Map-Reduce is a 2-phase process, each phase can also be applied on its own. I.e. sometimes there's no need for a later reduction or an initial mapping step.
+
+> Btw. Several modern "NoSQL" database systems (e.g. [CouchDB][147], [MongoDB][148], [Riak][149]) and distributed data processing platforms like [Hadoop][150] also heavily rely on Map-Reduce as underlying mechanism to process & create views of data. So if you ever intent to work with such, it's quite useful knowledge to work through this section, even if you have no further interest in Clojure...
+
+#### map
+
+In mathematical terms mapping is the transformation of values through the application of a function. In Clojure the [`map`][151] function is one of the most often used functions. It takes a transformation function and applies it to each element in a given collection/sequence. E.g. The example below takes the function `inc` and a seq of numbers. It then applies `inc` to each number individually and returns a new sequence of the results:
+
+```
+(map inc [1 2 3 4 5])
+; (2 3 4 5 6)
+```
+
+![map function visualized][152]
+
+The transformation function given to `map` can be anything and its also one of the situations where anonymous functions are often used. E.g. Here we produce a seq of square numbers:
+
+```
+(map (fn [x] (* x x)) [1 2 3 4 5])
+; (1 4 9 16 25)
+```
+
+As an aside, since anonymous functions are often very short, they can also be defined more concisely (though become less legible). The following is equivalent to the above expression:
+
+```
+(map #(* % %) [1 2 3 4 5])
+; (1 4 9 16 25)
+```
+
+Here we use the reader macro `#(..)` to define an anon fn and the symbol `%` to refer to the first (in this case only) argument. If such a function takes more than a single arg, then we can use `%2`, `%3` etc. to refer to these...
+
+```
+(#(* % %2) 10 2) ; call anon fn with args: 10, 2
+; 20
+```
+
+`map` can also be applied to several collections at once. In this case the transformation function needs to accept as many parameters as there are collections. Let's use `map` to build a seq of hashmaps from two vectors of point coordinates and colors. Each time our transformation fn is given a single point (a vector) and a color keyword. The fn simply combines these values into a single map with keys `:pos` and `:color`:
+
+```
+(map
+ (fn [p c] {:pos p :color c}) ; transformation fn
+ [[100 0] [0 -100] [0 100] [200 100]] ; points
+ [:red :green :blue]) ; colors
+; ({:pos [100 0], :color :red}
+; {:pos [0 -100], :color :green}
+; {:pos [0 100], :color :blue})
+```
+
+![map builder][153]
+
+> **Important:** You might have noticed that our vector of points has one more element than there're colors. In that case, `map` will stop as soon as one of the input collections is exhausted / has no further values. In this case we only have 3 colors, so the last (4th) point is ignored.
+
+##### Laziness and lazy seqs
+
+One thing not immediately obvious when experimenting with `map` in the REPL, is that the seq returned by `map` is a so called `lazy-seq`, that is, **the transformation function is actually not applied to our original values until their results are needed**. In other words, `map` is more of a recipe for a computation, but the computation does not ever happen if we don't attempt to use its results.
+
+To illustrate this better, let's again simulate a slow transformation function which takes 1 second per value. With 5 values in the original collection, our entire processing should take approx. 5 seconds:
+
+```
+(def results
+ (map
+ (fn [x]
+ (Thread/sleep 1000)
+ (* x 10))
+ [1 2 3 4 5]))
+```
+
+When this code executes, we can see the REPL **immediately** returned a result, the new Var `user/results`. It did not take 5 seconds, because at this stage we haven't yet attempted to do anything with that new Var - and hence no mapping did take place thus far. [It's plain lazy!][20].
+
+Now trying to display the contents of `results` however will force the computation and therefore will take 5 seconds until we can see the mapped values:
+
+```
+results ; takes ~5secs, world's slowest multiply
+; (20 30 40 50 60)
+```
+
+#### reduce
+
+[`reduce`][154] is Clojure's natural way of expressing an accumulation over a sequence of values. Like `map` it takes a function, an optional initial result and a sequence whose elements will be passed to the transformation function individually, for example:
+
+```
+(reduce + 0 [1 2 3 4 5 6 7 8 9 10])
+; 55
+```
+
+In this case `reduce` uses the function `+` to combine all values of our seq into the accumulated result one by one. The transformation function must always take 2 arguments: the current result (reduced value) and the next item to be processed. If no initial result is given, the first iteration will consume the first 2 items from the sequence.
+
+In our case this happens:
+
+```
+(+ 0 1) ; 0 is the initial result, returns 1
+ (+ 1 2) ; 1 is current result, returns 3
+ (+ 3 3) ; returns 6
+ ; and so on until the seq is exhausted...
+```
+
+Clojure also provides an alternative to `reduce`, called [`reductions`][155]. Instead of the just final reduction it returns a seq of all intermediate results (here we also use [`range`][156] to create a seq of numbers from 0-9):
+
+```
+(reduce + (range 10))
+; 45
+(reductions + (range 10))
+; (0 1 3 6 10 15 21 28 36 45)
+```
+
+![reduce vs. reductions][157]
+
+#### filter
+
+[`filter`][158] takes a function and a seq, then applies the function to each element and returns a lazyseq of only the elements the function returned a "truthy" value for. These kind of functions are also called "predicates".
+
+Clojure has a number of predicate functions which rely on truthiness and they can be easily recognized by their general naming convention, a function name suffixed with `?`. E.g. [`even?`][159] can be used to filter out all even numbers from the seq of numbers 0-9:
+
+```
+(filter even? (range 10))
+; (0 2 4 6 8)
+```
+
+![filter][160]
+
+Since the function needn't strictly return `true` or `false`, we can also use a set as predicate to filter out only values which are present in the set:
+
+```
+(filter #{1 2 4 8 16 32} (range 10))
+; (1 2 4 8)
+```
+
+Again we're using data as code, since vectors, maps & sets all can be used as functions and return `nil` if a value isn't present, therefore fulfilling the general contract of a predicate function...
+
+#### take / drop
+
+Sometimes we are only interested in a chunk of values from a larger collection. We can use [`take`][161] to retrieve the first `n` elements from a collection as a lazy sequence:
+
+```
+(take 3 '(a b c d e f))
+; (a b c)
+```
+
+In contrast, we can use [`drop`][162] to ignore the first `n` elements and give us a lazy sequence of all remaining elements:
+
+```
+(drop 3 '(a b c d e f))
+; (d e f)
+```
+
+Clojure has a few other variations on that theme, most notably [`take-last`][163], [`drop-last`][164], [`butlast`][165], [`take-nth`][166], [`take-while`][167] and [`drop-while`][168]. The latter two also take a predicate function and terminate as soon as the predicate returns a "falsy" result:
+
+```
+(take-while #(< % 5) (range 10))
+; (0 1 2 3 4)
+```
+
+#### concat & mapcat
+
+[`concat`][169] splices any number of seqs together into a single new lazy seq. The new `rotate-left` function shows how we can use `concat` with `take`/`drop` to rotate elements in a sequence:
+
+```
+(concat [1 2 3] '(a b c) {:a "aa" :b "bb})
+; (1 2 3 a b c [:a "aa"] [:b "bb"])
+
+(defn rotate-left [n coll] (concat (drop n coll) (take n coll)))
+; #'users/rotate-left
+
+(rotate-left 3 '(a b c d e f g h i))
+; (d e f g h i a b c)
+```
+
+[`mapcat`][170] is a combination of `map` & `concat`. Like `map` it accepts a transformation function and a (number of) seqs. The mapping function needs to produce a collection for each step which are then concatenated using `concat`:
+
+```
+; another social graph structure as from above (only w/ more people)...
+(def g2
+ #{#{:ricardo :toxi}
+ #{:filip :edu}
+ #{:filip :toxi}
+ #{:filip :ricardo}
+ #{:filip :marija}
+ #{:toxi :marija}
+ #{:marija :edu}
+ #{:edu :toxi}})
+
+; step 1: produce a seq of all relations
+(map seq g2)
+; ((:marija :filip) (:toxi :marija) (:edu :filip) (:ricardo :filip)
+; (:toxi :edu) (:toxi :ricardo) (:marija :edu) (:toxi :filip))
+
+; step 2: combine rels into single seq
+(mapcat seq g2) ; option #1: `seq` as transform fn
+(mapcat identity g2) ; option #2: `identity` as transform (same result)
+; (:marija :filip :toxi :marija :edu :filip :ricardo :filip :toxi :edu :toxi :ricardo :marija :edu :toxi :filip)
+
+; step 3: form a set of unique nodes in the graph
+(set (mapcat identity g2))
+; #{:toxi :marija :edu :ricardo :filip}
+
+; step 4: build map of node valence/connectivity
+(frequencies (mapcat identity g2))
+; {:marija 3, :filip 4, :toxi 4, :edu 3, :ricardo 2}
+```
+
+> There're two functions we haven't dealt with so far: [`identity`][171] simply returns the value given as argument. [`frequencies`][172] consumes a seq and returns a map with the seq's unique values as keys and their number of occurrences as values, basically a [histogram][173].
+
+`take` & `drop` are also important with respect to one more (optional) property of lazy sequences we haven't mentioned so far:
+
+##### Infinite sequences
+
+The concept of infinite data in a non-lazy (i.e. eager) context is obviously unachievable on a machine with finite memory. Laziness, however does enable potential infinity, both in terms of generating and/or consuming. In fact, there're many Clojure functions which exactly do that and without the proper precautions (i.e. combined with `take`, `drop` and friends), they would bring a machine to its knees. So be careful!
+
+We already have used one of these potentially infinite sequence generators above: [`range`][156] when called without an argument produces a lazyseq of monotonically increasing numbers: `(0 1 2 3 4 ...)` **(Since the REPL always tries to print out the result, do not ever call one of these without guards in the REPL!)**
+
+Other useful infinite lazyseq generators are:
+
+[`cycle`][174] delivers a lazyseq by repeating a given seq ad infinitum:
+
+```
+(take 5 (cycle [1 2 3]))
+; (1 2 3 1 2)
+(take 10 (take-nth 3 (cycle (range 10))))
+; (0 3 6 9 2 5 8 1 4 7)
+```
+
+[`repeat`][175] produces a lazyseq of a given value:
+
+```
+(take 5 (repeat 42))
+; (42 42 42 42 42)
+(repeat 5 42)
+; (42 42 42 42 42)
+```
+
+[`repeatedly`][176] produces a lazyseq of the results of calling a function (without arguments) repeatedly:
+
+```
+(take 5 (repeatedly rand))
+; (0.07610618695828963 0.3862058886976354 0.9787365745813027 0.6499681207528709 0.5344143491834465)
+```
+
+[`iterate`][177] takes a function and a start argument and produces a lazyseq of values returned by applying the function to the previous result: so (f (f (f x)))... Here to generate powers of 2:
+
+```
+(take 5 (iterate #(* 2 %) 1))
+; (1 2 4 8 16)
+(take 5 (drop 10 (iterate #(* 2 %) 1)))
+; (1024 2048 4096 8192 16384)
+```
+
+Since infinite lazyseqs are values just like any other (but at the same time can't be exhausted) it sometimes it's helpful to think about them as high level recipes for changing program states or triggers of computations. Combined with the various sequence processing functions they provide a truly alternative approach to solving common programming problems.
+
+#### Sequence (re)combinators
+
+Here're some more core functions related to combining collections in different ways:
+
+[`interleave`][178] recombines two sequences in an alternating manner (also lazy):
+
+```
+(interleave [:clojure :lisp :scheme] [2007 1958 1970])
+; (:clojure 2007 :lisp 1958 :scheme 1970)
+```
+
+[`interpose`][179] inserts a separator between each element of the original seq:
+
+```
+(interpose "," #{"cyan" "black" "yellow" "magenta"})
+; ("cyan" "," "magenta" "," "yellow" "," "black")
+```
+
+[`zipmap`][180] combines two collections into a single hashmap, where the 1st collection is used for keys and the second as values. Let's have some [Roman Numerals][181]:
+
+```
+; first the individual pieces:
+; powers of 10
+(take 10 (iterate #(* 10 %) 1))
+; (1 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000)
+
+; apply powers to 1 & 5
+(take 5 (map (fn [x] [x (* x 5)]) (iterate #(* 10 %) 1))) ; using `map`
+; ([1 5] [10 50] [100 500] [1000 5000] [10000 50000])
+(take 5 (mapcat (fn [x] [x (* x 5)]) (iterate #(* 10 %) 1))) ; using `mapcat`
+; (1 5 10 50 100)
+
+; altogether now...
+(zipmap
+ [:I :V :X :L :C :D :M] ; keys
+ (mapcat (fn [x] [x (* x 5)]) (iterate #(* 10 %) 1))) ; values
+; {:M 1000, :D 500, :C 100, :L 50, :X 10, :V 5, :I 1}
+```
+
+#### for
+
+Since we've just discussed sequence generators, we also must briefly mention [`for`][182]. Unlike `for` loops in other languages, Clojure's `for` is a so called [List comprehension][183], just another generator of lazyseqs, though one on crack if we may say so... `for` combines the behavior of `map` with lexical binding as we know from `let` and conditional processing. It returns its results as lazyseq. Here we iterate over the seq returned by `(range 4)` and bind `i` to each value successively, then execute `for`'s body to tell us if that current value of `i` is even:
+
+```
+(for [i (range 4)] {:i i :even (even? i)})
+; ({:i 0, :even true} {:i 1, :even false} {:i 2, :even true} {:i 3, :even false})
+(into {} (for [i (range 4)] [i (even? i)]))
+; {0 true, 1 false, 2 true, 3 false}
+```
+
+`for` can also be used to created nested seqs. This happens automatically when more than one symbol is bound, e.g. here we create positions in a 4x2 grid (the first symbol defines the outer loop, the next one(s) inner loops:
+
+```
+(for [y (range 2) ; outer loop
+ x (range 4)] ; inner loop
+ [x y]) ; result per iteration
+; ([0 0] [1 0] [2 0] [3 0] [0 1] [1 1] [2 1] [3 1])
+```
+
+The symbol binding part can be further customized with additional bindings to pre-compute values used in the body of `for` and/or we can specify a predicate to skip an iteration (therefore also achieving filtering a la `filter`) or cancel iteration (using `:while`). The next example creates points only along the border of a 4x4 grid (center points are skipped):
+
+```
+(for [y (range 4)
+ x (range 4)
+ :let [border? (or (= 0 x) (= 3 x) (= 0 y) (= 3 y))]
+ :when border?] ; skip iteration when border? is false
+ [x y])
+; ([0 0] [1 0] [2 0] [3 0] ; manually formatted to better visualize result...
+; [0 1] [3 1]
+; [0 2] [3 2]
+; [0 3] [1 3] [2 3] [3 3])
+```
+
+#### every? / some
+
+Sometimes we need to check if the values of a collection match certain criteria, e.g. to enforce a restriction. The [`every?`][184] function takes a validation function (predicate) and applies it to all elements of a collection. It only returns true, if the predicate returns a truthy value for all of them. Here we check if all elements in a seq have a `:name` key (remember, keywords can be used as functions!)
+
+```
+(every? :name [{:name "nardove"} {:name "toxi"} {:age 88}])
+; false
+```
+
+Or we could write our own predicate and check if all values are multiples of 3, that is a number for which the remainder, [`rem`][185], of a division by 3 is zero:
+
+```
+(every? #(zero? (rem % 3)) [666 42 99 12])
+; true
+```
+
+Alternatively, we can use [`some`][186] if we only want to ensure some of the values match a condition. `some` will return the first truthy value returned by the predicate (or `nil` if no items match). Again, we are using data (a set) as predicate fn:
+
+```
+(some #{3 6 9 12} [1 2 3 4 5 6])
+; 3
+```
+
+...or ask if some names are longer than 4 characters:
+
+```
+(some #(> (count %) 4) ["mia" "nardove" "toxi"])
+; true
+(some #(if (> (count %) 4) %) ["mia" "nardove" "toxi"])
+; "nardove"
+```
+
+#### apply
+
+So far we have used the phrase "applies a function to x" several times. In short it simply means that a function is called with `x` as its argument. Though, what should we do if we have a function accepting multiple arguments, but have our arguments only in a single collection (i.e. one built with `map` etc.)?
+
+To stick with some familiar constructs and add a concrete use case, our `hypot` function defined earlier, computes the length of the longest side in a triangle, given the lengths of the 2 other sides. At the same time we could interpret this as the calculation of the distance of a 2d point from the origin in a cartesian coordinate system: One side is the distance along the X-axis and the other the distance in Y.
+
+Imagine we have a collection of 2d points and we want to measure their distance from the origin (their [magnitude][187]):
+
+```
+(def points [[0 100] [200 100] [-300 50]])
+; #'user/points
+```
+
+Now we could use `map` and our `hypot` function to compute the distance/length for each point and produce a new sequence of the results. However, `hypot` so far requires 2 arguments `a` & `b`, but our points are defined as vectors of 2 elements and therefore each point is just a single value (the vector itself). For such situations, Clojure provides us with the `apply` function, allowing a function to accept a collection of values as individual arguments (with possibly additional ones given as well). So whereas the following will produce an error...
+
+```
+(hypot [200 100])
+; ArityException Wrong number of args (1) passed to: user$hypot
+```
+
+... using [`apply`][188] will unravel our vector into two individual arguments and call our function correctly:
+
+```
+(apply hypot [200 100])
+; 223.60679774997897
+```
+
+With this in place, we can now plug this into a `map` form and process all our points:
+
+```
+(map #(apply hypot %) points)
+; (100.0 223.60679774997897 304.138126514911)
+```
+
+To complete an earlier arc of our tutorial, we could also plug this into another `reduce` step to give us the longest distance (using `max` as the reduction function):
+
+```
+(reduce max (map #(apply hypot %) points))
+; 304.138126514911
+```
+
+### Destructuring
+
+As we've just learned with `apply`, sometimes it is required to adapt our data to a function's specifics. But we can also achieve the opposite and adapt a function to expect a specific data structure and do so without having to jump through hoops painstakingly pulling out individual values from a given collection. Clojure make this very easy using destructuring.
+
+Destructuring is a way to bind symbols to values in a collection, by replicating the overall structure of the collection and placing the symbols to be bound at the points from which we intend to get a value from in the supplied data structure. A few lines of code will illustrate this much better...
+
+#### Sequential destructuring
+
+As we know a vector is just a sequence of values, each of which can be another nested data structure:
+
+```
+(def nested-data [10 20 [30 40] {:x 1 :y 2}]) ; some test data
+```
+
+To bind the first 3 items of that input vector to symbols `a`, `b` and `c`, a naive and inelegant solution would be to bind each symbol individually, like this:
+
+```
+(let [a (nested-data 0)
+ b (nested-data 1)
+ c (nested-data 2)]
+ (prn :a a :b b :c c))
+; :a 10 :b 20 :c [30 40]
+```
+
+Using sequential destructuring, this can be expressed much more concisely. All we need to do is telling Clojure the symbols' values are part of a sequence, by wrapping them in a vector themselves:
+
+```
+(let [[a b c] nested-data] (prn :a a :b b :c c))
+; :a 10 :b 20 :c [30 40]
+```
+
+Sometimes we might need values which are not successive in the collection e.g. say we only care about the 2nd and 4th value:
+
+```
+(let [[_ b _ d] nested-data] (prn :b b :d d))
+; :b 20 :d {:x 1 :y 2}
+```
+
+> It's idiomatic to use the `_` symbol to bind values we're not interested in (in this case the 1st and 3rd elements).
+
+The third element of `nested-data` is another vector. To also restructure its elements, we simply need to replicate the overall structure of `nested-data` and indicate that this 3rd element is a sequence itself. We combine this with another destructuring option, called `:as`, to bind the entire 3rd element to yet another symbol, `third`:
+
+```
+(let [[_ _ [c d :as third]] nested-data]
+ (prn third "contains:" c d))
+; [30 40] "contains:" 30 40
+```
+
+When attempting to destructure sequences with more symbols than there are values, any symbols with missing values are bound to `nil`:
+
+```
+(let [[_ _ _ _ missing] nested-data]
+ (prn "missing?" (nil? missing)))
+; "missing?" true
+```
+
+Likewise, if we're only interested in the first x elements of a seq, we don't need to specify any additional symbols/placeholders. Clojure doesn't care if there're more elements in a seq than destructuring symbols. However, in addition to the initial elements we're interested in, we might still want to hold on to the `rest` of the collection too. This can be done with `&`:
+
+```
+(let [[a b & more] nested-data]
+ (println (count more) "more elements:" more))
+; 2 more elements: ([30 40] {:x 1 :y 2})
+```
+
+Destructuring can be used almost anywhere whenever Clojure expects a symbol binding form. E.g. in the symbol binding part of a `for` form or to specify the argument list(s) of a function.
+
+#### Map destructuring
+
+Maps too can be destructured, though because the lookup of values requires keys, their destructuring form needs to refer to keys as well. Since we used `[` and `]` to specify a sequential destructuring, it should also make sense that we use `{` and `}` for destructuring maps. In the following we destructure the 4th element of `nested-data` and bind this map's `:x` to symbol `a` and `:y` to `b`:
+
+```
+(let [{a :x b :y} (nested-data 4)]
+ (prn :a a :b b))
+; :a 1 :b 2
+```
+
+If we wanted to use the same symbol names as the keys used in the original map, an alternative is:
+
+```
+(let [{:keys [x y] :as v} (nested-data 4)]
+ (prn :x x :y y :v v))
+; :x 1 :y 2 :v {:x 1 :y 2}
+```
+
+As with sequential destructuring we can use `:as` to also bind the entire map and of course can be done recursively. You can find more examples in [Jay Field's blog post][189] about this matter.
+
+#### Destructuring and function arities
+
+A function providing more than one implementation is called a "multi-arity" function and many core Clojure functions are implemented like this to provide maximum flexibility. So finally, let's extend our earlier `hypot` function and turn it into a multi-arity fn, accepting not only two numbers, but also a single seq (w/ minimum two elements) instead:
+
+```
+(defn hypot
+ ([[a b]] (hypot a b)) ; destructure the seq and then call itself with the 2 args
+ ([a b] (Math/sqrt (+ (* a a) (* b b)))))
+; #'user/hypot
+
+(hypot [9 12]) ; no more need for `apply`
+; 15.0
+(= (hypot [9 12]) (hypot 9 12)) ; testing other arity...
+; true
+```
+
+> Remember to wrap each arity implementation in its own form, i.e. surround with `(` and `)`.
+
+### End of part 1
+
+Congratulations!!! You made it through to here and we're truly proud of you! Even though we could only give you glimpses of The Clojure Way™ so far, we hope you're excited enough to try out more when we will be applying some of these basics to more practical & visual examples in the next part(s) of this tutorial. In the next part we will start building our first projects and introduce you to [Quil][190], a Clojure wrapper around [Processing][191].
+
+In the meantime we recommend that you sharpen your Clojure Skillz by checking out some of the materials below, esp. the [4clojure][192] puzzles are a great way of learning.
+
+### Further reading & references
+
++ Clojure mailing list - main community discussion (~8600 members)
++ clojure-doc.org - great community based collection of guides & tutorials aimed at all levels (incl. setup guides for various tools & platforms)
++ clojuredocs.org - community & example based reference for core Clojure namespaces & functions (learn by example)
++ Clojure cheatsheets - online & PDF versions, incl. ClojureScript
++ Stackoverflow - SO questions tagged w/ Clojure
++ Try Clojure - online playground REPL, no installation needed
++ 4clojure - online learning resource to solve Clojure puzzles of varying difficulties
++ Planet Clojure (Twitter) - Clojure blog aggregator
++ O'Reilly book - IMHO currently most comprehensive & accessible book
++ The Joy of Clojure - another great book, also touching more on the why & how of Clojure's philosophy
++ clojure-toolbox.com - curated list of Clojure projects, grouped by topic
++ clojuresphere.com - autogenerated list of Clojure projects on GitHub, incl. dependency info
++ clojars.org - community repository for open source Clojure libraries (main repo for Leiningen)
++ ClojureWerkz - growing collection of well maintained open source libraries (mainly DB centric projects)
+
+
+--------------------------------------------------------------------------------
+
+via: https://www.creativeapplications.net/tutorials/introduction-to-clojure-part-1/
+
+作者:[Karsten Schmidt and Ricardo Sanchez][a]
+选题:[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.creativeapplications.net/author/karstenricardo/
+[b]: https://github.com/lujun9972
+[1]: http://nardove.com/
+[2]: http://resonate.io/2013/education
+[3]: http://postspectacular.com/
+[4]: http://www.lisperati.com/clojure-spels/casting.html
+[5]: http://resonate.io/
+[6]: http://en.wiktionary.org/wiki/TLDR
+[7]: http://clojure.org
+[8]: http://en.wikipedia.org/wiki/Lisp_(programming_language)
+[9]: http://en.wikipedia.org/wiki/Lambda_calculus
+[10]: http://en.wikipedia.org/wiki/Alonzo_Church
+[11]: http://www.erlang.org/
+[12]: http://fsharp.org/
+[13]: http://haskell.org
+[14]: http://scala-lang.org
+[15]: http://en.wikipedia.org/wiki/Functional_programming
+[16]: http://steve-yegge.blogspot.co.uk/2006/03/execution-in-kingdom-of-nouns.html
+[17]: http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html
+[18]: http://en.wikipedia.org/wiki/Anonymous_function#C.2B.2B
+[19]: http://en.wikipedia.org/wiki/Immutable_object
+[20]: http://en.wikipedia.org/wiki/Lazy_evaluation
+[21]: http://clojure.org/sequences
+[22]: http://clojure.org/protocols
+[23]: http://en.wikipedia.org/wiki/Multiple_dispatch
+[24]: http://clojure.org/macros
+[25]: http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
+[26]: http://clojure.org/concurrent_programming
+[27]: http://thechangelog.com/rich-hickeys-greatest-hits/
+[28]: https://twitter.com/yoavrubin/status/226419931435130880
+[29]: http://thinkrelevance.com/blog/2009/10/19/the-case-for-clojure
+[30]: https://github.com/clojure/clojurescript
+[31]: https://github.com/clojure-android/lein-droid
+[32]: https://github.com/halgari/mjolnir/
+[33]: http://en.wikipedia.org/wiki/Marmite
+[34]: https://twitter.com/puredanger/status/313507982623268865
+[35]: http://en.wikipedia.org/wiki/S-expression
+[36]: http://en.wikipedia.org/wiki/Brace_matching
+[37]: https://github.com/jlr/rainbow-delimiters
+[38]: https://www.youtube.com/watch?v=D6h5dFyyUX0
+[39]: http://leiningen.org
+[40]: http://en.wikipedia.org/wiki/Leiningen_Versus_the_Ants
+[41]: http://ant.apache.org
+[42]: http://brew.sh/
+[43]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
+[44]: http://code.google.com/p/counterclockwise
+[45]: http://clojure-doc.org
+[46]: http://jruby.org/
+[47]: https://developer.mozilla.org/en/docs/Rhino
+[48]: http://tryclj.com
+[49]: http://en.wikipedia.org/wiki/Prefix_notation
+[50]: http://en.wikipedia.org/wiki/Pythagorean_theorem
+[51]: https://www.creativeapplications.net/wp-content/uploads/2013/12/hypot.png
+[52]: http://www.haskell.org/
+[53]: http://en.wikipedia.org/wiki/Scheme_(programming_language)
+[54]: http://en.wikipedia.org/wiki/Closure_(computer_science)
+[55]: http://en.wikipedia.org/wiki/Monad_(functional_programming)
+[56]: http://en.wikipedia.org/wiki/Scope_(computer_science#Lexical_scoping)
+[57]: http://clojuredocs.org/clojure_core/clojure.core/let
+[58]: http://en.wikipedia.org/wiki/Don't_Repeat_Yourself
+[59]: http://www.cplusplus.com/doc/tutorial/namespaces/
+[60]: http://en.wikipedia.org/wiki/Java_package
+[61]: http://docs.python.org/2/tutorial/modules.html
+[62]: http://clojure.org/namespaces
+[63]: https://www.creativeapplications.net/wp-content/uploads/2013/04/var.png
+[64]: http://clojuredocs.org/clojure_core/clojure.core/def
+[65]: http://clojure.github.io/clojure/clojure.core-api.html
+[66]: http://clojuredocs.org/clojure_core/clojure.core/inc
+[67]: http://clojuredocs.org/clojure_core/clojure.core/defn
+[68]: http://clojure.org/java_interop
+[69]: http://docs.oracle.com/javase/7/docs/api/java/lang/Math.html
+[70]: http://en.wikipedia.org/wiki/Hypotenuse
+[71]: http://clojuredocs.org/clojure_core/clojure.core/fn
+[72]: http://clojuredocs.org/clojure_core/clojure.core/str
+[73]: http://en.wikipedia.org/wiki/Higher-order_function
+[74]: http://rosettacode.org/wiki/Partial_function_application
+[75]: http://en.wikipedia.org/wiki/Closure_(computer_programming)
+[76]: http://clojuredocs.org/clojure_core/clojure.core/partial
+[77]: http://en.wikipedia.org/wiki/Fail-fast
+[78]: http://en.wikipedia.org/wiki/Design_by_contract
+[79]: http://clojuredocs.org/clojure_core/clojure.core/string_q
+[80]: http://blog.fogus.me/2009/12/21/clojures-pre-and-post/
+[81]: http://ianrumford.github.io/blog/2012/11/17/first-take-on-contracts-in-clojure/
+[82]: http://clojuredocs.org/clojure_core/clojure.repl/doc
+[83]: http://clojuredocs.org/clojure_core/clojure.core/meta
+[84]: http://clojuredocs.org/clojure_core/clojure.core/with-meta
+[85]: http://clojuredocs.org/clojure_core/clojure.core/alter-meta
+[86]: http://clojure.org/metadata
+[87]: http://clojure.org/java_interop#Java%20Interop-Type%20Hints
+[88]: http://clojuredocs.org/clojure_core/clojure.core/and
+[89]: http://clojuredocs.org/clojure_core/clojure.core/or
+[90]: http://clojuredocs.org/clojure_core/clojure.core/not
+[91]: http://clojuredocs.org/clojure_core/clojure.core/if
+[92]: http://clojuredocs.org/clojure_core/clojure.core/when
+[93]: http://clojuredocs.org/clojure_core/clojure.core/do
+[94]: http://clojure.org/data_structures
+[95]: http://clojuredocs.org/clojure_core/clojure.core/list
+[96]: http://www.r-project.org/
+[97]: http://en.wikipedia.org/wiki/XSLT
+[98]: http://en.wikipedia.org/wiki/PostScript
+[99]: https://www.creativeapplications.net/wp-content/uploads/2013/12/quote.png
+[100]: http://en.wikipedia.org/wiki/Metaprogramming
+[101]: https://gist.github.com/stonegao/1335696
+[102]: http://www.packtpub.com/clojure-for-domain-specific-languages/book
+[103]: http://en.wikipedia.org/wiki/Stack_(abstract_data_type)
+[104]: http://clojuredocs.org/clojure_core/clojure.core/vector
+[105]: http://en.wikipedia.org/wiki/Hash_table
+[106]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects
+[107]: http://clojuredocs.org/clojure_core/clojure.core/keyword
+[108]: http://clojuredocs.org/clojure_core/clojure.core/hash-map
+[109]: http://en.wikipedia.org/wiki/JSON
+[110]: http://clojuredocs.org/clojure_core/clojure.core/get-in
+[111]: http://clojuredocs.org/clojure_core/clojure.core/select-keys
+[112]: http://en.wikipedia.org/wiki/Set_theory
+[113]: http://clojuredocs.org/clojure_core/clojure.core/set
+[114]: http://clojuredocs.org/clojure_core/clojure.core/into
+[115]: https://www.creativeapplications.net/wp-content/uploads/2013/12/socialgraph.png
+[116]: http://clojuredocs.org/clojure_core/clojure.core/nil_q
+[117]: http://en.wikipedia.org/wiki/Polymorphism_(computer_science)
+[118]: http://clojuredocs.org/clojure_core/clojure.core/conj
+[119]: http://clojuredocs.org/clojure_core/clojure.core/assoc
+[120]: http://clojuredocs.org/clojure_core/clojure.core/assoc-in
+[121]: http://clojuredocs.org/clojure_core/clojure.core/update-in
+[122]: http://clojuredocs.org/clojure_core/clojure.core/dissoc
+[123]: http://clojuredocs.org/clojure_core/clojure.core/disj
+[124]: http://clojuredocs.org/clojure_core/clojure.core/pop
+[125]: http://en.wikipedia.org/wiki/Persistent_data_structure
+[126]: http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
+[127]: https://www.creativeapplications.net/wp-content/uploads/2013/04/persistent.png
+[128]: http://clojuredocs.org/clojure_core/clojure.core/seq
+[129]: http://clojuredocs.org/clojure_core/clojure.core/first
+[130]: http://clojuredocs.org/clojure_core/clojure.core/next
+[131]: http://clojuredocs.org/clojure_core/clojure.core/cons
+[132]: https://www.creativeapplications.net/wp-content/uploads/2013/12/first-rest.png
+[133]: http://clojuredocs.org/clojure_core/clojure.core/loop
+[134]: http://clojuredocs.org/clojure_core/clojure.core/reverse
+[135]: http://clojuredocs.org/clojure_core/clojure.core/recur
+[136]: http://en.wikipedia.org/wiki/Tail_recursion
+[137]: http://clojuredocs.org/clojure_core/clojure.core/doseq
+[138]: http://clojuredocs.org/clojure_core/clojure.core/last
+[139]: http://clojuredocs.org/clojure_core/clojure.core/dotimes
+[140]: http://en.wikipedia.org/wiki/Referential_transparency_(computer_science)
+[141]: http://en.wikipedia.org/wiki/Idempotence
+[142]: http://en.wikipedia.org/wiki/Memoization
+[143]: http://clojuredocs.org/clojure_core/clojure.core/memoize
+[144]: http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#sleep(long)
+[145]: http://research.google.com/archive/mapreduce.html
+[146]: http://en.wikipedia.org/wiki/Map_Reduce
+[147]: http://couchdb.apache.org
+[148]: http://www.mongodb.org/
+[149]: http://basho.com/riak/
+[150]: http://en.wikipedia.org/wiki/Apache_Hadoop
+[151]: http://clojuredocs.org/clojure_core/clojure.core/map
+[152]: https://www.creativeapplications.net/wp-content/uploads/2013/04/map.png
+[153]: https://www.creativeapplications.net/wp-content/uploads/2013/12/map-builder-640x259.png
+[154]: http://clojuredocs.org/clojure_core/clojure.core/reduce
+[155]: http://clojuredocs.org/clojure_core/clojure.core/reductions
+[156]: http://clojuredocs.org/clojure_core/clojure.core/range
+[157]: https://www.creativeapplications.net/wp-content/uploads/2013/12/reduce-sum.png
+[158]: http://clojuredocs.org/clojure_core/clojure.core/filter
+[159]: http://clojuredocs.org/clojure_core/clojure.core/even_q
+[160]: https://www.creativeapplications.net/wp-content/uploads/2013/12/filter-640x54.png
+[161]: http://clojuredocs.org/clojure_core/clojure.core/take
+[162]: http://clojuredocs.org/clojure_core/clojure.core/drop
+[163]: http://clojuredocs.org/clojure_core/clojure.core/take-last
+[164]: http://clojuredocs.org/clojure_core/clojure.core/drop-last
+[165]: http://clojuredocs.org/clojure_core/clojure.core/butlast
+[166]: http://clojuredocs.org/clojure_core/clojure.core/take-nth
+[167]: http://clojuredocs.org/clojure_core/clojure.core/take-while
+[168]: http://clojuredocs.org/clojure_core/clojure.core/drop-while
+[169]: http://clojuredocs.org/clojure_core/clojure.core/concat
+[170]: http://clojuredocs.org/clojure_core/clojure.core/mapcat
+[171]: http://clojuredocs.org/clojure_core/clojure.core/identity
+[172]: http://clojuredocs.org/clojure_core/clojure.core/frequencies
+[173]: http://en.wikipedia.org/wiki/Histogram
+[174]: http://clojuredocs.org/clojure_core/clojure.core/cycle
+[175]: http://clojuredocs.org/clojure_core/clojure.core/repeat
+[176]: http://clojuredocs.org/clojure_core/clojure.core/repeatedly
+[177]: http://clojuredocs.org/clojure_core/clojure.core/iterate
+[178]: http://clojuredocs.org/clojure_core/clojure.core/interleave
+[179]: http://clojuredocs.org/clojure_core/clojure.core/interpose
+[180]: http://clojuredocs.org/clojure_core/clojure.core/zipmap
+[181]: http://en.wikipedia.org/wiki/Roman_numerals
+[182]: http://clojuredocs.org/clojure_core/clojure.core/for
+[183]: http://en.wikipedia.org/wiki/List_comprehension
+[184]: http://clojuredocs.org/clojure_core/clojure.core/every_q
+[185]: http://clojuredocs.org/clojure_core/clojure.core/rem
+[186]: http://clojuredocs.org/clojure_core/clojure.core/some
+[187]: http://en.wikipedia.org/wiki/Magnitude_(vector)
+[188]: http://clojuredocs.org/clojure_core/clojure.core/apply
+[189]: http://blog.jayfields.com/2010/07/clojure-destructuring.html
+[190]: https://github.com/quil/quil
+[191]: http://processing.org
+[192]: http://www.4clojure.com/
From 0ee0364ad74cdfb2b04d0e6fadcf296c201040a8 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 19:52:21 +0800
Subject: [PATCH 023/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20My=20Google-free?=
=?UTF-8?q?=20Android=20life?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20181108 My Google-free Android life.md | 191 ++++++++++++++++++
1 file changed, 191 insertions(+)
create mode 100644 sources/tech/20181108 My Google-free Android life.md
diff --git a/sources/tech/20181108 My Google-free Android life.md b/sources/tech/20181108 My Google-free Android life.md
new file mode 100644
index 0000000000..4e94af0de8
--- /dev/null
+++ b/sources/tech/20181108 My Google-free Android life.md
@@ -0,0 +1,191 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (My Google-free Android life)
+[#]: via: (https://lushka.al/my-android-setup/)
+[#]: author: (Anxhelo Lushka https://lushka.al/)
+
+My Google-free Android life
+======
+
+People have been asking me a lot lately about my phone, my Android setup and how I manage to use my smartphone without Google Services. Well, this is a post that aims to address precisely that. I would like to make this article really beginner-friendly so I’ll try to go slow, going through things one by one and including screenshots so you can have a better view on how things happen and work like.
+
+At first I’ll start with why Google Services are (imo) bad for your device. I could cut it short and guide you to this [post][1] by [Richard Stallman][2], but I’m grabbing a few main points from it and adding them here.
+
+ * Nonfree software required
+ * In general, most Google services require running nonfree Javascript code. Nowadays, nothing whatsoever appears if Javascript is disabled, even making a Google account requires running nonfree software (Javascript sent by the site), same thing for logging in.
+ * Surveillance
+ * Google quietly combines its ad-tracking profiles with its browsing profiles and stores a huge amount of data on each user.
+ * Terms of Service
+ * Google cuts off accounts for users that resell Pixel phones. They lose access to all of their mail and documents stored in Google servers under that account.
+ * Censorship
+ * Amazon and Google have cut off domain-fronting, a feature used to enable people in tyrannical countries to reach communication systems that are banned there.
+ * Google has agreed to perform special censorship of Youtube for the government of Pakistan, deleting views that the state opposes. This will help the illiberal Pakistani state suppress dissent.
+ * Youtube’s “content ID” automatically deletes posted videos in a way copyright law does not require.
+
+
+
+These are just a few reasons, but you can read the post by RMS I linked above in which he tries to explain these points in detail. Although it may look like a tinfoil hat reaction to you, all these actions already happen everyday in real life.
+
+### Next on the list, my setup and a tutorial on how I achieved it
+
+I own a **[Xiaomi Redmi Note 5 Pro][3]** smartphone (codename **whyred** ), produced in China by [Xiaomi][4], which I bought for around 185 EUR 4 months ago (from the time of writing this post).
+
+Now you might be thinking, ‘but why did you buy a Chinese brand, they are not reliable’. Yes, it is not made from the usuals as you would expect, such as Samsung (which people often associate with Android, which is plain wrong), OnePlus, Nokia etc, but you should know almost every phone is produced in China.
+
+There were a few reasons I chose this phone, first one of course being the price. It is a quite **budget-friendly** device, so most people are able to afford it. Next one would be the specs, which on paper (not only) are pretty decents for the price tag. With a 6 inch screen (Full HD resolution), a **4000 mAh battery** (superb battery life), 4GB of RAM, 64GB of storage, dual back cameras (12MP + 5MP), a front camera with flash (13MP) and a decent efficient Snapdragon 636, it was probably the best choice at that moment.
+
+The issue with it was that it came with [MIUI][5], the Android skin that Xiaomi ships with most of its devices (except the Android One project devices). Yes, it is not that horrible, it has some extra features, but the problems lie deeper within. One of the reasons these devices from Xiaomi are so cheap (afaik they only have 5-10% win margin from sales) is that **they include data mining and ads in the system altogether with MIUI**. In this way, the system apps requires extra unnecessary permissions that mine your data and bombard you with ads, from which Xiaomi earns money.
+
+Funnily enough, the Weather app included wanted access to my contacts and to make calls, why would it need that if it would just show the weather? Another case was with the Recorder app, it also required contacts and internet permissions, probably to send those recordings back to Xiaomi.
+
+To fix this, I’d have to format the phone and get rid of MIUI. This has become increasingly difficult with the latest phones in the market.
+
+The concept of formatting a phone is simple, you remove the existing system and install a new one of your preference (Android-only in this case). To do that, you have to have your [bootloader][6] unlocked.
+
+> A bootloader is a computer program that loads an operating system (OS) or runtime environment for the computer after completion of the self-tests. — [Wikipedia][7]
+
+The problem here is that Xiaomi has a specific policy about the bootloader unlocking. A few months ago, the process was like this. You would have to [make a request][8] to Xiaomi to obtain an unlock code for your phone, by giving a valid reason, but this would not always work, as they could just refuse your request without reason and explanation.
+
+Now, that process has changed. You’ll have to download a specific software from Xiaomi, called [Mi Unlock][9], install it in your Windows PC, [activate Debugging Settings in Developer Options][10] on your phone, reboot to the bootloader mode (by holding the Volume Down + Power button while the phone is off) and connect the phone to your computer to start a process called “Approval”. This process starts a timer on the Xiaomi servers that will allow you to **unlock the phone only after a period of 15 days** (or a month in some rare cases, totally random) goes by.
+
+![Mi Unlock app][11]
+
+After this period of 15 days has passed, you have to re-connect your phone and do the same procedure as above, then by pressing the Unlock button your bootloader will be unlocked and this will allow you to install other ROM-s (systems). **Careful, make sure to backup your data because unlocking the bootloader deletes everything in the phone**.
+
+The next step would be finding a system ([ROM][12]) that works for your device. I searched through the [XDA Developers Forum][13], which is a place where Android developers and users exchange ideas, apps etc. Fortunately, my phone is quite popular so it had [its own forum category][14]. There, I skimmed through some popular ROM-s for my device and decided to use the [AOSiP ROM][15] (AOSiP standing for Android Open Source illusion Project).
+
+**EDIT** : Someone emailed me to say that my article is exactly what [/e/][16] does and is targeted to. I wanted to say thank you for reaching out but that is not true at all. The reasoning behind my opinion about /e/ can also be found in this [website][17], but I’ll list a few of the reasons here.
+
+eelo is a “foundation” that got over 200K € in funding from Kickstarter and IndieGoGo, promising to create a mobile OS and web services that are open and secure and protect your privacy.
+
+ 1. Their OS is based on LineageOS 14.1 (Android 7.1) with microG and other open source apps with it, which already exists for a long time now and it’s called [Lineage for microG][18].
+ 2. Instead of building all apps from the source code, they download the APKs from [APKPure][19] and put them in the ROM, without knowing if those APKs contain proprietary code/malware in them.
+ 3. At one point, they were literally just removing the Lineage copyright header from their code and adding theirs.
+ 4. They love to delete negative feedback and censor their users’ opinions in their Telegram group chat.
+
+
+
+In conclusion, I **don’t recommend using /e/** ROM-s (at least until now).
+
+Another thing you would likely want to do is have [root access][20] to your phone, to make it truly yours and modify files in the system, such as use a system-wide adblocker etc. To do this, I decided to use [Magisk][21], a godsend app developed by a student to help you gain root access on your device and install what are called [modules][22], basically software.
+
+After downloading the ROM and Magisk, I had to install them on my phone. To do that, I moved the files to my SD card on the phone. Now, to install the system, I had to use something called a [recovery system][23]. The one I use is called [TWRP][24] (standing for TeamWin Recovery Project), a popular solution.
+
+To install the recovery system (sounds hard, I know), I had to [flash][20] the file on the phone. To do that, I connected my phone with the computer (Fedora Linux system) and with something called [ADB Tools][25] I issued a command that overwrites the system recovery with the custom one I had.
+
+> fastboot flash recovery twrp.img
+
+After this was done, I turned off the phone and kept Volume Up + Power button pressed until I saw the TWRP screen show up. That meant I was good to go and it was ready to receive my commands.
+
+![TWRP screen][26]
+
+Next step was to **issue a Wipe command** , necessary when you first install a custom ROM on your phone. As you can see from the image above, the Wipe command clears the Data, Cache and Dalvik (there is also an advanced option that allows us to tick a box to delete the System one too, as we don’t need the old one anymore).
+
+This takes a few moments and after that, your phone is basically clean. Now it’s time to **install the system**. By pressing the Install button on the main screen, we select the zip file we added there before (the ROM file) and swipe the screen to install it. Next, we have to install Magisk, which gives us root access to the device.
+
+**EDIT** : As some more experienced/power Android users might have noticed until now, there is no [GApps][27] (Google Apps) included. This is what we call GApps-less in the Android world, not having those packages installed at all.
+
+Note that one of the downsides of not having Google Services installed is that some of your apps might not work, for example their notifications might take longer to arrive or might not even work at all (this is what happens with Mattermost app for me). This happens because these apps use [Google Cloud Messaging][28] (now called [Firebase][29]) to wake the phone and push notifications to your phone.
+
+You can solve this (partially) by installing and using [microG][30] which provides some features of Google Services but allows for more control on your side. I don’t recommend using this because it still helps Google Services and you don’t really give up on them, but it’s a good start if you want to quit Google slowly and not go cold turkey on it.
+
+After successfully installing both, now we reboot the phone and **tada** 🎉, we are in the main screen.
+
+### Next part, installing the apps and configuring everything
+
+This is where things start to get easier. To install the apps, I use [F-Droid][31], an alternative app store that includes **only free and open source apps**. If you need apps that are not available there, you can use [Aurora Store][32], a client to download apps from the Play Store without using your Google account or getting tracked.
+
+F-Droid has what are called repos, a “storehouse” that contains apps you can install. I use the default ones and have added another one from [IzzyOnDroid][33], that contains some more apps not available from the default F-Droid repo and is updated more often.
+
+![My repos][34]
+
+Below you will find a list of the apps I have installed, what they replace and their use.
+
+This is pretty much **my list of the most useful F-Droid apps** I use, but unfortunately these are NOT the only apps I use. The proprietary apps I use (I know, I might sound a hypocrite, but not everything is replaceable, not yet at least) are as below:
+
+ * AliExpress
+ * Boost for Reddit
+ * Google Camera (coupled with Camera API 2, this app allows me to take wonderful pictures with a 185 EUR phone, it’s just too impressive)
+ * Instagram
+ * MediaBox HD (allows me to stream movies)
+ * Mi Fit (an app that pairs with my Mi Band 2)
+ * MyVodafoneAL (the carrier app)
+ * ProtonMail (email app)
+ * Shazam Encore (to find those songs you usually listen in coffee shops)
+ * Snapseed (photo editing app, really simple, powerful and quite good)
+ * Spotify (music streaming)
+ * Titanium Backup (to backup my app data, wifi passwords, calls log etc.)
+ * ViPER4Android FX (music equalizer)
+ * VSCO (photo editing, never use it really)
+ * WhatsApp (E2E proprietary messaging app, almost everyone I know has it)
+ * WiFi Map (mapped hotspots that are available, handy when abroad)
+
+
+
+This is pretty much it, all the apps I use on my phone. **The configs are then pretty simple and straightforward and I can give a few tips**.
+
+ 1. Read and check the permissions of apps carefully, don’t click ‘Install’ mindlessly.
+ 2. Try to use as many open source apps as possible, they both respect your privacy and are free (as in both free beer and freedom).
+ 3. Use a VPN as much as you can, find a reputable one and don’t use free ones, otherwise you get to be the product and you’ll get your data harvested.
+ 4. Don’t keep your WiFi/mobile data/location on all the time, it might be a security risk.
+ 5. Try not to rely on fingerprint unlock only, or better yet use only PIN/password/pattern unlock, as biometric data can be cloned and used against you, for example to unlock your phone and steal your data.
+
+
+
+And as a bonus for reading far down here, **a screenshot of my home screen** right now.
+
+![Screenshot][35]
+
+
+--------------------------------------------------------------------------------
+
+via: https://lushka.al/my-android-setup/
+
+作者:[Anxhelo Lushka][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://lushka.al/
+[b]: https://github.com/lujun9972
+[1]: https://stallman.org/google.html
+[2]: https://en.wikipedia.org/wiki/Richard_Stallman
+[3]: https://www.gsmarena.com/xiaomi_redmi_note_5_pro-8893.php
+[4]: https://en.wikipedia.org/wiki/Xiaomi
+[5]: https://en.wikipedia.org/wiki/MIUI
+[6]: https://forum.xda-developers.com/wiki/Bootloader
+[7]: https://en.wikipedia.org/wiki/Booting
+[8]: https://en.miui.com/unlock/
+[9]: http://www.miui.com/unlock/apply.php
+[10]: https://www.youtube.com/watch?v=7zhEsJlivFA
+[11]: https://lushka.al//assets/img/posts/mi-unlock.png
+[12]: https://www.xda-developers.com/what-is-custom-rom-android/
+[13]: https://forum.xda-developers.com/
+[14]: https://forum.xda-developers.com/redmi-note-5-pro
+[15]: https://forum.xda-developers.com/redmi-note-5-pro/development/rom-aosip-8-1-t3804473
+[16]: https://e.foundation
+[17]: https://ewwlo.xyz/evil
+[18]: https://lineage.microg.org/
+[19]: https://apkpure.com/
+[20]: https://lifehacker.com/5789397/the-always-up-to-date-guide-to-rooting-any-android-phone
+[21]: https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
+[22]: https://forum.xda-developers.com/apps/magisk
+[23]: http://www.smartmobilephonesolutions.com/content/android-system-recovery
+[24]: https://dl.twrp.me/whyred/
+[25]: https://developer.android.com/studio/command-line/adb
+[26]: https://lushka.al//assets/img/posts/android-twrp.png
+[27]: https://opengapps.org/
+[28]: https://developers.google.com/cloud-messaging/
+[29]: https://firebase.google.com/docs/cloud-messaging/
+[30]: https://microg.org/
+[31]: https://f-droid.org/
+[32]: https://f-droid.org/en/packages/com.dragons.aurora/
+[33]: https://android.izzysoft.de/repo
+[34]: https://lushka.al//assets/img/posts/android-fdroid-repos.jpg
+[35]: https://lushka.al//assets/img/posts/android-screenshot.jpg
+[36]: https://creativecommons.org/licenses/by-nc-sa/4.0/
From 60b2a73f87f45ed094e37b26f55a0f4c65c5818c Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 20:11:20 +0800
Subject: [PATCH 024/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Plan=20your=20own?=
=?UTF-8?q?=20holiday=20calendar=20at=20the=20Linux=20command=20line?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...iday calendar at the Linux command line.md | 132 ++++++++++++++++++
1 file changed, 132 insertions(+)
create mode 100644 sources/tech/20181207 Plan your own holiday calendar at the Linux command line.md
diff --git a/sources/tech/20181207 Plan your own holiday calendar at the Linux command line.md b/sources/tech/20181207 Plan your own holiday calendar at the Linux command line.md
new file mode 100644
index 0000000000..b4d6f58b32
--- /dev/null
+++ b/sources/tech/20181207 Plan your own holiday calendar at the Linux command line.md
@@ -0,0 +1,132 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Plan your own holiday calendar at the Linux command line)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-cal)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+
+Plan your own holiday calendar at the Linux command line
+======
+Link commands together to build a colorful calendar, and then whisk it away in a snowstorm.
+
+
+Welcome to today's installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game or any simple diversion that helps you have fun at the terminal.
+
+It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.
+
+We've somehow made it to the seventh day of our series without creating an actual calendar to celebrate with, so let's use a command-line tool to do that today: **cal**. By itself, **cal** is perhaps not the most amazing of tools, but we can use a few other utilities to spice it up a bit.
+
+Chances are, **cal** is installed on your system already. To use it in this instance, just type **cal**.
+
+```
+$ cal
+ December 2018
+Su Mo Tu We Th Fr Sa
+ 1
+ 2 3 4 5 6 7 8
+ 9 10 11 12 13 14 15
+16 17 18 19 20 21 22
+23 24 25 26 27 28 29
+30 31
+```
+
+We aren't going to go into advanced usage in this article, so if you want to learn more about **cal** , go check out Opensource.com Community Moderator Don Watkin's excellent [overview of the date and cal commands][1].
+
+Now, let's spice it up with a pretty box, as we covered in our previous Linux toy article. I'll use the diamonds box, and use a little bit of padding to get it nicely aligned.
+
+```
+$ cal | boxes -d diamonds -p a1l4t2
+ /\ /\ /\
+ /\//\\/\ /\//\\/\ /\//\\/\
+ /\//\\\///\\/\//\\\///\\/\//\\\///\\/\
+//\\\//\/\\///\\\//\/\\///\\\//\/\\///\\
+\\//\/ \/\\//
+ \/ \/
+ /\ December 2018 /\
+//\\ Su Mo Tu We Th Fr Sa //\\
+\\// 1 \\//
+ \/ 2 3 4 5 6 7 8 \/
+ /\ 9 10 11 12 13 14 15 /\
+//\\ 16 17 18 19 20 21 22 //\\
+\\// 23 24 25 26 27 28 29 \\//
+ \/ 30 31 \/
+ /\ /\
+//\\/\ /\//\\
+\\///\\/\//\\\///\\/\//\\\///\\/\//\\\//
+ \/\\///\\\//\/\\///\\\//\/\\///\\\//\/
+ \/\\//\/ \/\\//\/ \/\\//\/
+ \/ \/ \/
+```
+
+That looks nice, but for good measure, let's put the whole thing in a second box, just for fun. We'll use the scoll design this time.
+
+```
+cal | boxes -d diamonds -p a1t2l3 | boxes -a c -d scroll
+ / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \
+| /~~\ /~~\ |
+|\ \ | /\ /\ /\ | / /|
+| \ /| /\//\\/\ /\//\\/\ /\//\\/\ |\ / |
+| ~~ | /\//\\\///\\/\//\\\///\\/\//\\\///\\/\ | ~~ |
+| | //\\\//\/\\///\\\//\/\\///\\\//\/\\///\\ | |
+| | \\//\/ \/\\// | |
+| | \/ \/ | |
+| | /\ December 2018 /\ | |
+| | //\\ Su Mo Tu We Th Fr Sa //\\ | |
+| | \\// 1 \\// | |
+| | \/ 2 3 4 5 6 7 8 \/ | |
+| | /\ 9 10 11 12 13 14 15 /\ | |
+| | //\\ 16 17 18 19 20 21 22 //\\ | |
+| | \\// 23 24 25 26 27 28 29 \\// | |
+| | \/ 30 31 \/ | |
+| | /\ /\ | |
+| | //\\/\ /\//\\ | |
+| | \\///\\/\//\\\///\\/\//\\\///\\/\//\\\// | |
+| | \/\\///\\\//\/\\///\\\//\/\\///\\\//\/ | |
+| | \/\\//\/ \/\\//\/ \/\\//\/ | |
+| | \/ \/ \/ | |
+| | | |
+ \ |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| /
+ \ / \ /
+ ~~~ ~~~
+```
+
+Perfect. Now, here's where things get a little crazy. I like our design, but, I'd like to go all out. So I'm going to colorize it. But here in the Raleigh, NC office where Opensource.com's staff are based, there's a good chance for snow this weekend. So let's enjoy our colorized advent calendar, and then wipe it out with snow.
+
+For the snow, I'm grabbing a nifty [snippet][2] of Bash and Gawk goodness I found over on CLIMagic. If you're not familiar with CLIMagic, go check out their [website][3] and follow them on [Twitter][4]. You'll be glad you did.
+
+So here we go. Let's clear the screen, throw up our boxy calendar, colorize it, wait a few seconds, then snowstorm it away. All here at the terminal, in one line.
+
+```
+$ clear;cal|boxes -d diamonds -p a1t2l3|boxes -a c -d scroll|lolcat;sleep 3;while :;do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS)) $(printf "\u2744\n");sleep 0.1;done|gawk '{a[$3]=0;for(x in a) {o=a[x];a[x]=a[x]+1;printf "\033[%s;%sH ",o,x;printf "\033[%s;%sH%s \033[0;0H",a[x],x,$4;}}'
+```
+
+And there we go.
+
+
+
+For this to work on your system, you'll need all of the referenced utilities (boxes, lolcat, cal, gawk, etc.), and you'll need to use a terminal emulator that supports Unicode.
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Take a break at the Linux command line with Nyan Cat][5], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-cal
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://opensource.com/article/16/12/using-calendar-function-linux
+[2]: http://climagic.org/coolstuff/let-it-snow.html
+[3]: http://climagic.org/
+[4]: https://twitter.com/climagic
+[5]: https://opensource.com/article/18/12/linux-toy-nyancat
From ecc7245e561adf7b91a647b04a66bb5a27bab34b Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 20:15:03 +0800
Subject: [PATCH 025/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20YAML:=20probably?=
=?UTF-8?q?=20not=20so=20great=20after=20all?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...7 YAML- probably not so great after all.md | 316 ++++++++++++++++++
1 file changed, 316 insertions(+)
create mode 100644 sources/tech/20171227 YAML- probably not so great after all.md
diff --git a/sources/tech/20171227 YAML- probably not so great after all.md b/sources/tech/20171227 YAML- probably not so great after all.md
new file mode 100644
index 0000000000..ed853ca697
--- /dev/null
+++ b/sources/tech/20171227 YAML- probably not so great after all.md
@@ -0,0 +1,316 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (YAML: probably not so great after all)
+[#]: via: (https://arp242.net/weblog/yaml_probably_not_so_great_after_all.html)
+[#]: author: (Martin Tournoij https://arp242.net/)
+
+YAML: probably not so great after all
+======
+
+
+I previously wrote [why using JSON for human-editable configuration files is a bad idea][1]. Today we’re going to look at some general problems with the YAML format.
+
+### Insecure by default
+
+YAML is insecure by default. Loading a user-provided (untrusted) YAML string needs careful consideration.
+
+```
+!!python/object/apply:os.system
+args: ['ls /']
+```
+
+Running it with `print(yaml.load(open('a.yaml')))` should give you something like:
+
+```
+bin etc lib lost+found opt root sbin tmp var sys
+boot dev efi home lib64 mnt proc run srv usr
+0
+```
+
+Many other languages (including Ruby and PHP) are also unsafe by default. [Searching for `yaml.load` on GitHub][2] gives a whopping 2.8 million results. [`yaml.safe_load`][3] only gives 26,000 results.
+
+Mind you, many of those `yaml.load()`s are fine – loading in a config file with `yaml.load()` is often okay since it’s usually (though not always!) from a ‘trusted source’, and many are from test files with static YAML. But still, one can’t help but wonder how many exploits are hidden in those 2.8 million results.
+
+This is not a theoretical problem. In 2013 [every Ruby on Rails application ever written was found to be vulnerable][4] to remote code execution due to exactly this problem.
+
+One might argue this is not really the fault of the YAML format as such, but rather the fault of the libraries implementing it wrong, but it seems to be the case that the majority of libraries are unsafe by default (especially the dynamic languages), so de-facto it is a problem with YAML.
+
+One might also argue that fixing it is as easy as replacing `load()` with `safe_load()`, but many people are unaware of the problem, and even if you’re aware of it, it’s one of those things that can be easy to forget. It’s pretty bad API design.
+
+### Can be hard to edit, especially for large files
+
+YAML files can be hard to edit, and this difficulty grows fast as the file gets larger.
+
+A good example of this are Ruby on Rails’ translation files; for example:
+
+```
+en:
+ formtastic:
+ labels:
+ title: "Title" # Default global value
+ article:
+ body: "Article content"
+ post:
+ new:
+ title: "Choose a title..."
+ body: "Write something..."
+ edit:
+ title: "Edit title"
+ body: "Edit body"
+```
+
+This still looks okay, right? But what if this file has 100 lines? Or 1,000 lines? It is difficult to see “where” in the file you are because it may be off the screen. You’ll need to scroll up, but then you need to keep track of the indentation, which can be pretty hard even with indentation guides, especially since 2-space indentation is the norm and [tab indentation is forbidden][5].
+
+And accidentally getting the indentation wrong often isn’t an error; it will often just deserialize to something you didn’t intend. Happy debugging!
+
+I’ve been happily programming Python for over a decade, so I’m used to significant whitespace, but sometimes I’m still struggling with YAML. In Python the drawbacks and loss of clarity are contained by not having functions that are several pages long, but data or configuration files have no such natural limits to their length.
+
+For small files this is not a problem; but it really doesn’t scale well to larger files, especially not if you want to edit them later on.
+
+### It’s pretty complex
+
+YAML may seem ‘simple’ and ‘obvious’ when glancing at a basic example, but turns out it’s not. The [YAML spec][6] is 23,449 words; for comparison, [TOML][7] is 3,339 words, [JSON][8] is 1,969 words, and [XML][9] is 20,603 words.
+
+Who among us have read all that? Who among us have read and understood all of that? Who among of have read, understood, and **remembered** all of that?
+
+For example did you know there are [nine ways to write a multi-line string in YAML][10] with subtly different behaviour?
+
+Yeah :-/
+
+That post gets even more interesting if you look at [its revision history][11], as the author of the post discovers more and more ways to do this and more of the subtleties involved.
+
+It’s telling that the YAML spec starts with a preview, which states (emphases mine):
+
+> This section provides a quick glimpse into the expressive power of YAML. **It is not expected that the first-time reader grok all of the examples**. Rather, these selections are used as motivation for the remainder of the specification.
+
+#### Surprising behaviour
+
+What does this parse to (examples courtesy of [Colm O’Connor][12]):
+
+```
+- Don Corleone: Do you have faith in my judgment?
+- Clemenza: Yes
+- Don Corleone: Do I have your loyalty?
+```
+
+Yup!
+
+```
+[
+ {'Don Corleone': 'Do you have faith in my judgment?'},
+ {'Clemenza': True},
+ {'Don Corleone': 'Do I have your loyalty?'}
+]
+```
+
+Or what about:
+
+```
+python: 3.5.3
+postgres: 9.3
+```
+
+`3.5.3` gets recognized as as string, but `9.3` gets recognized as a number instead of a string:
+
+```
+{'python': '3.5.3', 'postgres': 9.3}
+```
+
+Or what about:
+
+```
+Effenaar: Eindhoven
+013: Tilburg
+```
+
+013 is a popular music Venue in Tilburg, but YAML will send you the wrong way since it’s parsed as an octal number:
+
+```
+{11: 'Tilburg', 'Effenaar': 'Eindhoven'}
+```
+
+All of this – and more – is why many experienced YAMLers will often quote all strings, even when it’s not strictly required. Many people don’t use quotes, and it can be easy to forget especially if the rest of the file – possibly written by other people – doesn’t use quotes.
+
+#### It’s not portable
+
+Because it’s so complex, its claims of portability have been greatly exaggerated. For example consider this example taken from the YAML spec:
+
+```
+? - Detroit Tigers
+ - Chicago cubs
+:
+ - 2001-07-23
+
+? [ New York Yankees,
+ Atlanta Braves ]
+: [ 2001-07-02, 2001-08-12,
+ 2001-08-14 ]
+```
+
+Aside from the fact that most readers of this probably won’t even know what this does, try parsing it in Python with PyYAML:
+
+```
+yaml.constructor.ConstructorError: while constructing a mapping
+ in "a.yaml", line 1, column 1
+found unhashable key
+ in "a.yaml", line 1, column 3
+```
+
+In Ruby it works:
+
+```
+{
+ ["Detroit Tigers", "Chicago cubs"] => [
+ #
+ ],
+ ["New York Yankees", "Atlanta Braves"] => [
+ #,
+ #,
+ #
+ ]
+}
+```
+
+The reason for this is because you can’t use a list as a dict key in Python:
+
+```
+>>> {['a']: 'zxc'}
+Traceback (most recent call last):
+ File "", line 1, in
+ TypeError: unhashable type: 'list'
+```
+
+And this restriction is not unique to Python; common languages such as PHP, JavaScript, and Go all share this restriction.
+
+So use this in a YAML file, and you won’t be able to read it in most languages.
+
+Here’s another example again taken from the examples section of the YAML spec:
+
+```
+# Ranking of 1998 home runs
+---
+- Mark McGwire
+- Sammy Sosa
+- Ken Griffey
+
+# Team ranking
+---
+- Chicago Cubs
+- St Louis Cardinals
+```
+
+Python says:
+
+```
+yaml.composer.ComposerError: expected a single document in the stream
+ in "a.yaml", line 3, column 1
+but found another document
+ in "a.yaml", line 8, column 1
+```
+
+While Ruby outputs:
+
+```
+["Mark McGwire", "Sammy Sosa", "Ken Griffey"]
+```
+
+The reason for this is that there are multiple YAML documents in a single file (`---` start the document). In Python there is the `load_all()` function to parse all documents. Ruby’s `load()` just loads the first document, and as near as I can tell, doesn’t have a way to load multiple documents.
+
+There are [many more incompatibilities between implementations][13].
+
+### Goals achieved?
+
+The spec states:
+
+> The design goals for YAML are, in decreasing priority:
+>
+> 1. YAML is easily readable by humans.
+> 2. YAML data is portable between programming languages.
+> 3. YAML matches the native data structures of agile languages.
+> 4. YAML has a consistent model to support generic tools.
+> 5. YAML supports one-pass processing.
+> 6. YAML is expressive and extensible.
+> 7. YAML is easy to implement and use.
+>
+
+
+So how well does it do?
+
+> YAML is easily readable by humans.
+
+True only if you stick to a small subset. The full set is complex – much more so than XML or JSON.
+
+> YAML data is portable between programming languages.
+
+Not really true, as it’s too easy to create constructs that are not supported by common languages.
+
+> YAML matches the native data structures of agile languages.
+
+See above. Plus, why only support agile (or dynamic) languages? What about other languages?
+
+> YAML has a consistent model to support generic tools.
+
+I am not even sure what this means and I can’t find any elaboration.
+
+> YAML supports one-pass processing.
+
+I’ll take their word for it.
+
+> YAML is expressive and extensible.
+
+Well, it is, but it’s too expressive (e.g. too complex).
+
+> YAML is easy to implement and use.
+
+```
+$ cat `ls -1 ~/gocode/src/github.com/go-yaml/yaml/*.go | grep -v _test` | wc -l
+9247
+
+$ cat /usr/lib/python3.5/site-packages/yaml/*.py | wc -l
+5713
+```
+
+### Conclusion
+
+Don’t get me wrong, it’s not like YAML is absolutely terrible – it’s certainly not as [problematic as using JSON][1] – but it’s not exactly great either. There are some drawbacks and surprises that are not at all obvious at first, and there are a number of better alternatives such as [TOML][7] and other more specialized formats.
+
+Personally, I’m not likely to use it again when I’ve got a choice.
+
+If you must use YAML then I recommend you use [StrictYAML][14], which removes some (though not all) of the more hairy parts.
+
+### Feedback
+
+You can mail me at [martin@arp242.net][15] or [create a GitHub issue][16] for feedback, questions, etc.
+
+--------------------------------------------------------------------------------
+
+via: https://arp242.net/weblog/yaml_probably_not_so_great_after_all.html
+
+作者:[Martin Tournoij][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://arp242.net/
+[b]: https://github.com/lujun9972
+[1]: http://arp242.net/weblog/JSON_as_configuration_files-_please_dont.html
+[2]: https://github.com/search?q=yaml.load&type=Code&utf8=%E2%9C%93
+[3]: https://github.com/search?q=yaml.safe_load&type=Code&utf8=%E2%9C%93
+[4]: https://www.sitepoint.com/anatomy-of-an-exploit-an-in-depth-look-at-the-rails-yaml-vulnerability/
+[5]: http://www.yaml.org/faq.html
+[6]: http://yaml.org/spec/1.2/spec.pdf
+[7]: https://github.com/toml-lang/toml
+[8]: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
+[9]: https://www.w3.org/TR/REC-xml/
+[10]: http://stackoverflow.com/a/21699210/660921
+[11]: http://stackoverflow.com/posts/21699210/revisions
+[12]: https://github.com/crdoconnor/strictyaml/blob/master/FAQ.rst#what-is-wrong-with-implicit-typing
+[13]: https://github.com/cblp/yaml-sucks
+[14]: https://github.com/crdoconnor/strictyaml
+[15]: mailto:martin@arp242.net
+[16]: https://github.com/Carpetsmoker/arp242.net/issues/new
From dcfa796e87ce019f240efe2d3c48c07378e7dccf Mon Sep 17 00:00:00 2001
From: seriouszyx <674965440@qq.com>
Date: Mon, 10 Dec 2018 20:22:22 +0800
Subject: [PATCH 026/119] seriouszyx translating
---
.../talk/20181127 What the open source community means to me.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/talk/20181127 What the open source community means to me.md b/sources/talk/20181127 What the open source community means to me.md
index bdb43bf20c..ec4d8f7a6d 100644
--- a/sources/talk/20181127 What the open source community means to me.md
+++ b/sources/talk/20181127 What the open source community means to me.md
@@ -1,3 +1,5 @@
+translating by seriouszyx
+
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
From 993416994a0eccd03db7b9a8d4d80d448aaaafba Mon Sep 17 00:00:00 2001
From: FelixYFZ <33593534+FelixYFZ@users.noreply.github.com>
Date: Mon, 10 Dec 2018 20:41:47 +0800
Subject: [PATCH 027/119] Delete 20180326 Manage your workstation with Ansible-
Automating configuration.md
---
... with Ansible- Automating configuration.md | 236 ------------------
1 file changed, 236 deletions(-)
delete mode 100644 sources/tech/20180326 Manage your workstation with Ansible- Automating configuration.md
diff --git a/sources/tech/20180326 Manage your workstation with Ansible- Automating configuration.md b/sources/tech/20180326 Manage your workstation with Ansible- Automating configuration.md
deleted file mode 100644
index b504b48ae0..0000000000
--- a/sources/tech/20180326 Manage your workstation with Ansible- Automating configuration.md
+++ /dev/null
@@ -1,236 +0,0 @@
-Manage your workstation with Ansible: Automating configuration Translating By FelixYFZ
-======
-
-
-Ansible is an amazing automation and configuration management tool. It is mainly used for servers and cloud deployments, and it gets far less attention for its use in workstations, both desktops and laptops, which is the focus of this series.
-
-In the [first part][1] of this series, I showed you basic usage of the `ansible-pull` command, and we created a playbook that installs a handful of packages. That wasn't extremely useful by itself, but it set the stage for further automation.
-
-In this article, everything comes together full circle, and by the end we will have a fully working solution for automating workstation configuration. This time, we'll set up our Ansible configuration such that future changes we make will automatically be applied to our workstations. At this point, I'm assuming you already worked through part one. If you haven't, feel free to do that now and then return to this article when you're done. You should already have a GitHub repository with the code from the first article inside it. We're going to build directly on what we did before.
-
-First, we need to do some reorganization because we're going to do more than just install packages. At this point, we currently have a playbook named `local.yml` with the following content:
-```
-- hosts: localhost
-
- become: true
-
- tasks:
-
- - name: Install packages
-
- apt: name={{item}}
-
- with_items:
-
- - htop
-
- - mc
-
- - tmux
-
-```
-
-That's all well and good if we only want to perform one task. As we add new things to our configuration, this file will become quite large and get very cluttered. It's better to organize our plays into individual files with each responsible for a different type of configuration. To achieve this, create what's called a taskbook, which is very much like a playbook but the contents are more streamlined. Let's create a directory for our taskbooks inside our Git repository:
-```
-mkdir tasks
-
-```
-
-The code inside our current `local.yml` playbook lends itself well to become a taskbook for installing packages. Let's move this file into the `tasks` directory we just created with a new name:
-```
-mv local.yml tasks/packages.yml
-
-```
-
-Now, we can edit our `packages.yml` taskbook and strip it down quite a bit. In fact, we can strip everything except for the individual task itself. Let's make `packages.yml` look like this:
-```
-- name: Install packages
-
- apt: name={{item}}
-
- with_items:
-
- - htop
-
- - mc
-
- - tmux
-
-```
-
-As you can see, it uses the same syntax, but we stripped out everything that isn't necessary to the task it's performing. Now we have a dedicated taskbook for installing packages. However, we still need a file named `local.yml`, since `ansible-pull` still expects to find a file with that name. So we'll create a fresh one with this content in the root of our repository (not in the `tasks` directory):
-```
-- hosts: localhost
-
- become: true
-
- pre_tasks:
-
- - name: update repositories
-
- apt: update_cache=yes
-
- changed_when: False
-
-
-
- tasks:
-
- - include: tasks/packages.yml
-
-```
-
-This new `local.yml` acts as an index that will import all our taskbooks. I've added a few new things to this file that you haven't seen yet in this series. First, at the beginning of the file, I added `pre_tasks`, which allows us to have Ansible perform a task before all the other tasks run. In this case, we're telling Ansible to update our distribution's repository index. This line does that for us:
-```
-apt: update_cache=yes
-
-```
-
-Normally the `apt` module allows us to install packages, but we can also tell it to update our repository index. The idea is that we want all our individual plays to work with a fresh index each time Ansible runs. This will help ensure we don't have an issue with a stale index while attempting to install a package. Note that the `apt` module works only with Debian, Ubuntu, and their derivatives. If you're running a different distribution, you'll want to use a module specific to your distribution rather than `apt`. See the documentation for Ansible if you need to use a different module.
-
-The following line is also worth further explanation:
-```
-changed_when: False
-
-```
-
-This line on an individual task stops Ansible from reporting the results of the play as changed even when it results in a change in the system. In this case, we don't care if the repository index contains new data; it almost always will, since repositories are always changing. We don't care about changes to `apt` repositories, as index changes are par for the course. If we omit this line, we'll see the summary at the end of the process report that something has changed, even if it was merely about the repository being updated. It's better to ignore these types of changes.
-
-Next is our normal tasks section, and we import the taskbook we created. Each time we add another taskbook, we add another line here:
-```
-tasks:
-
- - include: tasks/packages.yml
-
-```
-
-If you were to run the `ansible-pull` command here, it should essentially do the same thing as it did in the last article. The difference is that we have improved our organization and we can more efficiently expand on it. The `ansible-pull` command syntax, to save you from finding the previous article, is this:
-```
-sudo ansible-pull -U https://github.com//ansible.git
-
-```
-
-If you recall, the `ansible-pull` command pulls down a Git repository and applies the configuration it contains.
-
-Now that our foundation is in place, we can expand upon our Ansible config and add features. Specifically, we'll add configuration to automate the deployment of future changes to our workstations. To support this goal, the first thing we should do is to create a user specifically to apply our Ansible configuration. This isn't required—we can continue to run our Ansible configuration under our own user. But using a separate user segregates this to a system process that will run in the background, without our involvement.
-
-We could create this user with the normal method, but since we're using Ansible, we should shy away from manual changes. Instead, we'll create a taskbook to handle user creation. This taskbook will create just one user for now, but you can always add additional plays to this taskbook to add additional users. I'll call this user `ansible`, but you can name it something else if you wish (if you do, make sure to update all occurrences). Let's create a taskbook named `users.yml` and place this code inside of it:
-```
-- name: create ansible user
-
- user: name=ansible uid=900
-
-```
-
-Next, we need to edit our `local.yml` file and append this new taskbook to the file, so it will look like this:
-```
-- hosts: localhost
-
- become: true
-
- pre_tasks:
-
- - name: update repositories
-
- apt: update_cache=yes
-
- changed_when: False
-
-
-
- tasks:
-
- - include: tasks/users.yml
-
- - include: tasks/packages.yml
-
-```
-
-Now when we run our `ansible-pull` command, a user named `ansible` will be created on the system. Note that I specifically declared `User ID 900` for this user by using the `UID` option. This isn't required, but it's recommended. The reason is that UIDs under 1,000 are typically not shown on the login screen, which is great because there's no reason we would need to log into a desktop session as our `ansible` user. UID 900 is arbitrary; it should be any number under 1,000 that's not already in use. You can find out if UID 900 is in use on your system with the following command:
-```
-cat /etc/passwd |grep 900
-
-```
-
-However, you shouldn't run into a problem with this UID because I've never seen it used by default in any distribution I've used so far.
-
-Now, we have an `ansible` user that will later be used to apply our Ansible configuration automatically. Next, we can create the actual cron job that will be used to automate this. Rather than place this in the `users.yml` taskbook we just created, we should separate this into its own file. Create a taskbook named `cron.yml` in the tasks directory and place the following code inside:
-```
-- name: install cron job (ansible-pull)
-
- cron: user="ansible" name="ansible provision" minute="*/10" job="/usr/bin/ansible-pull -o -U https://github.com//ansible.git > /dev/null"
-
-```
-
-The syntax for the cron module should be fairly self-explanatory. With this play, we're creating a cron job to be run as the `ansible` user. The job will execute every 10 minutes, and the command it will execute is this:
-```
-/usr/bin/ansible-pull -o -U https://github.com//ansible.git > /dev/null
-
-```
-
-Also, we can put additional cron jobs we want all our workstations to have into this one file. We just need to add additional plays to add new cron jobs. However, simply adding a new taskbook for cron isn't enough—we'll also need to add it to our `local.yml` file so it will be called. Place the following line with the other includes:
-```
-- include: tasks/cron.yml
-
-```
-
-Now when `ansible-pull` is run, it will set up a new cron job that will be run as the `ansible` user every 10 minutes. But, having an Ansible job running every 10 minutes isn't ideal because it will take considerable CPU power. It really doesn't make sense for Ansible to run every 10 minutes unless we've changed something in the Git repository.
-
-However, we've already solved this problem. Notice the `-o` option I added to the `ansible-pull` command in the cron job that we've never used before. This option tells Ansible to run only if the repository has changed since the last time `ansible-pull` was called. If the repository hasn't changed, it won't do anything. This way, you're not wasting valuable CPU for no reason. Sure, some CPU will be used when it pulls down the repository, but not nearly as much as it would use if it were applying your entire configuration all over again. When `ansible-pull` does run, it will go through all the tasks in the Playbook and taskbooks, but at least it won't run for no purpose.
-
-Although we've added all the required components to automate `ansible-pull`, it actually won't work properly yet. The `ansible-pull` command will run with `sudo`, which would give it access to perform system-level commands. However, our `ansible` user is not set up to perform tasks as `sudo`. Therefore, when the cron job triggers, it will fail. Normally we could just use `visudo` and manually set the `ansible` user up to have this access. However, we should do things the Ansible way from now on, and this is a great opportunity to show you how the `copy` module works. The `copy` module allows you to copy a file from your Ansible repository to somewhere else in the filesystem. In our case, we'll copy a config file for `sudo` to `/etc/sudoers.d/` so that the `ansible` user can perform administrative tasks.
-
-Open up the `users.yml` taskbook, and add the following play to the bottom:
-```
-- name: copy sudoers_ansible
-
- copy: src=files/sudoers_ansible dest=/etc/sudoers.d/ansible owner=root group=root mode=0440
-
-```
-
-The `copy` module, as we can see, copies a file from our repository to somewhere else. In this case, we're grabbing a file named `sudoers_ansible` (which we will create shortly) and copying it to `/etc/sudoers.d/ansible` with `root` as the owner.
-
-Next, we need to create the file that we'll be copying. In the root of your Ansible repository, create a `files` directory:
-```
-mkdir files
-
-```
-
-Then, in the `files` directory we just created, create the `sudoers_ansible` file with the following content:
-```
-ansible ALL=(ALL) NOPASSWD: ALL
-
-```
-
-Creating a file in `/etc/sudoers.d`, like we're doing here, allows us to configure `sudo` for a specific user. Here we're allowing the `ansible` user full access to the system via `sudo` without a password prompt. This will allow `ansible-pull` to run as a background task without us needing to run it manually.
-
-Now, you can run `ansible-pull` again to pull down the latest changes:
-```
-sudo ansible-pull -U https://github.com//ansible.git
-
-```
-
-From this point forward, the cron job for `ansible-pull` will run every 10 minutes in the background and check your repository for changes. If it finds changes, it will run your playbook and apply your taskbooks.
-
-So now we have a fully working solution. When you first set up a new laptop or desktop, you'll run the `ansible-pull` command manually, but only the first time. From that point forward, the `ansible` user will take care of subsequent runs in the background. When you want to make a change to your workstation machines, you simply pull down your Git repository, make the changes, then push those changes back to the repository. Then, the next time the cron job fires on each machine, it will pull down those changes and apply them. You now only have to make changes once, and all your workstations will follow suit. This method may be a bit unconventional though. Normally, you'd have an `inventory` file with your machines listed and several roles each machine could be a member of. However, the `ansible-pull` method, as described in this article, is a very efficient way of managing workstation configuration.
-
-I have updated the code in my [GitHub repository][2] for this article, so feel free to browse the code there and check your syntax against mine. Also, I moved the code from the previous article into its own directory in that repository.
-
-In part 3, we'll close out the series by using Ansible to configure GNOME desktop settings. I'll show you how to set your wallpaper and lock screen, apply a desktop theme, and more.
-
-In the meantime, it's time for a little homework assignment. Most of us have configuration files we like to maintain for various applications we use. This could be configuration files for Bash, Vim, or whatever tools you use. I challenge you now to automate copying these configuration files to your machines via the Ansible repository we've been working on. In this article, I've shown you how to copy a file, so take a look at that and see if you can apply that knowledge to your personal files.
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/3/manage-your-workstation-configuration-ansible-part-2
-
-作者:[Jay LaCroix][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://opensource.com/users/jlacroix
-[1]:https://opensource.com/article/18/3/manage-workstation-ansible
-[2]:https://github.com/jlacroix82/ansible_article.git
From c0bada92bf30c06e21403792e0555e0c94366243 Mon Sep 17 00:00:00 2001
From: FelixYFZ <33593534+FelixYFZ@users.noreply.github.com>
Date: Mon, 10 Dec 2018 20:43:07 +0800
Subject: [PATCH 028/119] Create 20180326 Manage your workstation with Ansible-
Automating configuration.md
Translation Finished
---
... with Ansible- Automating configuration.md | 231 ++++++++++++++++++
1 file changed, 231 insertions(+)
create mode 100644 translated/tech/20180326 Manage your workstation with Ansible- Automating configuration.md
diff --git a/translated/tech/20180326 Manage your workstation with Ansible- Automating configuration.md b/translated/tech/20180326 Manage your workstation with Ansible- Automating configuration.md
new file mode 100644
index 0000000000..c464f4ea32
--- /dev/null
+++ b/translated/tech/20180326 Manage your workstation with Ansible- Automating configuration.md
@@ -0,0 +1,231 @@
+使用Ansible来管理你的工作站:配置自动化
+======
+
+
+
+Ansible是一个令人惊讶的自动化的配置管理工具。主要应用在服务器和云部署上,但在工作站上的应用(无论是台式机还是笔记本)却得到了很少的关注,这就是本系列所要关注的。
+
+在这个系列的第一部分,我会向你展示'ansible-pull'命令的基本用法,我们创建了一个安装了少量包的palybook.它本身是没有多大的用处的,但是它为后续的自动化做了准备。
+
+在这篇文章中,所有的事件操作都是闭环的,而且在最后部分,我们将会有一个针对工作站自动配置的完整的工作解决方案。现在,我们将要设置Ansible的配置,这样未来将要做的改变将会自动的部署应用到我们的工作站上。现阶段,假设你已经完成了第一部分的工作。如果没有的话,当你完成的时候回到本文。你应该已经有一个包含第一篇文章中代码的Github库。我们将直接按照之前的方式创建。
+
+首先,因为我们要做的不仅仅是安装包文件,所以我们要做一些重新的组织工作。现在,我们已经有一个名为'local.yml'并包含以下内容的playbook:
+```
+- hosts: localhost
+
+ become: true
+
+ tasks:
+
+ - name: Install packages
+
+ apt: name={{item}}
+
+ with_items:
+
+ - htop
+
+ - mc
+
+ - tmux
+
+```
+
+如果我们仅仅想实现一个任务那么上面的配置就足够了。随着向我们的配置中不断的添加内容,这个文件将会变的相当的庞大和杂乱。最好能够根据不同类型的配置将play文件分为独立的文件。为了达到这个要求,创建一个名为taskbook的文件,它和playbook很像但内容更加的流线型。让我们在Git库中为taskbook创建一个目录。
+```
+mkdir tasks
+
+```
+
+在'local.yml'playbook中的代码使它很好过过渡到成为安装包文件的taskbook.让我们把这个文件移动到刚刚创建好并新命名的目录中。
+
+```
+mv local.yml tasks/packages.yml
+
+```
+现在,我们编辑'packages.yml'文件将它进行大幅的瘦身,事实上,我们可以精简除了独立任务本身之外的所有内容。让我们把'packages.yml'编辑成如下的形式:
+```
+- name: Install packages
+
+ apt: name={{item}}
+
+ with_items:
+
+ - htop
+
+ - mc
+
+ - tmux
+
+```
+
+正如你所看到的,它使用同样的语法,但我们去掉了对这个任务无用没有必要的所有内容。现在我们有了一个专门安装包文件的taskbook.然而我们仍然需要一个名为'local.yml'的文件,因为执行'ansible-pull'命令时仍然会去发现这个文件。所以我们将在我们库的根目录下(不是在'task'目录下)创建一个包含这些内容的全新文件:
+```
+- hosts: localhost
+
+ become: true
+
+ pre_tasks:
+
+ - name: update repositories
+
+ apt: update_cache=yes
+
+ changed_when: False
+
+
+
+ tasks:
+
+ - include: tasks/packages.yml
+
+```
+
+这个新的'local.yml'扮演的是将要导入我们的taksbooks的主页的角色。我已经在这个文件中添加了一些你在这个系列中看不到的内容。首先,在这个文件的开头处,我添加了'pre——tasks',这个任务的作用是在其他所有任务运行之前先运行某个任务。在这种情况下,我们给Ansible的命令是让它去更新我们的分布存储库主页,下面的配置将执行这个任务要求:
+
+```
+apt: update_cache=yes
+
+```
+通常'apt'模块是用来安装包文件的,但我们也能够让它来更新库索引。这样做的目的是让我们的每个play在Ansible运行的时候能够以最新的索引工作。这将确保我们在使用一个老旧的索引安装一个包的时候不会出现问题。因为'apt'模块仅仅在Debian,Ubuntu和他们的衍生环境下工作。如果你运行的一个不同的环境,你期望在你的环境中使用一个特殊的模块而不是'apt'。如果你需要使用一个不同的模块请查看Ansible的相关文档。
+
+下面这行值得以后解释:
+```
+changed_when: False
+
+```
+在独立任务中的这行阻止了Ansible去报告play改变的结果即使是它本身在系统中导致的一个改变。在这中情况下,我们不会去在意库索引是否包含新的数据;它几乎总是会的,因为库总是在改变的。我们不会去在意'apt'库的改变,因为索引的改变是正常的过程。如果我们删除这行,我们将在过程保告的后面看到所有的变动,即使仅仅库的更新而已。最好能够去忽略这类的改变。
+
+接下来是常规任务的阶段,我们将创建好的taskbook导入。我们每次添加另一个taskbook的时候,要添加下面这一行:
+```
+tasks:
+
+ - include: tasks/packages.yml
+
+```
+
+如果你将要运行'ansible-pull'命令,他应该向上一篇文章中的那样做同样重要的事情。 不同的是我们已经提高了我们的组织并且能够更有效的扩展它。'ansible-pull'命令的语法,为了节省你到上一篇文章中去寻找,参考如下:
+```
+sudo ansible-pull -U https://github.com//ansible.git
+
+```
+如果你还记得话,'ansible-pull'的命令拉取一个Git库并且应用了它所包含的配置。
+
+既然我们的基础已经搭建好,我们现在可以扩展我们的Ansible并且添加功能。更特别的是,我们将添加配置来自动化的部署对工作站要做的改变。为了支撑这个要求,首先我们要创建一个特殊的账户来应用我们的Ansible配置。这个不是必要的,我们仍然能够在我们自己的用户下运行Ansible配置。但是使用一个隔离的用户能够将其隔离到不需要我们参与的在后台运行的一个系统进程中,
+
+我们可以使用常规的方式来创建这个用户,但是既然我们正在使用Ansible,我们应该尽量避开使用手动的改变。替代的是,我们将会创建一个taskbook来处理用户的创建任务。这个taskbook目前将会仅仅创建一个用户,但你可以在这个taskbook中添加额外的plays来创建更多的用户。我将这个用户命名为'ansible',你可以按照自己的想法来命名(如果你做了这个改变要确保更新所有的变动)。让我们来创建一个名为'user.yml'的taskbook并且将以下代码写进去:
+
+```
+- name: create ansible user
+
+ user: name=ansible uid=900
+
+```
+下一步,我们需要编辑'local.yml'文件,将这个新的taskbook添加进去,像如下这样写:
+
+```
+- hosts: localhost
+
+ become: true
+
+ pre_tasks:
+
+ - name: update repositories
+
+ apt: update_cache=yes
+
+ changed_when: False
+
+
+
+ tasks:
+
+ - include: tasks/users.yml
+
+ - include: tasks/packages.yml
+
+```
+现在当我们运行'ansible-pull'命令的时候,一个名为'ansible'的用户将会在系统中被创建。注意我特地通过参数'UID'为这个用户声明了用户ID为900。这个不是必须的,但建议直接创建好UID。因为在1000以下的UID在登陆界面是不会显示的,这样是很棒的因为我们根本没有需要去使用'ansibe'账户来登陆我们的桌面。UID 900是固定的;它应该是在1000以下没有被使用的任何一个数值。你可以使用以下命令在系统中去验证UID 900是否已经被使用了:
+
+```
+cat /etc/passwd |grep 900
+
+```
+然而,你使用这个UID应该不会遇到什么问题,因为迄今为止在我使用的任何发行版中我还没遇到过它是被默认使用的。
+
+现在,我们已经拥有了一个名为'ansible'的账户,它将会在之后的自动化配置中使用。接下来,我们可以创建实际的定时作业来自动操作它。而不是将其放置到我们刚刚创建的'users.yml'文件中,我们应该将其分开放到它自己的文件中。在任务目录中创建一个名为'cron.yml'的taskbook并且将以下的代买写进去:
+```
+- name: install cron job (ansible-pull)
+
+ cron: user="ansible" name="ansible provision" minute="*/10" job="/usr/bin/ansible-pull -o -U https://github.com//ansible.git > /dev/null"
+
+```
+定时模块的语法几乎是不需加以说明的。通过这个play,我们创建了一个通过用户'ansible'运行的定时作业。这个作业将每隔10分钟执行一次,下面是它将要执行的命令:
+
+```
+/usr/bin/ansible-pull -o -U https://github.com//ansible.git > /dev/null
+
+```
+同样,我们也可以添加想要我们的所有工作站部署的额外定时作业到这个文件中。我们只需要在新的定时作业中添加额外的palys即可。然而,仅仅是添加一个定时的taskbook是不够的,我们还需要将它添加到'local.yml'文件中以便它能够被调用。将下面的一行添加到末尾:
+```
+- include: tasks/cron.yml
+
+```
+现在当'ansible-pull'命令执行的时候,它将会以通过用户'ansible'每个十分钟设置一个新的定时作业。但是,每个十分钟运行一个Ansible作业并不是一个好的方式因为这个将消耗很多的CPU资源。每隔十分钟来运行对于Ansible来说是毫无意义的除非欧文已经在Git库中改变一些东西。
+
+然而,我们已经解决了这个问题。注意到我在定时作业中的命令'ansible-pill'添加的我们之前从未用到过的参数'-o'.这个参数告诉Ansible只有在从上次'ansible-pull'被调用以后库有了变化后才会运行。如果库没有任何变化,他将不会做任何事情。通过这个方法,你将不会无端的浪费CPU资源。当然,一些CPU资源将会在下来存储库的时候被使用,但不会像再一次应用整个配置的时候使用的那么多。当'ansible-pull'执行的时候,它将会遍历在playbooks和taskbooks中的所有任务,但至少它不会毫无目的的运行。
+
+尽管我们已经添加了所有必须的配置要素来自动化'ansible-pull',它任然还不能正常的工作。'ansible-pull'命令需要sudo的权限来运行,这将允许它执行系统级的命令。然而我们创建的用户'ansible'并没有被设置为以'sudo'的权限来执行命令,因此当定时作业触发的时候,执行将会失败。通常沃恩可以使用命令'visudo'来手动的去设置用户'ansible'的拥有这个权限。然而我们现在应该以Ansible的方式来操作,而且这将会是一个向你展示'copy'模块是如何工作的机会。'copy'模块允许你从库复制一个文件到文件系统的任何位置。在这个案列中,我们将会复制'sudo'的一个配置文件到'/etc/sudoers.d/'以便用户'ansible'能够以管理员的权限执行任务。
+
+打开'users.yml',将下面的play添加到文件末尾。
+
+```
+- name: copy sudoers_ansible
+
+ copy: src=files/sudoers_ansible dest=/etc/sudoers.d/ansible owner=root group=root mode=0440
+
+```
+'copy'模块,正如我们看到的,从库复制一个文件到其他任何位置。在这个过程中,我们正在抓取一个名为'sudoers_ansible'(我们将在后续创建)的文件并将它复制到拥有者为'root'的'/etc/sudoers/ansible'中。
+
+接下来,我们需要创建我们将要复制的文件。在你的库的根目录下,创建一个名为'files'的目录:
+
+```
+mkdir files
+
+```
+然后,在我们刚刚创建的'files'目录里,创建包含以下内容的名为'sudoers_ansible'的文件:
+```
+ansible ALL=(ALL) NOPASSWD: ALL
+
+```
+在'/etc/sudoer.d'目录里创建一个文件,就像我们正在这样做的,允许我们为一个特殊的用户配置'sudo'权限。现在我们正在通过'sudo'允许用户'ansible'不需要密码拥有完全控制权限。这将允许'ansible-pull'以后台任务的形式运行而不需要手动去运行。
+
+现在,你可以通过再次运行'ansible-pull'来拉取最新的变动:
+```
+sudo ansible-pull -U https://github.com//ansible.git
+
+```
+从这个节点开始,'ansible-pull'的定时作业将会在后台每隔十分钟运行一次来检查你的库是否有变化,如果它发现有变化,将会运行你的palybook并且应用你的taskbooks.
+
+所以现在我们有了一个完整的工作方案。当你第一次设置一台新的笔记本或者台式机的时候,你要去手动的运行'ansible-pull'命令,但仅仅是在第一次的时候。从第一次之后,用户'ansible'将会在后台接手后续的运行任务。当你想对你的机器做变动的时候,你只需要简单的去拉取你的Git库来做变动,然后将这些变化回传到库中。接着,当定时作业下次在每台机器上运行的时候,它将会拉取变动的部分并应用它们。你现在只需要做一次变动,你的所有工作站将会跟着一起变动。这方法尽管有一点不方便,通常,你会有一个你的机器列表的文件和包含不同机器的规则。不管怎样,'ansible-pull'的方法,就像在文章中描述的,是管理工作站配置的非常有效的方法。
+
+我已经在我的[Github repository]中更新了这篇文章中的代码,所以你可以随时去浏览来再一次检查你的语法。同时我将前一篇文章中的代码移到了它自己的目录中。
+
+在第三部分,我们将通过介绍使用Ansible来配置GNOME桌面设置来结束这个系列。我将会告诉你如何设置你的墙纸和锁屏壁纸,应用一个桌面主题以及更多的东西。
+
+同时,到了布置一些作业的时候了,大多数人有我们使用的各种应用的配置文件。可能是Bash,Vim或者其他你使用的工具的配置文件。现在你可以尝试通过我们在使用的Ansible库来自动复制这些配置到你的机器中。在这篇文章中,我已将想你展示了如何去复制文件,所以去尝试以下看看你是都已经能应用这些知识。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/3/manage-your-workstation-configuration-ansible-part-2
+
+作者:[Jay LaCroix][a]
+译者:[FelixYFZ](https://github.com/FelixYFZ)
+校对:[校对者ID](https://github.com/校对者ID)
+选题:[lujun9972](https://github.com/lujun9972)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://opensource.com/users/jlacroix
+[1]:https://opensource.com/article/18/3/manage-workstation-ansible
+[2]:https://github.com/jlacroix82/ansible_article.git
From 2c95b138ce3078ed548501de7504afaccb90fcc5 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 20:44:00 +0800
Subject: [PATCH 029/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Manage=20NTP=20wi?=
=?UTF-8?q?th=20Chrony?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../tech/20181003 Manage NTP with Chrony.md | 291 ++++++++++++++++++
1 file changed, 291 insertions(+)
create mode 100644 sources/tech/20181003 Manage NTP with Chrony.md
diff --git a/sources/tech/20181003 Manage NTP with Chrony.md b/sources/tech/20181003 Manage NTP with Chrony.md
new file mode 100644
index 0000000000..aaec88da26
--- /dev/null
+++ b/sources/tech/20181003 Manage NTP with Chrony.md
@@ -0,0 +1,291 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Manage NTP with Chrony)
+[#]: via: (https://opensource.com/article/18/12/manage-ntp-chrony)
+[#]: author: (David Both https://opensource.com/users/dboth)
+
+Manage NTP with Chrony
+======
+Chronyd is a better choice for most networks than ntpd for keeping computers synchronized with the Network Time Protocol.
+
+
+> "Does anybody really know what time it is? Does anybody really care?"
+> – [Chicago][1], 1969
+
+Perhaps that rock group didn't care what time it was, but our computers do need to know the exact time. Timekeeping is very important to computer networks. In banking, stock markets, and other financial businesses, transactions must be maintained in the proper order, and exact time sequences are critical for that. For sysadmins and DevOps professionals, it's easier to follow the trail of email through a series of servers or to determine the exact sequence of events using log files on geographically dispersed hosts when exact times are kept on the computers in question.
+
+I used to work at an organization that received over 20 million emails per day and had four servers just to accept and do a basic filter on the incoming flood of email. From there, emails were sent to one of four other servers to perform more complex anti-spam assessments, then they were delivered to one of several additional servers where the emails were placed in the correct inboxes. At each layer, the emails would be sent to one of the next-level servers, selected only by the randomness of round-robin DNS. Sometimes we had to trace a new message through the system until we could determine where it "got lost," according to the pointy-haired bosses. We had to do this with frightening regularity.
+
+Most of that email turned out to be spam. Some people actually complained that their [joke, cat pic, recipe, inspirational saying, or other-strange-email]-of-the-day was missing and asked us to find it. We did reject those opportunities.
+
+Our email and other transactional searches were aided by log entries with timestamps that—today—can resolve down to the nanosecond in even the slowest of modern Linux computers. In very high-volume transaction environments, even a few microseconds of difference in the system clocks can mean sorting thousands of transactions to find the correct one(s).
+
+### The NTP server hierarchy
+
+Computers worldwide use the [Network Time Protocol][2] (NTP) to synchronize their times with internet standard reference clocks via a hierarchy of NTP servers. The primary servers are at stratum 1, and they are connected directly to various national time services at stratum 0 via satellite, radio, or even modems over phone lines. The time service at stratum 0 may be an atomic clock, a radio receiver tuned to the signals broadcast by an atomic clock, or a GPS receiver using the highly accurate clock signals broadcast by GPS satellites.
+
+To prevent time requests from time servers lower in the hierarchy (i.e., with a higher stratum number) from overwhelming the primary reference servers, there are several thousand public NTP stratum 2 servers that are open and available for anyone to use. Many organizations with large numbers of hosts that need an NTP server will set up their own time servers so that only one local host accesses the stratum 2 time servers, then they configure the remaining network hosts to use the local time server which, in my case, is a stratum 3 server.
+
+### NTP choices
+
+The original NTP daemon, **ntpd** , has been joined by a newer one, **chronyd**. Both keep the local host's time synchronized with the time server. Both services are available, and I have seen nothing to indicate that this will change anytime soon.
+
+Chrony has features that make it the better choice for most environments for the following reasons:
+
+ * Chrony can synchronize to the time server much faster than NTP. This is good for laptops or desktops that don't run constantly.
+
+ * It can compensate for fluctuating clock frequencies, such as when a host hibernates or enters sleep mode, or when the clock speed varies due to frequency stepping that slows clock speeds when loads are low.
+
+ * It handles intermittent network connections and bandwidth saturation.
+
+ * It adjusts for network delays and latency.
+
+ * After the initial time sync, Chrony never steps the clock. This ensures stable and consistent time intervals for system services and applications.
+
+ * Chrony can work even without a network connection. In this case, the local host or server can be updated manually.
+
+
+
+
+The NTP and Chrony RPM packages are available from standard Fedora repositories. You can install both and switch between them, but modern Fedora, CentOS, and RHEL releases have moved from NTP to Chrony as their default time-keeping implementation. I have found that Chrony works well, provides a better interface for the sysadmin, presents much more information, and increases control.
+
+Just to make it clear, NTP is a protocol that is implemented with either NTP or Chrony. If you'd like to know more, read this [comparison between NTP and Chrony][3] as implementations of the NTP protocol.
+
+This article explains how to configure Chrony clients and servers on a Fedora host, but the configuration for CentOS and RHEL current releases works the same.
+
+### Chrony structure
+
+The Chrony daemon, **chronyd** , runs in the background and monitors the time and status of the time server specified in the **chrony.conf** file. If the local time needs to be adjusted, **chronyd** does it smoothly without the programmatic trauma that would occur if the clock were instantly reset to a new time.
+
+Chrony's **chronyc** tool allows someone to monitor the current status of Chrony and make changes if necessary. The **chronyc** utility can be used as a command that accepts subcommands, or it can be used as an interactive text-mode program. This article will explain both uses.
+
+### Client configuration
+
+The NTP client configuration is simple and requires little or no intervention. The NTP server can be defined during the Linux installation or provided by the DHCP server at boot time. The default **/etc/chrony.conf** file (shown below in its entirety) requires no intervention to work properly as a client. For Fedora, Chrony uses the Fedora NTP pool, and CentOS and RHEL have their own NTP server pools. Like many Red Hat-based distributions, the configuration file is well commented.
+
+```
+# Use public servers from the pool.ntp.org project.
+# Please consider joining the pool (http://www.pool.ntp.org/join.html).
+pool 2.fedora.pool.ntp.org iburst
+
+# Record the rate at which the system clock gains/losses time.
+driftfile /var/lib/chrony/drift
+
+# Allow the system clock to be stepped in the first three updates
+# if its offset is larger than 1 second.
+makestep 1.0 3
+
+# Enable kernel synchronization of the real-time clock (RTC).
+
+
+# Enable hardware timestamping on all interfaces that support it.
+#hwtimestamp *
+
+# Increase the minimum number of selectable sources required to adjust
+# the system clock.
+#minsources 2
+
+# Allow NTP client access from local network.
+#allow 192.168.0.0/16
+
+# Serve time even if not synchronized to a time source.
+#local stratum 10
+
+# Specify file containing keys for NTP authentication.
+keyfile /etc/chrony.keys
+
+# Get TAI-UTC offset and leap seconds from the system tz database.
+leapsectz right/UTC
+
+# Specify directory for log files.
+logdir /var/log/chrony
+
+# Select which information is logged.
+#log measurements statistics tracking
+```
+
+Let's look at the current status of NTP on a virtual machine I use for testing. The **chronyc** command, when used with the **tracking** subcommand, provides statistics that report how far off the local system is from the reference server.
+
+```
+[root@studentvm1 ~]# chronyc tracking
+Reference ID : 23ABED4D (ec2-35-171-237-77.compute-1.amazonaws.com)
+Stratum : 3
+Ref time (UTC) : Fri Nov 16 16:21:30 2018
+System time : 0.000645622 seconds slow of NTP time
+Last offset : -0.000308577 seconds
+RMS offset : 0.000786140 seconds
+Frequency : 0.147 ppm slow
+Residual freq : -0.073 ppm
+Skew : 0.062 ppm
+Root delay : 0.041452706 seconds
+Root dispersion : 0.022665167 seconds
+Update interval : 1044.2 seconds
+Leap status : Normal
+[root@studentvm1 ~]#
+```
+
+The Reference ID in the first line of the result is the server the host is synchronized to—in this case, a stratum 3 reference server that was last contacted by the host at 16:21:30 2018. The other lines are described in the [chronyc(1) man page][4].
+
+The **sources** subcommand is also useful because it provides information about the time source configured in **chrony.conf**.
+
+```
+[root@studentvm1 ~]# chronyc sources
+210 Number of sources = 5
+MS Name/IP address Stratum Poll Reach LastRx Last sample
+===============================================================================
+^+ 192.168.0.51 3 6 377 0 -2613us[-2613us] +/- 63ms
+^+ dev.smatwebdesign.com 3 10 377 28m -2961us[-3534us] +/- 113ms
+^+ propjet.latt.net 2 10 377 465 -1097us[-1085us] +/- 77ms
+^* ec2-35-171-237-77.comput> 2 10 377 83 +2388us[+2395us] +/- 95ms
+^+ PBX.cytranet.net 3 10 377 507 -1602us[-1589us] +/- 96ms
+[root@studentvm1 ~]#
+```
+
+The first source in the list is the time server I set up for my personal network. The others were provided by the pool. Even though my NTP server doesn't appear in the Chrony configuration file above, my DHCP server provides its IP address for the NTP server. The "S" column—Source State—indicates with an asterisk ( ***** ) the server our host is synced to. This is consistent with the data from the **tracking** subcommand.
+
+The **-v** option provides a nice description of the fields in this output.
+
+```
+[root@studentvm1 ~]# chronyc sources -v
+210 Number of sources = 5
+
+ .-- Source mode '^' = server, '=' = peer, '#' = local clock.
+ / .- Source state '*' = current synced, '+' = combined , '-' = not combined,
+| / '?' = unreachable, 'x' = time may be in error, '~' = time too variable.
+|| .- xxxx [ yyyy ] +/- zzzz
+|| Reachability register (octal) -. | xxxx = adjusted offset,
+|| Log2(Polling interval) --. | | yyyy = measured offset,
+|| \ | | zzzz = estimated error.
+|| | | \
+MS Name/IP address Stratum Poll Reach LastRx Last sample
+===============================================================================
+^+ 192.168.0.51 3 7 377 28 -2156us[-2156us] +/- 63ms
+^+ triton.ellipse.net 2 10 377 24 +5716us[+5716us] +/- 62ms
+^+ lithium.constant.com 2 10 377 351 -820us[ -820us] +/- 64ms
+^* t2.time.bf1.yahoo.com 2 10 377 453 -992us[ -965us] +/- 46ms
+^- ntp.idealab.com 2 10 377 799 +3653us[+3674us] +/- 87ms
+[root@studentvm1 ~]#
+```
+
+If I wanted my server to be the preferred reference time source for this host, I would add the line below to the **/etc/chrony.conf** file.
+
+```
+server 192.168.0.51 iburst prefer
+```
+
+I usually place this line just above the first pool server statement near the top of the file. There is no special reason for this, except I like to keep the server statements together. It would work just as well at the bottom of the file, and I have done that on several hosts. This configuration file is not sequence-sensitive.
+
+The **prefer** option marks this as the preferred reference source. As such, this host will always be synchronized with this reference source (as long as it is available). We can also use the fully qualified hostname for a remote reference server or the hostname only (without the domain name) for a local reference time source as long as the search statement is set in the **/etc/resolv.conf** file. I prefer the IP address to ensure that the time source is accessible even if DNS is not working. In most environments, the server name is probably the better option, because NTP will continue to work even if the server's IP address changes.
+
+If you don't have a specific reference source you want to synchronize to, it is fine to use the defaults.
+
+### Configuring an NTP server with Chrony
+
+The nice thing about the Chrony configuration file is that this single file configures the host as both a client and a server. To add a server function to our host—it will always be a client, obtaining its time from a reference server—we just need to make a couple of changes to the Chrony configuration, then configure the host's firewall to accept NTP requests.
+
+Open the **/etc/ ** **chrony****.conf** file in your favorite text editor and uncomment the **local stratum 10** line. This enables the Chrony NTP server to continue to act as if it were connected to a remote reference server if the internet connection fails; this enables the host to continue to be an NTP server to other hosts on the local network.
+
+Let's restart **chronyd** and track how the service is working for a few minutes. Before we enable our host as an NTP server, we want to test a bit.
+
+```
+[root@studentvm1 ~]# systemctl restart chronyd ; watch chronyc tracking
+```
+
+The results should look like this. The **watch** command runs the **chronyc tracking** command every two seconds so we can watch changes occur over time.
+
+```
+Every 2.0s: chronyc tracking studentvm1: Fri Nov 16 20:59:31 2018
+
+Reference ID : C0A80033 (192.168.0.51)
+Stratum : 4
+Ref time (UTC) : Sat Nov 17 01:58:51 2018
+System time : 0.001598277 seconds fast of NTP time
+Last offset : +0.001791533 seconds
+RMS offset : 0.001791533 seconds
+Frequency : 0.546 ppm slow
+Residual freq : -0.175 ppm
+Skew : 0.168 ppm
+Root delay : 0.094823152 seconds
+Root dispersion : 0.021242738 seconds
+Update interval : 65.0 seconds
+Leap status : Normal
+```
+
+Notice that my NTP server, the **studentvm1** host, synchronizes to the host at 192.168.0.51, which is my internal network NTP server, at stratum 4. Synchronizing directly to the Fedora pool machines would result in synchronization at stratum 3. Notice also that the amount of error decreases over time. Eventually, it should stabilize with a tiny variation around a fairly small range of error. The size of the error depends upon the stratum and other network factors. After a few minutes, use Ctrl+C to break out of the watch loop.
+
+To turn our host into an NTP server, we need to allow it to listen on the local network. Uncomment the following line to allow hosts on the local network to access our NTP server.
+
+```
+# Allow NTP client access from local network.
+allow 192.168.0.0/16
+```
+
+Note that the server can listen for requests on any local network it's attached to. The IP address in the "allow" line is just intended for illustrative purposes. Be sure to change the IP network and subnet mask in that line to match your local network's.
+
+Restart **chronyd**.
+
+```
+[root@studentvm1 ~]# systemctl restart chronyd
+```
+
+To allow other hosts on your network to access this server, configure the firewall to allow inbound UDP packets on port 123. Check your firewall's documentation to find out how to do that.
+
+### Testing
+
+Your host is now an NTP server. You can test it with another host or a VM that has access to the network on which the NTP server is listening. Configure the client to use the new NTP server as the preferred server in the **/etc/chrony.conf** file, then monitor that client using the **chronyc** tools we used above.
+
+### Chronyc as an interactive tool
+
+As I mentioned earlier, **chronyc** can be used as an interactive command tool. Simply run the command without a subcommand and you get a **chronyc** command prompt.
+
+```
+[root@studentvm1 ~]# chronyc
+chrony version 3.4
+Copyright (C) 1997-2003, 2007, 2009-2018 Richard P. Curnow and others
+chrony comes with ABSOLUTELY NO WARRANTY. This is free software, and
+you are welcome to redistribute it under certain conditions. See the
+GNU General Public License version 2 for details.
+
+chronyc>
+```
+
+You can enter just the subcommands at this prompt. Try using the **tracking** , **ntpdata** , and **sources** commands. The **chronyc** command line allows command recall and editing for **chronyc** subcommands. You can use the **help** subcommand to get a list of possible commands and their syntax.
+
+### Conclusion
+
+Chrony is a powerful tool for synchronizing the times of client hosts, whether they are all on the local network or scattered around the globe. It's easy to configure because, despite the large number of options available, only a few configurations are required for most circumstances.
+
+After my client computers have synchronized with the NTP server, I like to set the system hardware clock from the system (OS) time by using the following command:
+
+```
+/sbin/hwclock --systohc
+```
+
+This command can be added as a cron job or a script in **cron.daily** to keep the hardware clock synced with the system time.
+
+Chrony and NTP (the service) both use the same configuration, and the files' contents are interchangeable. The man pages for [chronyd][5], [chronyc][4], and [chrony.conf][6] contain an amazing amount of information that can help you get started or learn about esoteric configuration options.
+
+Do you run your own NTP server? Let us know in the comments and be sure to tell us which implementation you are using, NTP or Chrony.
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/manage-ntp-chrony
+
+作者:[David Both][a]
+选题:[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
+[b]: https://github.com/lujun9972
+[1]: https://en.wikipedia.org/wiki/Does_Anybody_Really_Know_What_Time_It_Is%3F
+[2]: https://en.wikipedia.org/wiki/Network_Time_Protocol
+[3]: https://chrony.tuxfamily.org/comparison.html
+[4]: https://linux.die.net/man/1/chronyc
+[5]: https://linux.die.net/man/8/chronyd
+[6]: https://linux.die.net/man/5/chrony.conf
From a45991e64b224a9107ecd4dbf660183904c553c7 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 20:45:51 +0800
Subject: [PATCH 030/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Screen=20Reco?=
=?UTF-8?q?rders=20for=20the=20Linux=20Desktop?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
... Screen Recorders for the Linux Desktop.md | 177 ++++++++++++++++++
1 file changed, 177 insertions(+)
create mode 100644 sources/tech/20181207 5 Screen Recorders for the Linux Desktop.md
diff --git a/sources/tech/20181207 5 Screen Recorders for the Linux Desktop.md b/sources/tech/20181207 5 Screen Recorders for the Linux Desktop.md
new file mode 100644
index 0000000000..4dd47e948a
--- /dev/null
+++ b/sources/tech/20181207 5 Screen Recorders for the Linux Desktop.md
@@ -0,0 +1,177 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (5 Screen Recorders for the Linux Desktop)
+[#]: via: (https://www.linux.com/blog/intro-to-linux/2018/12/5-screen-recorders-linux-desktop)
+[#]: author: (Jack Wallen https://www.linux.com/users/jlwallen)
+
+5 Screen Recorders for the Linux Desktop
+======
+
+
+
+There are so many reasons why you might need to record your Linux desktop. The two most important are for training and for support. If you are training users, a video recording of the desktop can go a long way to help them understand what you are trying to impart. Conversely, if you’re having trouble with one aspect of your Linux desktop, recording a video of the shenanigans could mean the difference between solving the problem and not. But what tools are available for the task? Fortunately, for every Linux user (regardless of desktop), there are options available. I want to highlight five of my favorite screen recorders for the Linux desktop. Among these five, you are certain to find one that perfectly meets your needs. I will only be focusing on those screen recorders that save as video. What video format you prefer may or may not dictate which tool you select.
+
+And, without further ado, let’s get on with the list.
+
+### Simple Screen Recorder
+
+I’m starting out with my go-to screen recorder. I use [Simple Screen Recorder][1] on a daily basis, and it never lets me down. This particular take on the screen recorder is available for nearly every flavor of Linux and is, as the name implies, very simple to use. With Simple Screen Recorder you can select a single window, a portion of the screen, or the entire screen to record. One of the best features of Simple Screen Recorder is the ability to save profiles (Figure 1), which allows you to configure the input for a recording (including scaling, frame rate, width, height, left edge and top edge spacing, and more). By saving profiles, you can easily use a specific profile to meet a unique need, without having to go through the customization every time. This is handy for those who do a lot of screen recording, with different input variables for specific jobs.
+
+![Simple Screen Recorder ][3]
+
+Figure 1: Simple Screen Recorder input profile window.
+
+[Used with permission][4]
+
+Simple screen recorder also:
+
+ * Records audio input
+
+ * Allows you to pause and resume recording
+
+ * Offers a preview during recording
+
+ * Allows for the selection of video containers and codecs
+
+ * Adds timestamp to file name (optional)
+
+ * Includes hotkey recording and sound notifications
+
+ * Works well on slower machines
+
+ * And much more
+
+
+
+
+Simple Screen Recorder is one of the most reliable screen recording tools I have found for the Linux desktop. Simple Screen Recorder can be installed from the standard repositories on many desktops, or via easy to follow instructions on the [application download page][5].
+
+### Gtk-recordmydesktop
+
+The next entry, [gtk-recordmydesktop][6], doesn’t give you nearly the options found in Simple Screen Recorder, but it does offer a command line component (for those who prefer not working with a GUI). The simplicity that comes along with this tool also means you are limited to a specific video output format (.ogv). That doesn’t mean gtk-recordmydesktop isn’t without appeal. In fact, there are a few features that make this option in the genre fairly appealing. First and foremost, it’s very simple to use. Second, the record window automatically gets out of your way while you record (as opposed to Simple Screen Recorder, where you need to minimize the recording window when recording full screen). Another feature found in gtk-recordmydesktop is the ability to have the recording follow the mouse (Figure 2).
+
+![gtk-recordmydesktop][8]
+
+Figure 2: Some of the options for gtk-recordmydesktop.
+
+[Used with permission][4]
+
+Unfortunately, the follow the mouse feature doesn’t always work as expected, so chances are you’ll be using the tool without this interesting option. In fact, if you opt to go the gtk-recordmydesktop route, you should understand the GUI frontend isn’t nearly as reliable as is the command line version of the tool. From the command line, you could record a specific position of the screen like so:
+
+```
+recordmydesktop -x X_POS -y Y_POS --width WIDTH --height HEIGHT -o FILENAME.ogv
+```
+
+where:
+
+ * X_POS is the offset on the X axis
+
+ * Y_POS is the offset on the Y axis
+
+ * WIDTH is the width of the screen to be recorded
+
+ * HEIGHT is the height of the screen to be recorded
+
+ * FILENAME is the name of the file to be saved
+
+
+
+
+To find out more about the command line options, issue the command man recordmydesktop and read through the manual page.
+
+### Kazam
+
+If you’re looking for a bit more than just a recorded screencast, you might want to give Kazam a go. Not only can you record a standard screen video (with the usual—albeit limited amount of—bells and whistles), you can also take screenshots and even broadcast video to YouTube Live (Figure 3).
+
+![Kazam][10]
+
+Figure 3: Setting up YouTube Live broadcasting in Kazam.
+
+[Used with permission][4]
+
+Kazam falls in line with gtk-recordmydesktop, when it comes to features. In other words, it’s slightly limited in what it can do. However, that doesn’t mean you shouldn’t give Kazam a go. In fact, Kazam might be one of the best screen recorders out there for new Linux users, as this app is pretty much point and click all the way. But if you’re looking for serious bells and whistles, look away.
+
+The version of Kazam, with broadcast goodness, can be found in the following repository:
+
+```
+ppa:sylvain-pineau/kazam
+```
+
+For Ubuntu (and Ubuntu-based distributions), install with the following commands:
+
+```
+sudo apt-add-repository ppa:sylvain-pineau/kazam
+
+sudo apt-get update
+
+sudo apt-get install kazam -y
+```
+
+### Vokoscreen
+
+The [Vokoscreen][11] recording app is for new-ish users who need more options. Not only can you configure the output format and the video/audio codecs, you can also configure it to work with a webcam (Figure 4).
+
+![Vokoscreen][13]
+
+Figure 4: Configuring a web cam for a Vokoscreen screen recording.
+
+[Used with permission][4]
+
+As with most every screen recording tool, Vokoscreen allows you to specify what on your screen to record. You can record the full screen (even selecting which display on multi-display setups), window, or area. Vokoscreen also allows you to select a magnification level (200x200, 400x200, or 600x200). The magnification level makes for a great tool to highlight a specific section of the screen (the magnification window follows your mouse).
+
+Like all the other tools, Vokoscreen can be installed from the standard repositories or cloned from its [GitHub repository][14].
+
+### OBS Studio
+
+For many, [OBS Studio][15] will be considered the mack daddy of all screen recording tools. Why? Because OBS Studio is as much a broadcasting tool as it is a desktop recording tool. With OBS Studio, you can broadcast to YouTube, Smashcast, Mixer.com, DailyMotion, Facebook Live, Restream.io, LiveEdu.tv, Twitter, and more. In fact, OBS Studio should seriously be considered the de facto standard for live broadcasting the Linux desktop.
+
+Upon installation (the software is only officially supported for Ubuntu Linux 14.04 and newer), you will be asked to walk through an auto-configuration wizard, where you setup your streaming service (Figure 5). This is, of course, optional; however, if you’re using OBS Studio, chances are this is exactly why, so you won’t want to skip out on configuring your default stream.
+
+![OBS Studio][17]
+
+Figure 5: Configuring your streaming service for OBS Studio.
+
+[Used with permission][4]
+
+I will warn you: OBS Studio isn’t exactly for the faint of heart. Plan on spending a good amount of time getting the streaming service up and running and getting up to speed with the tool. But for anyone needing such a solution for the Linux desktop, OBS Studio is what you want. Oh … it can also record your desktop screencast and save it locally.
+
+### There’s More Where That Came From
+
+This is a short list of screen recording solutions for Linux. Although there are plenty more where this came from, you should be able to fill all your desktop recording needs with one of these five apps.
+
+Learn more about Linux through the free ["Introduction to Linux" ][18]course from The Linux Foundation and edX.
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/blog/intro-to-linux/2018/12/5-screen-recorders-linux-desktop
+
+作者:[Jack Wallen][a]
+选题:[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/jlwallen
+[b]: https://github.com/lujun9972
+[1]: http://www.maartenbaert.be/simplescreenrecorder/
+[2]: /files/images/screenrecorder1jpg
+[3]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screenrecorder_1.jpg?itok=hZJ5xugI (Simple Screen Recorder )
+[4]: /licenses/category/used-permission
+[5]: http://www.maartenbaert.be/simplescreenrecorder/#download
+[6]: http://recordmydesktop.sourceforge.net/about.php
+[7]: /files/images/screenrecorder2jpg
+[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screenrecorder_2.jpg?itok=TEGXaVYI (gtk-recordmydesktop)
+[9]: /files/images/screenrecorder3jpg
+[10]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screenrecorder_3.jpg?itok=cvtFjxen (Kazam)
+[11]: https://github.com/vkohaupt/vokoscreen
+[12]: /files/images/screenrecorder4jpg
+[13]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screenrecorder_4.jpg?itok=c3KVS954 (Vokoscreen)
+[14]: https://github.com/vkohaupt/vokoscreen.git
+[15]: https://obsproject.com/
+[16]: /files/images/desktoprecorder5jpg
+[17]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/desktoprecorder_5.jpg?itok=xyM-dCa7 (OBS Studio)
+[18]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
From 98d61d75f99db0ea69edd36f3294a2ba144c7ea3 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 21:05:03 +0800
Subject: [PATCH 031/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Automatic=20conti?=
=?UTF-8?q?nuous=20development=20and=20delivery=20of=20a=20hybrid=20mobile?=
=?UTF-8?q?=20app?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ent and delivery of a hybrid mobile app.md | 102 ++++++++++++++++++
1 file changed, 102 insertions(+)
create mode 100644 sources/tech/20181207 Automatic continuous development and delivery of a hybrid mobile app.md
diff --git a/sources/tech/20181207 Automatic continuous development and delivery of a hybrid mobile app.md b/sources/tech/20181207 Automatic continuous development and delivery of a hybrid mobile app.md
new file mode 100644
index 0000000000..c513f36017
--- /dev/null
+++ b/sources/tech/20181207 Automatic continuous development and delivery of a hybrid mobile app.md
@@ -0,0 +1,102 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Automatic continuous development and delivery of a hybrid mobile app)
+[#]: via: (https://opensource.com/article/18/12/hybrid-mobile-app-development)
+[#]: author: (Angelo Manganiello https://opensource.com/users/amanganiello90)
+
+Automatic continuous development and delivery of a hybrid mobile app
+======
+Hybrid apps are a good middle ground between native and web apps.
+
+
+Offering a mobile app is essentially a business requirement for organizations today. One of the first steps in developing an app is to understand the different types—native, hybrid (or cross-platform), and web—so you can decide which one will best meet your needs.
+
+### Native is better, right?
+
+**Native apps** represent the vast majority of applications that people download every day. Native applications are developed specifically for an operating system. Thus, a native iOS application will not work on an Android system and vice versa. To develop a native app, you need to know two things:
+
+ 1. How to develop in a specific programming language (e.g., Swift for Apple devices; Java for Android)
+ 2. The app will not work for other platforms
+
+
+
+Even though native apps will work only on the platform they're developed for, they have several notable advantages over hybrid and web apps:
+
+ * Increased speed, reliability, and responsiveness and higher resolution, all of which provide a better user experience
+ * May work offline/without internet service
+ * Easier access to all phone features (e.g., accelerometer, camera, microphone)
+
+
+
+### But my business is still linked to the web…
+
+Most companies have focused their resources on web development and now want to enter the mobile market. But many don't have the right technical resources to develop a native app for each platform. For these companies, **hybrid** development is the right choice. In this model, developers can use their existing frontend skills to develop a single, cross-platform mobile app.
+
+![Hybrid mobile apps][2]
+
+Hybrid apps are a good middle ground: they're faster and less expensive to develop than native apps, and they offer more possibilities than web apps. The tradeoffs are they don't perform as well as native apps and developers can't maintain their existing tight focus on web development (as they could with web apps).
+
+If you already are a fan of the [Angular][3] cross-platform development framework, I recommend trying the [Ionic][4] framework, which "lets web developers build, test, and deploy cross-platform hybrid mobile apps." I see Ionic as an extension of the [Apache Cordova][5] framework, which enables a normal web app (JS, HTML, or CSS) to run as a mobile app in a container. Ionic uses the base Cordova features that support the Angular development for its user interface.
+
+The advantage of this approach is simple: the Angular paradigm is maintained, so developers can continue writing [TypeScript][6] files but target a build for Android, iOS, and Windows by properly configuring the development environment. It also provides two important tools:
+
+ * An appealing design and widget that are very similar to a native app's, so your hybrid app will look less "web"
+ * Cordova Plugins allow the app to communicate with all phone features
+
+
+
+### What about the Node.js backend?
+
+The programming world likes to standardize, which is why hybrid apps are so popular. Frontend developers' common skills are useful in the mobile world. But if we have a technology stack for the user interface, why not focus on a single backend with the same programming paradigm?
+
+This makes [Node.js][7] an appealing option. Node.js is a JavaScript runtime built on the Chrome V8 JavaScript engine. It can make the API development backend very fast and easy, and it integrates fully with web technologies. You can develop a Cordova plugin, using your Node.js backend, internally in your hybrid app, as I did with the [nodejs-cordova-plugin][8]. This plugin, following the Cordova guidelines, integrates a mobile-compatible version of the Node.js platform to provide a full-stack mobile app.
+
+If you need a simple CRUD Node.js backend, you can use my [API][9] [node generator][9] that generates an app using a [MongoDB][10] embedded database.
+
+![Cordova Full Stack application][12]
+
+### Deploying your app
+
+Open source offers everything you need to deploy your app in the best way. You just need a GitHub repository and a good continuous integration tool. I recommend [Travis-ci][13], an excellent tool that allows you to build and deploy your product for every commit.
+
+Travis-ci is a fork of the better known [Jenkins][14]. Like with Jenkins, you have to configure your pipeline through a configuration file (in this case a **.travis.yml** file) in your GitHub repo. See the [.travis.yml file][15] in my repository as an example.
+
+
+
+In addition, this pipeline automatically delivers and installs your app on [Appetize.io][16], a web-based iOS simulator and Android emulator, for testing.
+
+You can learn more in the [Cordova Android][17] section of my GitHub repository.
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/hybrid-mobile-app-development
+
+作者:[Angelo Manganiello][a]
+选题:[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/amanganiello90
+[b]: https://github.com/lujun9972
+[1]: /file/416441
+[2]: https://opensource.com/sites/default/files/uploads/1-title.png (Hybrid mobile apps)
+[3]: https://angular.io/
+[4]: https://ionicframework.com/
+[5]: https://cordova.apache.org/
+[6]: https://www.typescriptlang.org/
+[7]: https://nodejs.org/
+[8]: https://github.com/fullStackApp/nodejs-cordova-plugin
+[9]: https://github.com/fullStackApp/generator-full-stack-api
+[10]: https://www.mongodb.com/
+[11]: /file/416351
+[12]: https://opensource.com/sites/default/files/uploads/2-cordova-full-stack-app.png (Cordova Full Stack application)
+[13]: https://travis-ci.org/
+[14]: https://jenkins.io/
+[15]: https://github.com/amanganiello90/java-angular-web-app/blob/master/.travis.yml
+[16]: https://appetize.io/
+[17]: https://github.com/amanganiello90/java-angular-web-app#cordova-android
From 7b4c9a9b6c6f0caab0d8a01f9b372892ea844a86 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 21:07:13 +0800
Subject: [PATCH 032/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Boot?=
=?UTF-8?q?=20Into=20Rescue=20Mode=20Or=20Emergency=20Mode=20In=20Ubuntu?=
=?UTF-8?q?=2018.04?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
... Mode Or Emergency Mode In Ubuntu 18.04.md | 106 ++++++++++++++++++
1 file changed, 106 insertions(+)
create mode 100644 sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md
diff --git a/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md
new file mode 100644
index 0000000000..1b52121add
--- /dev/null
+++ b/sources/tech/20181206 How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04.md
@@ -0,0 +1,106 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04)
+[#]: via: (https://www.ostechnix.com/how-to-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/)
+[#]: author: (SK https://www.ostechnix.com/author/sk/)
+
+How To Boot Into Rescue Mode Or Emergency Mode In Ubuntu 18.04
+======
+
+
+As you might already know, **Runlevels** are replaced with **Systemd targets** in many recent Linux distributions like RHEL 7 and Ubuntu 16.04 LTS. For more details about runlevels and systemd target, refer [**this guide**][1]. In this brief tutorial, we are going to see how to boot into **rescue mode** and/or **emergency mode**. This guide is tested in Ubuntu 18.04 LTS, however the steps given below would work on most Linux distributions that uses Systemd as default service manager. Before going further, let me clarify what is rescue mode and emergency mode and what is the purpose of the both modes.
+
+### What is Rescue mode?
+
+The **rescue mode** is equivalent to **single user mode** in Linux distributions that uses **SysV** as the default service manager. In rescue mode, all local filesystems will be mounted, only some important services will be started. However, no normal services (E.g network services) won’t be started. The rescue mode is helpful in situations where the system can’t boot normally. Also, we can perform some important rescue operations, such as [**reset root password**][2], in rescue mode.
+
+### What is Emergency mode?
+
+In contrast to the rescue mode, nothing is started in the **emergency mode**. No services are started, no mount points mounted, no sockets established, nothing. All you will have is just a **raw shell**. Emergency mode is suitable for debugging purposes.
+
+### Boot Into Rescue Mode In Ubuntu 18.04 LTS
+
+Boot your Ubuntu system. When Grub menu appears, choose the first entry and press **e** to edit.
+
+
+
+If you don’t see the Grub menu, just hit ESC key right after the BIOS logo disappears.
+
+Find the line that starts with word **“linux”** and add the following line at the end of that line (To reach the end, just press **CTRL+e** or use END key or LEFT/RIGHT arrows in your keyboard):
+
+```
+systemd.unit=rescue.target
+```
+
+
+
+Once you added the above line, just press **CTRL+x** or **F10** to continue to boot into rescue mode. After a few seconds, you will be ended up in the rescue mode (single user mode) as root user. Here is how rescue mode looks like in Ubuntu 18.04 LTS server:
+
+
+
+Next, type the following command to mount root (/) file system into read/write mode.
+
+```
+mount -n -o remount,rw /
+```
+
+### Boot Into Emergency Mode
+
+Booting your Ubuntu into emergency is as same as above method. All you have to do is replace “systemd.unit=rescue.target” with “systemd.unit=emergency.target” when editing grub menu.
+
+[![emergency mode][3]][4]
+
+Once you added “systemd.unit=emergency.target”, press **Ctrl+x** or **F10** to continue booting into emergency mode.
+
+
+
+Finally, you can mount root filesystem into read/write mode with command:
+
+```
+mount -n -o remount,rw /
+```
+
+### Switch between Rescue to Emergency mode and vice versa
+
+If you are in rescue mode, you don’t have to edit the grub boot entry as I mentioned above. Instead, just type the following command to switch to emergency mode instantly:
+
+```
+systemctl emergency
+```
+
+Similarly, to switch from emergency to rescue mode, type:
+
+```
+systemctl rescue
+```
+
+You know now what is rescue and emergency modes and how to boot into those modes in Ubuntu 18.04. Like I already mentioned, the steps provided here will work on many recent Linux versions that uses Systemd.
+
+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-boot-into-rescue-mode-or-emergency-mode-in-ubuntu-18-04/
+
+作者:[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/check-runlevel-linux/
+[2]: https://www.ostechnix.com/how-to-reset-or-recover-root-user-password-in-linux/
+[3]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
+[4]: http://www.ostechnix.com/wp-content/uploads/2018/12/emergency-mode.png
From 1c816df2e5abdf43ea3f69e1352b2be6a08be427 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 10 Dec 2018 21:09:23 +0800
Subject: [PATCH 033/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20view?=
=?UTF-8?q?=20XML=20files=20in=20a=20web=20browser?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
... How to view XML files in a web browser.md | 109 ++++++++++++++++++
1 file changed, 109 insertions(+)
create mode 100644 sources/tech/20181206 How to view XML files in a web browser.md
diff --git a/sources/tech/20181206 How to view XML files in a web browser.md b/sources/tech/20181206 How to view XML files in a web browser.md
new file mode 100644
index 0000000000..6060c792e2
--- /dev/null
+++ b/sources/tech/20181206 How to view XML files in a web browser.md
@@ -0,0 +1,109 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How to view XML files in a web browser)
+[#]: via: (https://opensource.com/article/18/12/xml-browser)
+[#]: author: (Greg Pittman https://opensource.com/users/greg-p)
+
+How to view XML files in a web browser
+======
+Turn XML files into something more useful.
+
+
+Once you learn that HTML is a form of XML, you might wonder what would happen if you tried to view an XML file in a browser. The results are quite disappointing—Firefox shows you a banner at the top of the page that says, "This XML file does not appear to have any style information associated with it. The document tree is shown below." The document tree looks like the file would look in an editor:
+
+This is the beginning of the **menu.xml** file for the online manual that comes with [Scribus][1], to which I'm a contributor. Although you see blue text, they are not clickable links. I wanted to be able to view this in a regular browser, since sometimes I need to go back and forth from the canvas in Scribus to the manual to figure out how to do something (maybe to see if I need to edit the manual to straighten out some misinformation or to add some missing information).
+
+The way to help a browser know what to do with these XML tags is by using XSLT—Extensible Stylesheet Language Transformations. In a broad sense, you could use XSLT to transform XML to a variety of outputs, or even HTML to XML. Here I want to use it to present the XML tags to a browser as suitable HTML.
+
+One slight modification needs to happen to the XML file:
+
+
+
+Adding this second line to the file tells the browser to look for a file named **scribus-manual.xsl** for the style information. The more important part is to create this XSL file. Here is the complete listing of **scribus-manual.xsl** for the Scribus manual:
+
+```
+
+
+
+
+
+ Scribus Online Manual
+
+
+
+  |
+  |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+This looks a lot more like HTML, and you can see it contains a number of HTML tags. After some preliminary tags and some particulars about displaying H2, H3, and H4 tags, you see a Table tag. This adds a graphical heading at the top of the page and uses some images already in the documentation files.
+
+After this, you get into the process of dissecting the various **submenuitem** tags, trying to create the nested listing structure as it appears in Scribus when you view the manual. One feature I did not try to duplicate is the ability to collapse and expand **submenuitem** areas. As you can imagine, it takes some time to sort through the number of nested lists you need to create, but when I finished, here is how it looked:
+
+
+
+This minimal editing to **menu.xml** does not interfere with Scribus' ability to show the manual in its own browser. I put this modified **menu.xml** file and the **scribus-manual.xsl** in the English documentation folder for 1.5.x versions of Scribus, so anyone using these versions can simply point their browser to the **menu.xml** file and it should show up just like you see above.
+
+A much bigger chore I took on a few years ago was to create a version of the ICD10 (International Classification of Diseases, version 10) when it came out. Many changes were made from the previous version (ICD9) to 10. These are important since these codes must be used for diagnostic purposes in medical practice. You can easily download XML files from the US [Centers for Medicare and Medicaid][2] website since it is public information, but—just as with the Scribus manual—these files are hard to use.
+
+Here is the beginning of the tabular listing of diseases:
+
+
+
+One of the features I created was the color coding used in the listing shown here:
+
+
+
+As with **menu.xml** , the only editing I did in this **Tabular.xml** file was to add **** as the second line of the file. I started this project with the 2014 version, and I was quite pleased to find that the original **tabular.xsl** stylesheet worked perfectly when the 2016 version came out, which is the last one I worked on. The** Tabular.xml** file is 8.4MB, quite large for a plaintext file. It takes a few seconds to load into a browser, but once it's loaded, navigation is fast.
+
+While you may not often have to deal with an XML file in this way, if you do, I hope this article shows that your file can easily be turned into something much more usable.
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/xml-browser
+
+作者:[Greg Pittman][a]
+选题:[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/greg-p
+[b]: https://github.com/lujun9972
+[1]: https://www.scribus.net/
+[2]: https://www.cms.gov/
From 4aa8c8b3ab82d775ebb54d0bf892ce8b0725de0d Mon Sep 17 00:00:00 2001
From: Yixiang Zhao <674965440@qq.com>
Date: Mon, 10 Dec 2018 21:45:46 +0800
Subject: [PATCH 034/119] =?UTF-8?q?=E6=8C=89=E7=85=A7=E6=96=B0=E6=A8=A1?=
=?UTF-8?q?=E6=9D=BF=E7=9A=84=E6=A0=BC=E5=BC=8F=E8=BF=9B=E8=A1=8C=E4=BA=86?=
=?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20181127 What the open source community means to me.md | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sources/talk/20181127 What the open source community means to me.md b/sources/talk/20181127 What the open source community means to me.md
index ec4d8f7a6d..b092c1c33e 100644
--- a/sources/talk/20181127 What the open source community means to me.md
+++ b/sources/talk/20181127 What the open source community means to me.md
@@ -1,7 +1,5 @@
-translating by seriouszyx
-
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (seriouszyx)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (What the open source community means to me)
From 253f654fc962103f20e44a5422903e39a466209b Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 10 Dec 2018 22:24:24 +0800
Subject: [PATCH 035/119] PRF:20181112 A Free, Secure And Cross-platform
Password Manager.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@seriouszyx 翻译的很用心。
---
...ure And Cross-platform Password Manager.md | 49 ++++++++++---------
1 file changed, 26 insertions(+), 23 deletions(-)
diff --git a/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md b/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md
index 35a1c44720..637bec8b63 100644
--- a/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md
+++ b/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md
@@ -1,5 +1,3 @@
-(本文共两处译注)
-
一个免费、安全、跨平台的密码管理器
======
@@ -7,17 +5,17 @@
在这个现代化的互联网时代,你一定在许多网站上有多个账户,它可能是个人或官方邮箱账户、社交或专业网络账户、GitHub 账户和电子商务账户等。因此,对于不同的账户,你应该设置多个不同的密码。我相信你应该已经意识到为多个账户设置相同的密码是件疯狂又危险的事情。如果攻击者设法破解了你的一个账户,那么他/她很可能尝试使用相同的密码访问你的其他账户。所以,**强烈建议为不同的账户设置不同的密码**。
-不过,记住好几个密码是很困难的。你可以把它们写在纸上,但那也不是一个有效的方法,你可能会在一段时间后失去它们。这时密码管理器就派上用场了。密码管理器就像一个存储库,你可以在其中存储不同账户的所有密码,并用一个主密码将其锁定。这样,你需要记住的就只剩下主密码了。之前我们介绍过一个叫 [**KeeWeb**][1] 的开源密码管理器,今天,我们将介绍另外一款密码管理器———**Buttercup**。
+不过,记住好几个密码是很困难的。你可以把它们写在纸上,但那也不是一个有效的方法,你可能会在一段时间后失去它们。这时密码管理器就派上用场了。密码管理器就像一个存储库,你可以在其中存储不同账户的所有密码,并用一个主密码将其锁定。这样,你需要记住的就只剩下主密码了。之前我们介绍过一个叫 [KeeWeb][1] 的开源密码管理器,今天,我们将介绍另外一款密码管理器 ——— Buttercup。
### 关于 Buttercup
-Buttercup 是一个免费、开源、安全、跨平台的使用 **NodeJS** 编写的密码管理器。它可以帮助你将不同账户的所有登录凭证存储到加密存档中,该存档可以保存在本地系统或任何远程服务(如 DropBox、OwnCloud、NextCloud 和基于 WebDAV 的服务)中。它使用强大的 **256 位 AES 加密算法**,用主密码保存你的敏感数据。所以,除了拥有主密码的人以外,没有人可以访问你的登录信息。Buttercup 目前支持 Linux、Mac OS 和 Windows,还提供了一个浏览器扩展和移动应用程序。因此,你也可以在 Android 和 iOS 设备中的桌面应用程序和浏览器扩展程序中使用相同的存档。
+Buttercup 是一个自由、开源、安全、跨平台的密码管理器,使用 **NodeJS** 编写。它可以帮助你将不同账户的所有登录凭证存储到加密存档中,该存档可以保存在本地系统或任何远程服务(如 DropBox、OwnCloud、NextCloud 和基于 WebDAV 的服务)中。它使用强大的 **256 位 AES 加密算法**,用主密码保存你的敏感数据。所以,除了拥有主密码的人以外,没有人可以访问你的登录信息。Buttercup 目前支持 Linux、Mac OS 和 Windows,还提供了一个浏览器扩展和移动应用程序。因此,你也可以在 Android 和 iOS 设备中的桌面应用程序和浏览器扩展程序中使用相同的存档。
### 安装 Buttercup 密码管理器
-(译注:此处没有找到合适的语言翻译)Buttercup 目前可作为 .deb、.rpm 软件包、便携式 AppImage 和用于 Linux 平台的 tar 归档文件使用。转到 [**releases pages**][2] 下载安装你想要的版本。
+Buttercup 目前在 Linux 平台上有 .deb、.rpm 软件包、可移植的 AppImage 和 tar 归档文件等安装包。转到其 [发布页][2] 下载安装你想要的版本。
-Buttercup 桌面应用程序在 [**AUR**][3] 中也可用,你可以使用 AUR 帮助程序(如 [**Yay**][4])在基于 Arch 的系统上安装,如下所示:
+Buttercup 桌面应用程序在 [AUR][3] 中也可用,你可以使用 AUR 帮助程序(如 [Yay][4])在基于 Arch 的系统上安装,如下所示:
```
$ yay -S buttercup-desktop
@@ -35,21 +33,23 @@ $ chmod +x buttercup-desktop-1.11.0-x86_64.AppImage
$ ./buttercup-desktop-1.11.0-x86_64.AppImage
```
-运行此命令后,会提示是否要将 Buttercup AppImage 集成到你的系统中。如果选择“Yes”,则会将其添加到应用程序菜单并安装图标。如果不这样做,你仍然可以通过双击 AppImage 或在终端中使用上述命令启动应用程序。
+运行此命令后,会提示是否要将 Buttercup AppImage 集成到你的系统中。如果选择 “Yes”,则会将其添加到应用程序菜单并安装图标。如果不这样做,你仍然可以通过双击 AppImage 或在终端中使用上述命令启动应用程序。
### 添加存档
第一次启动时,会看到下面的欢迎界面:
+

-我们还没有添加任何存档,所以让我们添加一个吧。单击“New Archive File”按钮,输入存档文件的名称,并选择它的保存位置。
+我们还没有添加任何存档,所以让我们添加一个吧。单击 “New Archive File” 按钮,输入存档文件的名称,并选择它的保存位置。
+

-你可以随意命名。我把它命名为“mypass”,存档将以 **.bcup** 为扩展名保存在你选择的位置。
+你可以随意命名。我把它命名为 “mypass”,存档将以 .bcup 为扩展名保存在你选择的位置。
-如果你已经创建了一个,只需单击“Open Archive File”来选择它。
+如果你已经创建了一个,只需单击 “Open Archive File” 来选择它。
-接下来,buttercup 将提示你为新创建的存档输入主密码,建议提供一个强级别的密码,以保护存档不受未经授权的访问。
+接下来,Buttercup 将提示你为新创建的存档输入主密码,建议提供一个强级别的密码,以保护存档不会被未经授权访问。

@@ -57,7 +57,7 @@ $ ./buttercup-desktop-1.11.0-x86_64.AppImage
让我们继续在存档中添加账户的详细信息。
-### 在存档中添加条目(登陆凭证)
+### 在存档中添加条目(登录凭证)
创建或打开存档后,你将看到下面的界面。
@@ -65,33 +65,33 @@ $ ./buttercup-desktop-1.11.0-x86_64.AppImage
它就像一个保险库,我们将保存不同账户的登录凭证。如你所见,我们并没有添加任何条目。让我们添加一些。
-点击右下角的“ADD ENTRY”按钮来添加新的条目,输入你想要保存的账户的信息。
+点击右下角的 “ADD ENTRY” 按钮来添加新的条目,输入你想要保存的账户的信息。

-在每个条目下面都有一个“ADD NEW FIELD”选项,可以用来添加其他的细节。只需点击它,然后添加要包含在条目中的字段。
+在每个条目下面都有一个 “ADD NEW FIELD” 选项,可以用来添加其他的细节。只需点击它,然后添加要包含在条目中的字段。
添加完所有条目后,你将在 Buttercup 界面的右侧窗格中看到它们。
![][6]
-### 添加新的群组
+### 添加新的分组
-你还可以将登陆的详细信息分组到不同的名称下,以便于识别。例如,你可以将所有邮箱账户分组到一个名为“my_mails”的名称下。默认情况下,你的登录详细信息将保存在“General”群组下。要创建新的群组,请点击“NEW GROUP”按钮并输入名称。在新的群组中创建新条目时,与上述的步骤相同,只需单击组名并开始添加条目。
+你还可以将登录的详细信息分组到不同的名称下,以便于识别。例如,你可以将所有邮箱账户分组到一个名为 “my_mails” 的名称下。默认情况下,你的登录详细信息将保存在 “General” 群组下。要创建新的群组,请点击 “NEW GROUP” 按钮并输入名称。在新的群组中创建新条目时,与上述的步骤相同,只需单击组名并开始添加条目。
-### 管理和访问登陆的详细信息
+### 管理和访问登录的详细信息
-存储在存档中的数据可以随时编辑、移动到其他组或彻底删除。例如,如果要将用户名或密码复制到剪切板,请右击该条目,然后选择“Copy to Clipboard”。
+存储在存档中的数据可以随时编辑、移动到其他组或彻底删除。例如,如果要将用户名或密码复制到剪切板,请右击该条目,然后选择 “Copy to Clipboard”。
![][7]
-(译注:没理解这个 in the future 的意思)要在将来编辑/修改数据,只需点击所选条目下的“Edit”按钮。
+要进一步编辑/修改数据,只需点击所选条目下的 “Edit” 按钮。
### 在远程保存存档
默认情况下,Buttercup 会将数据保存在本地系统上。但是,你可以将它们保存在不同的远程服务(例如 Dropbox、OwnCloud、NextCloud 和基于 WebDAV 的服务)上。
-要连接这些服务,请点击 **File - > Connect Cloud Sources**。
+要连接这些服务,请点击 “File -> Connect Cloud Sources”。

@@ -107,13 +107,16 @@ Buttercup 允许你向其他密码管理器(例如 1Password、Lastpass 和 Ke
![][9]
-Buttercup 是一个简单但成熟、功能齐全的密码管理器。多年来它一直在积极发展。如果你需要密码管理器,Buttercup 可能是个不错的选择。有关更多的详细信息,请参阅项目网站和 GitHub 页面。
+Buttercup 是一个简单但成熟、功能齐全的密码管理器。多年来它一直在积极开发。如果你需要密码管理器,Buttercup 可能是个不错的选择。有关更多的详细信息,请参阅项目网站和 GitHub 页面。
那就介绍到这里,希望它对你有用。更多的精彩内容即将到来,敬请关注!
谢谢!
+### 资源
+- [Buttercup 网站](https://buttercup.pw/)
+- [Buttercup GitHub 仓库](https://github.com/buttercup/buttercup-desktop)
--------------------------------------------------------------------------------
@@ -122,13 +125,13 @@ via: https://www.ostechnix.com/buttercup-a-free-secure-and-cross-platform-passwo
作者:[SK][a]
选题:[lujun9972][b]
译者:[seriouszyx](https://github.com/seriouszyx)
-校对:[校对者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/keeweb-an-open-source-cross-platform-password-manager/
+[1]: https://linux.cn/article-10211-1.html
[2]: https://github.com/buttercup/buttercup-desktop/releases/latest
[3]: https://aur.archlinux.org/packages/buttercup-desktop/
[4]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
From b51ddad34e3b9f4655d3bc2ce5bc2ee4ac444bea Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 10 Dec 2018 22:26:04 +0800
Subject: [PATCH 036/119] PUB: 20181112 A Free, Secure And Cross-platform
Password Manager.md
@seriouszyx https://linux.cn/article-10331-1.html
---
...20181112 A Free, Secure And Cross-platform Password Manager.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20181112 A Free, Secure And Cross-platform Password Manager.md (100%)
diff --git a/translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md b/published/20181112 A Free, Secure And Cross-platform Password Manager.md
similarity index 100%
rename from translated/tech/20181112 A Free, Secure And Cross-platform Password Manager.md
rename to published/20181112 A Free, Secure And Cross-platform Password Manager.md
From 07a7d22341595b95d8c6ec203b05b591349c0055 Mon Sep 17 00:00:00 2001
From: alim0x
Date: Mon, 10 Dec 2018 22:47:00 +0800
Subject: [PATCH 037/119] [translating]DevOps is for everyone
---
sources/talk/20181121 DevOps is for everyone.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/talk/20181121 DevOps is for everyone.md b/sources/talk/20181121 DevOps is for everyone.md
index 075046f615..256a4e9fc3 100644
--- a/sources/talk/20181121 DevOps is for everyone.md
+++ b/sources/talk/20181121 DevOps is for everyone.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (alim0x)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (DevOps is for everyone)
From b71990694ae6cf5f3c85525c3d5fbeb0a1991cd1 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Tue, 11 Dec 2018 08:59:51 +0800
Subject: [PATCH 038/119] translated
---
...le Formats with SoundConverter in Linux.md | 92 ------------------
...le Formats with SoundConverter in Linux.md | 94 +++++++++++++++++++
2 files changed, 94 insertions(+), 92 deletions(-)
delete mode 100644 sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
create mode 100644 translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
diff --git a/sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
deleted file mode 100644
index d77062526b..0000000000
--- a/sources/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
+++ /dev/null
@@ -1,92 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: reviewer: ( )
-[#]: publisher: ( )
-[#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux)
-[#]: via: (https://itsfoss.com/sound-converter-linux/)
-[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
-[#]: url: ( )
-
-Easily Convert Audio File Formats with SoundConverter in Linux
-======
-
-**If you are looking for converting audio file formats to wav, mp3, ogg or any other format, SoundConverter is the tool you need in Linux.**
-
-![Audio Converter in Linux][1]
-
-So recently I purchased some DRM-free music. I got it from [SaReGaMa][2], the oldest and the largest music labels in India. The downloaded files were in HD quality and in WAV format.
-
-Unfortunately, Rhythmbox doesn’t play the WAV files. On top of that, a single file was around 70 MB in size. Imagine transferring such large music files to smartphones. It would eat up a lot of space unnecessarily.
-
-So I thought it was time to convert the WAV files to MP3, the evergreen and the most popular music file format.
-
-And for this task, I needed an audio converter in Linux. In this quick tutorial, I’ll show you how can you convert your audio files from one format to another easily with a GUI tool called SoundCoverter.
-
-### Installing SoundConverter in Linux
-
-[SoundConverter][3] is a popular free and open source software. It should be available in the official repository of most Linux distributions.
-
-Ubuntu/Linux Mint users can simply search for SoundConverter in the software center and install it from there.
-
-![SoundConverter application in Software Center of Ubuntu][4]SoundConverter can be installed from Software Center
-
-Alternatively, you can use the command line way. In Debian and Ubuntu based systems, you can use the following command:
-
-```
-sudo apt install soundconverter
-```
-
-For Arch, Fedora and other non-Debian based distributions, you can use the software center or the package manager of your distribution.
-
-### Using SoundConverter to convert audio file formats in Linux
-
-Once you have installed SoundConverter, search for it in the menu and start it.
-
-The default interface looks like this and it cannot be more simple than this:
-
-![SoundConverter application interface in Linux][5]Simple Interface
-
-Converting audio file format is as easy as selecting the file and clicking on convert.
-
-However, I would advise you to check the default settings at least on the first run. By default it converts the audio file to OGG file format and you may not want that.
-
-![Preferences in SoundConverter][6]Default output settings can be changed in Preferences
-
-To change the default output settings, click on the Preferences icon visible on the interface. You’ll see plenty of options to change here.
-
-You can change the default output format, bitrate, quality etc. You can also choose if you want to keep the converted files in the same folder as the original or not.
-
-There is also an option of automatically deleting the original file after conversion. I don’t think you should use that option.
-
-You can also change the output file name. By default, it will just change the suffix but you can also choose to name it based on track number, title, artist etc. For that to happen, you should have proper metadata on the original file.
-
-Speaking of metadata, have you heard of [MusicBrainz Picard][7]? This tool helps you automatically updates the metadata of your local music files.
-
-### Conclusion
-
-I have discussed [recording audio in Linux][8] previously with a similar tiny application. Such nifty tools actually make life easier with their focused aim of completing a certain task. You may use full-fledged and a lot better audio editing tool like [Audacity][9] but that may be complicated to use for smaller tasks like converting audio file formats.
-
-I hope you like SoundConverter. If you use some other tool, do mention that in the comments and I may cover it here on It’s FOSS. Enjoy!
-
---------------------------------------------------------------------------------
-
-via: https://itsfoss.com/sound-converter-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://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Convert-audio-file-format-linux.png?resize=800%2C450&ssl=1
-[2]: https://en.wikipedia.org/wiki/Saregama
-[3]: http://soundconverter.org/
-[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-software-center.png?ssl=1
-[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux.jpeg?ssl=1
-[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux-preferences.jpeg?resize=800%2C431&ssl=1
-[7]: https://itsfoss.com/musicbrainz-picard/
-[8]: https://itsfoss.com/record-streaming-audio/
-[9]: https://www.audacityteam.org/
diff --git a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
new file mode 100644
index 0000000000..0ad348edb0
--- /dev/null
+++ b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
@@ -0,0 +1,94 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux)
+[#]: via: (https://itsfoss.com/sound-converter-linux/)
+[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+[#]: url: ( )
+
+在 Linux 中使用 SoundConverter 轻松转换音频文件格式
+======
+
+**如果你正在寻找将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中需要的工具。**
+
+![Audio Converter in Linux][1]
+
+最近我购买了一些没有 DRM 的音乐。我是从 [SaReGaMa][2] 那里买的,这是一家印度历史最悠久,规模最大的音乐品牌。下载的文件采用高清质量的 WAV 格式。
+
+不幸的是,Rhythmbox 无法播放 WAV。最重要的是,单个文件大小约为 70MB。想象一下,将这么大的音乐传输到智能手机。它会不必要地占用大量空间。
+
+所以我认为是时候将 WAV 文件转换为 MP3,这个长青且最流行的音乐文件格式。
+
+为此,我需要一个在 Linux 中的音频转换器。在这个教程中,我将向你展示如何使用名为 SoundCoverter 的 GUI 工具轻松地将音频文件从一种格式转换为另一种格式。
+
+### 在 Linux 中安装 SoundConverter
+
+[SoundConverter][3] 是一款流行的免费开源软件。它应该可以在大多数 Linux 发行版的官方仓库中找到。
+
+Ubuntu/Linux Mint 用户只需在软件中心搜索 SoundConverter 并从那里安装即可。
+
+![SoundConverter application in Software Center of Ubuntu][4]
+SoundConverter 可以从软件中心安装
+
+或者,你可以使用命令行方式。在基于 Debian 和 Ubuntu 的系统中,你可以使用以下命令:
+
+```
+sudo apt install soundconverter
+```
+
+在 Arch、Fedora 和其他非基于 Debian 的发行版中,你可以使用你的发行版的软件中心或软件包管理器。
+
+### 在 Linux 中使用 SoundConverter 转换音频文件格式
+
+安装完 SoundConverter 后,在菜单中搜索并启动它。
+
+默认界面看起来像这样,它不能比这简单:
+
+![SoundConverter application interface in Linux][5]Simple Interface
+
+转换音频文件格式只要选择文件并单击转换。
+
+但是,我建议你至少在第一次运行时检查下默认设置。默认情况下,它会将音频文件转换为 OGG 文件格式,你可能不希望这样。
+
+![Preferences in SoundConverter][6]
+可以在“首选项”中更改默认输出设置
+
+要更改默认输出设置,请单击界面上的“首选项”图标。你会在这里看到很多可更改的选择。
+
+你可以更改默认输出格式、比特率、质量等。你还可以选择是否要将转换后的文件保存在与原始文件相同的文件夹中。
+
+转换后还可以选择自动删除原始文件。我不认为你应该使用那个选项。
+
+你还可以更改输出文件名。默认情况下,它只会更改后缀,但你也可以选择根据曲目编号、标题、艺术家等进行命名。为此,原始文件中应包含适当的元数据。
+
+说到元数据,你听说过 [MusicBrainz Picard][7]吗?此工具可帮助你自动更新本地音乐文件的元数据。
+
+### 总结
+
+我之前用讨论过用一个小程序[在 Linux 中录制音频][8]。这些很棒的工具通过专注某个特定的任务使得生活更轻松。你可以使用成熟和更好的音频编辑工具,如 [Audacity][9],但对于较小的任务,如转换音频文件格式,它可能用起来很复杂。
+
+我希望你喜欢 SoundConverter。如果你使用其他工具,请在评论中提及,我会在 FOSS 中提及。使用开心!
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/sound-converter-linux/
+
+作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Convert-audio-file-format-linux.png?resize=800%2C450&ssl=1
+[2]: https://en.wikipedia.org/wiki/Saregama
+[3]: http://soundconverter.org/
+[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-software-center.png?ssl=1
+[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux.jpeg?ssl=1
+[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux-preferences.jpeg?resize=800%2C431&ssl=1
+[7]: https://itsfoss.com/musicbrainz-picard/
+[8]: https://itsfoss.com/record-streaming-audio/
+[9]: https://www.audacityteam.org/
\ No newline at end of file
From 0cc97d4d35429b73e226914ad0874e2d98edcccb Mon Sep 17 00:00:00 2001
From: geekpi
Date: Tue, 11 Dec 2018 09:02:11 +0800
Subject: [PATCH 039/119] translating
---
...81205 Bring some color to your Linux terminal with lolcat.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
index 740e95c3bf..3e070414ae 100644
--- a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
+++ b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (Bring some color to your Linux terminal with lolcat)
From dad4389513a2bc7c0d212d38c74cfc63bb8f99f8 Mon Sep 17 00:00:00 2001
From: darksun
Date: Tue, 11 Dec 2018 11:44:27 +0800
Subject: [PATCH 040/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Snake=20your=20wa?=
=?UTF-8?q?y=20across=20your=20Linux=20terminal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ake your way across your Linux terminal.md | 52 +++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100644 sources/tech/20181210 Snake your way across your Linux terminal.md
diff --git a/sources/tech/20181210 Snake your way across your Linux terminal.md b/sources/tech/20181210 Snake your way across your Linux terminal.md
new file mode 100644
index 0000000000..5ae452dcf5
--- /dev/null
+++ b/sources/tech/20181210 Snake your way across your Linux terminal.md
@@ -0,0 +1,52 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Snake your way across your Linux terminal)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-snake)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+
+Snake your way across your Linux terminal
+======
+Python isn't the only snake you'll find at the Linux command line with this classic 1970s game remake.
+
+
+Welcome back to the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. It's hard to say exactly, but my definition is anything that helps you have fun at the terminal.
+
+We've been on a roll with games over the weekend, and it was fun, so let's look at one more game today, Snake!
+
+Snake is an oldie but goodie; versions of it have been around seemingly forever. The first version I remember playing was one called [Nibbles][1] that came packaged with [QBasic][2] in the 1990s, and was probably pretty important to my understanding of what a programming language even was. Here I had the source code to a game that I could modify and just see what happens, and maybe learn something about what all of those funny little words that made up a programming language were all about.
+
+Today's [Snake][3] is written in Go, and while it's simple, it's just as much fun as the original. Like most simple old games, there are a ton of versions to choose from. In Snake's case, there's even a version in the classic [bsdgames][4] package that's almost certainly packaged for your distribution.
+
+But what I like about this version of Snake is that it's packaged for Docker so I can easily run it in one line from my terminal without worrying about anything disto-specific. That, and it makes use of 15 randomized food emojis for the snake to eat. I'm a sucker for food emojis. Anyway, give it a try using:
+
+```
+$ docker run -ti dyego/snake-game
+```
+
+This Snake is licensed as open source under an MIT license, and you can check out the source code [on GitHub][3].
+
+Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Powers of two, powers of Linux: 2048 at the command line][5], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-snake
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://en.wikipedia.org/wiki/Nibbles_(video_game)
+[2]: https://en.wikipedia.org/wiki/QBasic
+[3]: https://github.com/DyegoCosta/snake-game
+[4]: https://github.com/vattam/BSDGames
+[5]: https://opensource.com/article/18/12/linux-toy-2048
From 95fe23b0b6775885bd206bc5f84816d4111d411c Mon Sep 17 00:00:00 2001
From: darksun
Date: Tue, 11 Dec 2018 11:47:47 +0800
Subject: [PATCH 041/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20get=20?=
=?UTF-8?q?started=20in=20AI?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../tech/20181210 How to get started in AI.md | 113 ++++++++++++++++++
1 file changed, 113 insertions(+)
create mode 100644 sources/tech/20181210 How to get started in AI.md
diff --git a/sources/tech/20181210 How to get started in AI.md b/sources/tech/20181210 How to get started in AI.md
new file mode 100644
index 0000000000..b0ac291557
--- /dev/null
+++ b/sources/tech/20181210 How to get started in AI.md
@@ -0,0 +1,113 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How to get started in AI)
+[#]: via: (https://opensource.com/article/18/12/how-get-started-ai)
+[#]: author: (Gordon Haff https://opensource.com/users/ghaff)
+
+How to get started in AI
+======
+Before you can begin working in artificial intelligence, you need to acquire some human intelligence.
+
+
+I've both asked and been asked about the best way to learn more about artificial intelligence (AI). What should I read? What should I watch? I'll get to that. But, first, it's useful to break down this question, given that AI covers a lot of territory.
+
+One important distinction to draw is between the research side of AI and the applied side. Cassie Kozyrkov of Google [drew this distinction][1] in a talk at the recent O'Reilly Artificial Intelligence Conference in London, and it's a good one.
+
+Research AI is rather academic in nature and requires a heavy dose of math across a variety of disciplines before you even get to those parts that are specific to AI. This aspect of AI focuses on the algorithms and tools that drive the state of AI forward. For example, what neural network structures might improve vision recognition results? How might we make unsupervised learning a more generally useful approach? Can we find ways to understand better how deep learning pipelines come up with the answers they do?
+
+Applied AI, on the other hand, is more about using existing tools to obtain useful results. Open source has played a big role here in providing free and often easy-to-use software in a variety of languages. Public cloud providers have also devoted a lot of attention to providing machine learning services, models, and datasets that make the onramp to getting started with AI much simpler than it would be otherwise.
+
+I'll add at this point that applied AI practitioners shouldn't treat their tools as some sort of black box that spits out answers for mysterious reasons. At a minimum, they need to understand the limits and potential biases of different techniques, models, and data collection approaches. It's just that they don't necessarily need to delve deeply into all the theory underpinning every part of their toolchain.
+
+Although it's probably less important for working in AI on a day-to-day basis, it's also useful to understand the broader context of AI. It goes beyond the narrow scope of deep learning on neural networks that have been so important to the gains made in reinforcement learning and supervised learning to date. For example, AI is often viewed as a way to augment (rather than replace) human judgment and decisions. But the handoff between machine and human has its own pitfalls.
+
+With that background, here are some study areas and resources you may find useful.
+
+### Research AI
+
+In a lot of respects, a list of resources for research AI mirror those in an undergraduate (or even graduate) computer science program that's focused on AI. The main difference is that the syllabus you draw up may be more interdisciplinary than more traditionally focused university curricula.
+
+Where you start will depend on your computer science and math background.
+
+If it's minimal or rusty, but you still want to develop a deep understanding of AI fundamentals, you'll benefit from taking some math courses to start. There are many options on massive online open courses (MOOCs) like the nonprofit [edX][2] platform and [Coursera][3]. (Both platforms charge for certifications, but edX makes all the content available for free to people just auditing the course.)
+
+Typical foundational courses could include:
+
++ [MIT's Calculus courses][22], starting with differentiation
++ [Linear Algebra][23] (University of Texas)
++ Probability and statistics, such as MIT's [Probability—The Science of Uncertainty and Data][24]
+
+
+To get deeper into AI from a research perspective, you'll probably want to get into all these areas of mathematics and more. But the above should give you an idea of the general branches of study that are probably most important before delving into machine learning and AI proper.
+
+In addition to MOOCs, resources such as [MIT OpenCourseWare][4] provide the syllabus and various supporting materials for a wide range of mathematics and computer science courses.
+
+With the foundations in place, you can move onto more specialized courses in AI proper. Andrew Ng's AI MOOC, from when he was teaching at Stanford, was one of the early courses to popularize the whole online course space. Today, his [Neural Networks and Deep Learning][5] is part of the Deep Learning specialization at Coursera. There are corresponding programs on edX. For example, Columbia offers an [Artificial Intelligence MicroMasters][6].
+
+In addition to courses, a variety of textbooks and other learning material are also available online. These include:
+
+ * [Neural Networks and Deep Learning][7]
+ * [Deep Learning][8] from MIT Press by Ian Goodfellow and Yoshua Bengio and Aaron Courville
+
+### Applied AI
+
+Applied AI is much more focused on using available tools than building new ones. Some appreciation of the mathematical underpinnings, especially statistics, is still useful—arguably even necessary—but you won't be majoring in that aspect of AI to the same degree you would in a research mode.
+
+Programming is a core skill here. While different programming languages can come into play, a lot of libraries and toolsets—such as [PyTorch][9]—rely on Python, so that's a good skill to have. Especially if you have some level of programming background, MIT's [Introduction to Computer Science and Programming Using Python][10], based on its on-campus 6.001 course, is a good primer. If you're truly new to programming, Charles Severance's [Programming for Everybody (Getting Started with Python)][11] from the University of Michigan doesn't toss you into the deep end of the pool the way the MIT course does.
+
+[The R programming language][12] is also a useful skill to add to your toolbox. While it's less used in machine learning (ML) per se, it's common for a variety of other data science tasks, and applied AI/ML and data science often blend in practice. For example, many tasks associated with organizing and cleaning data apply equally whatever analysis techniques you'll eventually use. A MOOC sequence like Harvard's [Data Science certificate][13] is an example of a set of courses that provide a good introduction to working with data.
+
+Another open source software library you're likely to encounter if you do any work with AI is [TensorFlow][14]. It was originally developed by researchers and engineers from the Google Brain team within Google's AI organization. [Google offers a variety of tutorials][15] to get started with TensorFlow using the high-level Keras API. You can run TensorFlow locally as well as online in Google Cloud.
+
+In general, all of the big public cloud providers offer online datasets and ML services that can be an easy way to get started. However, especially as you move beyond "play" datasets and applications, you need to start thinking seriously about the degree to which you want to be locked into a single provider.
+
+Datasets for your exploratory learning projects are available from many different sources. In addition to the public cloud providers, [Kaggle][16] is another popular source and also a good learning resource more broadly. Government data is also increasingly available in digital form. The US Federal Government's [Data.gov][17] claims over 300,000 datasets. State and local governments also publish data on everything from restaurant health ratings to dogs' names.
+
+### Miscellany
+
+I'll close by noting that AI is a broad topic that isn't just about math, programming, and data. AI as a whole touches many other fields, including cognitive psychology, linguistics, game theory, operations research, and control systems. Indeed, a concern among at least some AI researchers today is that the field has become too fixated on a small number of techniques that have become powerful and interesting only quite recently because of the intersection of processing power and big data. Many longstanding problems in understanding how humans learn and reason remain largely unsolved. Developing at least some appreciation for these broader problem spaces will better enable you to place AI within a broader context.
+
+One of my favorite examples is the [Humans and Autonomy Lab][18] at Duke. The work in this lab touches on all the challenges of humans working with machines, such as how autopilots can create ["Children of the Magenta"][19] who are unable to take control quickly if the automation fails. A basic brain-science course, such as MIT's [Introduction to Psychology][20], provides some useful context for the relationship between human intelligence and machine intelligence. Another course in a similar vein, but taught by the late Marvin Minsky from MIT's Electrical Engineering and Computer Science department, is [The Society of Mind][21].
+
+If there's one key challenge to learning about AI, it's not that raw materials and tools aren't readily available. It's that there are so many of them. My objective hasn't been to give you a comprehensive set of pointers. Rather, it's been to both point out the different paths you can take and provide you with some possible starting points. Happy learning!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/how-get-started-ai
+
+作者:[Gordon Haff][a]
+选题:[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/ghaff
+[b]: https://github.com/lujun9972
+[1]: https://www.youtube.com/watch?v=RLtI7r3QUyY
+[2]: https://www.edx.org/
+[3]: https://www.coursera.org/
+[4]: https://ocw.mit.edu/index.htm
+[5]: https://www.coursera.org/learn/neural-networks-deep-learning
+[6]: https://www.edx.org/micromasters/columbiax-artificial-intelligence
+[7]: http://neuralnetworksanddeeplearning.com/
+[8]: http://www.deeplearningbook.org/
+[9]: https://pytorch.org/
+[10]: https://www.edx.org/course/introduction-to-computer-science-and-programming-using-python
+[11]: https://www.coursera.org/learn/python
+[12]: https://www.r-project.org/about.html
+[13]: https://www.edx.org/professional-certificate/harvardx-data-science
+[14]: https://www.tensorflow.org/
+[15]: https://www.tensorflow.org/tutorials/
+[16]: https://www.kaggle.com/
+[17]: https://www.data.gov/
+[18]: https://hal.pratt.duke.edu/
+[19]: https://99percentinvisible.org/episode/children-of-the-magenta-automation-paradox-pt-1/
+[20]: https://ocw.mit.edu/courses/brain-and-cognitive-sciences/9-00sc-introduction-to-psychology-fall-2011/
+[21]: https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-868j-the-society-of-mind-fall-2011/
+[22]: https://www.edx.org/course/calculus-1a-differentiation
+[23]: https://www.edx.org/course/linear-algebra-foundations-to-frontiers
+[24]: https://courses.edx.org/courses/course-v1:MITx+6.431x+3T2018/course/
From 7e96a46a1b62c2b7fb76166bd8e31187361a8ea1 Mon Sep 17 00:00:00 2001
From: darksun
Date: Tue, 11 Dec 2018 11:51:23 +0800
Subject: [PATCH 042/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20McFly=20=E2=80=93?=
=?UTF-8?q?=20A=20Replacement=20To=20=E2=80=98Ctrl+R=E2=80=99=20Bash=20His?=
=?UTF-8?q?tory=20Search=20Feature?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...To ‘Ctrl-R- Bash History Search Feature.md | 160 ++++++++++++++++++
1 file changed, 160 insertions(+)
create mode 100644 sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md
diff --git a/sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md b/sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md
new file mode 100644
index 0000000000..4c1da08110
--- /dev/null
+++ b/sources/tech/20181210 McFly - A Replacement To ‘Ctrl-R- Bash History Search Feature.md
@@ -0,0 +1,160 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (McFly – A Replacement To ‘Ctrl+R’ Bash History Search Feature)
+[#]: via: (https://www.ostechnix.com/mcfly-a-replacement-to-ctrlr-bash-history-search-feature/)
+[#]: author: (SK https://www.ostechnix.com/author/sk/)
+
+McFly – A Replacement To ‘Ctrl+R’ Bash History Search Feature
+======
+
+If you spend a lot of time on CLI mode, you should definitely used or heard about **reverse search** function in BASH. The keyboard shortcut to do reverse search in Bash is **Ctrl+r**. Using bash reverse search, we can bring up all commands which we used previously executed without having to re-type them every time. You can, of course, use UP/DOWN arrows to search your bash history. However, Ctrl+r will make this process much easier and faster. Today, I Stumbled upon a replacement to ‘Ctrl+r’ Bash history search feature. Meet **“McFly”** , a simple tool written in **Rust** programming language that replaces the default Ctrl+r Bash history search with an intelligent search engine. All command suggestions made by McFly are prioritized in real time with a small **neural network**.
+
+McFly rebinds Ctrl+r functionality to bring up all recently executed commands from your Bash history. It augments your shell history by tracking the following:
+
+ * Command exit status,
+ * timestamp (When you run the command),
+ * and execution directory (Where you run the command).
+
+
+
+It saves all tracking details in a SQLite database. Since it tracks the command’s historical exit status, you can simply ignore the old failed commands. Cool, yeah?
+
+When suggesting a command, McFly considers the following facts:
+
+ * On which directory you ran the command. You’re likely to repeat that command in the same directory in future.
+ * What commands you typed before the command.
+ * How often you run the command.
+ * When you last ran the command.
+ * If you’ve selected the command in McFly before.
+ * The command’s historical exit status. Because, you probably don’t want to run old failed commands, right?
+
+
+
+McFly maintains your default Bash history file, so you can stop using McFly at any time. McFly is not just for BASH, it is also extendable for other shells as well.
+
+### Installing McFly
+
+McFly can be installed using Linuxbrew on Linux. If you haven’t installed Linuxbrew yet, refer the following link.
+
+[Linuxbrew – A Common Package Manager For Linux And Mac OS X][1]
+
+Once Linuxbrew installed, run the following commands to install McFly:
+
+```
+$ brew tap cantino/mcfly https://github.com/cantino/mcfly
+
+$ brew install mcfly
+```
+
+After the installation is completed, you will see the following output.
+
+```
+==> Installing mcfly from cantino/mcfly
+==> Downloading https://github.com/cantino/mcfly/releases/download/v0.2.5/mcfly-v0
+==> Downloading from https://github-production-release-asset-2e65be.s3.amazonaws.c
+######################################################################## 100.0%
+==> ONE MORE STEP! Edit ~/.bashrc and add the following:
+
+if [ -f $(brew --prefix)/opt/mcfly/mcfly.bash ]; then
+. $(brew --prefix)/opt/mcfly/mcfly.bash
+fi
+🍺 /home/linuxbrew/.linuxbrew/Cellar/mcfly/v0.2.5: 4 files, 3.5MB, built in 33 seconds
+```
+
+As you can see, we need to do one more step before start using McFly.
+
+Add the following lines to your **~/.bashrc** file:
+
+```
+if [ -f $(brew --prefix)/opt/mcfly/mcfly.bash ]; then
+. $(brew --prefix)/opt/mcfly/mcfly.bash
+fi
+```
+
+Finally, run the following command to take effects changes:
+
+```
+$ source ~/.bashrc
+```
+
+Your BASH history will be imported to McFly database when you run this command for the first time. It will take a few moments depending upon size of your bash history file. Once the import is done, you will see the following message.
+
+```
+McFly: Importing Bash history for the first time. This may take a minute or two...done.
+```
+
+You can now start using McFly.
+
+
+### Usage
+
+To search through your command history, just type ‘mcfly search’ followed by the part of the command name and hit ENTER key. Mcfly will display the command suggestions based on the search query you just type.
+
+```
+$ mcfly search
+```
+
+For instance, I type the following command:
+
+```
+$ mcfly search mk
+```
+
+Here is the sample output from my Ubuntu machine:
+
+
+
+As you can see, I have used ‘mkdir’ command two times. If you want to run a command from the list of suggestions, just use **UP/DOWN** arrows to select it and hit ENTER to run it immediately. If you want to edit a command, choose it and hit **TAB** key to bring it back to your Terminal and then edit before running it. To delete the selected command from the history, just press **F2**.
+
+Alternatively, type the following command to open the history search and then type any command or part of the command to view the suggestions from your history.
+
+```
+$ mcfly search
+```
+
+McFly will display the command suggestions as you type.
+
+Here is a short video demonstration of McFly:
+
+View help:
+
+```
+$ mcfly --help
+```
+
+
+### Remove McFly
+
+Don’t like McFly, no problem! Remove it using the following commands:
+
+```
+$ brew uninstall mcfly
+
+$ brew untap cantino/mcfly
+```
+
+Finally, remove the lines which we added earlier from **~/.bashrc** file.
+
+And, that’s all for now. More good stuffs to come. Stay tuned!
+
+Cheers!
+
+
+
+--------------------------------------------------------------------------------
+
+via: https://www.ostechnix.com/mcfly-a-replacement-to-ctrlr-bash-history-search-feature/
+
+作者:[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/linuxbrew-common-package-manager-linux-mac-os-x/
From 8f8020834752d49289f78b3123a353439f3e3f2d Mon Sep 17 00:00:00 2001
From: darksun
Date: Tue, 11 Dec 2018 12:13:30 +0800
Subject: [PATCH 043/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Four=20Easy=20Way?=
=?UTF-8?q?s=20to=20Search=20Or=20Find=20Files=20And=20Folders=20in=20Linu?=
=?UTF-8?q?x?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...arch Or Find Files And Folders in Linux.md | 153 ++++++++++++++++++
1 file changed, 153 insertions(+)
create mode 100644 sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
diff --git a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
new file mode 100644
index 0000000000..8dde618420
--- /dev/null
+++ b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
@@ -0,0 +1,153 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Four Easy Ways to Search Or Find Files And Folders in Linux)
+[#]: via: (https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/)
+[#]: author: (Prakash Subramanian https://www.2daygeek.com/author/prakash/)
+
+Four Easy Ways to Search Or Find Files And Folders in Linux
+======
+
+Linux admins can’t able to leave a day without performing a file search as this one of the activity for their routine.
+
+It’s good to know all the file search stuffs because it would help you in many ways when you are working on headless server.
+
+These commands are not complicate to remember because these are using a standard syntax.
+
+This can be performed through Four Linux commands and each command has their own unique feature.
+
+### Method-1: Search Files And Folders in Linux Using find Command
+
+Find command is widely used and very famous command to search files and folders in Linux. It searches given files in the current directory and recursively through its sub-directories based on the search criteria.
+
+It allow users to perform all kind of file searches based on the criteria lie by size, name, owner, group, type, permissions, date, and other criteria.
+
+Run the following command to find a given file in system.
+
+```
+# find / -iname "sshd_config"
+/etc/ssh/sshd_config
+```
+
+Run the following command to find a given folder in system. To search a folder in Linux we need to use `-type` parameter.
+
+```
+# find / -type d -iname "ssh"
+/usr/lib/ssh
+/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh
+/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh
+/etc/ssh
+```
+
+Use wildcard option to search set of files on your system. We are going to search all files available in the system with `.config` extension.
+
+```
+# find / -name "*.config"
+/usr/lib/mono/gac/avahi-sharp/1.0.0.0__4d116c78973743f5/avahi-sharp.dll.config
+/usr/lib/mono/gac/avahi-ui-sharp/0.0.0.0__4d116c78973743f5/avahi-ui-sharp.dll.config
+/usr/lib/python2.7/config/Setup.config
+/usr/share/git/mw-to-git/t/test.config
+/var/lib/lightdm/.config
+/home/daygeek/.config
+/root/.config
+/etc/skel/.config
+```
+
+Use the following command format to find an empty files and folders in system.
+
+```
+# find / -empty
+```
+
+Use the following command combination to find all files containing specific text on Linux.
+
+```
+# find / -type f -exec grep "Port 22" '{}' \; -print
+# find / -type f -print | xargs grep "Port 22"
+# find / -type f | xargs grep 'Port 22'
+# find / -type f -exec grep -H 'Port 22' {} \;
+```
+
+### Method-2: Search Files And Folders in Linux 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, however we can manually update it by running the following command.
+
+```
+$ sudo updatedb
+```
+
+Simply run the following command to list the given file or folder. There is no specific options need to be specified in locate command to print file or folder.
+
+To search `ssh` folder in system.
+
+```
+# locate --basename '\ssh'
+/etc/ssh
+/usr/bin/ssh
+/usr/lib/ssh
+/usr/lib/go/pkg/linux_amd64/cmd/vendor/golang.org/x/crypto/ssh
+/usr/lib/go/src/cmd/go/testdata/failssh/ssh
+/usr/lib/go/src/cmd/vendor/golang.org/x/crypto/ssh
+```
+
+To search `ssh_config` file in system.
+
+```
+# locate --basename '\sshd_config'
+/etc/ssh/sshd_config
+```
+
+### Method-3: Search Files in Linux Using which command
+
+TThe 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.
+
+Run the following command to print the full path of the vim executable file location.
+
+```
+# which vi
+/usr/bin/vi
+```
+
+Alternatively, it’s allowing user to perform multiple file search in one shot.
+
+```
+# which -a vi sudo
+/usr/bin/vi
+/bin/vi
+/usr/bin/sudo
+/bin/sudo
+```
+
+### Method-4: Search Files in Linux Using whereis command
+
+The whereis command used to search the binary, source, and man page files for a given command.
+
+```
+# whereis vi
+vi: /usr/bin/vi /usr/share/man/man1/vi.1p.gz /usr/share/man/man1/vi.1.gz
+```
+--------------------------------------------------------------------------------
+
+via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders-in-linux/
+
+作者:[Prakash Subramanian][a]
+选题:[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/prakash/
+[b]: https://github.com/lujun9972
From 512e039533da3e82b93ff6f58f596fd5a53256a1 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 12:48:01 +0800
Subject: [PATCH 044/119] PRF:20181121 10 ways to give thanks to open source
and free software maintainers.md
@geekpi
---
...en source and free software maintainers.md | 36 ++++++++++---------
1 file changed, 19 insertions(+), 17 deletions(-)
diff --git a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md
index 5dcda79b9e..9f3b5b970f 100644
--- a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md
+++ b/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (10 ways to give thanks to open source and free software maintainers)
[#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source)
@@ -8,39 +8,41 @@
[#]: url: ( )
感谢开源和自由软件维护者的 10 种方法
-======
-如何表达你的感激之情。
-
+=======
-每天,我都使用高质量的软件,这些软件由没有要求付款的人开发和维护,他们尊重我的自由,并且慷慨地付出时间和精力。
+> 如何表达你的感激之情。
+
+
+
+每天,我使用的那些高质量的软件 —— 开发和维护这些软件的人不需要我为之付款,他们尊重我的自由,并且慷慨地付出时间和精力。
在这个感恩的季节,我鼓励那些也使用和欣赏开源和自由软件维护者工作的人表达你的感激之情。以下是十种方法:
### 容易做到的
- 1. 发送电子邮件,感谢开发人员。具体点说,告诉他们你使用他们的什么软件以及你如何获益的。
- 2. 使用你最喜爱的社交媒体平台宣传它。
- 3. 写一篇关于你最喜欢的软件的博客文章。
+1、发送电子邮件感谢开发人员。具体点说,告诉他们你使用他们的什么软件以及它是如何帮助了你。
+2、使用你最喜爱的社交媒体平台宣传它。
+3、写一篇关于你最喜欢的软件的博客文章。
### 捐款
- 4. 如果你最喜欢的开源项目接受捐款,请汇款。
- 5. 如果你受雇于使用开源软件的公司,看你是否可以说服管理层赞助某些项目。
- 6. 提供最高设置额度的捐款。社交动机能做的不可思议!
+4、如果你最喜欢的开源项目接受捐款,请汇款。
+5、如果你受雇于使用开源软件的公司,看你是否可以说服管理层赞助某些项目。
+6、尽你所能地捐款。社交动机能做的不可思议!
### 花费时间
- 7. 帮助查看补丁。
- 8. 帮助分类 bug。
- 9. 回答 IRC、邮件列表或 [Stack Overflow][1] 中的问题。
+7、帮助审查补丁。
+8、帮助分类 bug。
+9、回答 IRC、邮件列表或 [Stack Overflow][1] 中的问题。
-**10. 额外的:**如果你像我一样,你在某个时候对开源社区的其他人说了一些严厉的话。承诺做得更好:用善良和开放沟通。感谢的最好方式是让开源社区成为人们能舒适沟通的地方。
+**10、额外的:**如果你像我一样,你在某个时候对开源社区的其他人说了一些严厉的话。承诺做得更好:用善良和开放沟通。感谢的最好方式是让开源社区成为人们能舒适沟通的地方。
--------------------------------------------------------------------------------
@@ -49,10 +51,10 @@ via: https://opensource.com/article/18/11/ways-give-thanks-open-source
作者:[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/) 荣誉推出
[a]: https://opensource.com/users/moshez
[b]: https://github.com/lujun9972
-[1]: https://meta.stackoverflow.com/
\ No newline at end of file
+[1]: https://meta.stackoverflow.com/
From b63e87093936d6aff9f034a5da6953458f467613 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 12:48:54 +0800
Subject: [PATCH 045/119] PUB:20181121 10 ways to give thanks to open source
and free software maintainers.md
@geekpi https://linux.cn/article-10333-1.html
---
...ive thanks to open source and free software maintainers.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/talk => published}/20181121 10 ways to give thanks to open source and free software maintainers.md (96%)
diff --git a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md b/published/20181121 10 ways to give thanks to open source and free software maintainers.md
similarity index 96%
rename from translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md
rename to published/20181121 10 ways to give thanks to open source and free software maintainers.md
index 9f3b5b970f..4a70429555 100644
--- a/translated/talk/20181121 10 ways to give thanks to open source and free software maintainers.md
+++ b/published/20181121 10 ways to give thanks to open source and free software maintainers.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (10 ways to give thanks to open source and free software maintainers)
[#]: via: (https://opensource.com/article/18/11/ways-give-thanks-open-source)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10333-1.html)
感谢开源和自由软件维护者的 10 种方法
=======
From a0f1995061a808b012981aa58bde51737029454f Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 13:05:22 +0800
Subject: [PATCH 046/119] PRF:20180331 Emacs -4- Automated emails to org-mode
and org-mode syncing.md
@oneforalone
---
...emails to org-mode and org-mode syncing.md | 45 ++++++++++---------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md b/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md
index 976979192f..f9e423899d 100644
--- a/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md
+++ b/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md
@@ -1,55 +1,56 @@
-Emacs #4:使用org-mode自动管理邮件及同步文档
+Emacs 系列(四):使用 Org 模式自动管理邮件及同步文档
======
-这是 [Emacs 和 org-mode 系类][4]的第四篇。
-至今为止,你已经见识到了 org-mode 的强大和高效,如果你像我一样,你可能会想:
+这是 [Emacs 和 Org 模式系列][4]的第四篇。
-“我真的很想让它在我所有的设备上同步。”
+至今为止,你已经见识到了 Org 模式的强大和高效,如果你像我一样,你可能会想:
+
+> “我真的很想让它在我所有的设备上同步。”
或者是说:
-“我能在 org-mode 中转发邮件吗?”
+> “我能在 Org 模式中转发邮件吗?”
答案当然是肯定的,因为这就是 Emacs。
### 同步
-由于 org-mode 只使用文本文件,所以使用任意工具都可以很容易地实现同步。我使用的是 git 的 git-remote-gcrypt。由于 git-remote-gcrypt 的一些限制,每台机器都倾向于推到自己的分支,并使用命令来控制。每台机子都会先合并其他所有的 branch 然后再将合并后的结果 push 到 master 上。cron 作业可以实现将机器上的 branch push 上去,而 elisp 会协调这一切--确保在同步之前保存缓冲区,在同步之后从磁盘刷新缓冲区,等等。
+由于 Org 模式只使用文本文件,所以使用任意工具都可以很容易地实现同步。我使用的是 git 的 `git-remote-gcrypt`。由于 `git-remote-gcrypt` 的一些限制,每台机器都倾向于推到自己的分支,并使用命令来控制。每台机器都会先合并其它所有的分支,然后再将合并后的结果推送到主干上。cron 作业可以实现将机器上的分支推送上去,而 elisp 会协调这一切 —— 确保在同步之前保存缓冲区,在同步之后从磁盘刷新缓冲区,等等。
这篇文章的代码有点多,所以我将把它链接到 github 上,而不是写在这里。
-我有一个用来存放我所有的 org-stuff 的目录 $HOME/org,在 ~/org 目录下有个 [Makefile][2] 文件来处理同步。该文件定义了一下目标:
- * push: 添加,提交和 push 到以主机命名的 branch 上
- * fetch: 一个简单的 git fetch
- * sync: 添加,提交和 pull 远程的修改,合并并将其 push 到以主机命名的 branch 和 master 上(假设合并成功)
+我有一个用来存放我所有的 Org 模式的文件的目录 `$HOME/org`,在 `~/org` 目录下有个 [Makefile][2] 文件来处理同步。该文件定义了以下目标:
+ * `push`: 添加、提交和推送到以主机命名的分支上
+ * `fetch`: 一个简单的 `git fetch` 操作
+ * `sync`: 添加、提交和拉取远程的修改,合并,并(假设合并成功)将其推送到以主机命名的分支和主干上
现在,在我的用户 crontab 中有这个:
-```
-*/15 * * * * make -C $HOME/org push fetch 2>&1 | logger --tag 'orgsync'
```
-[accompanying elisp code][3] 定义了一个快捷键(C-c s)来调用同步。多亏了 cronjob,只要文件被保存 -- 即使我没有在另一个 boxen 上同步 -- 它们也会被 pull 进来。
+*/15 * * * * make -C $HOME/org push fetch 2>&1 | logger --tag 'orgsync'
+```
+
+[与之相关的 elisp 代码][3] 定义了一个快捷键(`C-c s`)来调用同步。多亏了 cronjob,只要文件被保存 —— 即使我没有在另一个机器上同步 —— 它们也会被拉取进来。
我发现这个设置非常好用。
-### 用 org-mode 发邮件
+### 用 Org 模式发邮件
-在继续下去之前,首先要问自己一下:你真的需要它吗? 我用的是带有 [mu4e][4] 的 org-mode,而且它集成的也很好;任何组织任务都可以通过 message-id 链接到电子邮件,这很理想 -- 它可以让一个人做一些事情,比如提醒他在一周内回复一条消息。
+在继续下去之前,首先要问自己一下:你真的需要它吗? 我用的是带有 [mu4e][4] 的 Org 模式,而且它集成的也很好;任何 Org 模式的任务都可以通过 `Message-id` 链接到电子邮件,这很理想 —— 它可以让一个人做一些事情,比如提醒他在一周内回复一条消息。
-然而,org 不仅仅只有提醒。它还是一个知识库、创作系统等,但是并不是我所有的邮件客户端都使用 mu4e。(注意:像 MobileOrg 是存在于移动设备中)。我并没有像我想的那样经常使用它,但是它有它的用途,所以我认为我也应该在这里记录它。
+然而,Org 模式不仅仅只有提醒。它还是一个知识库、创作系统等,但是并不是我所有的邮件客户端都使用 mu4e。(注意:移动设备中有像 MobileOrg 这样的应用)。我并没有像我想的那样经常使用它,但是它有它的用途,所以我认为我也应该在这里记录它。
-现在我不仅想处理纯文本电子邮件。我希望能够处理附件、HTML 邮件等。这听起来很快就有问题了 -- 但是通过使用 ripmime 和 pandoc 这样的工具,情况还不错。
+现在我不仅想处理纯文本电子邮件。我希望能够处理附件、HTML 邮件等。这听起来很快就有问题了 —— 但是通过使用 ripmime 和 pandoc 这样的工具,情况还不错。
-第一步就是要用某些方法将获取到的邮件放入指定的文件夹下。扩展名,特殊用户等。然后我用 [fetchmail configuration][5] 来将它 pull 下来并运行我自己的 [insorgmail][6] 脚本。
+第一步就是要用某些方法将获取到的邮件放入指定的文件夹下。扩展名、特殊用户等。然后我用一个 [fetchmail 配置][5] 来将它拉取下来并运行我自己的 [insorgmail][6] 脚本。
-这个脚本就是处理所有有趣的部分了。它从 ripmime 开始处理消息,用 pandoc 将HTML 的部分转换为 org 格式。 org 的层次结构是用来尽可能最好地表示 email 的结构。使用HTML和其他工具时,email 可能会变得相当复杂,但我发现这对于我来说是可以接受的。
+这个脚本就是处理所有有趣的部分了。它开始用 ripmime 处理消息,用 pandoc 将 HTML 的部分转换为 Org 模式的格式。 Org 模式的层次结构是用来尽可能最好地表示 email 的结构。使用 HTML 和其他工具时,email 可能会变得相当复杂,但我发现这对于我来说是可以接受的。
### 下一篇
-我最后一篇关于 org-mode 的文章将讨论如何使用它来编写文档和准备幻灯片 -- 我发现自己对 org-mode 的使用非常满意,但这需要一些调整。
-
+我最后一篇关于 Org 模式的文章将讨论如何使用它来编写文档和准备幻灯片 —— 我发现自己对 Org 模式的使用非常满意,但这需要一些调整。
--------------------------------------------------------------------------------
@@ -58,7 +59,7 @@ via: http://changelog.complete.org/archives/9898-emacs-4-automated-emails-to-org
作者:[John Goerzen][a]
译者:[oneforalone](https://github.com/oneforalone)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 2ae2ef44957c77ae0c7be98a6d00e9ee0a992960 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 13:05:54 +0800
Subject: [PATCH 047/119] PUB:20180331 Emacs -4- Automated emails to org-mode
and org-mode syncing.md
@oneforalone https://linux.cn/article-10334-1.html
---
...Emacs -4- Automated emails to org-mode and org-mode syncing.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md (100%)
diff --git a/translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md b/published/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md
similarity index 100%
rename from translated/tech/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md
rename to published/20180331 Emacs -4- Automated emails to org-mode and org-mode syncing.md
From 9ac1bda1d33cffb7a66f24710793aad8895e6953 Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Tue, 11 Dec 2018 13:07:38 +0800
Subject: [PATCH 048/119] Translating by qhwdw
---
...ction to Quantum Computing with Open Source Cirq Framework.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
index 8cec20916d..ee35ef36ec 100644
--- a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
+++ b/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
@@ -1,3 +1,4 @@
+Translating by qhwdw
An Introduction to Quantum Computing with Open Source Cirq Framework
======
As the title suggests what we are about to begin discussing, this article is an effort to understand how far we have come in Quantum Computing and where we are headed in the field in order to accelerate scientific and technological research, through an Open Source perspective with Cirq.
From 8ec35df76d59af461f39a5dc01ba277d17c3d3ed Mon Sep 17 00:00:00 2001
From: HankChow <280630620@qq.com>
Date: Tue, 11 Dec 2018 15:02:29 +0800
Subject: [PATCH 049/119] hankchow translating
---
.../20181205 Bash Variables- Environmental and Otherwise.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
index 11397f9b80..4df8c10143 100644
--- a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
+++ b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (HankChow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (Bash Variables: Environmental and Otherwise)
From e0f4674f9b120cb5f4c468db414864fb549aa89b Mon Sep 17 00:00:00 2001
From: heguangzhi <7731226@qq.com>
Date: Tue, 11 Dec 2018 17:02:12 +0800
Subject: [PATCH 050/119] translated
---
...04 Have a cow at the Linux command line.md | 41 +++++++++----------
1 file changed, 20 insertions(+), 21 deletions(-)
rename {sources => translated}/tech/20181204 Have a cow at the Linux command line.md (59%)
diff --git a/sources/tech/20181204 Have a cow at the Linux command line.md b/translated/tech/20181204 Have a cow at the Linux command line.md
similarity index 59%
rename from sources/tech/20181204 Have a cow at the Linux command line.md
rename to translated/tech/20181204 Have a cow at the Linux command line.md
index a396c0ce14..ef08209828 100644
--- a/sources/tech/20181204 Have a cow at the Linux command line.md
+++ b/translated/tech/20181204 Have a cow at the Linux command line.md
@@ -1,5 +1,3 @@
-heguangzhi Translating
-
[#]: collector: (lujun9972)
[#]: translator: (heguangzhi)
[#]: reviewer: ( )
@@ -9,26 +7,28 @@ heguangzhi Translating
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
[#]: url: ( )
-Have a cow at the Linux command line
+
+在Linux命令行上拥有一头奶牛
======
-Bring a bovine voice to your terminal output with the cowsay utility.
+
+使用 cowsay 实用程序将牛的声音带到你的终端输出。
+

-Welcome to the fourth day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal.
+欢迎来到 Linux 命令行玩具第四天。如果这是你第一次访问这个系列,你可能会问自己,什么是命令行玩具。我们也在考虑这一点,但是一般来说,这可能是一个游戏,或者任何简单的娱乐,可以帮助你在终端玩得开心。
-Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone. Because just about everyone who I’ve mentioned this series to has asked me about it already, today’s selection is an obligatory one.
+你们中的一些人以前会看过我们日历上的各种选项,但是我们希望每个人都至少有一个新的选项。因为几乎所有我提到这个系列的人都已经问过我了,今天的选项是必须的。
-You didn’t think we’d make it through this series without mentioning cowsay, did you?
+你不认为我们会在不提及 cowsay 的情况下完成这个系列,是吗?
-Cowsay is an udderly fantastic utility that takes text and outputs it as the spoken text of an ASCII-art bovine.
+Cowsey 是一个神奇的实用程序,它将文本作为ASCII艺术牛的口语文本输出。
-You’ll likely find cowsay packaged in your default repositories, and perhaps even already installed. For me, in Fedora, all it took to install was:
+你可能会发现 cowsey 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装:
```
$ sudo dnf install -y cowsay
```
-
-Then, invoke it with cowsay followed by your message. Perhaps you’d like to pipe in the [fortune][1] [utility][1] we talked about yesterday.
+然后,用 cowsey 调用它,然后是你的消息。也许你想到昨天我们谈到的 [幸运][1] [应用][1]。
```
$ fortune | cowsay
@@ -43,7 +43,7 @@ $ fortune | cowsay
|| ||
```
-That’s it! **Cowsay** ships with few variations, called cow files, that can usually be found in **/usr/share/cowsay.** To see the cow file options available on your system, use **-l** flag after cowsay. Then, use the **-f** flag to try one out.
+就这样!**CowSay** 几乎没有变化,称为 cow 文件,通常可以在 **/usr/share/cowsay** ,要查看系统上可用的 cow 文件选项,请在 cowsay 之后使用 **-l** 。然后,用 **-f** 试试其中之一。
```
$ cowsay -f dragon "Run for cover, I feel a sneeze coming on."
@@ -68,10 +68,10 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~
```
+我对 **cowsay** 的真正不满是,我今天没有足够的时间来为牛的挤奶。牛排太高了,我可能会开个玩笑。
-My real beef with **cowsay** is that I don’t have enough time today to really milk the cow puns for all they are worth. The steaks are just too high, and I might butcher the joke.
+更严重的是,我已经完全忘记了 **cowsay** 直到我在学习可翻译的剧本时再次遇到它。如果你碰巧安装了 **cowyay**,当你运行脚本时,你会从一系列奶牛身上获得产出。例如,运行本脚本:
-On a more serious note, I had completely forgotten about **cowsay** until I re-encountered it when learning Ansible playbooks. If you happen to have **cowsay** installed, when you run a playbook, you’ll get your output from a series of cows. For example, running this playbook:
```
- hosts:
@@ -79,8 +79,7 @@ On a more serious note, I had completely forgotten about **cowsay** until I re-e
tasks:
- action: ping
```
-
-Might give you the following:
+可能会给你以下信息:
```
$ ansible-playbook playbook.yml
@@ -124,14 +123,14 @@ ok: [localhost]
localhost : ok=2 changed=0 unreachable=0 failed=0
```
-
-**Cowsay** is available under a GPLv3 license, and you can find the Perl [source code][2] on GitHub. I’ve also seen versions floating around in other languages, so take a look around for other variants; here’s [one in R][3], for example. Implementing your own version in your language of choice might even be a fun programming learning task.
+**Cowsay** 在GPLV3许可证下可用,您可以在 GitHub 上找到 Perl [源代码][2]。我也见过其他语言的版本,所以看看其他变体;例如,这是 [R语言][3] 。用你选择的语言实现你自己的版本可能是一项有趣的编程学习任务。
Now that **cowsay** is out of the way, we can move on to greener pastures.
+既然 **cowsay** 不碍事了,我们可以去更绿色的牧场了。
-Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+你有最喜欢的命令行玩具吗,你认为我应该对它进行分析?这个系列的日历大部分都填好了,但我还有一些地方。在下面的评论中让我知道,梦幻篮球来看看。如果有空间,梦幻篮球会尝试把它包括进去。如果没有,但是我收到了一些好的意见书,梦幻篮球在结尾做了一个荣誉提名的总结。
-Check out yesterday's toy, [How to bring good fortune to your Linux terminal][1], and check back tomorrow for another!
+看看昨天的玩具,[如何给你的Linux终端带来好运][1],明天再来看看另一个!
--------------------------------------------------------------------------------
@@ -139,7 +138,7 @@ via: https://opensource.com/article/18/12/linux-toy-cowsay
作者:[Jason Baker][a]
选题:[lujun9972][b]
-译者:[译者ID](https://github.com/译者ID)
+译者:[heguangzhi](https://github.com/heguangzhi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 723eb145691c2ce7dcf081796f75af9b5fe69fa0 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 17:56:43 +0800
Subject: [PATCH 051/119] PRF:20181112 The Source History of Cat.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@name1e5s 翻译的很棒!这个系列的文章值得字斟字酌地翻译。
---
.../20181112 The Source History of Cat.md | 47 ++++++++++---------
1 file changed, 24 insertions(+), 23 deletions(-)
diff --git a/translated/talk/20181112 The Source History of Cat.md b/translated/talk/20181112 The Source History of Cat.md
index 3644ce161e..155f5e928e 100644
--- a/translated/talk/20181112 The Source History of Cat.md
+++ b/translated/talk/20181112 The Source History of Cat.md
@@ -1,28 +1,29 @@
-The Source History of Cat
+Cat 命令的源码历史
======
-以前我和我的一些亲戚争论过计算机科学的学位值不值得读。当时我正在上大学,并要决定是不是该主修计算机。我姨和我一表姐觉得我不应该主修计算机。她们承认知道如何编程肯定是很有用且对自己有利的一件事,但是她们认为计算机科学现在发展的如此迅速以至于我学的东西几乎马上就过时了。建议我更好是把编程作为辅业,选择一个基础原理可以受用终身的领域主修,比如经济学或物理学。
-我知道我姨和我表姐说的不对,并决定主修计算机科学。(对不住啊!)平常人可能会觉得像计算机科学领域和软件工程专业每隔几年就完全和之前不一样了。其原因很容易理解。我们有了个人电脑,然后有了互联网,有了手机,之后还有了机器学习…… 科技总是在更新,支撑科技发展的原理和技能当然也在改变。当然,最惊人的是其实原理的改变竟然如此之小。我敢肯定,大多数人在知道了他们电脑里一些重要的软件的历史是多么久远时他们一定会深感震惊。当然我不是说那些刷版本号的浮夸软件 —— 我电脑上的 Firefox 浏览器副本,可能是我用的最多的软件,可能才更新不到两周。如果你看了比如 `grep` 的手册页,你就会发现他在 2010 年后就没有过更新了(至少在 MacOS 上如此)。初版 `grep` 是在 1974 年写就的,那时可以算是计算机世界的侏罗纪了。直到现在,人们(还有程序)仍然依赖 `grep` 来完成日常工作。
+以前我和我的一些亲戚争论过计算机科学的学位值不值得读。当时我正在上大学,并要决定是不是该主修计算机。我姨和我表姐觉得我不应该主修计算机。她们承认知道如何编程肯定是很有用且对自己有利的一件事,但是她们认为计算机科学现在发展的如此迅速以至于我学的东西几乎马上就过时了。建议我更好是把编程作为辅业,选择一个基础原理可以受用终身的领域主修,比如经济学或物理学。
-我姨和我表姐认为计算机技术就像一系列日渐精致的沙堡,在潮水抹净沙滩后新的沙堡完全取代旧的。但事实上,在很多领域上,我们都是不断积累能够解决问题的程序。我们可能不得不偶尔修改这些程序以避免软件无法使用,但大多数情况下我们都可以不修改。 `grep` 是一个简单的程序,可以解决一个仍然存在的问题,所以它能够存活下来。 大多数应用程序编程都是在非常高的级别上完成的,他们建立在解决了旧问题的程序的金字塔上。 30年或40年前的想法和概念,远非过时,在很多情况下他们依然在您的笔记本电脑上软件中存在着。
+我知道我姨和我表姐说的不对,并决定主修计算机科学。(对不住啊!)平常人可能会觉得像计算机科学领域和软件工程专业每隔几年就完全和之前不一样了。其原因很容易理解。我们有了个人电脑,然后有了互联网,有了手机,之后还有了机器学习…… 科技总是在更新,支撑科技发展的原理和技能当然也在改变。当然,最惊人的是其实原理的改变竟然如此之小。我敢肯定,大多数人在知道了他们电脑里一些重要的软件的历史是多么久远时他们一定会深感震惊。当然我不是说那些刷版本号的浮夸软件 —— 我电脑上的 Firefox 浏览器副本,可能是我用的最多的软件,可能两周前就更新过。如果你看了比如 `grep` 的手册页,你就会发现它在 2010 年后就没有过更新了(至少在 MacOS 上如此)。初版 `grep` 是在 1974 年写就的,那时可以算是计算机世界的侏罗纪了。直到现在,人们(还有程序)仍然依赖 `grep` 来完成日常工作。
-我想追溯这样的老程序自第一次写就以来改变了多少回很有趣。 `cat`可能是所有 Unix 实用程序中最简单的,因此我们以它为例。 Ken Thompson于 1969 年编写了 `cat` 的原始实现。如果我告诉别人我的电脑上安了个 1969 年的程序,这准确吗?我们电脑上的程序多大了?
+我姨和我表姐认为计算机技术就像一系列日渐精致的沙堡,在潮水抹净沙滩后新的沙堡完全取代旧的。但事实上,在很多领域上,我们都是不断积累能够解决问题的程序。我们可能不得不偶尔修改这些程序以避免软件无法使用,但大多数情况下我们都可以不修改。`grep` 是一个简单的程序,可以解决一个仍然存在的需求,所以它能够存活下来。 大多数应用程序编程都是在非常高的级别上完成的,它们建立在解决了旧问题的旧程序的金字塔上。 30 年或 40 年前的思路和概念,远非过时,在很多情况下它们依然在您的笔记本电脑上软件中存在着。
+
+我想追溯这样的老程序自第一次写就以来改变了多少回很有趣。 `cat` 可能是所有 Unix 实用程序中最简单的,因此我们以它为例。Ken Thompson 于 1969 年编写了 `cat` 的原始实现。如果我告诉别人我的电脑上安装了个来自 1969 年的程序,这准确吗?我们电脑上的程序多大了?
感谢这种[这种][1]仓库,我们可以完整的看到 `cat` 自 1969 年后是如何发展的。我会先聚焦于可以算得上是我的 MacBook 上的 `cat` 的祖先的 `cat` 实现。随着我们从 Unix 上的第一版 `cat` 追踪到现在 MacOS 上的 `cat`,你会发现,这个程序被重写的次数比你想的还要多 —— 但是直到现在它运行的方式和五十年前多少是完全一致的。
### 研究 Unix
-Ken Thompson 和 Dennis Ritchie 在 PDP 7 上开始写 Unix。那还是 1969 年,C 还没被发明出来,因此所有早期的 Unix 软件都是用 PDP 7 汇编实现的。他们使用的汇编种类是 Unix 特有的,Ken Thompson 在 DEC,也就是 PDP 7 的厂商提供的汇编器之上加了些特性,实现了自己的汇编器。Thompson 的更改在[最初的 Unix 程序员手册][2]的 `as`(也就是汇编器)条目下均有所记录。
+Ken Thompson 和 Dennis Ritchie 在 PDP 7 上开始写 Unix。那还是 1969 年,C 还没被发明出来,因此所有早期的 Unix 软件都是用 PDP 7 汇编实现的。他们使用的汇编种类是 Unix 特有的,Ken Thompson 在 DEC(PDP 7 的厂商)提供的汇编器之上加了些特性,实现了自己的汇编器。Thompson 的更改在[最初的 Unix 程序员手册][2]的 `as`(也就是汇编器)条目下均有所记录。
-因此,[最初的][3] `cat` 也是使用 PDP 7 汇编实现的。 我添加了一些注释,试图解释每条指令的作用,但除非你理解 Thompson 在编写汇编器时加的特性,否则程序仍然很难理解。在那些特性中有两个很重要:其一是 `;` 这个字符可以在一行中用来分隔多条语句,它多出现于在使用 `sys` 指令时将系统调用的多个参数放在同一行上。其二是, Thompson 的汇编器支持使用 0 到 9 作为“临时标签”,也就是在程序内可以重用的标签。因此。就如 Unix 程序员手册中所说:“对程序员的想象力和汇编程序的符号空间的要求都降低了”。在任何给定的指令内,你都可以使用 `nf` 和 `nb` 来引用下一个或最近的临时标签 `n`。 例如,如果存在标记为 `1:` 的代码块,你就可以使用指令 `jmp 1b` 从下游代码跳回该块。 (但是你不使用 `jmp 1f` 的话就没法从上面的代码跳到这里。)
+因此,[最初的][3] `cat` 也是使用 PDP 7 汇编实现的。 我添加了一些注释,试图解释每条指令的作用,但除非你理解 Thompson 在编写汇编器时加的特性,否则程序仍然很难理解。在那些特性中有两个很重要:其一是 `;` 这个字符可以在一行中用来分隔多条语句,它多出现于在使用 `sys` 指令时将系统调用的多个参数放在同一行上。其二是, Thompson 的汇编器支持使用 0 到 9 作为“临时标签”,这是在程序内可以重用的标签。因此。就如 Unix 程序员手册中所说:“对程序员的想象力和汇编程序的符号空间的要求都降低了”。在任何给定的指令内,你都可以使用 `nf` 和 `nb` 来引用下一个或最近的临时标签 `n`。 例如,如果存在标记为 `1:` 的代码块,你就可以使用指令 `jmp 1b` 从下游代码跳回该块。 (但是你不使用 `jmp 1f` 的话就没法从上面的代码跳到这里。)
-初版 `cat` 最有趣的就是它包含着我们应该认识的符号。有一块指令快标记为 `getc`,还有一个标记为 `putc`,可以看到这两个符号比 C 标准还古老。第一版的 `cat` 函数实际上已经包含了这两个函数的实现。这个 `cat` 实现做了缓存,这样他就不需要一次只读写一个字母。
+初版 `cat` 最有趣的就是它包含着我们应该认识的符号。有一块指令块标记为 `getc`,还有一个标记为 `putc`,可以看到这两个符号比 C 标准还古老。第一版的 `cat` 函数实际上已经包含了这两个函数的实现。该实现做了输入缓存,这样它就不需要一次只读写一个字母。
`cat` 的第一个版本并没有持续多久。 Ken Thompson 和 Dennis Ritchie 说服贝尔实验室购买了 PDP 11,这样他们就能够继续扩展和改进 Unix。 PDP 11 的指令集和之前不一样,因此必须重写 `cat`。 我也注释了[这个第二版][4] `cat`。 它为新的指令集使用新的汇编程序助记符,并利用了 PDP 11 的各种[寻址模式][5]。(如果你对源代码中的括号和美元符号感到困惑,那是因为这些符号用于指示不同的寻址模式。)但它也使用 `;` 字符和临时标签,和 `cat` 的第一个版本一样,这意味着当把 `as` 移植到 PDP 11 上时,必须要保留这些功能。
-`cat` 的第二个版本比第一个版本简单得多。 它也更有 Unix 味儿,它不只是依靠参数列表,一旦没给参数列表,它将从 `stdin` 读取数据,这也就是今天 `cat` 仍在做的事情。 你也也可以在此版本的 `cat` 中以 `-` 为参数,以表示它应该从`stdin`读取。
+`cat` 的第二个版本比第一个版本简单得多。 它也更有 Unix 味儿,它不只是依靠参数列表,一旦没给参数列表,它将从 `stdin` 读取数据,这也就是今天 `cat` 仍在做的事情。 你也可以在此版本的 `cat` 中以 `-` 为参数,以表示它应该从`stdin`读取。
-在 1973 年,为了准备发布第四版 Unix,大部分代码都用 C 语言重写了。但是 `cat` 似乎在之后一段时间内并没有使用 C 重写。 [`cat` 的第一个 C 语言实现][6]出现在第七版 Unix 中。 这个实现非常有趣,因为它很简单。 在所有要以后的实现中,这个实现和在 K&R 的 C语言教科书中用作教学示范的理想化 `cat` 最相似。这个程序的核心就是经典的两行:
+在 1973 年,为了准备发布第四版 Unix,大部分代码都用 C 语言重写了。但是 `cat` 似乎在之后一段时间内并没有使用 C 重写。 [cat 的第一个 C 语言实现][6]出现在第七版 Unix 中。 这个实现非常有趣,因为它很简单。 在所有以后的实现中,这个实现和在 K&R 的 C 语言教科书中用作教学示范的理想化 `cat` 最相似。这个程序的核心就是经典的两行:
```
while ((c = getc(fi)) != EOF)
@@ -33,33 +34,33 @@ while ((c = getc(fi)) != EOF)
### BSD
-在第七版之后,Unix 出现了了各种衍生品和分支。 MacOS 建立于 Darwin 之上,而 Darwin 又源自 Berkeley Software Distribution(BSD),因此 BSD 是我们最感兴趣的Unix 分支。 BSD 最初只是 Unix 中的实用程序和附加组件的集合,但它最终成为了一个完整的操作系统。直到第四版 BSD,人称 4BSD,为一大堆新标志添加了支持之前,BSD 似乎还是依赖于最初的 `cat` 实现的。`cat` 的 [4BSD 实现][7] 显然是从原始实现中衍生出来的,尽管它添加了一个新函数来实现新标志触发的行为。按照已经在文件中使用由用于标记输入是从`stdin`还是文件读取的 `fflg` 变量指定的命名约定。被新添加的 `nflg`,`bflg`,`vflg`,`sflg`,`eflg`和`tflg` 保存了下来,这些变量记录了在调用程序时是否使用了这些新标志。这些是最后一批添加到 `cat` 的命令行标志。如今 `cat` 的手册页列出了这些标志,没有其他的标志了,至少在Mac OS上是如此。 4BSD 于1980年发布,因此这套标志已有 38 年历史。
+在第七版 Unix 之后,Unix 出现了各种衍生品和分支。 MacOS 建立于 Darwin 之上,而 Darwin 又源自伯克利软件分发版(BSD),因此 BSD 是我们最感兴趣的 Unix 分支。 BSD 最初只是 Unix 中的实用程序和附加组件的集合,但它最终成为了一个完整的操作系统。直到第四版 BSD,人称 4BSD,为一大堆新标志添加了支持之前,BSD 似乎还是依赖于最初的 `cat` 实现的。`cat` 的 [4BSD 实现][7] 显然是从原始实现中衍生出来的,尽管它添加了一个新函数来实现由新标志触发的行为。已经在文件中使用的 `fflg` 变量(用于标记输入是从 `stdin` 还是文件读取的)的命名约定,被新添加的 `nflg`、`bflg`、`vflg`、`sflg`、`eflg` 和 `tflg` 沿袭了下来,这些变量记录了在调用程序时是否使用了这些新标志。这些是最后一批添加到 `cat` 的命令行标志。如今 `cat` 的手册页列出了这些标志,没有其他的标志了,至少在 Mac OS 上是如此。 4BSD 于 1980 年发布,因此这套标志已有 38 年历史。
-`cat` 最后一次被完全重写是在 BSD NET/2 上,其目的是通过替换全部 AT&T 发布的 Unix 源代码来规避许可证问题。BSD Net/2 在 1991 年发布。这一版本的 `cat` 是由 Kevin Fall 重写的。 Kevin Fall 于 1988 年毕业于加州大学伯克利分校并在下一年成为计算机系统研究组(CSRG)的组员,Fall 和我说当时使用 AT&T 代码的 Unix 工具被列在了 CSRG 的墙上,组员需要从中选出他们想要重写的工具; Fall 选了 `cat` 以及 `mknod`。 MacOS 系统内自带的 `cat` 实现源码的最上面还有着他的名字。他的这一版 `cat`,尽管平淡无奇,在今天还是被无数人使用着。
+`cat` 最后一次被完全重写是在 BSD NET/2 上,其目的是通过替换 AT&T 发布的全部 Unix 源代码来规避许可证问题。BSD Net/2 在 1991 年发布。这一版本的 `cat` 是由 Kevin Fall 重写的。 Kevin Fall 于 1988 年毕业于加州大学伯克利分校并在下一年成为计算机系统研究组(CSRG)的组员,Fall 和我说当时使用 AT&T 代码的 Unix 工具被列在了 CSRG 的墙上,组员需要从中选出他们想要重写的工具; Fall 选了 `cat` 以及 `mknod`。 MacOS 系统内自带的 `cat` 实现源码的最上面还有着他的名字。他的这一版 `cat`,尽管平淡无奇,在今天还是被无数人使用着。
-[Fall的原始 `cat `实现][8] 比我们迄今为止看到的程序都要长。 除了支持 `-?` 帮助标志外,它没有增加任何新功能。 从概念上讲,它与 4BSD 的实现非常相似。 它长是因为 Fall 将实现分为 “原始” 模式和 “熟” 模式。 “原始” 模式是 `cat ` 的经典实现; 它一个字符一个字符的打印文件。 “熟” 模式是带有所有 4BSD 命令行选项的 `cat`。 如此区别不无道理,但这么办也扩充了实现规模,因此乍一看其源码似乎比实际上更复杂。文件末尾还有一个奇特的错误处理函数,进一步地增加了实现的长度。
+[Fall 的原始 cat 实现][8] 比我们迄今为止看到的版本都要长。 除了支持 `-?` 帮助标志外,它没有增加任何新功能。 从概念上讲,它与 4BSD 的实现非常相似。 它长是因为 Fall 将实现分为 “原始” 模式和 “加工” 模式。 “原始” 模式是 `cat` 的经典实现;它一个字符一个字符的打印文件。 “加工” 模式是带有所有 4BSD 命令行选项的 `cat`。 如此区别不无道理,但这么办也扩充了实现规模,因此乍一看其源码似乎比实际上更复杂。文件末尾还有一个奇特的错误处理函数,进一步地增加了实现的长度。
### MacOS
-在 2001 年,苹果发布了 MacOS X。这一发布对苹果意义重大。因为苹果花了很多年时间来尝试并且取代现有的过时操作系统(经典的Mac OS),但是都失败了。 在 Mac OS X 之前苹果两次尝试在内部创建一个新的操作系统,但两者都无疾而终。 最后,苹果收购了史蒂夫 · 乔布斯的 NeXT 公司,后者开发了一个名为 NeXTSTEP 的操作系统和面向对象编程框架。 苹果将 NeXTSTEP 作为Mac OS X的基础。因为 NeXTSTEP 部分基于 BSD,使以 NeXTSTEP 为基础的 Mac OS X的自然就把 BSD 系的代码直接带入苹果宇宙的中心。
+在 2001 年,苹果发布了 MacOS X。这一发布对苹果意义重大。因为苹果用了多年的时间尝试以取代其现有的老旧操作系统(经典的 Mac OS),但是都失败了。 在 Mac OS X 之前苹果两次尝试在内部创建一个新的操作系统,但两者都无疾而终。 最后,苹果收购了史蒂夫·乔布斯的 NeXT 公司,后者开发了一个名为 NeXTSTEP 的操作系统和面向对象编程框架。 苹果将 NeXTSTEP 作为 Mac OS X 的基础。因为 NeXTSTEP 部分基于 BSD,使以 NeXTSTEP 为基础的 Mac OS X 的自然就把 BSD 系的代码直接带入苹果宇宙的中心。
-因此,Mac OS X的第一个版本包含了从 NetBSD 项目中提取的 `cat` 的[实现][9]。如今仍在开发中的 NetBSD 最初是 386BSD 的分支,而后者又直接基于 BSD Net/2。所以Mac OS X里面的第一个 `cat` 的实现就是 Kevin Fall的 `cat`。唯一改变的是,Fall 的错误处理函数 `err()` 被 `err.h` 提供的`err()` 函数取代了。 `err.h` 是 C 标准库的 BSD 扩展。
+因此,Mac OS X 的非常早期的第一个版本包含了从 NetBSD 项目中提取的 `cat` 的[实现][9]。如今仍保持开发的 NetBSD 最初是 386BSD 的分支,而后者又直接基于 BSD Net/2。所以 Mac OS X 里面的第一个 `cat` 的实现就是 Kevin Fall 的 `cat`。唯一改变的是,Fall 的错误处理函数 `err()` 被 `err.h` 提供的 `err()` 函数取代了。 `err.h` 是 C 标准库的 BSD 扩展。
-之后不久,`cat` 的 NetBSD 实现被换成了 FreeBSD 中的 `cat` 实现。 [根据维基百科][10],苹果在Mac OS X 10.3(Panther) 中开始使用 FreeBSD 的实现而不是 NetBSD 的实现。但根据苹果自己开源的版本,`cat` 的Mac OS X实现在2007年发布的 Mac OS X 10.5(Leopard) 之前没有被替换。苹果为 Leopard 替换的的 [FreeBSD 实现][11]与今天苹果计算机上的实现相同。截至 2018 年,此实现仍未被更新或修改。
+之后不久,这里的 `cat` 的 NetBSD 实现被换成了 FreeBSD 中的 `cat` 实现。 [根据维基百科][10],苹果在 Mac OS X 10.3(Panther)中开始使用 FreeBSD 的实现而不是 NetBSD 的实现。但根据苹果自己开源的版本,`cat` 的 Mac OS X 实现在 2007 年发布的 Mac OS X 10.5(Leopard)之前没有被替换。苹果为 Leopard 替换的的 [FreeBSD 实现][11]与今天苹果计算机上的实现相同。截至 2018 年,2007 年以来的这个实现仍未被更新或修改。
-所以Mac OS 上的 `cat` 已经很老了。实际上,这一实现在 2007 年在 MacOS X 上露面两年前就被发布了。 [这个 2005 年的修改][12] 在 FreeBSD 的 Github 镜像中可见,是在苹果将其合并入 Mac OS X 前对 FreeBSD 的 `cat` 实现进行的最后一次更改。所以 Mac OS X 的没有与 FreeBSD 的 `cat` 实现保持同步的 `cat`实现,如今 13 岁了。对于软件修改了多少代码才能仍是算是同一软件这一话题有着旷日持久的争论。不过,在这种情况下,源文件自 2005 年以来根本没有变化。
+所以 Mac OS 上的 `cat` 已经很老了。实际上,这一实现在 2007 年在 MacOS X 上露面两年前就被发布了。 [这个 2005 年的修改][12] 在 FreeBSD 的 Github 镜像中可见,是在苹果将其合并入 Mac OS X 前对 FreeBSD 的 `cat` 实现进行的最后一次更改。所以 Mac OS X 中的实现没有与 FreeBSD 的 `cat` 实现保持同步,它如今已经 13 岁了。对于软件修改了多少代码才能仍是算是同一软件这一话题有着旷日持久的争论。不过,在这种情况下,源文件自 2005 年以来根本没有变化。
-现在 Mac OS 使用的 `cat` 实现与 Fall 1991年为 BSD Net/2 版本编写的实现没有什么不同。最大的区别是添加了一个全新的功能来提供 Unix 域套接字支持。FreeBSD 开发人员似乎将 Fall 的 `raw_args()` 函数和 `cook_args()` 函数组合成一个名为`scanfiles()`的函数。要没有的话,程序的核心就仍是 Fall 的代码。
+现在 Mac OS 使用的 `cat` 实现与 Fall 1991 年为 BSD Net/2 版本编写的实现没有什么不同。最大的区别是添加了一个全新的功能来提供 Unix 域套接字支持。FreeBSD 开发人员似乎将 Fall 的 `raw_args()` 函数和 `cook_args()` 函数组合成一个名为`scanfiles()` 的函数。否则,程序的核心就仍是 Fall 的代码。
-我问过 Fall 对编写如今被数以百万计的苹果用户直接或者通过依赖 `cat` 的程序间接使用的 `cat` 实现有何感想。Fall,如今是最新版 TCP/IP 详解的顾问和合著者,说,当人们从了解他对 `cat` 所做的的工作中收获颇丰时,他感到很惊讶。 Fall 在计算机领域有着悠久的职业生涯,曾参与许多备受瞩目的项目,但似乎很多人仍对他在 1989 年重写 `cat` 的那六个月的工作感到最为兴奋。
+我问过 Fall 对编写了如今被数以百万计的苹果用户(直接或者间接通过依赖 `cat` 的某些程序)使用的 `cat` 实现有何感想。Fall,如今是一位顾问,也是最新版《TCP/IP 详解》的合著者,他说,当人们从了解他对 `cat` 所做的工作中收获颇丰时,他感到很惊讶。 Fall 在计算机领域有着悠久的职业生涯,曾参与许多备受瞩目的项目,但似乎很多人仍对他在 1989 年重写 `cat` 的那六个月的工作感到最为兴奋。
### 百年老程序
-在宏伟的发明史中,计算机并不是一项古老的发明。我们已经习惯了百年的照片甚至是百年的视频短片。但是计算机程序不一样 - 它们代表着高科技和新技术。至少,他们是现代的技术造出来的。随着计算行业的成熟,我们有朝一日会发现自己正在使用有着接近百年历史的程序吗?
+在宏伟的发明史中,计算机并不是一项古老的发明。我们已经习惯了百年的照片甚至是百年的视频短片。但是计算机程序不一样 —— 它们代表着高科技和新技术。至少,他们是现代的技术造出来的。随着计算行业的成熟,我们有朝一日会发现自己正在使用有着接近百年历史的程序吗?
-计算机硬件可能会发生较大的变化,使得我们也许无法让现在编译的可执行文件在一个世纪后的硬件上运行。也许编程语言设计的进步让未来没有人能理解 C 语言,`cat` 将来也可能也被别的语言重写很久了。 (尽管 C已经存在了五十年了,而且它似乎不会很快就被替换掉。)但除此之外,为什么不永远使用我们现在的 `cat`?
+计算机硬件可能会发生较大的变化,使得我们也许无法让现在编译的可执行文件在一个世纪后的硬件上运行。也许编程语言设计的进步让未来没有人能理解 C 语言,`cat` 将来也可能也被别的语言重写很久了。 (尽管 C 已经存在了五十年了,而且它似乎不会很快就被替换掉。)但除此之外,为什么不永远使用我们现在的 `cat`?
-我认为 `cat` 的历史表明,计算机科学中的一些想法确实非常持久。事实上,对于 `cat`,这个想法和程序本身都很古老。不准确地说,我的电脑上的 `cat` 来自1969 年。但我也可以说我的计算机上的 `cat` 来自1989 年,当时 Fall 写了他的 `cat` 实现。许多其他软件也同样古老。因此,也许我们不应该把计算机科学和软件开发视为不断破坏现状和发明新事物的领域。我们的计算机系统是由诸多历史文物构建的。有时,我们可能会花费更多时间在理解和维护这些历史文物上,而不是花在编写新代码上。
+我认为 `cat` 的历史表明,计算机科学中的一些想法确实非常持久。事实上,对于 `cat`,这个想法和程序本身都很古老。不准确地说,我的电脑上的 `cat` 来自 1969 年。但我也可以说我的计算机上的 `cat` 来自1989 年,当时 Fall 写了他的 `cat` 实现。许多其他软件也同样古老。因此,也许我们不应该把计算机科学和软件开发视为不断破坏现状和发明新事物的领域。我们的计算机系统是由诸多历史文物构建的。有时,我们可能会花费更多时间在理解和维护这些历史文物上,而不是花在编写新代码上。
如果你喜欢本文,你可能更喜欢两周来一篇更新!在推特上关注 [@TwoBitHistory][13] 或者订阅这个 [RSS 源][14] 以保证接受到新的文章。
@@ -71,7 +72,7 @@ via: https://twobithistory.org/2018/11/12/cat.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[name1e5s](https://github.com/name1e5s)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 87ba3f9da6b69c80eb1d5af7da8b3d44f5ee8b37 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 21:37:48 +0800
Subject: [PATCH 052/119] PRF:20180226 -Getting to Done- on the Linux command
line.md
@guevaraya
---
...ting to Done- on the Linux command line.md | 88 +++++++++++--------
1 file changed, 49 insertions(+), 39 deletions(-)
diff --git a/translated/tech/20180226 -Getting to Done- on the Linux command line.md b/translated/tech/20180226 -Getting to Done- on the Linux command line.md
index 2e06c51dce..61a0307055 100644
--- a/translated/tech/20180226 -Getting to Done- on the Linux command line.md
+++ b/translated/tech/20180226 -Getting to Done- on the Linux command line.md
@@ -1,103 +1,111 @@
-享受Linux下命令行全操作
+在 Linux 命令行下进行时间管理
======
+> 学习如何在命令行下用这些方法自己组织待办事项。
+

-很多文章讨论关于命令行下如何做事情。有多少文章要么用晦涩的方式介绍 `ls` ,要么介绍关于 Sed 和 Awk 一些有意思的正则表达式,要么就是介绍一大堆的 perl 脚本是如何解析的?这些都不是命令行操作的重点。
-本文章是关于[享受命令行全操作][1],在我们不需要图形桌面,网络浏览器或网络连接情况下,用命令行操作能完成实际事务的跟踪。为了达到这一点,我们将介绍四个途径跟踪你的待办清单:纯文件文件,Todo.txt,TaskWarrior,Org-mode。
+关于如何在命令行下进行时间管理(GTD)有很多讨论。不知有多少文章在讲使用 ls 晦涩的选项、配合 Sed 和 Awk 的一些神奇的正则表达式,以及用 Perl 解析一大堆的文本。但这些都不是问题的重点。
-### 纯文本
+本文章是关于“[如何完成][1]”,在我们不需要图形桌面、网络浏览器或网络连接情况下,用命令行操作能实际完成事务的跟踪。为了达到这一点,我们将介绍四种跟踪待办事项的方式:纯文件文件、Todo.txt、TaskWarrior 和 Org 模式。
-![plaintext][3]
+### 简单纯文本
-我喜欢用 Vim ,其实你也可以喜欢 Nano。
+![纯文本][3]
-最直接管理管理你的待办清单的方式就是用纯文本文件来编辑。只需要打开一个空文件,每一行添加一个任务。当任务完成后,删除这一行,简单有效,不用再关心这一行之前干什么用的了。不过这个方法也有缺点,一点你删除一行并保存了文件,它就是永远消失了。如果你想知道本周或者上周都做了哪些事情,就成了问题。使用简单文本文件很方便却也容易导致混乱。
+*我喜欢用 Vim,其实你也可以用 Nano。*
+
+最直接管理你的待办事项的方式就是用纯文本文件来编辑。只需要打开一个空文件,每一行添加一个任务。当任务完成后,删除这一行。简单有效,无论你用它做什么都没关系。不过这个方法也有两个缺点,一但你删除一行并保存了文件,它就是永远消失了。如果你想知道本周或者上周都做了哪些事情,就成了问题。使用简单文本文件很方便却也容易导致混乱。
### Todo.txt: 纯文件的升级版
+![todo.txt 截屏][5]
-![todo.txt screen][5]
+*整洁,有条理,易用*
-整洁,有条理,易用
-
-这就是我们要说的 [Todo.txt][6] 格式文件和应用程序。安装可从 GitHub [下载][7]最新的版本解压后并执行命令 `sudo make install`
+这就是我们要说的 [Todo.txt][6] 文件格式和应用程序。安装很简单,可从 GitHub [下载][7]最新的版本解压后并执行命令 `sudo make install` 。
![安装 todo.txt][9]
-也可以从 Git 克隆一个。
+*也可以从 Git 克隆一个。*
-Todo.txt 可以很容易的增加新任务,并能显示任务列表和已完成任务的标记:
+Todo.txt 可以很容易的增加新任务,并能显示任务列表和已完成任务的标记:
-|||
+| 命令 | 说明 |
| ------------- |:-------------|
-| `todo.sh add "某任务"` | 增加 "某任务" 到你的待办列表 |
+| `todo.sh add "某任务"` | 增加 “某任务” 到你的待办列表 |
| `todo.sh ls` | 显示所有的任务 |
| `todo.sh ls due:2018-02-15` | 显示2018-02-15之前的所有任务 |
| `todo.sh do 3` | 标记任务3 为已完成任务 |
-清单实际上仍然是纯文本,你可以用你喜欢的编辑器遵循[正确的格式][10]编辑它。
-
-应用程序同时也内置了一个强大的帮助。
+这个清单实际上仍然是纯文本,你可以用你喜欢的编辑器遵循[正确的格式][10]编辑它。
+该应用程序同时也内置了一个强大的帮助系统。
![在 todo.txt 中语法高亮][12]
-你可以使用语法高亮的功能
-
-此外,还有许多附加组件可供选择,以及编写自己的附件组件规范。甚至有浏览器组件,移动设备应用程序和桌面应用程序支持 Todo.txt 的格式。
+*你可以使用语法高亮的功能*
+此外,还有许多附加组件可供选择,以及编写自己的附件组件规范。甚至有浏览器组件、移动设备应用程序和桌面应用程序支持 Todo.txt 的格式。
![GNOME extensions in todo.txt][14]
-GNOME的扩展组件
+*GNOME的扩展组件*
-Todo.txt 最大的缺点是缺少自动或内置的同步机制。大多数(不是全部)的浏览器扩展程序和移动应用程序需要用 Dropbox 实现桌面系统和应用程序直接的数据同步。如果你想内置同步机制,我们也有……
+Todo.txt 最大的缺点是缺少自动或内置的同步机制。大多数(不是全部)的浏览器扩展程序和移动应用程序需要用 Dropbox 实现桌面系统和应用程序直接的数据同步。如果你想内置同步机制,我们有……
### Taskwarrior: 现在我们用 Python 做事了
-[Taskwarrior][15] 是一个与Todo.txt 有许多相同功能的 Python 工具。但不同的是它的数据保存在数据库里并具有内置的数据同步功能。它还可以跟踪即将要做的任务,可以提醒某个任务持续了多久,可以提醒你一些重要的事情应该马上去做。
+![Taskwarrior][25]
-[安装][16] Taskwarrior 可以通过通过发行版自带的包管理器,或通过 Python 命令 `pip`安装,或者用源码编译。用法也和 Todo.txt 的命令完全一样:
+*花哨吗?*
-|||
+[Taskwarrior][15] 是一个与 Todo.txt 有许多相同功能的 Python 工具。但不同的是它的数据保存在数据库里并具有内置的数据同步功能。它还可以跟踪即将要做的任务,可以提醒某个任务持续了多久,可以提醒你一些重要的事情应该马上去做。
+
+![][26]
+
+*看起来不错*
+
+[安装][16] Taskwarrior 可以通过通过发行版自带的包管理器,或通过 Python 命令 `pip` 安装,或者用源码编译。用法也和 Todo.txt 的命令完全一样:
+
+| 命令 | 说明 |
| ------------- |:-------------|
-| `task add "某任务"` | 增加 "某任务" 到任务清单 |
+| `task add "某任务"` | 增加 “某任务” 到任务清单 |
| `task list` | 列出所有任务 |
-| `task list due ``:today` |列出截止今天的任务 |
+| `task list due ``:today` | 列出截止今天的任务 |
| `task do 3` | 标记编号是3的任务为完成状态 |
Taskwarrior 还有漂亮的文本用户界面。
![Taskwarrior in Vit][18]
-我喜欢 Vit, 它的设计灵感来自 Vim.
+*我喜欢 Vit, 它的设计灵感来自 Vim*
-不同于 Todo.txt,Taskwarrior 可以和本地或远程服务器同步信息。如果你希望运行自己的同步服务器可以使用名为 `taskd` 的基础服务器,如果不使用自己的服务器也有好几个可用服务器。
+不同于 Todo.txt,Taskwarrior 可以和本地或远程服务器同步信息。如果你希望运行自己的同步服务器可以使用名为 `taskd` 的非常基本的服务器,如果不使用自己的服务器也有好几个可用服务器。
-Taskwarriot 还拥有一个蓬勃发展的插件和扩展生态系统,这和移动和桌面系统的应用生态类似。
+Taskwarriot 还拥有一个蓬勃发展的插件和扩展生态系统,以及移动和桌面系统的应用。
![GNOME in Taskwarrior ][20]
-在 GNOME 下的 Taskwarrior 看起来还是很漂亮的。
+*在 GNOME 下的 Taskwarrior 看起来还是很漂亮的。*
Taskwarrior 有一个唯一的缺点,你是不能直接修改待办任务的,这和其他的工具不一样。你只能把任务清单按照格式导出,然后修改导出文件后,重新再导入,这样相对于编辑器直接编辑任务还是挺麻烦的。
-谁能给我们带来最大的希望呢......
+谁能给我们带来最大的希望呢……
-### Emacs Org-mode: 牛逼的任务收割机
+### Emacs Org 模式:牛X的任务收割机
![Org-mode][22]
-Emacs 具有所有优点。
+*Emacs 啥都有*
-Emacs [Org-mode][23] 是目前为止最强大,最灵活的开源待办任务管理器。它支持多文件,使用纯文本,高度定制和自动识别日期,截止日期和任务计划。相对于我们这里介绍的其他工具,它的配置也更复杂一些。但是一旦配置好,她可以比其他工具完成更多功能。如果你是熟悉或者是 [Bullet Journals][24] 的粉丝,Org-mode 可能是在桌面程序里最像[Bullet Journals][24]的了。
+Emacs [Org 模式][23] 是目前为止最强大、最灵活的开源待办事项管理器。它支持多文件、使用纯文本、高度可定制、自动识别日期、截止日期和任务计划。相对于我们这里介绍的其他工具,它的配置也更复杂一些。但是一旦配置好,它可以比其他工具完成更多功能。如果你是熟悉或者是 [Bullet Journals][24] 的粉丝,Org 模式可能是在桌面程序里最像[Bullet Journals][24] 的了。
-Org-mode 可以运行在任何 Emacs 运行的地方,一些移动应用程序可以和它很好交互。但是不幸的是,目前没有桌面程序或浏览器插件支持Org-mode。尽管如此,Org-mode仍然是跟踪待办事项最好的应用程序之一,因为他确实很强大。
+Emacs 能运行,Org 模式就能运行,一些移动应用程序可以和它很好交互。但是不幸的是,目前没有桌面程序或浏览器插件支持 Org 模式。尽管如此,Org 模式仍然是跟踪待办事项最好的应用程序之一,因为它确实很强大。
### 选择适合自己的工具
-最后,这些程序目的是帮助你跟踪待办事务并确保不会忘记做某个事情。这些程序的基础功能都大同小异,那一款适合你取决于多种因素。有的人需要自带同步功能,有的人需要一个移动客户端,有的人要必须支持插件。不管你选择什么,请记住程序本身不会让你更有调理,但是可以帮助你。
+最后,这些程序目的是帮助你跟踪待办事项,并确保不会忘记做某个事情。这些程序的基础功能都大同小异,那一款适合你取决于多种因素。有的人需要自带同步功能,有的人需要一个移动客户端,有的人要必须支持插件。不管你选择什么,请记住程序本身不会让你更有调理,但是可以帮助你。
--------------------------------------------------------------------------------
@@ -105,7 +113,7 @@ via: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-lin
作者:[Kevin Sonney][a]
译者:[guevaraya](https://github.com/guevaraya)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@@ -126,3 +134,5 @@ via: https://opensource.com/article/18/2/getting-to-done-agile-linux-command-lin
[22]:https://opensource.com/sites/default/files/u128651/emacs-org-mode.png (Org-mode)
[23]:https://orgmode.org/
[24]:http://bulletjournal.com/
+[25]:https://opensource.com/sites/default/files/u128651/taskwarrior.png
+[26]:https://opensource.com/sites/default/files/u128651/taskwarrior-complains.png
From 2913f24c2d37091dcf73670762c142f8766c160a Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 21:38:19 +0800
Subject: [PATCH 053/119] PUB:20180226 -Getting to Done- on the Linux command
line.md
@guevaraya https://linux.cn/article-10335-1.html
---
.../20180226 -Getting to Done- on the Linux command line.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180226 -Getting to Done- on the Linux command line.md (100%)
diff --git a/translated/tech/20180226 -Getting to Done- on the Linux command line.md b/published/20180226 -Getting to Done- on the Linux command line.md
similarity index 100%
rename from translated/tech/20180226 -Getting to Done- on the Linux command line.md
rename to published/20180226 -Getting to Done- on the Linux command line.md
From d29de3e5f41e4860dca355759f5c05de75ed9d4b Mon Sep 17 00:00:00 2001
From: GraveAccent
Date: Tue, 11 Dec 2018 23:04:16 +0800
Subject: [PATCH 054/119] GraveAccent translated 20180422...
---
...icks For Data Scientists - kade killary.md | 526 ------------------
...icks For Data Scientists - kade killary.md | 469 ++++++++++++++++
2 files changed, 469 insertions(+), 526 deletions(-)
delete mode 100644 sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
create mode 100644 translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
diff --git a/sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
deleted file mode 100644
index 2e1abf248f..0000000000
--- a/sources/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
+++ /dev/null
@@ -1,526 +0,0 @@
-GraveAccent翻译中 Command Line Tricks For Data Scientists • kade killary
-======
-
-
-
-For many data scientists, data manipulation begins and ends with Pandas or the Tidyverse. In theory, there is nothing wrong with this notion. It is, after all, why these tools exist in the first place. Yet, these options can often be overkill for simple tasks like delimiter conversion.
-
-Aspiring to master the command line should be on every developer’s list, especially data scientists. Learning the ins and outs of your shell will undeniably make you more productive. Beyond that, the command line serves as a great history lesson in computing. For instance, awk - a data-driven scripting language. Awk first appeared in 1977 with the help of [Brian Kernighan][1], the K in the legendary [K&R book][2]. Today, some near 50 years later, awk remains relevant with [new books][3] still appearing every year! Thus, it’s safe to assume that an investment in command line wizardry won’t depreciate any time soon.
-
-### What We’ll Cover
-
- * ICONV
- * HEAD
- * TR
- * WC
- * SPLIT
- * SORT & UNIQ
- * CUT
- * PASTE
- * JOIN
- * GREP
- * SED
- * AWK
-
-
-
-### ICONV
-
-File encodings can be tricky. For the most part files these days are all UTF-8 encoded. To understand some of the magic behind UTF-8, check out this [excellent video][4]. Nonetheless, there are times where we receive a file that isn’t in this format. This can lead to some wonky attempts at swapping the encoding schema. Here, `iconv` is a life saver. Iconv is a simple program that will take text in one encoding and output the text in another.
-```
-# Converting -f (from) latin1 (ISO-8859-1)
-# -t (to) standard UTF_8
-
-iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt
-
-```
-
- * Useful options:
-
- * `iconv -l` list all known encodings
- * `iconv -c` silently discard characters that cannot be converted
-
-
-
-### HEAD
-
-If you are a frequent Pandas user then `head` will be familiar. Often when dealing with new data the first thing we want to do is get a sense of what exists. This leads to firing up Pandas, reading in the data and then calling `df.head()` \- strenuous, to say the least. Head, without any flags, will print out the first 10 lines of a file. The true power of `head` lies in testing out cleaning operations. For instance, if we wanted to change the delimiter of a file from commas to pipes. One quick test would be: `head mydata.csv | sed 's/,/|/g'`.
-```
-# Prints out first 10 lines
-
-head filename.csv
-
-# Print first 3 lines
-
-head -n 3 filename.csv
-
-```
-
- * Useful options:
-
- * `head -n` print a specific number of lines
- * `head -c` print a specific number of bytes
-
-
-
-### TR
-
-Tr is analogous to translate. This powerful utility is a workhorse for basic file cleaning. An ideal use case is for swapping out the delimiters within a file.
-```
-# Converting a tab delimited file into commas
-
-cat tab_delimited.txt | tr "\t" "," comma_delimited.csv
-
-```
-
-Another feature of `tr` is all the built in `[:class:]` variables at your disposal. These include:
-```
-[:alnum:] all letters and digits
-[:alpha:] all letters
-[:blank:] all horizontal whitespace
-[:cntrl:] all control characters
-[:digit:] all digits
-[:graph:] all printable characters, not including space
-[:lower:] all lower case letters
-[:print:] all printable characters, including space
-[:punct:] all punctuation characters
-[:space:] all horizontal or vertical whitespace
-[:upper:] all upper case letters
-[:xdigit:] all hexadecimal digits
-
-```
-
-You can chain a variety of these together to compose powerful programs. The following is a basic word count program you could use to check your READMEs for overuse.
-```
-cat README.md | tr "[:punct:][:space:]" "\n" | tr "[:upper:]" "[:lower:]" | grep . | sort | uniq -c | sort -nr
-
-```
-
-Another example using basic regex:
-```
-# Converting all upper case letters to lower case
-
-cat filename.csv | tr '[A-Z]' '[a-z]'
-
-```
-
- * Useful options:
-
- * `tr -d` delete characters
- * `tr -s` squeeze characters
- * `\b` backspace
- * `\f` form feed
- * `\v` vertical tab
- * `\NNN` character with octal value NNN
-
-
-
-### WC
-
-Word count. Its value is primarily derived from the `-l` flag, which will give you the line count.
-```
-# Will return number of lines in CSV
-
-wc -l gigantic_comma.csv
-
-```
-
-This tool comes in handy to confirm the output of various commands. So, if we were to convert the delimiters within a file and then run `wc -l` we would expect the total lines to be the same. If not, then we know something went wrong.
-
- * Useful options:
-
- * `wc -c` print the byte counts
- * `wc -m` print the character counts
- * `wc -L` print length of longest line
- * `wc -w` print word counts
-
-
-
-### SPLIT
-
-File sizes can range dramatically. And depending on the job, it could be beneficial to split up the file - thus `split`. The basic syntax for split is:
-```
-# We will split our CSV into new_filename every 500 lines
-
-split -l 500 filename.csv new_filename_
-
-# filename.csv
-# ls output
-# new_filename_aaa
-# new_filename_aab
-# new_filename_aac
-
-```
-
-Two quirks are the naming convention and lack of file extensions. The suffix convention can be numeric via the `-d` flag. To add file extensions, you’ll need to run the following `find` command. It will change the names of ALL files within the current directory by appending `.csv`, so be careful.
-```
-find . -type f -exec mv '{}' '{}'.csv \;
-
-# ls output
-# filename.csv.csv
-# new_filename_aaa.csv
-# new_filename_aab.csv
-# new_filename_aac.csv
-
-```
-
- * Useful options:
-
- * `split -b` split by certain byte size
- * `split -a` generate suffixes of length N
- * `split -x` split using hex suffixes
-
-
-
-### SORT & UNIQ
-
-The preceding commands are obvious: they do what they say they do. These two provide the most punch in tandem (i.e. unique word counts). This is due to `uniq`, which only operates on duplicate adjacent lines. Thus, the reason to `sort` before piping the output through. One interesting note is that `sort -u` will achieve the same results as the typical `sort file.txt | uniq` pattern.
-
-Sort does have a sneakily useful ability for data scientists: the ability to sort an entire CSV based on a particular column.
-```
-# Sorting a CSV file by the second column alphabetically
-
-sort -t"," -k2,2 filename.csv
-
-# Numerically
-
-sort -t"," -k2n,2 filename.csv
-
-# Reverse order
-
-sort -t"," -k2nr,2 filename.csv
-
-```
-
-The `-t` option here is to specify the comma as our delimiter. More often than not spaces or tabs are assumed. Furthermore, the `-k` flag is for specifying our key. The syntax for this is `-km,n`, with `m` being the starting field and `n` being the last.
-
- * Useful options:
-
- * `sort -f` ignore case
- * `sort -r` reverse sort order
- * `sort -R` scramble order
- * `uniq -c` count number of occurrences
- * `uniq -d` only print duplicate lines
-
-
-
-### CUT
-
-Cut is for removing columns. To illustrate, if we only wanted the first and third columns.
-```
-cut -d, -f 1,3 filename.csv
-
-```
-
-To select every column other than the first.
-```
-cut -d, -f 2- filename.csv
-
-```
-
-In combination with other commands, `cut` serves as a filter.
-```
-# Print first 10 lines of column 1 and 3, where "some_string_value" is present
-
-head filename.csv | grep "some_string_value" | cut -d, -f 1,3
-
-```
-
-Finding out the number of unique values within the second column.
-```
-cat filename.csv | cut -d, -f 2 | sort | uniq | wc -l
-
-# Count occurences of unique values, limiting to first 10 results
-
-cat filename.csv | cut -d, -f 2 | sort | uniq -c | head
-
-```
-
-### PASTE
-
-Paste is a niche command with an interesting function. If you have two files that you need merged, and they are already sorted, `paste` has you covered.
-```
-# names.txt
-adam
-john
-zach
-
-# jobs.txt
-lawyer
-youtuber
-developer
-
-# Join the two into a CSV
-
-paste -d ',' names.txt jobs.txt > person_data.txt
-
-# Output
-adam,lawyer
-john,youtuber
-zach,developer
-
-```
-
-For a more SQL_-esque variant, see below.
-
-### JOIN
-
-Join is a simplistic, quasi-tangential, SQL. The largest differences being that `join` will return all columns and matches can only be on one field. By default, `join` will try and use the first column as the match key. For a different result, the following syntax is necessary:
-```
-# Join the first file (-1) by the second column
-# and the second file (-2) by the first
-
-join -t"," -1 2 -2 1 first_file.txt second_file.txt
-
-```
-
-The standard join is an inner join. However, an outer join is also viable through the `-a` flag. Another noteworthy quirk is the `-e` flag, which can be used to substitute a value if a missing field is found.
-```
-# Outer join, replace blanks with NULL in columns 1 and 2
-# -o which fields to substitute - 0 is key, 1.1 is first column, etc...
-
-join -t"," -1 2 -a 1 -a2 -e ' NULL' -o '0,1.1,2.2' first_file.txt second_file.txt
-
-```
-
-Not the most user-friendly command, but desperate times, desperate measures.
-
- * Useful options:
-
- * `join -a` print unpairable lines
- * `join -e` replace missing input fields
- * `join -j` equivalent to `-1 FIELD -2 FIELD`
-
-
-
-### GREP
-
-Global search for a regular expression and print, or `grep`; likely, the most well known command, and with good reason. Grep has a lot of power, especially for finding your way around large codebases. Within the realm of data science, it acts as a refining mechanism for other commands. Although its standard usage is valuable as well.
-```
-# Recursively search and list all files in directory containing 'word'
-
-grep -lr 'word' .
-
-# List number of files containing word
-
-grep -lr 'word' . | wc -l
-
-```
-
-Count total number of lines containing word / pattern.
-```
-grep -c 'some_value' filename.csv
-
-# Same thing, but in all files in current directory by file name
-
-grep -c 'some_value' *
-
-```
-
-Grep for multiple values using the or operator - `\|`.
-```
-grep "first_value\|second_value" filename.csv
-
-```
-
- * Useful options
-
- * `alias grep="grep --color=auto"` make grep colorful
- * `grep -E` use extended regexps
- * `grep -w` only match whole words
- * `grep -l` print name of files with match
- * `grep -v` inverted matching
-
-
-
-### THE BIG GUNS
-
-Sed and Awk are the two most powerful commands in this article. For brevity, I’m not going to go into exhausting detail about either. Instead, I will cover a variety of commands that prove their impressive might. If you want to know more, [there is a book][5] just for that.
-
-### SED
-
-At its core `sed` is a stream editor. It excels at substitutions, but can also be leveraged for all out refactoring.
-
-The most basic `sed` command consists of `s/old/new/g`. This translates to search for old value, replace with new globally. Without the `/g` our command would terminate after the first occurrence.
-
-To get a quick taste of the power lets dive into an example. In this scenario you’ve been given the following file:
-```
-balance,name
-$1,000,john
-$2,000,jack
-
-```
-
-The first thing we may want to do is remove the dollar signs. The `-i` flag indicates in-place. The `''` is to indicate a zero-length file extension, thus overwriting our initial file. Ideally, you would test each of these individually and then output to a new file.
-```
-sed -i '' 's/\$//g' data.txt
-
-# balance,name
-# 1,000,john
-# 2,000,jack
-
-```
-
-Next up, the commas in our `balance` column values.
-```
-sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt
-
-# balance,name
-# 1000,john
-# 2000,jack
-
-```
-
-Lastly, Jack up and decided to quit one day. So, au revoir, mon ami.
-```
-sed -i '' '/jack/d' data.txt
-
-# balance,name
-# 1000,john
-
-```
-
-As you can see, `sed` packs quite a punch, but the fun doesn’t stop there.
-
-### AWK
-
-The best for last. Awk is much more than a simple command: it is a full-blown language. Of everything covered in this article, `awk` is by far the coolest. If you find yourself impressed there are loads of great resources - see [here][6], [here][7] and [here][8].
-
-Common use cases for `awk` include:
-
- * Text processing
- * Formatted text reports
- * Performing arithmetic operations
- * Performing string operations
-
-
-
-Awk can parallel `grep` in its most nascent form.
-```
-awk '/word/' filename.csv
-
-```
-
-Or with a little more magic the combination of `grep` and `cut`. Here, `awk` prints the third and fourth column, tab separated, for all lines with our word. `-F,` merely changes our delimiter to a comma.
-```
-awk -F, '/word/ { print $3 "\t" $4 }' filename.csv
-
-```
-
-Awk comes with a lot of nifty variables built-in. For instance, `NF` \- number of fields - and `NR` \- number of records. To get the fifty-third record in a file:
-```
-awk -F, 'NR == 53' filename.csv
-
-```
-
-An added wrinkle is the ability to filter based off of one or more values. The first example, below, will print the line number and columns for records where the first column equals string.
-```
-awk -F, ' $1 == "string" { print NR, $0 } ' filename.csv
-
-# Filter based off of numerical value in second column
-
-awk -F, ' $2 == 1000 { print NR, $0 } ' filename.csv
-
-```
-
-Multiple numerical expressions:
-```
-# Print line number and columns where column three greater
-# than 2005 and column five less than one thousand
-
-awk -F, ' $3 >= 2005 && $5 <= 1000 { print NR, $0 } ' filename.csv
-
-```
-
-Sum the third column:
-```
-awk -F, '{ x+=$3 } END { print x }' filename.csv
-
-```
-
-The sum of the third column, for values where the first column equals “something”.
-```
-awk -F, '$1 == "something" { x+=$3 } END { print x }' filename.csv
-
-```
-
-Get the dimensions of a file:
-```
-awk -F, 'END { print NF, NR }' filename.csv
-
-# Prettier version
-
-awk -F, 'BEGIN { print "COLUMNS", "ROWS" }; END { print NF, NR }' filename.csv
-
-```
-
-Print lines appearing twice:
-```
-awk -F, '++seen[$0] == 2' filename.csv
-
-```
-
-Remove duplicate lines:
-```
-# Consecutive lines
-awk 'a !~ $0; {a=$0}']
-
-# Nonconsecutive lines
-awk '! a[$0]++' filename.csv
-
-# More efficient
-awk '!($0 in a) {a[$0];print}
-
-```
-
-Substitute multiple values using built-in function `gsub()`.
-```
-awk '{gsub(/scarlet|ruby|puce/, "red"); print}'
-
-```
-
-This `awk` command will combine multiple CSV files, ignoring the header and then append it at the end.
-```
-awk 'FNR==1 && NR!=1{next;}{print}' *.csv > final_file.csv
-
-```
-
-Need to downsize a massive file? Welp, `awk` can handle that with help from `sed`. Specifically, this command breaks one big file into multiple smaller ones based on a line count. This one-liner will also add an extension.
-```
-sed '1d;$d' filename.csv | awk 'NR%NUMBER_OF_LINES==1{x="filename-"++i".csv";}{print > x}'
-
-# Example: splitting big_data.csv into data_(n).csv every 100,000 lines
-
-sed '1d;$d' big_data.csv | awk 'NR%100000==1{x="data_"++i".csv";}{print > x}'
-
-```
-
-### CLOSING
-
-The command line boasts endless power. The commands covered in this article are enough to elevate you from zero to hero in no time. Beyond those covered, there are many utilities to consider for daily data operations. [Csvkit][9], [xsv][10] and [q][11] are three of note. If you’re looking to take an even deeper dive into command line data science, then look no further than [this book][12]. It’s also available online [for free][13]!
-
---------------------------------------------------------------------------------
-
-via: http://kadekillary.work/post/cli-4-ds/
-
-作者:[Kade Killary][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://kadekillary.work/authors/kadekillary
-[1]:https://en.wikipedia.org/wiki/Brian_Kernighan
-[2]:https://en.wikipedia.org/wiki/The_C_Programming_Language
-[3]:https://www.amazon.com/Learning-AWK-Programming-cutting-edge-text-processing-ebook/dp/B07BT98HDS
-[4]:https://www.youtube.com/watch?v=MijmeoH9LT4
-[5]:https://www.amazon.com/sed-awk-Dale-Dougherty/dp/1565922255/ref=sr_1_1?ie=UTF8&qid=1524381457&sr=8-1&keywords=sed+and+awk
-[6]:https://www.amazon.com/AWK-Programming-Language-Alfred-Aho/dp/020107981X/ref=sr_1_1?ie=UTF8&qid=1524388936&sr=8-1&keywords=awk
-[7]:http://www.grymoire.com/Unix/Awk.html
-[8]:https://www.tutorialspoint.com/awk/index.htm
-[9]:http://csvkit.readthedocs.io/en/1.0.3/
-[10]:https://github.com/BurntSushi/xsv
-[11]:https://github.com/harelba/q
-[12]:https://www.amazon.com/Data-Science-Command-Line-Time-Tested/dp/1491947853/ref=sr_1_1?ie=UTF8&qid=1524390894&sr=8-1&keywords=data+science+at+the+command+line
-[13]:https://www.datascienceatthecommandline.com/
diff --git a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
new file mode 100644
index 0000000000..a02057f65a
--- /dev/null
+++ b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
@@ -0,0 +1,469 @@
+数据科学家的命令行技巧
+======
+
+
+
+对于许多数据科学家来说,数据操作始于和结束于 Pandas 或 Tidyverse。从理论上讲,这样做没有任何问题。毕竟,这就是这些工具存在的原因。然而,对于像分隔符转换这样的简单任务,这些工具是大材小用了。
+
+立志掌握命令行应该在每个开发人员的清单上,特别是数据科学家。学习 shell 的来龙去脉将无可否认地提高你的生产力。除此之外,命令行还是计算领域的一个重要历史课程。例如,awk - 一种数据驱动的脚本语言。1977年,在传奇的 [K&R 书][2]中 K 即 [Brain Kernighan][1] 的帮助下,Awk 首次出现。今天,大约五十年过去了,awk 仍然和每年出现的[新书][3]相关。因此,可以安全地假设对命令行魔法的投资不会很快贬值。
+
+### 我们将涵盖什么
+
+ * ICONV
+ * HEAD
+ * TR
+ * WC
+ * SPLIT
+ * SORT & UNIQ
+ * CUT
+ * PASTE
+ * JOIN
+ * GREP
+ * SED
+ * AWK
+
+
+
+### ICONV
+
+文件编码可能会很棘手。现在大部分文件都是 UTF-8 编码的。要了解 UTF-8 背后的一些魔力,请查看这个出色的[视频][4]。尽管如此,有时我们收到的文件不是这种格式。这可能引起对改变编码模式的一些不靠谱尝试。这里,iconv 是一个拯救者。Iconv 是一个简单的程序,它将获取采用一种编码的文本并输出采用另一种编码的文本。
+```
+# Converting -f (from) latin1 (ISO-8859-1)
+# -t (to) standard UTF_8
+
+iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt
+```
+
+ * 实用选项:
+
+ * `iconv -l` 列出所有已知编码
+ * `iconv -c` 默默丢弃无法转换的字符
+
+
+
+### HEAD
+
+如果你是一个频繁的 Pandas 用户,那么会很熟悉 `head`。通常在处理新数据时,我们想做的第一件事就是了解其内容。这导致启动 Pandas,读取数据然后调用 `df.head()` \- 这至少是费劲的。没有任何标志的 Head 将打印出文件的前10行。`head` 的真正力量在于测试出来干净利落的操作。例如,如果我们想将文件的分隔符从逗号更改为管道。一个快速测试将是:`head mydata.csv | sed 's/,/|/g'`。
+```bash
+# Prints out first 10 lines
+head filename.csv
+
+# Print first 3 lines
+head -n 3 filename.csv
+```
+
+ * 实用选项:
+
+ * `head -n` 打印特定行数
+ * `head -c` 打印具体的字节数
+
+
+
+### TR
+
+Tr 类似于翻译。这个功能强大的实用程序是基本文件清理的主力。理想的用例是交换文件中的分隔符。
+```bash
+# Converting a tab delimited file into commas
+cat tab_delimited.txt | tr "\t" "," comma_delimited.csv
+```
+
+`tr` 另一个功能是在你支配中的内建 `[:class:]` 变量(POSIX 字符类)。这些包括了:
+
+```
+[:alnum:] all letters and digits
+[:alpha:] all letters
+[:blank:] all horizontal whitespace
+[:cntrl:] all control characters
+[:digit:] all digits
+[:graph:] all printable characters, not including space
+[:lower:] all lower case letters
+[:print:] all printable characters, including space
+[:punct:] all punctuation characters
+[:space:] all horizontal or vertical whitespace
+[:upper:] all upper case letters
+[:xdigit:] all hexadecimal digits
+```
+
+你可以将这些连接在一起以组成强大的程序。以下是一个基本的字数统计程序,可用于检查自述文件是否过度使用。
+```
+cat README.md | tr "[:punct:][:space:]" "\n" | tr "[:upper:]" "[:lower:]" | grep . | sort | uniq -c | sort -nr
+```
+
+另一个使用基本正则表达式的例子:
+```
+# Converting all upper case letters to lower case
+cat filename.csv | tr '[A-Z]' '[a-z]'
+```
+
+ * 实用选项:
+
+ * `tr -d` 删除字符
+ * `tr -s` 压缩字符
+ * `\b` 退格
+ * `\f` 换页
+ * `\v` 垂直制表符
+ * `\NNN` 八进制字符
+
+
+
+### WC
+
+单词数量。它的值主要来自 `-l` 标志,它会给你提供行数。
+```
+# Will return number of lines in CSV
+wc -l gigantic_comma.csv
+```
+
+这个工具可以方便地确认各种命令的输出。所以,如果我们在转换文件中的分隔符之后运行 `wc -l`,我们会期待总行数是一样的,如果不一致,我们就知道有地方出错了。
+
+ * 实用选项:
+
+ * `wc -c` 打印字节数
+ * `wc -m` 打印字符数
+ * `wc -L` 打印最长行的长度
+ * `wc -w` 打印单词数量
+
+
+
+### SPLIT
+
+文件大小的范围可以很广。取决于任务,拆分文件可以是有益的,所以使用 `split` 吧。split的基本语法是:
+```bash
+# We will split our CSV into new_filename every 500 lines
+split -l 500 filename.csv new_filename_
+# filename.csv
+# ls output
+# new_filename_aaa
+# new_filename_aab
+# new_filename_aa
+```
+
+两个奇怪的地方是命名约定和缺少文件扩展名。后缀约定可以通过 `-d` 标志变为数字。要添加文件扩展名,你需要运行以下 `find` 命令。它将通过附加 `.csv`更改当前目录中所有文件的名称,所以小心了。
+```bash
+find . -type f -exec mv '{}' '{}'.csv \;
+# ls output
+# filename.csv.csv
+# new_filename_aaa.csv
+# new_filename_aab.csv
+# new_filename_aac.csv
+```
+
+ * 实用选项:
+
+ * `split -b` 按特定字节大小分割
+ * `split -a` 生成长度为 N 的后缀
+ * `split -x` 使用十六进制后缀分割
+
+
+
+### SORT & UNIQ
+
+以上两个命令很明显:他们的作用就是字面意思。这两者结合起来可以提供最强大的冲击 (i.e. 单独单词数量)。这是由于 `uniq` 只作用于重复的相邻行。这也是在输出前 `sort` 的原因。一个有趣的纪录是 `sort -u` 会达到和典型的 `sort file.txt | uniq` 模式一样的结果。
+
+Sort 对数据科学家来说确实具有潜在的有用能力:能够根据特定列对整个 CSV 进行排序。
+```bash
+# Sorting a CSV file by the second column alphabetically
+sort -t"," -k2,2 filename.csv
+
+# Numerically
+sort -t"," -k2n,2 filename.csv
+
+# Reverse order
+sort -t"," -k2nr,2 filename.csv
+```
+
+这里的 `-t` 选项将逗号指定为分隔符。通常假设分隔符是空格或制表符。此外,`-k` 标志是为了确定我们的 key。这里的语法是 `-km,n`,`m` 作为开始列,`n` 作为结束列。
+
+ * 实用选项:
+
+ * `sort -f` 忽略大小写
+ * `sort -r` 反向排序
+ * `sort -R` 乱序
+ * `uniq -c` 统计出现次数
+ * `uniq -d` 只打印重复行
+
+
+
+### CUT
+
+Cut 用于删除列。为了演示,如果我们只想删除第一和第三列。
+```bash
+cut -d, -f 1,3 filename.csv
+```
+
+选择除了第一行外的所有行。
+```bash
+cut -d, -f 2- filename.csv
+```
+
+结合其他命令,将`cut` 用作过滤器。
+```bash
+# Print first 10 lines of column 1 and 3, where "some_string_value" is present
+head filename.csv | grep "some_string_value" | cut -d, -f 1,3
+```
+
+查出第二列中唯一值的数量。
+```bash
+cat filename.csv | cut -d, -f 2 | sort | uniq | wc -l
+
+# Count occurences of unique values, limiting to first 10 results
+cat filename.csv | cut -d, -f 2 | sort | uniq -c | head
+```
+
+### PASTE
+
+Paste 是一个带有趣味性功能的粘贴命令。如果你有两个需要合并的文件,并且它们已经排序了,`paste` 帮你解决了接下来的步骤。
+```bash
+# names.txt
+adam
+john
+zach
+
+# jobs.txt
+lawyer
+youtuber
+developer
+
+# Join the two into a CSV
+paste -d ',' names.txt jobs.txt > person_data.txt
+
+# Output
+adam,lawyer
+john,youtuber
+zach,developer
+```
+
+查看更多 SQL_-esque 变种,见下文。
+
+### JOIN
+
+Join 是一个简单准切向的 SQL。最大的区别是 `join` 将返回所有列以及只能在一个字段上匹配。默认情况下,`join` 将尝试使用第一列作为匹配键。为了获得不同结果,必须使用以下语法:
+```bash
+# Join the first file (-1) by the second column
+# and the second file (-2) by the first
+join -t "," -1 2 -2 1 first_file.txt second_file.txt
+```
+
+标准的 join 是内连接。然而,外连接通过 `-a` 标志也是可行的。另一个值得一提的技巧是 `-q` 标志,如果发现有缺失的字段,可用于替换值。
+```bash
+# Outer join, replace blanks with NULL in columns 1 and 2
+# -o which fields to substitute - 0 is key, 1.1 is first column, etc...
+join -t"," -1 2 -a 1 -a2 -e ' NULL' -o '0,1.1,2.2' first_file.txt second_file.txt
+```
+
+不是最用户友好的命令,而是绝望时刻的绝望措施。
+
+ * 实用选项:
+
+ * `join -a` 打印不可配对的行
+ * `join -e` 替换丢失的输入字段
+ * `join -j` 相当于 `-1 FIELD -2 FIELD`
+
+
+
+### GREP
+
+用正则表达式全局搜索并且打印,或者 `grep`,可能是最有名的命令并且有充分的理由。Grep 很强大,特别适合在大型代码库中找到路径。在数据科学的王国里,它充当其他命令的提炼机制。虽然它的标准用途也很有价值。
+```
+# Recursively search and list all files in directory containing 'word'
+
+grep -lr 'word' .
+
+# List number of files containing word
+
+grep -lr 'word' . | wc -l
+
+```
+
+计算包含单词或模式的总行数。
+```
+grep -c 'some_value' filename.csv
+
+# Same thing, but in all files in current directory by file name
+
+grep -c 'some_value' *
+```
+
+使用 or 运算符 - `\|` 为多个值 Grep。
+```
+grep "first_value\|second_value" filename.csv
+```
+
+ * 实用选项:
+
+ * `alias grep="grep --color=auto"` 使 grep 丰富多彩
+ * `grep -E` 使用扩展的 regexp
+ * `grep -w` 只匹配整个单词
+ * `grep -l` 打印匹配的文件名
+ * `grep -v` 倒置匹配
+
+
+
+### 大人物们
+
+Sed 和 Awk 是本文中最强大的两个命令。为简介起见,我不打算详细讨论这两个命令。相反,我将介绍各种能证明其令人印象深刻的力量的命令。如果你想了解更多,[这儿就有一本书][5]是关于它们的。
+
+### SED
+
+`sed` 本质上是一个流编辑器。它擅长替换,但也可以用于所有输出重构。
+
+最基本的 `sed` 命令由 `s/old/new/g` 组成。这转换为搜索旧值,全局替换为新值。 如果没有 `/g`,我们的命令将在旧值第一次出现后终止。
+
+为了快速了解它的功能,我们可以深入了解一个例子。 在以下情景中,你已获得以下文件:
+```
+balance,name
+$1,000,john
+$2,000,jack
+```
+
+我们可能想要做的第一件事是删除美元符号。`-i` 标志表示原位。`''` 表示零长度文件扩展名,从而覆盖我们的初始文件。理想情况下,你可以单独测试每个,然后输出到新文件。
+```
+sed -i '' 's/\$//g' data.txt
+# balance,name
+# 1,000,john
+# 2,000,jack
+```
+
+接下来, `blance` 列的逗号。
+```
+sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt
+# balance,name
+# 1000,john
+# 2000,jack
+```
+
+最后杰克有一天决定退出。所以,再见了,我的朋友。
+```
+sed -i '' '/jack/d' data.txt
+# balance,name
+# 1000,john
+```
+
+正如你所看到的,`sed` 有很多强大的功能,但乐趣并不止于此。
+
+### AWK
+
+最好的留在最后。Awk 不仅仅是一个简单的命令:它是一个成熟的语言。在本文中涉及的所有内容中,`awk` 是目前为止最酷的。如果你发现自己对其印象深刻,这里有很多很棒的资源 - 看 [这里][6], [这里][7] 和 [这里][8]。
+
+`awk` 的常见用例包括:
+
+ * 文字处理
+ * 格式化文本报告
+ * 执行算术运算
+ * 执行字符串操作
+
+
+
+Awk 可以以最原生的形式并行 `grep`。
+```
+awk '/word/' filename.csv
+```
+
+或者更加神奇:将 `grep` 和 `cut` 组合起来。在这里,`awk` 打印第三和第四列,用 tab 分隔,对于所有带我们指定单词的行。`-F,` 只是改变我们的分隔符为逗号。
+```bash
+awk -F, '/word/ { print $3 "\t" $4 }' filename.csv
+```
+
+Awk 内置了许多精巧的变量。比如,`NF` \- 字段数 - 和 `NR` \- 记录数。要获取文件中的第53条记录:
+```bash
+awk -F, 'NR == 53' filename.csv
+```
+
+增加的代码是基于一个或多个值进行过滤的能力。下面的第一个示例将打印第一列等于给定字符串的记录的行号和列。
+```bash
+awk -F, ' $1 == "string" { print NR, $0 } ' filename.csv
+
+# Filter based off of numerical value in second column
+awk -F, ' $2 == 1000 { print NR, $0 } ' filename.csv
+```
+
+多个数值表达式:
+```bash
+# Print line number and columns where column three greater
+# than 2005 and column five less than one thousand
+
+awk -F, ' $3 >= 2005 && $5 <= 1000 { print NR, $0 } ' filename.csv
+```
+
+求出第三列的总和:
+```bash
+awk -F, '{ x+=$3 } END { print x }' filename.csv
+```
+
+在第一列等于 “something”的那些行,求出第三列值的总和。
+```bash
+awk -F, '$1 == "something" { x+=$3 } END { print x }' filename.csv
+```
+
+获取文件的尺寸:
+```bash
+awk -F, 'END { print NF, NR }' filename.csv
+
+# Prettier version
+awk -F, 'BEGIN { print "COLUMNS", "ROWS" }; END { print NF, NR }' filename.csv
+```
+
+打印出现了两次的行:
+```bash
+awk -F, '++seen[$0] == 2' filename.csv
+```
+
+删除重复的行:
+```bash
+# Consecutive lines
+awk 'a !~ $0; {a=$0}']
+
+# Nonconsecutive lines
+awk '! a[$0]++' filename.csv
+
+# More efficient
+awk '!($0 in a) {a[$0];print}
+```
+
+使用内置函数 `gsub()` 替换多个值。
+```bash
+awk '{gsub(/scarlet|ruby|puce/, "red"); print}'
+```
+
+这个 `awk` 命令将组合多个 CSV 文件,忽略标题,然后在最后附加它。
+```bash
+awk 'FNR==1 && NR!=1{next;}{print}' *.csv > final_file.csv
+```
+
+需要缩小一个庞大的文件? `awk` 可以在 `sed` 的帮助下处理它。具体来说,该命令根据行数将一个大文件分成多个较小的文件。这个 one-liner 也将增加一个扩展。
+```bash
+sed '1d;$d' filename.csv | awk 'NR%NUMBER_OF_LINES==1{x="filename-"++i".csv";}{print > x}'
+
+# Example: splitting big_data.csv into data_(n).csv every 100,000 lines
+sed '1d;$d' big_data.csv | awk 'NR%100000==1{x="data_"++i".csv";}{print > x}'
+```
+
+### 结语
+
+命令行拥有无穷无尽的力量。本文中介绍的命令足以将你从一无所知提升到英雄人物。除了涵盖的内容之外,还有许多实用程序需要考虑用于日常数据操作。[Csvkit][9], [xsv][10] 还有 [q][11] 是需要记住的三个。如果你希望更深入地了解命令行数据科学,查看[这本书][12]。它也可以[免费][13]在线获得!
+
+--------------------------------------------------------------------------------
+
+via: http://kadekillary.work/post/cli-4-ds/
+
+作者:[Kade Killary][a]
+选题:[lujun9972](https://github.com/lujun9972)
+译者:[GraveAccent](https://github.com/graveaccent)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:http://kadekillary.work/authors/kadekillary
+[1]:https://en.wikipedia.org/wiki/Brian_Kernighan
+[2]:https://en.wikipedia.org/wiki/The_C_Programming_Language
+[3]:https://www.amazon.com/Learning-AWK-Programming-cutting-edge-text-processing-ebook/dp/B07BT98HDS
+[4]:https://www.youtube.com/watch?v=MijmeoH9LT4
+[5]:https://www.amazon.com/sed-awk-Dale-Dougherty/dp/1565922255/ref=sr_1_1?ie=UTF8&qid=1524381457&sr=8-1&keywords=sed+and+awk
+[6]:https://www.amazon.com/AWK-Programming-Language-Alfred-Aho/dp/020107981X/ref=sr_1_1?ie=UTF8&qid=1524388936&sr=8-1&keywords=awk
+[7]:http://www.grymoire.com/Unix/Awk.html
+[8]:https://www.tutorialspoint.com/awk/index.htm
+[9]:http://csvkit.readthedocs.io/en/1.0.3/
+[10]:https://github.com/BurntSushi/xsv
+[11]:https://github.com/harelba/q
+[12]:https://www.amazon.com/Data-Science-Command-Line-Time-Tested/dp/1491947853/ref=sr_1_1?ie=UTF8&qid=1524390894&sr=8-1&keywords=data+science+at+the+command+line
+[13]:https://www.datascienceatthecommandline.com/
From 5c307e68ac0a41dd69a486fa03a7853a7a4d261c Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 23:10:44 +0800
Subject: [PATCH 055/119] PRF:20181204 3 implications of serverless.md
@HankChow
---
.../20181204 3 implications of serverless.md | 23 +++++++++----------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/translated/talk/20181204 3 implications of serverless.md b/translated/talk/20181204 3 implications of serverless.md
index 866e48fdd7..d2a097f898 100644
--- a/translated/talk/20181204 3 implications of serverless.md
+++ b/translated/talk/20181204 3 implications of serverless.md
@@ -1,31 +1,30 @@
无服务器架构的三个意义
======
-对于无服务器架构,什么时候该用,什么时候不该用呢?
+
+> 以及,对于无服务器架构,什么时候该用,什么时候不该用呢?

如果将如今互联网体验中最方便实用的那一部分去掉,那么留下来的基本就是客户端-服务端模式了。这一个模式在互联网建立初期就已经在使用了,直到目前都没有太大的变化,也就是说,这个模式仍然在为我们服务。
-那么,当人们谈论无服务器架构的时候,到底是指什么呢?其实,无服务器架构并不是说不使用服务器了。恰恰相反,客户端-服务端模式仍然在其中发挥着重要的作用。
+那么,当人们谈论无服务器架构的时候,到底是指什么呢?其实,无服务器架构并不是说不使用服务器了。恰恰相反,客户端-服务端模式仍然在其中发挥着重要的作用。
无服务器架构实际上指的是能够让开发者在不需要关心服务器上架、为操作系统打补丁、创建容器镜像这些工作的情况下,就能够完成编码、部署和创建应用这一整套流程的架构。
### 无服务器架构的三个重要意义
- 1. 一些缺乏开发经验的人员现在要参与到开发工作中来了。无服务器架构能够让他们尽量只学习必要的工作内容,把更多的时间放在更具创造性的开发工作中。
- 2. 开发者不再需要重复造轮子。运行和维护服务器、为操作系统打补丁、创建容器等这一系列工作,都可以由更专业的无服务器架构提供商来完成。
- 3. 最现实的一点是,如果不使用无服务器架构,那么在服务器管理方面,总需要有一个作最终决策的人。当服务器发生崩溃时,或是需要在服务器上执行某些操作时,总是需要这样一个统领全局的人来作出决策。因此最佳的方案是使用无服务器架构。
-
-
+1. 一些缺乏开发经验的人员现在要参与到开发工作中来了。无服务器架构能够让他们尽量只学习必要的工作内容,把更多的时间放在更具创造性的开发工作中。
+2. 开发者不再需要重复造轮子。运行和维护服务器、为操作系统打补丁、创建容器等这一系列工作,都可以由更专业的无服务器架构提供商来完成。
+3. 最现实的一点是,如果不使用无服务器架构,那么在服务器管理方面,总需要有一个作最终决策的人。当服务器发生崩溃时,或是需要在服务器上执行某些操作时,总是需要这样一个统领全局的人来作出决策。因此最佳的方案是使用无服务器架构。
### 什么时候该用或者不该用无服务器架构?
听起来无服务器架构是个好东西。但事实上,无服务器架构并不是万能的,在使用之前还需要考虑以下这些因素:
- 1. 成本
- 2. 使用范围
- 3. 时间
- 4. 控制方式
+1. 成本
+2. 使用范围
+3. 时间
+4. 控制方式
其中值得注意的是控制方式。现在已经有一些项目为开发者提供了操作和控制无服务器架构计算环境的工具了,[Apache OpenWhisk][1] 就是其中之一。
@@ -40,7 +39,7 @@ via: https://opensource.com/article/18/12/serverless-podcast-command-line-heros
作者:[Jen Wike Huger][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/) 荣誉推出
From 837b4d6256bbfc94b66ba34d0da675571de55e5f Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 11 Dec 2018 23:11:36 +0800
Subject: [PATCH 056/119] PUB:20181204 3 implications of serverless.md
@HankChow https://linux.cn/article-10336-1.html
---
.../talk => published}/20181204 3 implications of serverless.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/talk => published}/20181204 3 implications of serverless.md (100%)
diff --git a/translated/talk/20181204 3 implications of serverless.md b/published/20181204 3 implications of serverless.md
similarity index 100%
rename from translated/talk/20181204 3 implications of serverless.md
rename to published/20181204 3 implications of serverless.md
From 86f0fbcdf31f22860b95fd340eadf58743e5d358 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Wed, 12 Dec 2018 09:28:28 +0800
Subject: [PATCH 057/119] translated
---
...ux- Features, Download and Installation.md | 86 -------------------
...ux- Features, Download and Installation.md | 86 +++++++++++++++++++
2 files changed, 86 insertions(+), 86 deletions(-)
delete mode 100644 sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
create mode 100644 translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
diff --git a/sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
deleted file mode 100644
index b21790181a..0000000000
--- a/sources/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
+++ /dev/null
@@ -1,86 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: reviewer: ( )
-[#]: publisher: ( )
-[#]: subject: (SMPlayer in Linux: Features, Download and Installation)
-[#]: via: (https://itsfoss.com/smplayer/)
-[#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/)
-[#]: url: ( )
-
-SMPlayer in Linux: Features, Download and Installation
-======
-
-One of the [things you’ll notice after a fresh install of Ubuntu][1], or pretty much any other Linux distribution, is this message when you try to play certain video files.
-
-![][2]
-Default media player is not good with codecs
-
-It means that the [codecs needed][3] to play the media are not installed on the system. Now, due to some copyright issues, some Linux based operating systems cannot pre-pack the codecs in the installation media. But they do allow you to download and install the codecs with just a click, or you could just install a media player which has all the multimedia codecs, to begin with. Checkout [SMPlayer][4].
-
-### Meet SMPlayer: A Better Media Player for Linux
-
-SMPlayer is a free and open-source media player built on the powerful [MPlayer][5] media engine. SMPlayer is capable of playing avi, mp4, mkv, mpeg, mov, divx, h.264 and pretty much any other major media format out there. And the cherry on top is, it can play [YouTube][6] videos too, ad-free.
-
-![SMPlayer default interface][7]
-
-SMPlayer is a complete media solution. It is cross-platform, so available on all the operating systems. If you have a dual boot, you can install it on your Windows and Linux OS to get a uniform experience on both the systems. It also supports convertible laptops with touch support.
-
-You can play YouTube on SMPlayer too. I know it’s impractical to copy-paste the video URL and play on an external player every time. But SMPlayer is particularly useful when you are watching comparatively lengthy videos. SMPlayer plays YouTube videos in a very good quality and I felt the videos play out much better than the in-browser videos. And by playing the lengthier videos on SMPlayer, you can stay clear of the mid-roll ads that pop up on the lengthier videos.
-
-If you’re watching a movie which doesn’t have subtitles, You can directly download the subtitles through SMPlayer. It comes with [opensubtitles.org][8] integration. So none of that, open the browser, search for subtitles, download the appropriate ones, unzip, place them in the video folder and connect the subtitles to the movie. No Sir! SMPlayer at your service.
-
-![Automatic subtitle download in SMPlayer][9]
-
-SMPlayer is available in more than 30 languages and it is highly customizable. It has both applications theming and a ton of icon sets in it.
-
-If you feel that the default interface of SMPlayer doesn’t look good, in a few clicks you can make it look like this:
-
-![SMPlayer skin change][10]
-
-SMPlayer comes with a lot of tools and features for the power users. It has an equalizer, video speed controls, aspect ratio and zoom controls, video filters, screenshot ripping and lot more.
-
-All in all, I really liked SMPlayer. It has a lot to offer in a small and lightweight package. I think it is a must have video player on your Linux PC. Along with playing all the media formats easily it also provides a ton of power controls.
-
-### Installing SMPlayer on Linux
-
-SMPlayer should be available in the software center of all major Linux distributions. You can search for it and install it from there itself.
-
-On Ubuntu/ Linux Mint/ Elementary OS, you can also install SMPlayer by running the following command in the terminal
-
-```
-sudo apt install smplayer
-```
-
-Alternatively, you can download the package for Fedora, Arch Linux, OpenSUSE and Debian [here.][11]
-
-### Wrapping Up
-
-There are a good number of full-fledged media players out there like the VLC media player. SMPlayer is one of the best ones with a full functionality and great add-on benefits. I’ll consider it one of the [must-have applications for Linux][12].
-
-Do give it a try and share your thoughts with us in the comments section below.
-
---------------------------------------------------------------------------------
-
-via: https://itsfoss.com/smplayer/
-
-作者:[Aquil Roshan;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/aquil/
-[b]: https://github.com/lujun9972
-[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
-[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-warning.jpg?fit=800%2C450&ssl=1
-[3]: https://packages.ubuntu.com/trusty/ubuntu-restricted-extras
-[4]: https://www.smplayer.info/
-[5]: http://www.mplayerhq.hu/design7/news.html
-[6]: https://www.youtube.com/
-[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-coco.jpg?fit=800%2C450&ssl=1
-[8]: https://www.opensubtitles.org/en/search
-[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1
-[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1
-[11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer
-[12]: https://itsfoss.com/essential-linux-applications/
diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
new file mode 100644
index 0000000000..be826fc446
--- /dev/null
+++ b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
@@ -0,0 +1,86 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (SMPlayer in Linux: Features, Download and Installation)
+[#]: via: (https://itsfoss.com/smplayer/)
+[#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/)
+[#]: url: ( )
+
+Linux 中的 SMPlayer:功能,下载和安装
+======
+
+当你要播放视频时,你会在[全新安装的 Ubuntu][1],或其他许多发行版中,会注意到一个消息:
+
+![][2]
+默认媒体播放器没有适合的编解码器
+
+这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。了解一下 [SMPlayer][4]。
+
+### 认识 SMPlayer:适用于 Linux 的更好的媒体播放器
+
+SMPlayer 是一款免费的开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。
+
+![SMPlayer default interface][7]
+
+SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。
+
+你也可以在 SMPlayer 上播放 YouTube。我知道每次复制粘贴视频 URL 并在外部播放器上播放是不切实际的。但是当你观看相对较长的视频时,SMPlayer 特别有用。SMPlayer 以相当好的质量播放 YouTube 视频,我觉得比在浏览器中播放得更好。通过在 SMPlayer 上播放较长的视频,你可以远离视频中间弹出的插播广告。
+
+如果你在观看没有字幕的电影,你可以直接通过 SMPlayer 下载字幕。它集成了 [opensubtitles.org][8]。所以,打开浏览器,搜索字幕,下载相应的字幕,解压缩,将它们放在视频文件夹中并将字幕连接到电影,这些都不需要!SMPlayer 会为你服务。
+
+![Automatic subtitle download in SMPlayer][9]
+
+SMPlayer 支持 30 多种语言,并可高度自定义。它还有应用主题和大量的图标集。
+
+如果你觉得 SMPlayer 的默认界面看起来不太好,只需点击几下,它就可以看起来像这样:
+
+![SMPlayer skin change][10]
+
+SMPlayer 为高级用户提供了许多工具和功能。它有均衡器、视频速度控制、宽高比和缩放控制、视频过滤器、屏幕截图等等。
+
+总而言之,我真的很喜欢 SMPlayer。它在一个小巧轻量级的安装包中提供了很多功能。我认为它是 Linux PC 上必备的视频播放器。除了轻松播放所有媒体格式外,它还提供了大量的控制。
+
+### 在 Linux 上安装 SMPlayer
+
+SMPlayer 应该可在所有主要 Linux 发行版的软件中心获取。你可以搜索它并从那里安装它。
+
+在 Ubuntu/ Linux Mint/ Elementary OS 上,你还可以通过在终端中运行以下命令来安装 SMPlayer
+
+```
+sudo apt install smplayer
+```
+
+或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包
+
+### 总结
+
+有很多像 VLC 媒体播放器那样成熟的播放器。SMPlayer 是拥有完整功能和插件优势的最佳产品之一。我认为它是[必备 Linux 应用][12]之一。
+
+请尝试一下并在下面的评论栏与我们分享你的想法。
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/smplayer/
+
+作者:[Aquil Roshan;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/aquil/
+[b]: https://github.com/lujun9972
+[1]: https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
+[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-warning.jpg?fit=800%2C450&ssl=1
+[3]: https://packages.ubuntu.com/trusty/ubuntu-restricted-extras
+[4]: https://www.smplayer.info/
+[5]: http://www.mplayerhq.hu/design7/news.html
+[6]: https://www.youtube.com/
+[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-coco.jpg?fit=800%2C450&ssl=1
+[8]: https://www.opensubtitles.org/en/search
+[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-icon-packs.jpg?fit=800%2C450&ssl=1
+[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/11/SMPlayer-theme.jpg?fit=800%2C450&ssl=1
+[11]: https://software.opensuse.org/download.html?project=home%3Asmplayerdev&package=smplayer
+[12]: https://itsfoss.com/essential-linux-applications/
\ No newline at end of file
From e241040dd6c6aa7f2c1e52f8015e9383c15d102e Mon Sep 17 00:00:00 2001
From: geekpi
Date: Wed, 12 Dec 2018 09:32:00 +0800
Subject: [PATCH 058/119] translating
---
...ur Easy Ways to Search Or Find Files And Folders in Linux.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
index 8dde618420..f28649013b 100644
--- a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
+++ b/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From ab0558683312b3c62fedacc1b08127d90a6cbc25 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 13:03:09 +0800
Subject: [PATCH 059/119] PRF:20181128 OpenSnitch - an Application Firewall for
Linux -Review.md
@qhwdw
---
... Application Firewall for Linux -Review.md | 35 +++++++++++--------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md b/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
index 229b5b89c1..9cfe0afa34 100644
--- a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
+++ b/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
@@ -1,13 +1,13 @@
[#]: collector: "lujun9972"
[#]: translator: "qhwdw"
-[#]: reviewer: " "
+[#]: reviewer: "wxy"
[#]: publisher: " "
[#]: subject: "OpenSnitch – an Application Firewall for Linux [Review]"
[#]: via: "https://itsfoss.com/opensnitch-firewall-linux/"
-[#]: author: "[John Paul](https://itsfoss.com/author/john/)"
+[#]: author: "John Paul https://itsfoss.com/author/john/"
[#]: url: " "
-OpenSnitch – 一个 Linux 上的应用程序防火墙
+OpenSnitch:一个 Linux 上的应用程序防火墙
======
不能因为 Linux 比 Windows 更安全,就可以在 Linux 上放松警惕。Linux 上可以使用的防火墙很多,它们可以让你的 Linux 系统更安全。今天,我们将带你了解一个这样的防火墙工具,它就是 OpenSnitch。
@@ -20,9 +20,11 @@ OpenSnitch – 一个 Linux 上的应用程序防火墙
OpenSnitch 所做的主要事情就是跟踪你机器上安装的应用程序所发起的互联网请求。OpenSnitch 允许你去创建规则以同意或阻止那个应用程序发起的互联网访问。当一个应用程序尝试去访问互联网而没有相应的访问规则存在时,就会出现一个对话框,这个对话框让你去选择允许还是阻止那个连接。
-你也可以决定这个新规则是应用到进程上、精确的 URL 上、域名上、单个实例上,以及本次会话还是永久有效。
+你也可以决定这个新规则是应用到进程上、具体的 URL 上、域名上、单个实例上,以及本次会话还是永久有效。
-![OpenSnitch firewall app in Linux][5]OpenSnatch 规则请求
+![OpenSnitch firewall app in Linux][5]
+
+*OpenSnatch 规则请求*
你创建的所有规则都保存为 [JSON 文件][6],如果以后需要修改它,就可以去修改这个文件。比如说,你错误地阻止了一个应用程序。
@@ -33,17 +35,17 @@ OpenSnitch 也有一个漂亮的、一目了然的图形用户界面:
* 属主用户是谁
* 使用哪个端口
-
-
如果你愿意,也可以将这些信息导出到一个 CSV 文件中。
OpenSnitch 遵循 GPL v3 许可证使用。
-![OpenSnitch firewall interface][7]OpenSnitch 进程标签页
+![OpenSnitch firewall interface][7]
+
+*OpenSnitch 进程标签页*
### 在 Linux 中安装 OpenSnitch
-[OpenSnitch GitHub 页面][8] 上的安装介绍是针对 Ubuntu 用户的。如果你使用的是其它发行版,你需要调整一下相关的命令。据我所知,这个应用程序仅打包到 [Arch User Repository][9] 中。
+[OpenSnitch GitHub 页面][8] 上的安装介绍是针对 Ubuntu 用户的。如果你使用的是其它发行版,你需要调整一下相关的命令。据我所知,这个应用程序仅在 [Arch User Repository][9] 中打包了。
在你开始之前,你必须正确安装了 Go,并且已经定义好了 `$GOPATH` 环境变量。
@@ -67,7 +69,7 @@ go get github.com/evilsocket/opensnitch
cd $GOPATH/src/github.com/evilsocket/opensnitch
```
-如果没有正确设置 `$GOPATH` 环境变量,运行上面的命令时将会出现一个 “no such folder found” 的错误信息。只需要进入到你刚才克隆仓库位置的 “evilsocket/opensnitch” 文件夹中即可。
+如果没有正确设置 `$GOPATH` 环境变量,运行上面的命令时将会出现一个 “no such folder found” 的错误信息。只需要进入到你刚才克隆仓库位置的 `evilsocket/opensnitch` 文件夹中即可。
现在,我们构建并安装它。
@@ -77,7 +79,7 @@ make
sudo make install
```
-如果出现 “`dep` command could not be found” 的错误信息,在 `PATH` 中添加 `GOPATH/bin` 即可。
+如果出现 “dep command could not be found” 的错误信息,在 `$PATH` 中添加 `$GOPATH/bin` 即可。
安装完成后,我们将要启动它的守护程序和图形用户界面。
@@ -90,7 +92,8 @@ opensnitch-ui
```
![OpenSnitch firewall interface][10]
-运行在 Manjaro 上的 OpenSnitch
+
+*运行在 Manjaro 上的 OpenSnitch*
### 使用体验
@@ -98,7 +101,7 @@ opensnitch-ui
不幸的是,我安装之后,不能启动图形用户界面。因此,我手动去运行最后三个步骤。一切似乎很顺利。如果我想让 Firefox 去访问 Manjaro 的网站,对话框就会弹出来询问我。
-有趣的是,当我运行一个 [AUR 工具][11] `yay` 去更新我的系统时,弹出对话框要求了 `yay`、`pacman`、`pamac`、和 `git` 的访问规则。后来,我关闭并重启动 GUI,因为它是活动的。当我重启动它时,它不再要求我去创建规则了。我安装了 Falkon,而 OpenSnitch 并没有询问我去授予它任何权限。它甚至在 OpenSnitch 的 GUI 中没有列出 Falkon。我重新安装了 OpenSnitch 后,这个问题依旧存在。
+有趣的是,当我运行一个 [AUR 工具][11] `yay` 去更新我的系统时,弹出对话框要求了 `yay`、`pacman`、`pamac`、和 `git` 的访问规则。后来,我关闭并重启动 GUI,因为它当前是激活的。当我重启动它时,它不再要求我去创建规则了。我安装了 Falkon,而 OpenSnitch 并没有询问我去授予它任何权限。它甚至在 OpenSnitch 的 GUI 中没有列出 Falkon。我重新安装了 OpenSnitch 后,这个问题依旧存在。
然后,我转到 Ubuntu Mate 上安装 OpenSnitch,因为安装介绍就是针对 Ubuntu 所写的,进展很顺利。但是,我遇到了几个问题。我调整了一下上面介绍的安装过程以解决我遇到的问题。
@@ -106,7 +109,9 @@ opensnitch-ui
GUI 也有一点需要去改进。由于某些原因,每次窗口都被放在顶部。而且不能通过设置来修改这个问题。如果能够从 GUI 中改变规则将是一个不错的选择。
-![][12]OpenSnitch 的 hosts 标签
+![][12]
+
+*OpenSnitch 的 hosts 标签*
### 对 OpenSnitch 的最后意见
@@ -125,7 +130,7 @@ via: https://itsfoss.com/opensnitch-firewall-linux/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[qhwdw](https://github.com/qhwdw)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From d58835965df2e398c02e29d85babd8e1f7ac94d8 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 13:04:11 +0800
Subject: [PATCH 060/119] PUB:20181128 OpenSnitch - an Application Firewall for
Linux -Review.md
@qhwdw https://linux.cn/article-10337-1.html
---
... OpenSnitch - an Application Firewall for Linux -Review.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181128 OpenSnitch - an Application Firewall for Linux -Review.md (99%)
diff --git a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md b/published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
similarity index 99%
rename from translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
rename to published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
index 9cfe0afa34..996f905ddc 100644
--- a/translated/tech/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
+++ b/published/20181128 OpenSnitch - an Application Firewall for Linux -Review.md
@@ -1,11 +1,11 @@
[#]: collector: "lujun9972"
[#]: translator: "qhwdw"
[#]: reviewer: "wxy"
-[#]: publisher: " "
+[#]: publisher: "wxy"
[#]: subject: "OpenSnitch – an Application Firewall for Linux [Review]"
[#]: via: "https://itsfoss.com/opensnitch-firewall-linux/"
[#]: author: "John Paul https://itsfoss.com/author/john/"
-[#]: url: " "
+[#]: url: "https://linux.cn/article-10337-1.html"
OpenSnitch:一个 Linux 上的应用程序防火墙
======
From 390bdf2579df7a7ae2631ff5ba2ecf877af3d60b Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 13:29:33 +0800
Subject: [PATCH 061/119] PRF:20180221 12 useful zypper command examples.md
@cycoe
---
...80221 12 useful zypper command examples.md | 92 ++++++++++---------
1 file changed, 50 insertions(+), 42 deletions(-)
diff --git a/translated/tech/20180221 12 useful zypper command examples.md b/translated/tech/20180221 12 useful zypper command examples.md
index 018c5da7c3..356c55becc 100644
--- a/translated/tech/20180221 12 useful zypper command examples.md
+++ b/translated/tech/20180221 12 useful zypper command examples.md
@@ -1,10 +1,11 @@
12 条实用的 zypper 命令范例
======
-zypper 是 Suse Linux 系统的包和补丁管理器,你可以根据下面的 12 条附带输出示例的实用范例来学习 zypper 命令的使用。
+
+`zypper` 是 Suse Linux 系统的包和补丁管理器,你可以根据下面的 12 条附带输出示例的实用范例来学习 `zypper` 命令的使用。
![zypper 命令示例][1]
-Suse Linux 使用 zypper 进行包管理,其是一个由 [ZYpp 包管理引擎][2]提供技术支持的包管理系统。在此篇文章中我们将分享 12 条附带输出示例的实用 zypper 命令,能帮助你处理日常的系统管理任务。
+Suse Linux 使用 `zypper` 进行包管理,其是一个由 [ZYpp 包管理引擎][2]提供的包管理系统。在此篇文章中我们将分享 12 条附带输出示例的实用 `zypper` 命令,能帮助你处理日常的系统管理任务。
不带参数的 `zypper` 命令将列出所有可用的选项,这比参考详细的 man 手册要容易上手得多。
@@ -18,12 +19,12 @@ root@kerneltalks # zypper
--help, -h 帮助
--version, -V 输出版本号
--promptids 输出 zypper 用户提示符列表
- --config, -c 使用制定的配置文件来替代默认的
+ --config, -c 使用指定的配置文件来替代默认的
--userdata 在历史和插件中使用的用户自定义事务 id
--quiet, -q 忽略正常输出,只打印错误信息
--verbose, -v 增加冗长程度
--color
- --no-color 是否启用彩色模式如果 tty 支持
+ --no-color 是否启用彩色模式,如果 tty 支持的话
--no-abbrev, -A 表格中的文字不使用缩写
--table-style, -s 表格样式(整型)
--non-interactive, -n 不询问任何选项,自动使用默认答案
@@ -43,7 +44,7 @@ root@kerneltalks # zypper
--gpg-auto-import-keys 自动信任并导入新仓库的签名密钥
--plus-repo, -p 使用附加仓库
--plus-content 另外使用禁用的仓库来提供特定的关键词
- 尝试 '--plus-content debug' 选项来启用仓库
+ 尝试使用 '--plus-content debug' 选项来启用仓库
--disable-repositories 不从仓库中读取元数据
--no-refresh 不刷新仓库
--no-cd 忽略 CD/DVD 中的仓库
@@ -55,11 +56,11 @@ root@kerneltalks # zypper
--disable-system-resolvables
不读取已安装包
- 命令:
+ 命令:
help, ? 打印帮助
shell, sh 允许多命令
- 仓库管理:
+ 仓库管理:
repos, lr 列出所有自定义仓库
addrepo, ar 添加一个新仓库
removerepo, rr 移除指定仓库
@@ -68,14 +69,14 @@ root@kerneltalks # zypper
refresh, ref 刷新所有仓库
clean 清除本地缓存
- 服务管理:
+ 服务管理:
services, ls 列出所有自定义服务
addservice, as 添加一个新服务
modifyservice, ms 修改指定服务
removeservice, rs 移除指定服务
refresh-services, refs 刷新所有服务
- 软件管理:
+ 软件管理:
install, in 安装包
remove, rm 移除包
verify, ve 确认包依赖的完整性
@@ -83,7 +84,7 @@ root@kerneltalks # zypper
install-new-recommends, inr
安装由已安装包建议一并安装的新包
- 更新管理:
+ 更新管理:
update, up 更新已安装包至更新版本
list-updates, lu 列出可用更新
patch 安装必要的补丁
@@ -91,7 +92,7 @@ root@kerneltalks # zypper
dist-upgrade, dup 进行发行版更新
patch-check, pchk 检查补丁
- 查询:
+ 查询:
search, se 查找符合匹配模式的包
info, if 展示特定包的完全信息
patch-info 展示特定补丁的完全信息
@@ -103,27 +104,28 @@ root@kerneltalks # zypper
products, pd 列出所有可用的产品
what-provides, wp 列出提供特定功能的包
- 包锁定:
+ 包锁定:
addlock, al 添加一个包锁定
removelock, rl 移除一个包锁定
locks, ll 列出当前的包锁定
cleanlocks, cl 移除无用的锁定
- 其他命令:
+ 其他命令:
versioncmp, vcmp 比较两个版本字符串
targetos, tos 打印目标操作系统 ID 字符串
licenses 打印已安装包的证书和 EULAs 报告
download 使用命令行下载指定 rpm 包到本地目录
source-download 下载所有已安装包的源码 rpm 包到本地目录
- 子命令:
+ 子命令:
subcommand 列出可用子命令
输入 'zypper help ' 来获得特定命令的帮助。
```
-##### 如何使用 zypper 安装包
-`zypper` 通过 `in` 或 `install` 开关来在你的系统上安装包。它的用法与 [yum package installation][3] 相同。你只需要提供包名作为参数,包管理器(此处是 zypper)就会处理所有的依赖并与你指定的包一并安装。
+### 如何使用 zypper 安装包
+
+`zypper` 通过 `in` 或 `install` 子命令来在你的系统上安装包。它的用法与 [yum 软件包安装][3] 相同。你只需要提供包名作为参数,包管理器(此处是 `zypper`)就会处理所有的依赖并与你指定的包一并安装。
```
# zypper install telnet
@@ -147,11 +149,11 @@ Checking for file conflicts: ...................................................
以上是我们安装 `telnet` 包时的输出,供你参考。
-推荐阅读 : [在 YUM 和 APT 系统中安装包][3]
+推荐阅读:[在 YUM 和 APT 系统中安装包][3]
-##### 如何使用 zypper 移除包
+### 如何使用 zypper 移除包
-要在 Suse Linux 中擦除或移除包,使用 `zypper` 命令附带 `remove` 或 `rm` 开关。
+要在 Suse Linux 中擦除或移除包,使用 `zypper` 附带 `remove` 或 `rm` 子命令。
```
root@kerneltalks # zypper rm telnet
@@ -167,13 +169,14 @@ After the operation, 113.3 KiB will be freed.
Continue? [y/n/...? shows all options] (y): y
(1/1) Removing telnet-1.2-165.63.x86_64 ..........................................................................................................................[done]
```
+
我们在此处移除了先前安装的 telnet 包。
-##### 使用 zypper 检查依赖或者认证已安装包的完整性
+### 使用 zypper 检查依赖或者认证已安装包的完整性
有时可以通过强制忽略依赖关系来安装软件包。`zypper` 使你能够扫描所有已安装的软件包并检查其依赖性。如果缺少任何依赖项,它将提供你安装或重新安装它的机会,从而保持已安装软件包的完整性。
-使用附带 `verify` 或 `ve` 开关的 `zypper` 命令来检查已安装包的完整性。
+使用附带 `verify` 或 `ve` 子命令的 `zypper` 命令来检查已安装包的完整性。
```
root@kerneltalks # zypper ve
@@ -184,9 +187,10 @@ Reading installed packages...
Dependencies of all installed packages are satisfied.
```
+
在上面的输出中,你能够看到最后一行说明已安装包的所有依赖都已安装完全,并且无需更多操作。
-##### 如何在 Suse Linux 中使用 zypper 下载包
+### 如何在 Suse Linux 中使用 zypper 下载包
`zypper` 提供了一种方法使得你能够将包下载到本地目录而不去安装它。你可以在其他具有同样配置的系统上使用这个已下载的软件包。包会被下载至 `/var/cache/zypp/packages///` 目录。
@@ -206,13 +210,14 @@ total 52
-rw-r--r-- 1 root root 53025 Feb 21 03:17 telnet-1.2-165.63.x86_64.rpm
```
+
你能看到我们使用 `zypper` 将 telnet 包下载到了本地。
-推荐阅读 : [在 YUM 和 APT 系统中只下载包而不安装][4]
+推荐阅读:[在 YUM 和 APT 系统中只下载包而不安装][4]
-##### 如何使用 zypper 列出可用包更新
+### 如何使用 zypper 列出可用包更新
-`zypper` 允许你浏览已安装包的所有可用更新,以便你可以提前计划更新活动。使用 `list-updates` 或 `lu` 开关来显示已安装包的所有可用更新。
+`zypper` 允许你浏览已安装包的所有可用更新,以便你可以提前计划更新活动。使用 `list-updates` 或 `lu` 子命令来显示已安装包的所有可用更新。
```
root@kerneltalks # zypper lu
@@ -229,11 +234,12 @@ v | SLE-Module-Containers12-Updates | containerd | 0.2.5+gitr6
v | SLES12-SP3-Updates | crash | 7.1.8-4.3.1 | 7.1.8-4.6.2 | x86_64
v | SLES12-SP3-Updates | rsync | 3.1.0-12.1 | 3.1.0-13.10.1 | x86_64
```
+
输出特意被格式化以便于阅读。每一列分别代表包所属仓库名称、包名、已安装版本、可用的更新版本和架构。
-##### 在 Suse Linux 中列出和安装补丁
+### 在 Suse Linux 中列出和安装补丁
-使用 `list-patches` 或 `lp` 开关来显示你的 Suse Linux 系统需要被应用的所有可用补丁。
+使用 `list-patches` 或 `lp` 子命令来显示你的 Suse Linux 系统需要被应用的所有可用补丁。
```
root@kerneltalks # zypper lp
@@ -262,7 +268,7 @@ Found 37 applicable patches:
##### 如何使用 zypper 更新包
-要使用 zypper 更新包,使用 `update` 或 `up` 开关后接包名。在上述列出的更新命令中,我们知道在我们的服务器上 `rsync` 包更新可用。让我们现在来更新它吧!
+要使用 `zypper` 更新包,使用 `update` 或 `up` 子命令后接包名。在上述列出的更新命令中,我们知道在我们的服务器上 `rsync` 包更新可用。让我们现在来更新它吧!
```
root@kerneltalks # zypper update rsync
@@ -284,9 +290,9 @@ Checking for file conflicts: ...................................................
(1/1) Installing: rsync-3.1.0-13.10.1.x86_64 .....................................................................................................................[done]
```
-##### 在 Suse Linux 上使用 zypper 查找包
+### 在 Suse Linux 上使用 zypper 查找包
-如果你不确定包的全名也不要担心。你可以使用 zypper 附带 `se` 或 `search` 开关并提供查找字符串来查找包。
+如果你不确定包的全名也不要担心。你可以使用 `zypper` 附带的 `se` 或 `search` 子命令并提供查找字符串来查找包。
```
root@kerneltalks # zypper se lvm
@@ -303,14 +309,15 @@ S | Name | Summary | Type
| llvm-devel | Header Files for LLVM | package
| lvm2 | Logical Volume Manager Tools | srcpackage
i+ | lvm2 | Logical Volume Manager Tools | package
- | lvm2-devel | Development files for LVM2 | package
-
+ | lvm2-devel | Development files for LVM2 | package
```
-在上述示例中我们查找了 `lvm` 字符串并得到了如上输出列表。你能在 zypper install/remove/update 命令中使用 `Name` 字段的名字。
-##### 使用 zypper 检查已安装包信息
+在上述示例中我们查找了 `lvm` 字符串并得到了如上输出列表。你能在 `zypper install/remove/update` 命令中使用 `Name` 字段的名字。
+
+### 使用 zypper 检查已安装包信息
+
+你能够使用 `zypper` 检查已安装包的详细信息。`info` 或 `if` 子命令将列出已安装包的信息。它也可以显示未安装包的详细信息,在该情况下,`Installed` 参数将返回 `No` 值。
-你能够使用 zypper 检查已安装包的详细信息。`info` 或 `if` 开关将列出已安装包的信息。它也可以显示未安装包的详细信息,在该情况下,`Installed` 参数将返回 `No` 值。
```
root@kerneltalks # zypper info rsync
Refreshing service 'SMT-http_smt-ec2_susecloud_net'.
@@ -343,9 +350,9 @@ Description :
for backups and mirroring and as an improved copy command for everyday use.
```
-##### 使用 zypper 列出仓库
+### 使用 zypper 列出仓库
-使用 zypper 命令附带 `lr` 或 `repos` 开关列出仓库。
+使用 `zypper` 命令附带 `lr` 或 `repos` 子命令列出仓库。
```
root@kerneltalks # zypper lr
@@ -364,7 +371,7 @@ Repository priorities are without effect. All enabled repositories share the sam
此处你需要检查 `enabled` 列来确定哪些仓库是已被启用的而哪些没有。
-##### 在 Suse Linux 中使用 zypper 添加或移除仓库
+### 在 Suse Linux 中使用 zypper 添加或移除仓库
要添加仓库你需要仓库或 .repo 文件的 URI,否则你会遇到如下错误。
@@ -390,16 +397,17 @@ Priority : 99 (default priority)
Repository priorities are without effect. All enabled repositories share the same priority.
```
-在 Suse 中使用附带 `addrepo` 或 `ar` 开关的 `zypper` 命令添加仓库,后接 URI 以及你需要提供一个别名。
+在 Suse 中使用附带 `addrepo` 或 `ar` 子命令的 `zypper` 命令添加仓库,后接 URI 以及你需要提供一个别名。
+
+要在 Suse 中移除一个仓库,使用附带 `removerepo` 或 `rr` 子命令的 `zypper` 命令。
-要在 Suse 中移除一个仓库,使用附带 `removerepo` 或 `rr` 开关的 `zypper` 命令。
```
root@kerneltalks # zypper removerepo nVidia-Driver-SLE12-SP3
Removing repository 'nVidia-Driver-SLE12-SP3' ....................................................................................................................[done]
Repository 'nVidia-Driver-SLE12-SP3' has been removed.
```
-##### 清除 zypper 本地缓存
+### 清除 zypper 本地缓存
使用 `zypper clean` 命令清除 zypper 本地缓存。
@@ -414,7 +422,7 @@ via: https://kerneltalks.com/commands/12-useful-zypper-command-examples/
作者:[KernelTalks][a]
译者:[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 75a1fa3916397b14659ad58463dff7180b544507 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 13:29:57 +0800
Subject: [PATCH 062/119] PUB:20180221 12 useful zypper command examples.md
@cycoe https://linux.cn/article-10338-1.html
---
.../20180221 12 useful zypper command examples.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180221 12 useful zypper command examples.md (100%)
diff --git a/translated/tech/20180221 12 useful zypper command examples.md b/published/20180221 12 useful zypper command examples.md
similarity index 100%
rename from translated/tech/20180221 12 useful zypper command examples.md
rename to published/20180221 12 useful zypper command examples.md
From 553d2fe37ed1e0912c83689382de3185187bbc8b Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 13:31:01 +0800
Subject: [PATCH 063/119] PRF:20180221 12 useful zypper command examples.md
---
published/20180221 12 useful zypper command examples.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/published/20180221 12 useful zypper command examples.md b/published/20180221 12 useful zypper command examples.md
index 356c55becc..94397cd964 100644
--- a/published/20180221 12 useful zypper command examples.md
+++ b/published/20180221 12 useful zypper command examples.md
@@ -266,7 +266,7 @@ Found 37 applicable patches:
你可以通过发出 `zypper patch` 命令安装所有需要的补丁。
-##### 如何使用 zypper 更新包
+### 如何使用 zypper 更新包
要使用 `zypper` 更新包,使用 `update` 或 `up` 子命令后接包名。在上述列出的更新命令中,我们知道在我们的服务器上 `rsync` 包更新可用。让我们现在来更新它吧!
From 33aa734db5ee947793bf10c3df19115dc3d4dfeb Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Wed, 12 Dec 2018 13:38:58 +0800
Subject: [PATCH 064/119] Translating 7 command-line tools for writers.
---
...119 7 command-line tools for writers - Opensource.com.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index 8feec80f41..ead46909ff 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -33,11 +33,11 @@
### 其他工具
-Sometimes you just can't find the right synonym for a word. But you don't need to grab a "dead tree" thesaurus or go to a dedicated website to perfect your word choice. Just run [Aiksaurus][16] against the word you want to replace, and it does the work for you. This utility's main drawback, though, is that it supports English only.
+有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行[Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。
-Even writers with few (if any) technical skills are embracing [Markdown][17] to quickly and easily format their work. Sometimes, though, you need to convert files formatted with Markdown to something else. That's where [Pandoc][18] comes in. You can use it to convert your documents to HTML, Word, LibreOffice Writer, LaTeX, EPUB, and other formats. You can even use Pandoc to produce books and [research papers][19].
+即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用Markdown格式的文件转换成其他格式。这就是[Pandoc][18]的用武之地。你可以用它来将你的文档转换成 HTML, Word, LibreOffice Writer, LaTeX, EPUB以及其他格式。你甚至可以用Pandoc来生成书籍和[研究论文][19]。
-Do you have a favorite command-line tool for writing? Share it with the Opensource.com community by leaving a comment.
+你有一个最喜欢的命令行写作工具吗?在Opensource.com社区发表评论分享它。
--------------------------------------------------------------------------------
From 637b4c71b5870042ac3df0104aea6617f3c25e6c Mon Sep 17 00:00:00 2001
From: darksun
Date: Wed, 12 Dec 2018 14:29:15 +0800
Subject: [PATCH 065/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Open=20source=20D?=
=?UTF-8?q?IY=20ethics?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../talk/20181209 Open source DIY ethics.md | 62 +++++++++++++++++++
1 file changed, 62 insertions(+)
create mode 100644 sources/talk/20181209 Open source DIY ethics.md
diff --git a/sources/talk/20181209 Open source DIY ethics.md b/sources/talk/20181209 Open source DIY ethics.md
new file mode 100644
index 0000000000..2c249d33af
--- /dev/null
+++ b/sources/talk/20181209 Open source DIY ethics.md
@@ -0,0 +1,62 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Open source DIY ethics)
+[#]: via: (https://arp242.net/weblog/diy.html)
+[#]: author: (Martin Tournoij https://arp242.net/)
+
+Open source DIY ethics
+======
+
+I moved to New Zealand last week, and as a proper Dutch person one of the first things I did after arriving was getting a bicycle.
+
+I was recommended [a great place][1] where they collect old bikes and provide people with the parts and tools to fix up the bikes. Want a bike? Choose one, fix it, and it’s yours. There are helpful and knowledgable volunteers who will gladly help you and explain how things work, but in the end you’ll have to fix your own bike; they’re not going to do it for you.
+
+I like this DIY attitude; I built my own fixie (which I unfortunately couldn’t bring) years ago and had been maintaining it myself ever since, but there are many different aspects I never touched on (different brake systems, gears, etc.) and fixing my bike with some help and explanation was a useful experience which taught me a thing or two that I’ll be sure to use in the future.
+
+My attitude to open source projects tends to be similar: I’ll gladly assist you or explain things, but you will have to do the work. This is especially true when it comes to feature requests or very specific scenarios.
+
+Open source software is fundamentally a [DIY ethic][2] for many – though not all – people who participate in it. It certainly is for me. I just fix stuff I want myself. Since I take some amount of pride in my work and want things to work well for others I’ll also gladly fix most bugs that are reported, but sometimes people will post an enhancement or feature request and just expect me to implement it. It’s sometimes even combined with a “but project X does it!”-comment. Well, feck off and use project X then (I don’t actually say this, just think it).
+
+I’ve seen more than a few people get frustrated by this attitude especially — though hardly exclusively — in the OpenBSD and suckless communities ([recent example that prompted this post][3]), partly because it’s not infrequently communicated in a somewhat unhelpful fashion (the OpenBSD saying is “shut up and hack”), but also because some people seem to misunderstand what it means to be a maintainer of an open source project. Open source software isn’t a service I provide to the world; it’s something I DIY’d myself and make available to the world because why not?
+
+Some open source software is supported by companies. Only about [14% of the contributions to the Linux kernel are not affiliated with a company][4]. I don’t think this matters: these are companies who are DIY-ing as well.
+
+Are there people who contribute to open source for other reasons? Sure. Some do because they really believe in [Free Software][5], or because they like programming as a hobby. But those are not the majority.
+
+Not all contributions that aren’t code are useless. Sometimes someone will have a great idea for an enhancement or feature that I hadn’t thought of myself and this can be a very valuable contribution. But those types of constructive contributions are usually easy to recognize: they consist of more than just a single paragraph, are respectful, show a clear understanding of what the project is supposed to do, if they don’t understand a certain aspect they’ll ask instead of bombastically claiming that it’s “broken”, and perhaps most importantly, they show a willingness to constructively contribute, rather than just trying to tell you how to run your project.
+
+This attitude isn’t limited to open source; to quote Neil Gaiman when talking about A Song of Ice and Fire fans demanding George R.R. Martin work harder on the next instalment of the series: “[George R.R. Martin is not your bitch][6]”.
+
+I can’t help George with his next book, but I can help with software projects, which is really neat. Not everyone is a computer programmer, but the vast majority of projects I’ve worked on are used exclusively by programmers.
+
+In the two months that it took me to finish this post (cleaning up drafts always takes forever) there have been a number of incidents in various communities that touched upon a mismatch in expectations between open source authors/maintainers and the users. “It’s not fun anymore, you get nothing from maintaining a popular package”, to quote one maintainer, or “I’m frustrated because I can’t handle the volume of emails” to quote another.
+
+The situation would be vastly improved if more people start seeing and treating open source more like the DIY that it is and assume responsibility for that bug you’ve encountered or enhancement you want, rather than offloading all responsibility to the maintainer. This won’t fix everything, but it’s a good start. Note that plenty of people — including myself — already do this.
+
+Both authors and users will benefit; authors will be frustrated less with “entitled” users, and users will be frustrated less by “rude” authors, and in the end the software will work better as users will be more willing to spend some time fixing stuff themselves, rather than just expecting other people to do it for them.
+
+
+--------------------------------------------------------------------------------
+
+via: https://arp242.net/weblog/diy.html
+
+作者:[Martin Tournoij][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://arp242.net/
+[b]: https://github.com/lujun9972
+[1]: https://www.facebook.com/TheCrookedSpoke
+[2]: https://en.wikipedia.org/wiki/DIY_ethic
+[3]: https://www.reddit.com/r/suckless/comments/9mhwg8/why_does_sts_latency_suck_so_bad/e7fu9sj/
+[4]: https://www.linux.com/publications/linux-kernel-development-how-fast-it-going-who-doing-it-what-they-are-doing-and-who-0
+[5]: https://www.gnu.org/philosophy/free-sw.html
+[6]: http://journal.neilgaiman.com/2009/05/entitlement-issues.html
+[7]: mailto:martin@arp242.net
+[8]: https://github.com/Carpetsmoker/arp242.net/issues/new
From 031716bec70f3dac5ae989a7404c54c8f30ddab9 Mon Sep 17 00:00:00 2001
From: darksun
Date: Wed, 12 Dec 2018 14:33:55 +0800
Subject: [PATCH 066/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Winterize=20your?=
=?UTF-8?q?=20Bash=20prompt=20in=20Linux?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...211 Winterize your Bash prompt in Linux.md | 85 +++++++++++++++++++
1 file changed, 85 insertions(+)
create mode 100644 sources/tech/20181211 Winterize your Bash prompt in Linux.md
diff --git a/sources/tech/20181211 Winterize your Bash prompt in Linux.md b/sources/tech/20181211 Winterize your Bash prompt in Linux.md
new file mode 100644
index 0000000000..bae5837a2c
--- /dev/null
+++ b/sources/tech/20181211 Winterize your Bash prompt in Linux.md
@@ -0,0 +1,85 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Winterize your Bash prompt in Linux)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-bash-prompt)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+
+Winterize your Bash prompt in Linux
+======
+Your Linux terminal probably supports Unicode, so why not take advantage of that and add a seasonal touch to your prompt?
+
+
+Hello once again for another installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is? Really, we're keeping it pretty open-ended: It's anything that's a fun diversion at the terminal, and we're giving bonus points for anything holiday-themed.
+
+Maybe you've seen some of these before, maybe you haven't. Either way, we hope you have fun.
+
+Today's toy is super-simple: It's your Bash prompt. Your Bash prompt? Yep! We've got a few more weeks of the holiday season left to stare at it, and even more weeks of winter here in the northern hemisphere, so why not have some fun with it.
+
+Your Bash prompt currently might be a simple dollar sign ( **$** ), or more likely, it's something a little longer. If you're not sure what makes up your Bash prompt right now, you can find it in an environment variable called $PS1. To see it, type:
+
+```
+echo $PS1
+```
+
+For me, this returns:
+
+```
+[\u@\h \W]\$
+```
+
+The **\u** , **\h** , and **\W** are special characters for username, hostname, and working directory. There are others you can use as well; for help building out your Bash prompt, you can use [EzPrompt][1], an online generator of PS1 configurations that includes lots of options including date and time, Git status, and more.
+
+You may have other variables that make up your Bash prompt set as well; **$PS2** for me contains the closing brace of my command prompt. See [this article][2] for more information.
+
+To change your prompt, simply set the environment variable in your terminal like this:
+
+```
+$ PS1='\u is cold: '
+jehb is cold:
+```
+
+To set it permanently, add the same code to your **/etc/bashrc **using your favorite text editor.
+
+So what does this have to do with winterization? Well, chances are on a modern machine, your terminal support Unicode, so you're not limited to the standard ASCII character set. You can use any emoji that's a part of the Unicode specification, including a snowflake ❄, a snowman ☃, or a pair of skis 🎿. You've got plenty of wintery options to choose from.
+
+```
+🎄 Christmas Tree
+🧥 Coat
+🦌 Deer
+🧤 Gloves
+🤶 Mrs. Claus
+🎅 Santa Claus
+🧣 Scarf
+🎿 Skis
+🏂 Snowboarder
+❄ Snowflake
+☃ Snowman
+⛄ Snowman Without Snow
+🎁 Wrapped Gift
+```
+
+Pick your favorite, and enjoy some winter cheer. Fun fact: modern filesystems also support Unicode characters in their filenames, meaning you can technically name your next program **"❄❄❄❄❄.py"**. That said, please don't.
+
+Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Snake your way across your Linux terminal][3], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-bash-prompt
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: http://ezprompt.net/
+[2]: https://access.redhat.com/solutions/505983
+[3]: https://opensource.com/article/18/12/linux-toy-snake
From af31f90e72396bd52ca3e62f0ad16b1f31a96fb5 Mon Sep 17 00:00:00 2001
From: darksun
Date: Wed, 12 Dec 2018 14:53:28 +0800
Subject: [PATCH 067/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Instal?=
=?UTF-8?q?l=20Putty=20on=20Ubuntu=20and=20Other=20Linux=20Distributions?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...on Ubuntu and Other Linux Distributions.md | 111 ++++++++++++++++++
1 file changed, 111 insertions(+)
create mode 100644 sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
diff --git a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
new file mode 100644
index 0000000000..1b92a73645
--- /dev/null
+++ b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
@@ -0,0 +1,111 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How to Install Putty on Ubuntu and Other Linux Distributions)
+[#]: via: (https://itsfoss.com/putty-linux/)
+[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+
+How to Install Putty on Ubuntu and Other Linux Distributions
+======
+
+If I am not wrong, [Putty][1] is perhaps the most popular SSH client for Windows.
+
+In IT companies, the development environment is usually on a remote Linux system while the developers use Windows as their local system. Putty is used for connecting to the remote Linux system from the Windows machine.
+
+Putty is not limited to Windows only. You can also use this open source software on Linux and macOS.
+
+But wait! Why would you use a separate SSH client on Linux when you already have the ‘real’ Linux terminal with you? There are several reasons why you would want to use Putty on Linux.
+
+ * You have used Putty for so long on Windows that you are more comfortable with it.
+ * You find it difficult to manually edit SSH config file to save the various SSH sessions. You prefer Putty’s graphical way of storing SSH connection.
+ * You want to debug by connecting to raw sockets and serial ports.
+
+
+
+Whatever may be the reason, if you want to use Putty on Ubuntu or any other Linux, you can certainly do so. Let me show you how to do that.
+
+### Installing Putty on Ubuntu Linux
+
+![Installing Putty on Linux][2]
+
+The good news for the Ubuntu users is that Putty is available in the universe repository of Ubuntu.
+
+To install Putty on Ubuntu, you should first make sure that the universe repository is enabled.
+
+```
+sudo add-apt-repository universe
+```
+
+Once you have the universe repository enabled, you should update Ubuntu with this command:
+
+```
+sudo apt update
+```
+
+After this, you can install Putty with this command:
+
+```
+sudo apt install putty
+```
+
+Once installed, you can start Putty by finding it in the menu.
+
+As you can see in the screenshot below, the Linux version of Putty looks the same as the Windows version. That’s a relief because you won’t have to fiddle around trying to find your way through a new and changed settings.
+
+![Putty in Linux][3]
+
+When you enter the remote system’s [hostname][4] or IP address and connect to it, Putty will utilize the already saved SSH keys in your home directory.
+
+![Using Putty in Ubuntu Linux][5]
+
+### Installing Putty on other Linux distributions
+
+[Putty is available for Debian][6] so you just need to use apt-get or aptitude for installing it.
+
+```
+sudo apt-get install putty
+```
+
+Putty is also available for Fedora/Red Hat and can be installed using the default package manager.
+
+```
+sudo dnf install putty
+```
+
+You can also easily install Putty in Arch Linux based distributions.
+
+```
+sudo pacman -S putty
+```
+
+Remember that Putty is an open source software. You can also install it via source code if you really want to. You can get the source code of Putty from the link below.
+
+[Download Putty Source Code][8]
+
+I would always prefer the native Linux terminal over an SSH client like Putty. I feel more at home with the GNOME terminal or [Terminator][7]. However, it’s up to an individual’s choice to use the default terminal or Putty in Linux
+
+What do you use for managing multiple SSH connections on Linux?
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/putty-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.putty.org/
+[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/Putty-linux.png?resize=800%2C450&ssl=1
+[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu.jpeg?resize=800%2C503&ssl=1
+[4]: https://itsfoss.com/change-hostname-ubuntu/
+[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/putty-interface-ubuntu-1.jpeg?resize=800%2C430&ssl=1
+[6]: https://packages.debian.org/jessie/putty
+[7]: https://launchpad.net/terminator
+[8]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
From cbd0d1640a89fcf704439c480f0fdd65feece0f4 Mon Sep 17 00:00:00 2001
From: darksun
Date: Wed, 12 Dec 2018 15:02:08 +0800
Subject: [PATCH 068/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Benchm?=
=?UTF-8?q?ark=20Linux=20Commands=20And=20Programs=20From=20Commandline?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
... Commands And Programs From Commandline.md | 265 ++++++++++++++++++
1 file changed, 265 insertions(+)
create mode 100644 sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md
diff --git a/sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md b/sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md
new file mode 100644
index 0000000000..3962e361f3
--- /dev/null
+++ b/sources/tech/20181211 How To Benchmark Linux Commands And Programs From Commandline.md
@@ -0,0 +1,265 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How To Benchmark Linux Commands And Programs From Commandline)
+[#]: via: (https://www.ostechnix.com/how-to-benchmark-linux-commands-and-programs-from-commandline/)
+[#]: author: (SK https://www.ostechnix.com/author/sk/)
+
+How To Benchmark Linux Commands And Programs From Commandline
+======
+
+
+
+A while ago, I have written a guide about the [**alternatives to ‘top’, the command line utility**][1]. Some of the users asked me which one among those tools is best and on what basis (like features, contributors, years active, page requests etc.) I compared those tools. They also asked me to share the bench-marking results If I have any. Unfortunately, I didn’t even know how to benchmark programs at that time. While searching for some simple and easy to use bench-marking tools to compare the Linux programs, I stumbled upon two utilities named **‘Bench’** and **‘Hyperfine’**. These are simple and easy-to-use command line tools to benchmark Linux commands and programs on Unix-like systems.
+
+### 1\. Bench Tool
+
+The **‘Bench’** utility benchmarks one or more given commands/programs using **Haskell’s criterion** library and displays the output statistics in an easy-to-understandable format. This tool can be helpful where you need to compare similar programs based on the bench-marking result. We can also export the results to HTML format or CSV or templated output.
+
+#### Installing Bench Utility
+
+The bench utility can be installed in three methods.
+
+**1\. Using Linuxbrew**
+
+We can install Bench utility using Linuxbrew package manager. If you haven’t installed Linuxbrew yet, refer the following link.
+
+After installing Linuxbrew, run the following command to install Bench:
+
+```
+$ brew install bench
+```
+
+**2\. Using Haskell’s stack tool**
+
+First, install Haskell as described in the following link.
+
+And then, run the following commands to install Bench.
+
+```
+$ stack setup
+
+$ stack install bench
+```
+
+The ‘stack’ will install bench to **~/.local/bin** or something similar. Make sure that the installation directory is on your executable search path before using bench tool. You will be reminded to do this even if you forgot.
+
+**3\. Using Nix package manager**
+
+Another way to install Bench is using **Nix** package manager. Install Nix as shown in the below link.
+
+After installing Nix, install Bench tool using command:
+
+```
+$ nix-env -i bench
+```
+
+#### Benchmark Linux Commands And Programs Using Bench
+
+It is time to start benchmarking the programs.
+
+For instance, let me show you the benchmark result of ‘ls -al’ command.
+
+```
+$ bench 'ls -al'
+```
+
+**Sample output:**
+
+
+
+You must quote the commands when you use flags/options with them.
+
+Similarly, you can benchmark any programs installed in your system. The following commands shows the benchmarking result of ‘htop’ and ‘ptop’ programs.
+
+```
+$ bench htop
+
+$ bench ptop
+```
+
+Bench tool can benchmark multiple programs at once as well. Here is the benchmarking result of ls, htop, ptop programs.
+
+```
+$ bench ls htop ptop
+```
+
+Sample output:
+
+
+We can also export the benchmark result to a HTML like below.
+
+```
+$ bench htop --output example.html
+```
+
+To export the result to CSV, just run:
+
+```
+$ bench htop --csv FILE
+```
+
+View help section:
+
+```
+$ bench --help
+```
+
+### **2. Hyperfine Benchmark Tool
+
+**
+
+**Hyperfine** is yet another command line benchmarking tool inspired by the ‘Bench’ tool which we just discussed above. It is free, open source, cross-platform benchmarking program and written in **Rust** programming language. It has few additional features compared to the Bench tool as listed below.
+
+ * Statistical analysis across multiple runs.
+ * Support for arbitrary shell commands.
+ * Constant feedback about the benchmark progress and current estimates.
+ * Perform warmup runs before the actual benchmark.
+ * Cache-clearing commands can be set up before each timing run.
+ * Statistical outlier detection.
+ * Export benchmark results to various formats, such as CSV, JSON, Markdown.
+ * Parameterized benchmarks.
+
+
+
+#### Installing Hyperfine
+
+We can install Hyperfine using any one of the following methods.
+
+**1\. Using Linuxbrew**
+
+```
+$ brew install hyperfine
+```
+
+**2\. Using Cargo**
+
+Make sure you have installed Rust as described in the following link.
+
+After installing Rust, run the following command to install Hyperfine via Cargo:
+
+```
+$ cargo install hyperfine
+```
+
+**3\. Using AUR helper programs**
+
+Hyperfine is available in [**AUR**][2]. So, you can install it on Arch-based systems using any helper programs, such as [**YaY**][3], like below.
+
+```
+$ yay -S hyperfine
+```
+
+**4\. Download and install the binaries**
+
+Hyperfine is available in binaries for Debian-based systems. Download the latest .deb binary file from the [**releases page**][4] and install it using ‘dpkg’ package manager. As of writing this guide, the latest version was **1.4.0**.
+
+```
+$ wget https://github.com/sharkdp/hyperfine/releases/download/v1.4.0/hyperfine_1.4.0_amd64.deb
+
+$ sudo dpkg -i hyperfine_1.4.0_amd64.deb
+
+$ sudo apt install -f
+```
+
+#### Benchmark Linux Commands And Programs Using Hyperfine
+
+To run a benchmark using Hyperfine, simply run it along with the program/command as shown below.
+
+```
+$ hyperfine 'ls -al'
+```
+
+
+
+Benchmark multiple commands/programs:
+
+```
+$ hyperfine htop ptop
+```
+
+Sample output:
+
+
+
+As you can see at the end of the output, Hyperfine mentiones – **‘htop ran 1.96 times faster than ptop’** , so we can immediately conclude htop performs better than Ptop. This will help you to quickly find which program performs better when benchmarking multiple programs. We don’t get this detailed output in Bench utility though.
+
+Hyperfine will automatically determine the number of runs to perform for each command. By default, it will perform at least **10 benchmarking runs**. If you want to set the **minimum number of runs** (E.g 5 runs), use the `-m` **/`--min-runs`** option like below:
+
+```
+$ hyperfine --min-runs 5 htop ptop
+```
+
+Or,
+
+```
+$ hyperfine -m 5 htop ptop
+```
+
+Similarly, to perform **maximum number of runs** for each command, the command would be:
+
+```
+$ hyperfine --max-runs 5 htop ptop
+```
+
+Or,
+
+```
+$ hyperfine -M 5 htop ptop
+```
+
+We can even perform **exact number of runs** for each command using the following command:
+
+```
+$ hyperfine -r 5 htop ptop
+```
+
+As you may know, if the program execution time is limited by disk I/O, the benchmarking results can be heavily influenced by disk caches and whether they are cold or warm. Luckily, Hyperfine has the options to perform a certain number of program executions before performing the actual benchmark.
+
+To perform NUM warmup runs (E.g 3) before the actual benchmark, use the **`-w`/**`--warmup` option like below:
+
+```
+$ hyperfine --warmup 3 htop
+```
+
+Just like Bench utility, Hyperfine also allows us to export the benchmark results to a given file. We can export the results to CSV, JSON, and Markdown formats.
+
+For instance, to export the results in Markdown format, use the following command:
+
+```
+$ hyperfine htop ptop --export-markdown
+```
+
+For more options and usage details, refer the help secion:
+
+```
+$ hyperfine --help
+```
+
+And, that’s all for now. If you ever be in a situation where you need to benchmark similar and alternative programs, these tools might help to compare how they performs and share the details with your peers and colleagues.
+
+More good stuffs to come. Stay tuned!
+
+Cheers!
+
+
+
+--------------------------------------------------------------------------------
+
+via: https://www.ostechnix.com/how-to-benchmark-linux-commands-and-programs-from-commandline/
+
+作者:[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/some-alternatives-to-top-command-line-utility-you-might-want-to-know/
+[2]: https://aur.archlinux.org/packages/hyperfine
+[3]: https://www.ostechnix.com/yay-found-yet-another-reliable-aur-helper/
+[4]: https://github.com/sharkdp/hyperfine/releases
From 86a7efd9b6c3c9bcdb86f8612d5bbc35eb3c6d13 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 16:41:41 +0800
Subject: [PATCH 069/119] PUB:20181112 The Source History of Cat.md
@name1e5s https://linux.cn/article-10339-1.html
---
.../talk => published}/20181112 The Source History of Cat.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/talk => published}/20181112 The Source History of Cat.md (100%)
diff --git a/translated/talk/20181112 The Source History of Cat.md b/published/20181112 The Source History of Cat.md
similarity index 100%
rename from translated/talk/20181112 The Source History of Cat.md
rename to published/20181112 The Source History of Cat.md
From 7b4f45a854945e41a86ad4080fd8d5382c0c8a37 Mon Sep 17 00:00:00 2001
From: darksun
Date: Wed, 12 Dec 2018 17:39:10 +0800
Subject: [PATCH 070/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Ways=20To=20C?=
=?UTF-8?q?heck=20Laptop=20Battery=20Status=20And=20Level=20From=20Linux?=
=?UTF-8?q?=20Terminal?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ry Status And Level From Linux Terminal.md | 257 ++++++++++++++++++
1 file changed, 257 insertions(+)
create mode 100644 sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
diff --git a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
new file mode 100644
index 0000000000..631efa91f9
--- /dev/null
+++ b/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
@@ -0,0 +1,257 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (5 Ways To Check Laptop Battery Status And Level From Linux Terminal)
+[#]: via: (https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/)
+[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
+
+5 Ways To Check Laptop Battery Status And Level From Linux Terminal
+======
+
+We can easily check the battery status through GUI such as current battery percentage, whether it’s charging or not charging and how long it will be usable without charging, but we can’t able to check the battery health and other related information.
+
+In this scenario what will be the solutions.
+
+Yes, we have few utilities available for this in Linux and it can be achieved through command line.
+
+We are going to discuss about this topic today through this article and i will try to cover possible information i can.
+
+Checking your battery health monthly once is something good. It will help you to identify whether we are facing any battery or charge related issues.
+
+Also, we can see battery model name, power source, vendor and battery technology, etc,.
+
+Power management is a feature that turns off the power or switches system’s components to a low-power state when inactive.
+
+### Following Utilities are available in Linux to Check Battery Status.
+
+ * `upower`: upower is a command line tool which provides an interface to enumerate power sources on the system.
+ * `acpi`: acpi Shows information from the /proc or the /sys filesystem, such as battery status or thermal information.
+ * `batstat`: batstat is a command line tool to print battery status for linux.
+ * `tlp`: TLP brings you the benefits of advanced power management for Linux without changing any configuration.
+ * `class file`: The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures.
+
+
+
+### How to Check Laptop Battery Status Using upower Command?
+
+[upower][1] is a command line tool that provides an interface to enumerate power sources on the system. It control the latency of different operations on your computer, which enables you to save significant amounts of power.
+
+Just run the following command to get the battery and it’s related information on Linux.
+
+```
+$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
+ native-path: BAT0
+ vendor: SMP
+ model: L14M4P23
+ serial: 756
+ power supply: yes
+ updated: Monday 03 December 2018 07:56:18 PM IST (95 seconds ago)
+ has history: yes
+ has statistics: yes
+ battery
+ present: yes
+ rechargeable: yes
+ state: discharging
+ warning-level: none
+ energy: 28.23 Wh
+ energy-empty: 0 Wh
+ energy-full: 52.26 Wh
+ energy-full-design: 60 Wh
+ energy-rate: 10.714 W
+ voltage: 14.819 V
+ time to empty: 2.6 hours
+ percentage: 54%
+ capacity: 87.1%
+ technology: lithium-ion
+ icon-name: 'battery-good-symbolic'
+ History (charge):
+ 1543847178 54.000 discharging
+ History (rate):
+ 1543847178 10.714 discharging
+```
+
+To check the specific information about battery, use the following format.
+
+```
+$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
+ state: discharging
+ time to empty: 2.1 hours
+ percentage: 43%
+```
+
+It’s same as above, but it’s taken after power cable plugged in, that’s why the state showing charging.
+
+```
+$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
+ state: charging
+ percentage: 41%
+```
+
+### How to Check Laptop Battery Status Using TLP Command?
+
+TLP is a free opensource feature-rich command line tool which optimize laptop battery without making any configuration change.
+
+TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements.
+
+TLP package is available in most of the Linux distribution official repository such as Arch, Debian, Fedora, Gentoo, openSUSE, etc. Use your distribution Package Manager to install the TLP utility.
+
+Just run the following command to get the battery and it’s related information on Linux.
+
+```
+$ sudo tlp-stat -b
+--- 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 = 52260 [mWh]
+/sys/class/power_supply/BAT0/energy_now = 21950 [mWh]
+/sys/class/power_supply/BAT0/power_now = 10923 [mW]
+/sys/class/power_supply/BAT0/status = Discharging
+
+Charge = 42.0 [%]
+Capacity = 87.1 [%]
+```
+
+To see other information as well.
+
+```
+$ sudo tlp-stat -s
+--- 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 = 07:16:12 IST, 4362 sec(s) ago
+Mode = battery
+Power source = battery
+```
+
+### How to Check Laptop Battery Status Using ACPI Command?
+
+ACPI stands for Advanced Configuration and Power Interface modules are kernel modules for different ACPI parts. They enable special ACPI functions or add information to /proc or /sys. These information can be parsed by acpid for events or other monitoring applications.
+
+```
+$ acpi
+Battery 0: Charging, 43%, 01:05:11 until charged
+```
+
+To see battery capacity.
+
+```
+$ acpi -i
+Battery 0: Charging, 43%, 01:05:07 until charged
+Battery 0: design capacity 3817 mAh, last full capacity 3324 mAh = 87%
+```
+
+To see more details about battery and related information.
+
+```
+$ acpi -V
+Battery 0: Charging, 43%, 01:05:07 until charged
+Battery 0: design capacity 3815 mAh, last full capacity 3323 mAh = 87%
+Adapter 0: on-line
+Cooling 0: Processor 0 of 10
+Cooling 1: Processor 0 of 10
+Cooling 2: Processor 0 of 10
+Cooling 3: iwlwifi 0 of 19
+Cooling 4: Processor 0 of 10
+Cooling 5: iwlwifi no state information available
+Cooling 6: Processor 0 of 10
+Cooling 7: Processor 0 of 10
+Cooling 8: Processor 0 of 10
+Cooling 9: intel_powerclamp no state information available
+Cooling 10: x86_pkg_temp no state information available
+Cooling 11: Processor 0 of 10
+```
+
+### How to Check Laptop Battery Status Using Batstat Command?
+
+batstat is a command line tool to print battery status in linux terminal.
+
+```
+Status: Charging
+Max energy: 50.00 Wh
+Energy left: 24.50 Wh
+Power Consumption: 26.40 W
+Percentage left: 49.00%
+Average power Consumption: 0.00 W
+Time elapsed: 0: 0:12 since 49.00%
+= Time ======== Percent ============================================
+ 0: 0: 0 49.00%
+```
+
+### How to Check Laptop Battery Status Using sysfs filesystem?
+
+The sysfs filesystem is a pseudo-filesystem which provides an interface to kernel data structures. The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components.
+
+The sysfs filesystem is commonly mounted at /sys. Typically, it is mounted automatically by the system, but it can also be mounted manually using a command such as `mount -t sysfs sysfs /sys`
+
+Many of the files in the sysfs filesystem are read-only, but some files are writable, allowing kernel variables to be changed. To avoid redundancy, symbolic links are heavily used to connect entries across the filesystem tree.
+
+```
+$ cat /sys/class/power_supply/BAT0/*
+0
+51
+Normal
+0
+cat: /sys/class/power_supply/BAT0/device: Is a directory
+52260000
+60000000
+26660000
+SMP
+L14M4P23
+cat: /sys/class/power_supply/BAT0/power: Is a directory
+27656000
+1
+ 756
+Charging
+cat: /sys/class/power_supply/BAT0/subsystem: Is a directory
+Li-ion
+Battery
+POWER_SUPPLY_NAME=BAT0
+POWER_SUPPLY_STATUS=Charging
+POWER_SUPPLY_PRESENT=1
+POWER_SUPPLY_TECHNOLOGY=Li-ion
+POWER_SUPPLY_CYCLE_COUNT=0
+POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000
+POWER_SUPPLY_VOLTAGE_NOW=15840000
+POWER_SUPPLY_POWER_NOW=27656000
+POWER_SUPPLY_ENERGY_FULL_DESIGN=60000000
+POWER_SUPPLY_ENERGY_FULL=52260000
+POWER_SUPPLY_ENERGY_NOW=26660000
+POWER_SUPPLY_CAPACITY=51
+POWER_SUPPLY_CAPACITY_LEVEL=Normal
+POWER_SUPPLY_MODEL_NAME=L14M4P23
+POWER_SUPPLY_MANUFACTURER=SMP
+POWER_SUPPLY_SERIAL_NUMBER= 756
+14800000
+15840000
+```
+
+--------------------------------------------------------------------------------
+
+via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-linux-terminal/
+
+作者:[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://upower.freedesktop.org/
From a18c3bd5362477bfd419a04a3fb46e2f04054b0d Mon Sep 17 00:00:00 2001
From: MjSeven
Date: Wed, 12 Dec 2018 20:02:01 +0800
Subject: [PATCH 071/119] =?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/20180710 Users, Groups, and Other Linux Beasts.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md b/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md
index 6083111a32..ad5be702d8 100644
--- a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md
+++ b/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md
@@ -1,3 +1,5 @@
+Translating by MjSeven
+
Users, Groups, and Other Linux Beasts
======
From 17b9c0017c82f2ef1fad76789761b8574d328501 Mon Sep 17 00:00:00 2001
From: jlztan
Date: Wed, 12 Dec 2018 20:50:13 +0800
Subject: [PATCH 072/119] Delete 20181121 How to swap Ctrl and Caps Lock keys
in Linux.md
---
...o swap Ctrl and Caps Lock keys in Linux.md | 113 ------------------
1 file changed, 113 deletions(-)
delete mode 100644 sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
diff --git a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
deleted file mode 100644
index c9f24938ff..0000000000
--- a/sources/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
+++ /dev/null
@@ -1,113 +0,0 @@
-Translating by jlztan
-
-How to swap Ctrl and Caps Lock keys in Linux
-======
-Linux desktop environments make it easy to set up your keyboard as you want it. Here's how.
-
-
-For many people who've been computer users for (let's just say) "quite some time now," the Ctrl and Caps Lock keys have been in the wrong place since shortly after the first PC keyboards rolled off the production line. For me, the correct positioning appears in this image of a vintage 1995 Sun Workstation keyboard. (Forgive me for the blurriness of the image; it was taken with a Minox spy camera in low light.)
-
-If you're interested, you can read about the [history of the Ctrl key location][1]. I'm not going to discuss the various rationales for placing the Ctrl key next to the "a" key versus below the Shift key; I'm not going to comment on the overall uselessness of the Caps Lock key (whoops); and I'm not going to argue with those who advocate using the heel of the hand to activate the Ctrl key, even though it's impossible to do on some laptop keyboards where the keys are inset below the level of the wrist rest (whoops).
-
-Rather, I'm going to assume I'm not the only one who prefers the Ctrl key next to the "a" and describe how to use the wonderful flexibility that comes with Linux to swap the Ctrl and Caps Lock keys on various desktop environments. Note that this kind of advice seems to have a limited shelf life, as tools for tweaking desktop settings change fairly often. But I hope this offers a good place for you to start.
-
-### With GNOME 3
-
-[GNOME 3][2] desktop environment users can use the [Tweaks][3] tool to swap their Caps Lock and Ctrl keys, as you can see below.
-
-Here's how to do it:
-
- 1. Install the Tweaks tool from your distribution's repositories.
- 2. Start the Tweaks application.
- 3. Select "Keyboard & Mouse" from the left-hand menu.
- 4. Click "Additional Layout Options".
- 5. Click "Ctrl position" on the window that opens and choose "Swap Ctrl and Caps Lock."
-
-
-
-That's it! By the way, you can do lots of cool stuff with the Tweaks tool. For example, I set my right Ctrl key to be a Compose key, which allows me to type all sorts of characters with keyboard shortcuts—such as ç, é, ô, and ñ and with the keystrokes Compose+c+Comma; Compose+e+Right quote; Compose+o+Circumflex; and Compose+n+Tilde.
-
-### With KDE
-
-I don't use [KDE][4], but item 5 in this article about [KDE tweaks that will change your life][5] by my colleague Seth Kenlon will show you how to remap your keys.
-
-### With Xfce
-
-As far as I can tell, the [Xfce][6] desktop environment doesn't have a handy tool for managing these kinds of settings. However, the **ctrl:swapcaps** option to the **setxkbmap** command will help you make these changes. This type of modification has two parts:
-
- 1. Figuring out the command's usage;
- 2. Figuring out where to invoke the command so it is activated as the desktop comes up.
-
-
-
-The first part is pretty straightforward: the command is:
-
-```
-/usr/bin/setxkbmap -option "ctrl:nocaps"
-```
-
-It's worth executing this in a terminal window to make sure the results are what you expect.
-
-Assuming it works, where should you invoke the command? That requires some experimentation; one possibility is in the file **.profile** in the user's home directory. Another option is to add the command to the autostart facility in Xfce (look for "Session and Startup" in the Settings Manager).
-
-Another possibility is to use the same option in the file / **etc/default/keyboard** , which might end up looking like this:
-
-```
-# KEYBOARD CONFIGURATION FILE
-
-# Consult the keyboard(5) manual page.
-
-XKBMODEL="pc105"
-XKBLAYOUT="us"
-XKBVARIANT=""
-XKBOPTIONS="ctrl:swapcaps"
-
-BACKSPACE="guess"
-```
-
-Note that this kind of change will affect all users, so if you share your computer, be prepared to do some explaining. Also, system updates may overwrite this file, so you'll need to edit it again if your setup stops working. Putting the same information in the file **.keyboard** in the user's home directory might accomplish the same task on the user's behalf.
-
-Finally, note that these kinds of changes require you to restart Xfce (except when running the command on the command line in the terminal window, but that won't stick past the end of the session).
-
-### With LXQt and other desktop environments
-
-I haven't tried [LXQt][7], but if my memory serves from [LXDE][8], I would try the same recipe used above for Xfce. I'd also expect that the Xfce recipe could work for other Linux desktop environments, but, of course, your favorite search engine is always your friend.
-
-### The console
-
-I haven't tried this, as I have very few opportunities to interact with the console (what you see on a server or when your window system doesn't come up properly). The recipes presented above affect the terminal window in the way one would hope, i.e., consistently with other applications.
-
-However, if the file **/etc/default/keyboard** or **~/.keyboard** has already been edited (as described above), the utility **setupcon** is intended to change the console keyboard setup so it functions the same way.** **This [StackExchange article][9], [this other one][10], and [this third one][11] give some ideas on how to effect these changes from both of these files. The third article also talks about using **dumpkeys** and **loadkeys**. It's also worthwhile to read [the setupcon man page][12] — it's short and to the point, and combined with the comments from the StackExchange articles, should be enough to get a solution in place.
-
-Finally, it's worth emphasizing here the point mentioned in the StackExchange articles - configuring the console IS NOT THE SAME as configuring terminal windows; the latter are configured through the desktop manager as described previously.
-
-### When all else fails
-
-The manual pages for **setxkbmap** , **xkeyboard-config** , **keyboard** , **console-setup** , and **setupcon** are all useful references. Or, if you don't like reading manual pages, there's [this great article][13].
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard
-
-作者:[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://en.wikipedia.org/wiki/Control_key
-[2]: https://www.gnome.org/gnome-3/
-[3]: https://wiki.gnome.org/Apps/Tweaks
-[4]: https://www.kde.org/
-[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life
-[6]: https://www.xfce.org/
-[7]: https://lxqt.org/
-[8]: https://lxde.org/
-[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x
-[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot
-[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux
-[12]: http://man.he.net/man1/setupcon
-[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto
From 9bbd1ddbee79db7f99933b4eb05f10f64c2fbcae Mon Sep 17 00:00:00 2001
From: jlztan
Date: Wed, 12 Dec 2018 20:59:10 +0800
Subject: [PATCH 073/119] Create 20181121 How to swap Ctrl and Caps Lock keys
in Linux.md
---
...o swap Ctrl and Caps Lock keys in Linux.md | 108 ++++++++++++++++++
1 file changed, 108 insertions(+)
create mode 100644 translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
diff --git a/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
new file mode 100644
index 0000000000..cf1c56e908
--- /dev/null
+++ b/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
@@ -0,0 +1,108 @@
+在 Linux 下交换 Ctrl 与 Caps Lock 键
+======
+
+Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
+
+
+对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和 Caps Lock 键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。)
+
+感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,不评论 Caps Lock 键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上也不可能这样做,因为有的键会位于腕托以下。
+
+相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和 Caps Lock 键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。
+
+### GNOME 3
+
+[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换 Caps Lock 和 Ctrl 键,如下所示。
+
+具体步骤如下:
+
+ 1. 从你的 Linux 发行版的软件仓库安装 Tweaks 工具。
+ 2. 启动 Tweaks 程序。
+ 3. 从左侧菜单中选择“Keyboard & Mouse”。
+ 4. 单击“Additional Layout Options”。
+ 5. 在打开的窗口中单击“Ctrl position”,然后选择“Swap Ctrl and Caps Lock”。
+
+完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+O+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。
+
+### KDE
+
+我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [KDE tweaks that will change your life][5] 这篇文章的第 5 项演示了如何重新映射按键。
+
+### Xfce
+
+据我所知,[Xfce][6] 桌面环境没有一个方便的工具来管理这些(指交换按键)设置。 但是,`setxkbmap` 命令的 `ctrl:swapcaps` 选项可以帮助你完成交换按键的修改。这个修改包含两部分:
+
+ 1. 弄清楚命令的用法;
+ 2. 找出调用命令的位置,以便在桌面启动时激活它。
+
+第一部分非常简单,命令是:
+
+```
+/usr/bin/setxkbmap -option "ctrl:nocaps"
+```
+
+在终端窗口中执行此命令,以确保结果符合你的预期。
+
+假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找“Session and Startup”)里。
+
+还有一种可能性是在文件 `/etc/default/keyboard` 中使用相同的选项,最终可能看起来像这样:
+
+```
+# KEYBOARD CONFIGURATION FILE
+
+# Consult the keyboard(5) manual page.
+
+XKBMODEL="pc105"
+XKBLAYOUT="us"
+XKBVARIANT=""
+XKBOPTIONS="ctrl:swapcaps"
+
+BACKSPACE="guess"
+```
+
+注意,这个更改将影响所有用户,因此如果你和其他人共享计算机,请准备好进行一些说明。此外,系统更新可能会覆盖此文件,因此如果你的设置失效了,就需要再次编辑它。将相同的信息放在用户主目录中的 `.keyboard` 文件内,可以为每个用户进行设置。
+
+最后请注意,这些更改需要重新启动 Xfce(除非在终端窗口中的命令行上运行,但这在会话结束之后便会失效)。
+
+### LXQt 和其他桌面环境
+
+我没有用过 [LXQt][7],但根据我使用 [LXDE][8] 的经验,我会尝试上面用于 Xfce 的方法。我也希望适用于 Xfce 的方法可以用于其他 Linux 桌面环境。当然了,在其他桌面环境上遇到问题的时候,可以通过你最喜欢的搜索引擎来查找解决办法。
+
+### 控制台
+
+我没有在控制台上进行过尝试,因为我很少有机会与控制台(你在服务器上看到的或你的窗口系统没有正确显示时出现的界面)进行交互。上面给出的方法以人们希望的方式(即与其他应用程序一致)调整终端窗口。
+
+但是,如果像上面一样已经编辑了 `/etc/default/keyboard` 文件或 `〜/.keyboard`,则实用程序 `setupcon` 可以用于更改控制台的键盘设置,以便实现相同的功能。[链接 1][9]、[链接 2][10] 和 [链接 3][11] 给出了一些关于如何从这两个文件实现这些更改的想法。第三个链接还讨论了使用 `dumpkeys` 和 `loadkeys` 来实现想要的效果。[setupcon 的手册][12] 简短而重要,值得阅读,再结合上面 StackExchange 问题的一些评论,应该足以得到一个解决办法。
+
+### 其他环境
+
+最后,上面 StackExchange 的链接中提到的这一点值得强调--配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。
+
+`setxkbmap`、`xkeyboard-config`、`keyboard`、`console-setup` 和 `setupcon` 命令的手册都是有用的参考资料。或者,如果你不喜欢阅读手册,可以看一下 [这篇极好的文章][13]。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keyboard
+
+作者:[Chris Hermansen][a]
+选题:[lujun9972][b]
+译者:[jlztan](https://github.com/jlztan)
+校对:[校对者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://en.wikipedia.org/wiki/Control_key
+[2]: https://www.gnome.org/gnome-3/
+[3]: https://wiki.gnome.org/Apps/Tweaks
+[4]: https://www.kde.org/
+[5]: https://opensource.com/article/17/5/7-cool-kde-tweaks-will-improve-your-life
+[6]: https://www.xfce.org/
+[7]: https://lxqt.org/
+[8]: https://lxde.org/
+[9]: https://askubuntu.com/questions/485454/how-to-remap-keys-on-a-user-level-both-with-and-without-x
+[10]: https://unix.stackexchange.com/questions/198791/how-do-i-permanently-change-the-console-tty-font-type-so-it-holds-after-reboot
+[11]: https://superuser.com/questions/290115/how-to-change-console-keymap-in-linux
+[12]: http://man.he.net/man1/setupcon
+[13]: http://www.noah.org/wiki/CapsLock_Remap_Howto
From 7fe51f3b2e9ba1ea5d451aa245ca7df745116d44 Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Wed, 12 Dec 2018 21:39:29 +0800
Subject: [PATCH 074/119] Translated by qhwdw
---
...mputing with Open Source Cirq Framework.md | 229 ------------------
...mputing with Open Source Cirq Framework.md | 228 +++++++++++++++++
2 files changed, 228 insertions(+), 229 deletions(-)
delete mode 100644 sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
create mode 100644 translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
diff --git a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
deleted file mode 100644
index ee35ef36ec..0000000000
--- a/sources/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
+++ /dev/null
@@ -1,229 +0,0 @@
-Translating by qhwdw
-An Introduction to Quantum Computing with Open Source Cirq Framework
-======
-As the title suggests what we are about to begin discussing, this article is an effort to understand how far we have come in Quantum Computing and where we are headed in the field in order to accelerate scientific and technological research, through an Open Source perspective with Cirq.
-
-First, we will introduce you to the world of Quantum Computing. We will try our best to explain the basic idea behind the same before we look into how Cirq would be playing a significant role in the future of Quantum Computing. Cirq, as you might have heard of recently, has been breaking news in the field and in this Open Science article, we will try to find out why.
-
-
-
-Before we start with what Quantum Computing is, it is essential to get to know about the term Quantum, that is, a [subatomic particle][1] referring to the smallest known entity. The word [Quantum][2] is based on the Latin word Quantus, meaning, “how little”, as described in this short video:
-
-
-
-It will be easier for us to understand Quantum Computing by comparing it first to Classical Computing. Classical Computing refers to how today’s conventional computers are designed to work. The device with which you are reading this article right now, can also be referred to as a Classical Computing Device.
-
-### Classical Computing
-
-Classical Computing is just another way to describe how a conventional computer works. They work via a binary system, i.e, information is stored using either 1 or 0. Our Classical computers cannot understand any other form.
-
-In literal terms inside the computer, a transistor can be either on (1) or off (0). Whatever information we provide input to, is translated into 0s and 1s, so that the computer can understand and store that information. Everything is represented only with the help of a combination of 0s and 1s.
-
-
-
-### Quantum Computing
-
-Quantum Computing, on the other hand, does not follow an “on or off” model like Classical Computing. Instead, it can simultaneously handle multiple states of information with help of two phenomena called [superimposition and entanglement][3], thus accelerating computing at a much faster rate and also facilitating greater productivity in information storage.
-
-Please note that superposition and entanglement are [not the same phenomena][4].
-
-
-
-![][5]
-
-So, if we have bits in Classical Computing, then in the case of Quantum Computing, we would have qubits (or Quantum bits) instead. To know more about the vast difference between the two, check this [page][6] from where the above pic was obtained for explanation.
-
-Quantum Computers are not going to replace our Classical Computers. But, there are certain humongous tasks that our Classical Computers will never be able to accomplish and that is when Quantum Computers would prove extremely resourceful. The following video describes the same in detail while also describing how Quantum Computers work:
-
-
-
-A comprehensive video on the progress in Quantum Computing so far:
-
-
-
-### Noisy Intermediate Scale Quantum
-
-According to the very recently updated research paper (31st July 2018), the term “Noisy” refers to inaccuracy because of producing an incorrect value caused by imperfect control over qubits. This inaccuracy is why there will be serious limitations on what Quantum devices can achieve in the near term.
-
-“Intermediate Scale” refers to the size of Quantum Computers which will be available in the next few years, where the number of qubits can range from 50 to a few hundred. 50 qubits is a significant milestone because that’s beyond what can be simulated by [brute force][7] using the most powerful existing digital [supercomputers][8]. Read more in the paper [here][9].
-
-With the advent of Cirq, a lot is about to change.
-
-### What is Cirq?
-
-Cirq is a python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits that we just talked about. In other words, Cirq can address challenges to improve accuracy and reduce noise in Quantum Computing.
-
-Cirq does not necessarily require an actual Quantum Computer for execution. Cirq can also use a simulator-like interface to perform Quantum circuit simulations.
-
-Cirq is gradually grabbing a lot of pace, with one of its first users being [Zapata][10], formed last year by a [group of scientists][11] from Harvard University focused on Quantum Computing.
-
-### Getting started with Cirq on Linux
-
-The developers of the Open Source [Cirq library][12] recommend the installation in a [virtual python environment][13] like [virtualenv][14]. The developers’ installation guide for Linux can be found [here][15].
-
-However, we successfully installed and tested Cirq directly for Python3 on an Ubuntu 16.04 system via the following steps:
-
-#### Installing Cirq on Ubuntu
-
-![Cirq Framework for Quantum Computing in Linux][16]
-
-First, we would require pip or pip3 to install Cirq. [Pip][17] is a tool recommended for installing and managing Python packages.
-
-For Python 3.x versions, Pip can be installed with:
-```
-sudo apt-get install python3-pip
-
-```
-
-Python3 packages can be installed via:
-```
-pip3 install
-
-```
-
-We went ahead and installed the Cirq library with Pip3 for Python3:
-```
-pip3 install cirq
-
-```
-
-#### Enabling Plot and PDF generation (optional)
-
-Optional system dependencies not install-able with pip can be installed with:
-```
-sudo apt-get install python3-tk texlive-latex-base latexmk
-
-```
-
- * python3-tk is Python’s own graphic library which enables plotting functionality.
- * texlive-latex-base and latexmk enable PDF writing functionality.
-
-
-
-Later, we successfully tested Cirq with the following command and code:
-```
-python3 -c 'import cirq; print(cirq.google.Foxtail)'
-
-```
-
-We got the resulting output as:
-
-![][18]
-
-#### Configuring Pycharm IDE for Cirq
-
-We also configured a Python IDE [PyCharm on Ubuntu][19] to test the same results:
-
-Since we installed Cirq for Python3 on our Linux system, we set the path to the project interpreter in the IDE settings to be:
-```
-/usr/bin/python3
-
-```
-
-![][20]
-
-In the output above, you can note that the path to the project interpreter that we just set, is shown along with the path to the test program file (test.py). An exit code of 0 shows that the program has finished executing successfully without errors.
-
-So, that’s a ready-to-use IDE environment where you can import the Cirq library to start programming with Python and simulate Quantum circuits.
-
-#### Get started with Cirq
-
-A good place to start are the [examples][21] that have been made available on Cirq’s Github page.
-
-The developers have included this [tutorial][22] on GitHub to get started with learning Cirq. If you are serious about learning Quantum Computing, they recommend an excellent book called [“Quantum Computation and Quantum Information” by Nielsen and Chuang][23].
-
-#### OpenFermion-Cirq
-
-[OpenFermion][24] is an open source library for obtaining and manipulating representations of fermionic systems (including Quantum Chemistry) for simulation on Quantum Computers. Fermionic systems are related to the generation of [fermions][25], which according to [particle physics][26], follow [Fermi-Dirac statistics][27].
-
-OpenFermion has been hailed as [a great practice tool][28] for chemists and researchers involved with [Quantum Chemistry][29]. The main focus of Quantum Chemistry is the application of [Quantum Mechanics][30] in physical models and experiments of chemical systems. Quantum Chemistry is also referred to as [Molecular Quantum Mechanics][31].
-
-The advent of Cirq has now made it possible for OpenFermion to extend its functionality by providing routines and tools for using Cirq to compile and compose circuits for Quantum simulation algorithms.
-
-#### Google Bristlecone
-
-On March 5, 2018, Google presented [Bristlecone][32], their new Quantum processor, at the annual [American Physical Society meeting][33] in Los Angeles. The [gate-based superconducting system][34] provides a test platform for research into [system error rates][35] and [scalability][36] of Google’s [qubit technology][37], along-with applications in Quantum [simulation][38], [optimization][39], and [machine learning.][40]
-
-In the near future, Google wants to make its 72 qubit Bristlecone Quantum processor [cloud accessible][41]. Bristlecone will gradually become quite capable to perform a task that a Classical Supercomputer would not be able to complete in a reasonable amount of time.
-
-Cirq would make it easier for researchers to directly write programs for Bristlecone on the cloud, serving as a very convenient interface for real-time Quantum programming and testing.
-
-Cirq will allow us to:
-
- * Fine tune control over Quantum circuits,
- * Specify [gate][42] behavior using native gates,
- * Place gates appropriately on the device &
- * Schedule the timing of these gates.
-
-
-
-### The Open Science Perspective on Cirq
-
-As we all know Cirq is Open Source on GitHub, its addition to the Open Source Scientific Communities, especially those which are focused on Quantum Research, can now efficiently collaborate to solve the current challenges in Quantum Computing today by developing new ways to reduce error rates and improve accuracy in the existing Quantum models.
-
-Had Cirq not followed an Open Source model, things would have definitely been a lot more challenging. A great initiative would have been missed out and we would not have been one step closer in the field of Quantum Computing.
-
-### Summary
-
-To summarize in the end, we first introduced you to the concept of Quantum Computing by comparing it to existing Classical Computing techniques followed by a very important video on recent developmental updates in Quantum Computing since last year. We then briefly discussed Noisy Intermediate Scale Quantum, which is what Cirq is specifically built for.
-
-We saw how we can install and test Cirq on an Ubuntu system. We also tested the installation for usability on an IDE environment with some resources to get started to learn the concept.
-
-Finally, we also saw two examples of how Cirq would be an essential advantage in the development of research in Quantum Computing, namely OpenFermion and Bristlecone. We concluded the discussion by highlighting some thoughts on Cirq with an Open Science Perspective.
-
-We hope we were able to introduce you to Quantum Computing with Cirq in an easy to understand manner. If you have any feedback related to the same, please let us know in the comments section. Thank you for reading and we look forward to see you in our next Open Science article.
-
---------------------------------------------------------------------------------
-
-via: https://itsfoss.com/qunatum-computing-cirq-framework/
-
-作者:[Avimanyu Bandyopadhyay][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/avimanyu/
-[1]:https://en.wikipedia.org/wiki/Subatomic_particle
-[2]:https://en.wikipedia.org/wiki/Quantum
-[3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained
-[4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom
-[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg
-[6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html
-[7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion
-[8]:https://www.explainthatstuff.com/how-supercomputers-work.html
-[9]:https://arxiv.org/abs/1801.00862
-[10]:https://www.xconomy.com/san-francisco/2018/07/19/google-partners-with-zapata-on-open-source-quantum-computing-effort/
-[11]:https://www.zapatacomputing.com/about/
-[12]:https://github.com/quantumlib/Cirq
-[13]:https://itsfoss.com/python-setup-linux/
-[14]:https://virtualenv.pypa.io
-[15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux
-[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg
-[17]:https://pypi.org/project/pip/
-[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg
-[19]:https://itsfoss.com/install-pycharm-ubuntu/
-[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg
-[21]:https://github.com/quantumlib/Cirq/tree/master/examples
-[22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md
-[23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf
-[24]:http://openfermion.org
-[25]:https://en.wikipedia.org/wiki/Fermion
-[26]:https://en.wikipedia.org/wiki/Particle_physics
-[27]:https://en.wikipedia.org/wiki/Fermi-Dirac_statistics
-[28]:https://phys.org/news/2018-03-openfermion-tool-quantum-coding.html
-[29]:https://en.wikipedia.org/wiki/Quantum_chemistry
-[30]:https://en.wikipedia.org/wiki/Quantum_mechanics
-[31]:https://ocw.mit.edu/courses/chemical-engineering/10-675j-computational-quantum-mechanics-of-molecular-and-extended-systems-fall-2004/lecture-notes/
-[32]:https://techcrunch.com/2018/03/05/googles-new-bristlecone-processor-brings-it-one-step-closer-to-quantum-supremacy/
-[33]:http://meetings.aps.org/Meeting/MAR18/Content/3475
-[34]:https://en.wikipedia.org/wiki/Superconducting_quantum_computing
-[35]:https://en.wikipedia.org/wiki/Quantum_error_correction
-[36]:https://en.wikipedia.org/wiki/Scalability
-[37]:https://research.googleblog.com/2015/03/a-step-closer-to-quantum-computation.html
-[38]:https://research.googleblog.com/2017/10/announcing-openfermion-open-source.html
-[39]:https://research.googleblog.com/2016/06/quantum-annealing-with-digital-twist.html
-[40]:https://arxiv.org/abs/1802.06002
-[41]:https://www.computerworld.com.au/article/644051/google-launches-quantum-framework-cirq-plans-bristlecone-cloud-move/
-[42]:https://en.wikipedia.org/wiki/Logic_gate
diff --git a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
new file mode 100644
index 0000000000..289a62de15
--- /dev/null
+++ b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
@@ -0,0 +1,228 @@
+量子计算的开源框架 Cirq 介绍
+======
+我们即将讨论的内容正如标题所示,本文通过使用 Cirq 的一个开源视角,尝试去了解我们已经在量子计算领域取得多大的成就,和该领域的发展方向,以加快科学和技术研究。
+
+首先,我们将引领你进入量子计算的世界。在我们深入了解 Cirq 在未来的量子计算中扮演什么样的重要角色之前,我们将尽量向你解释其背后的基本概念。Cirq,你最近可能听说过,在这个领域中已经发生了重大新闻,在 Open Science 上的文章中,我们将去尝试找出答案。
+
+
+
+在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “非常小”,在下面的短视频链接中有描述:
+
+
+
+为了易于我们理解量子计算,我们将量子计算与传统计算(也译做经典计算)进行比较。传统计算是指设计用于工作的、我们正在使用的传统计算机,正如你现在用于阅读本文的设备,就是我们所谓的传统计算设备。
+
+### 传统计算
+
+传统计算是描述传统计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。传统计算机不会理解除 1 或 0 之外的任何其它东西。
+
+直白来说,在计算机内部一个晶体管只能是开(1)或关(0)。我们输入的任何信息都被转换为无数个 1 和 0,所以计算机只能理解和存储 1 和 0。所有的东西都只能用无数个 1 和 0 的组合来表示。
+
+
+
+### 量子计算
+
+然而,量子计算不再像传统计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。
+
+请注意,叠加和纠缠 [不是同一个现象][4]。
+
+
+
+![][5]
+
+就像在传统计算中,我们有比特,在量子计算中,我们相应也有量子比特(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。
+
+量子计算机并不是来替代我们的传统计算机的。但是,有一些非常巨大的任务用我们的传统计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。
+
+
+
+下面的视频全面描述了量子计算领域到目前为止的最新进展:
+
+
+
+### 嘈杂中型量子
+
+根据最新更新的(2018 年 7 月 31 日)研究论文,术语 “Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性严重制约了量子设备短期内实现其目标。
+
+“中型” 指的是在接下来的几年中,量子计算机将要实现的规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。
+
+随着 Cirq 出现,许多事情将会发生变化。
+
+### Cirq 是什么?
+
+Cirq 是一个 python 框架,它用于创建、编辑和调用我们前面讨论的嘈杂中型量子(NISQ)。换句话说,Cirq 能够解决挑战,去改善精确度和降低量子计算中的噪声。
+
+Cirq 并不需要必须有一台真实的量子计算机。Cirq 能够使用一个类似模拟器的界面去执行量子电路模拟。
+
+Cirq 的前进步伐越来越快了,[Zapata][10] 是使用它的首批用户之一,Zapata 是由来自哈佛大学的一群专注于量子计算的科学家在去年成立的。
+
+### Linux 上使用 Cirq 入门
+
+开源的 [Cirq 库][12] 开发者建议将它安装在像 [virtualenv][14] 这样的一个 [虚拟 python 环境][13] 中。在 Linux 上的开发者安装指南可以在 [这里][15] 找到。
+
+但我们在 Ubuntu 16.04 的系统上成功地安装和测试了 Python3 的 Cirq 库,安装步骤如下:
+
+#### 在 Ubuntu 上安装 Cirq
+
+![Cirq Framework for Quantum Computing in Linux][16]
+
+首先,我们需要 pip 或 pip3 去安装 Cirq。[Pip][17] 是推荐用于安装和管理 Python 包的工具。
+
+对于 Python 3.x 版本,Pip 能够用如下的命令来安装:
+```
+sudo apt-get install python3-pip
+
+```
+
+Python3 包能够通过如下的命令来安装:
+```
+pip3 install
+
+```
+
+我们继续去使用 Pip3 为 Python3 安装 Cirq 库:
+```
+pip3 install cirq
+
+```
+
+#### 启用 Plot 和 PDF 生成(可选)
+
+可选系统的依赖没有安装的,可以使用 pip 去安装它:
+```
+sudo apt-get install python3-tk texlive-latex-base latexmk
+
+```
+
+ * python3-tk 是 Python 自有的启用了绘图功能的图形库
+ * texlive-latex-base 和 latexmk 启动了 PDF 输出功能。
+
+
+
+最后,我们使用如下的命令和代码成功测试了 Cirq:
+```
+python3 -c 'import cirq; print(cirq.google.Foxtail)'
+
+```
+
+我们得到的输出如下图:
+
+![][18]
+
+#### 为 Cirq 配置 Pycharm IDE
+
+我们也配置了一个 Python IDE [PyCharm][19] 去测试同样的结果:
+
+因为在我们的 Linux 系统上为 Python3 安装了 Cirq,我们在 IDE 中配置项目解释器路径:
+```
+/usr/bin/python3
+
+```
+
+![][20]
+
+在上面的输出中,你可能注意到我们刚设置的项目解释器路径与测试程序文件(test.py)的路径显示在一起。退出代码 0 表示程序已经成功退出,没有错误。
+
+因此,那是一个现成的 IDE 环境,你可以导入 Cirq 库去开始使用 Python 去编程和模拟量子电路。
+
+#### Cirq 使用入门
+
+Criq 入门的一个好的开端就是它 GitHub 页面上的 [示例][21]。
+
+Cirq 的开发者在 GitHub 上已经放了学习 [教程][22]。如果你想认真地学习量子计算,他们推荐你去看一本非常好的书,它是[由 Nielsen 和 Chuang 写的名为 “量子计算和量子信息“][23]。
+
+#### OpenFermion-Cirq
+
+[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵表示费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。
+
+OpenFermion 被称为从事 [量子化学][29] 的化学家和研究人员的 [一个极好的实践工具][28]。量子化学主要专注于 [量子力学][30] 在物理模型和化学系统实验中的应用。量子化学也被称为 [分子量子力学][31]。
+
+Cirq 的出现使 OpenFermion 通过提供程序和工具去扩展功能成为了可能,通过使用 Cirq 可以去编译和构造仿真量子电路。
+
+#### Google Bristlecone
+
+2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上,Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39]、和 [机器学习][40] 方面的应用。
+
+Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个传统超级计算机无法在合理时间内完成的任务。
+
+Cirq 将让研究人员直接在云上为 Bristlecone 写程序变得很容易,它提供了一个非常方便的、实时的、量子编程和测试的接口。
+
+Cirq 将允许我们去:
+
+ * 量子电路的微调管理
+ * 使用原生门去指定 [门][42] 行为
+ * 在设备上放置适当的门
+ * 并调度这个门的时刻
+
+
+
+### Open Science 关于 Cirq 的观点
+
+我们知道 Cirq 是在 GitHub 上开源的,它除了在 Open Science 社区之外,特别是那些专注于量子研究的人们,都可以高效率地合作,通过开发新方法,去降低现有量子模型中的错误率和提升精确度,以解决目前在量子计算中所面临的挑战。
+
+如果 Cirq 不走开源模型的路线,事情可能变得更具挑战。一个伟大的创举可能就此错过,我们可能在量子计算领域止步不前。
+
+### 总结
+
+最后我们总结一下,我们首先通过与传统计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。
+
+我们看了如何在一个 Ubuntu 系统上安装和测试 Cirq。我们也在一个更好用的 IDE 环境中做了安装测试,并使用一些资源去开始学习有关概念。
+
+最后,我们看了两个示例 OpenFermion 和 Bristlecone,介绍了在量子计算中,Cirq 在开发研究中具有什么样的基本优势。最后我们以 Open Science 社区的视角对 Cirq 进行了一些精彩的思考,结束了我们的话题。
+
+我们希望能以一种易于理解的方式向你介绍量子计算框架 Cirq 的使用。如果你有与此相关的任何反馈,请在下面的评论区告诉我们。感谢阅读,希望我们能在 Open Science 的下一篇文章中再见。
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/qunatum-computing-cirq-framework/
+
+作者:[Avimanyu Bandyopadhyay][a]
+选题:[lujun9972](https://github.com/lujun9972)
+译者:[qhwdw](https://github.com/qhwdw)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://itsfoss.com/author/avimanyu/
+[1]:https://en.wikipedia.org/wiki/Subatomic_particle
+[2]:https://en.wikipedia.org/wiki/Quantum
+[3]:https://www.clerro.com/guide/491/quantum-superposition-and-entanglement-explained
+[4]:https://physics.stackexchange.com/questions/148131/can-quantum-entanglement-and-quantum-superposition-be-considered-the-same-phenom
+[5]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/bit-vs-qubit.jpg
+[6]:http://www.rfwireless-world.com/Terminology/Difference-between-Bit-and-Qubit.html
+[7]:https://en.wikipedia.org/wiki/Proof_by_exhaustion
+[8]:https://www.explainthatstuff.com/how-supercomputers-work.html
+[9]:https://arxiv.org/abs/1801.00862
+[10]:https://www.xconomy.com/san-francisco/2018/07/19/google-partners-with-zapata-on-open-source-quantum-computing-effort/
+[11]:https://www.zapatacomputing.com/about/
+[12]:https://github.com/quantumlib/Cirq
+[13]:https://itsfoss.com/python-setup-linux/
+[14]:https://virtualenv.pypa.io
+[15]:https://cirq.readthedocs.io/en/latest/install.html#installing-on-linux
+[16]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-framework-linux.jpeg
+[17]:https://pypi.org/project/pip/
+[18]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-test-output.jpg
+[19]:https://itsfoss.com/install-pycharm-ubuntu/
+[20]:https://4bds6hergc-flywheel.netdna-ssl.com/wp-content/uploads/2018/08/cirq-tested-on-pycharm.jpg
+[21]:https://github.com/quantumlib/Cirq/tree/master/examples
+[22]:https://github.com/quantumlib/Cirq/blob/master/docs/tutorial.md
+[23]:http://mmrc.amss.cas.cn/tlb/201702/W020170224608149940643.pdf
+[24]:http://openfermion.org
+[25]:https://en.wikipedia.org/wiki/Fermion
+[26]:https://en.wikipedia.org/wiki/Particle_physics
+[27]:https://en.wikipedia.org/wiki/Fermi-Dirac_statistics
+[28]:https://phys.org/news/2018-03-openfermion-tool-quantum-coding.html
+[29]:https://en.wikipedia.org/wiki/Quantum_chemistry
+[30]:https://en.wikipedia.org/wiki/Quantum_mechanics
+[31]:https://ocw.mit.edu/courses/chemical-engineering/10-675j-computational-quantum-mechanics-of-molecular-and-extended-systems-fall-2004/lecture-notes/
+[32]:https://techcrunch.com/2018/03/05/googles-new-bristlecone-processor-brings-it-one-step-closer-to-quantum-supremacy/
+[33]:http://meetings.aps.org/Meeting/MAR18/Content/3475
+[34]:https://en.wikipedia.org/wiki/Superconducting_quantum_computing
+[35]:https://en.wikipedia.org/wiki/Quantum_error_correction
+[36]:https://en.wikipedia.org/wiki/Scalability
+[37]:https://research.googleblog.com/2015/03/a-step-closer-to-quantum-computation.html
+[38]:https://research.googleblog.com/2017/10/announcing-openfermion-open-source.html
+[39]:https://research.googleblog.com/2016/06/quantum-annealing-with-digital-twist.html
+[40]:https://arxiv.org/abs/1802.06002
+[41]:https://www.computerworld.com.au/article/644051/google-launches-quantum-framework-cirq-plans-bristlecone-cloud-move/
+[42]:https://en.wikipedia.org/wiki/Logic_gate
From 3052a1e4400cb3d81cb9d16f616cf8dec0ea7e89 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 22:59:41 +0800
Subject: [PATCH 075/119] PRF:20180404 Emacs -5- Documents and Presentations
with org-mode.md
@oneforalone
---
...cuments and Presentations with org-mode.md | 79 ++++++++++---------
1 file changed, 40 insertions(+), 39 deletions(-)
diff --git a/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md b/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md
index ad420da202..9ed04db2cb 100644
--- a/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md
+++ b/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md
@@ -1,59 +1,58 @@
-Emacs #5: org-mode 之文档与 Presentations
+Emacs 系列(五):org 模式之文档与演示稿
======
-### 1 org-mode 的输出
+这是 [Emacs 和 Org 模式系列][20]的第五篇。
+
+这篇博文是由 Org 模式的源文件生成的,其有几种格式:[博客页面][21]、[演示稿][22] 和 [PDF 文档][23]。
+
+### 1 Org 模式的输出
#### 1.1 背景
-org-mode 不仅仅只是一个议程生成程序, 它也能输出许多不同的格式: LaTeX,PDF,Beamer,iCalendar(议程),HTML,Markdown,ODT,普通文本,帮助页面(man pages)和其它更多的复杂的格式,比如说网页文件。
+Org 模式不仅仅只是一个议程生成程序,它也能输出许多不同的格式: LaTeX、PDF、Beamer、iCalendar(议程)、HTML、Markdown、ODT、普通文本、手册页和其它更多的复杂的格式,比如说网页文件。
-这也不只是一些事后的想法,这是 org-mode 的设计核心部分并且集成的很好。
+这也不只是一些事后的想法,这是 Org 模式的设计核心部分并且集成的很好。
-一个文件可以同时是源代码,自动生成的输出,任务列表,文档和 presentation。
+这一个文件可以同时是源代码、自动生成的输出、任务列表、文档和展示。
-有些人将 org-mode 作为他们首选的标记格式,甚至对于 LaTeX 文档也是如此。org-mode 手册中的 [section on exporting][13] 有更详细的介绍。
+有些人将 Org 模式作为他们首选的标记格式,甚至对于 LaTeX 文档也是如此。Org 模式手册中的 [输出一节][13] 有更详细的介绍。
#### 1.2 开始
-对于任意的 org-mode 的文档,只要按下 C-c C-e键,就会弹出一个让你选择多种输出格式和选项的菜单。这些选项通常是次键选择,所以很容易设置和执行。例如:要输出一个 PDF 文档,按 C-c C-e l p,要输出 HMTL 格式的, 按 C-c C-e h h。
+对于任意的 Org 模式的文档,只要按下 `C-c C-e` 键,就会弹出一个让你选择多种输出格式和选项的菜单。这些选项通常是次键选择,所以很容易设置和执行。例如:要输出一个 PDF 文档,按 `C-c C-e l p`,要输出 HMTL 格式的, 按 `C-c C-e h h`。
对于所有的输出选项,都有许多可用的设置;详情参见手册。事实上,使用 LaTeX 格式相当于同时使用 LaTeX 和 HTML 模式,在不同的模式中插入任意的前言和设置等。
#### 1.3 第三方插件
-[ELPA][19] 中也包含了许多额外的输出格式,详情参见 [ELPA][19].
+[ELPA][19] 中也包含了许多额外的输出格式,详情参见 [ELPA][19]。
-### 2 org-mode 的 Beamer 演示
+### 2 Org 模式的 Beamer 演示
#### 2.1 关于 Beamer
-[Beamer][14] 是一个生成 presentation 的 LaTeX 环境. 它包括了一下特性:
+[Beamer][14] 是一个生成演示稿的 LaTeX 环境. 它包括了以下特性:
-* 在 presentation 中自动生成结构化的元素(例如 [the Marburg theme][1])。 在 presentation 时,这个特性可以为观众提供了视觉参考。
+* 在演示稿中自动生成结构化的元素(例如 [Marburg 主题][1])。 在演示稿中,这个特性可以为观众提供了视觉参考。
+* 对组织演示稿有很大的帮助。
+* 主题
+* 完全支持 LaTeX
-* 对组织 presentation 有很大的帮助。
+#### 2.2 Org 模式中 Beamer 的优点
-* 主题
-
-* 完全支持 LaTeX
-
-#### 2.2 org-mode 中 Beamer 的优点
-
-在 org-mode 中用 Beamer 有很多好处,总的来说:
-
-* org-mode 很简单而且对可视化支持的很好,同时改变结构可以快速的重组你的材料。
+在 Org 模式中用 Beamer 有很多好处,总的来说:
+* Org 模式很简单而且对可视化支持的很好,同时改变结构可以快速的重组你的材料。
* 与 org-babel 绑定在一起,实时语法高亮源码和内嵌结果。
-
* 语法通常更容易使用。
-我已经完全用 org-mode 和 beamer 替换掉 LibreOffice/Powerpoint/GoogleDocs 的使用。事实上,当我必须使用其中一种工具时,这是相当令人沮丧的,因为它们在可视化表示结构方面远远比不上 org-mode。
+我已经完全用 Org 模式和 beamer 替换掉使用 LibreOffice/Powerpoint/GoogleDocs。事实上,当我必须使用其中一种工具时,这是相当令人沮丧的,因为它们在可视化表示演讲稿结构方面远远比不上 Org 模式。
#### 2.3 标题层次
-org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转换成幻灯片。当然,问题是:哪些部分?这是由 H [export setting][15](org-export-headline-levels)决定的。
+Org 模式的 Beamer 会将你文档中的部分(文中定义了标题的)转换成幻灯片。当然,问题是:哪些部分?这是由 H [输出设置][15](`org-export-headline-levels`)决定的。
-针对不同的人,有许多不同的方法。我比较喜欢我的 presentation 这样:
+针对不同的人,有许多不同的方法。我比较喜欢我的演示稿这样:
```
#+OPTIONS: H:2
@@ -64,7 +63,7 @@ org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转
#### 2.4 主题和配置
-你可以在 org 文件的顶部来插入几行来配置 Beamer 和 LaTeX。在本文中,例如,你可以这样定义:
+你可以在 Org 模式的文件顶部来插入几行来配置 Beamer 和 LaTeX。在本文中,例如,你可以这样定义:
```
#+TITLE: Documents and presentations with org-mode
@@ -96,13 +95,13 @@ org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转
#+BEAMER_HEADER: \setlength{\parskip}{\smallskipamount}
```
-在这里, aspectratio=169 将纵横比设为 16:9, 其它部分都是标准的 LaTeX/Beamer 配置。
+在这里,`aspectratio=169` 将纵横比设为 16:9, 其它部分都是标准的 LaTeX/Beamer 配置。
#### 2.6 缩小 (适应屏幕)
有时你会遇到一些非常大的代码示例,你可能更倾向与将幻灯片缩小以适应它们。
-只要按下 C-c C-c p 将 BEAMER_opt属性设为 shrink=15\.(或者设为更大的 shrink 值)。上一张幻灯片就用到了这个。
+只要按下 `C-c C-c p` 将 `BEAMER_opt` 属性设为 `shrink=15`\。(或者设为更大的 shrink 值)。上一张幻灯片就用到了这个。
#### 2.7 效果
@@ -114,28 +113,24 @@ org-mode 的 Beamer 会将你文档中的部分(文中定义了标题的)转
#### 3.1 交互式的 Emacs 幻灯片
-使用 [org-tree-slide package][17] 这个插件的话, 就可以在 Emacs 的右侧显示幻灯片了。 只要按下 M-x,然后输入 org-tree-slide-mode,回车,然后你就可以用 C-> 和 C-< 在幻灯片之间切换了。
+使用 [org-tree-slide][17] 这个插件的话,就可以在 Emacs 的右侧显示幻灯片了。 只要按下 `M-x`,然后输入 `org-tree-slide-mode`,回车,然后你就可以用 `C->` 和 `C-<` 在幻灯片之间切换了。
-你可能会发现 C-c C-x C-v (即 org-toggle-inline-images)有助于使系统显示内嵌的图像。
+你可能会发现 `C-c C-x C-v` (即 `org-toggle-inline-images`)有助于使系统显示内嵌的图像。
#### 3.2 HTML 幻灯片
-有许多方式可以将 org-mode 的 presentation 导出为 HTML,并有不同级别的 JavaScript 集成。有关详细信息,请参见 org-mode 的 wiki 中的 [non-beamer presentations section][18]。
+有许多方式可以将 Org 模式的演讲稿导出为 HTML,并有不同级别的 JavaScript 集成。有关详细信息,请参见 Org 模式的 wiki 中的 [非 beamer 演讲稿一节][18]。
### 4 更多
#### 4.1 本文中的附加资源
* [orgmode.org beamer tutorial][2]
-
* [LaTeX wiki][3]
-
* [Generating section title slides][4]
-
* [Shrinking content to fit on slide][5]
-
-* 很棒的资源: refcard-org-beamer 详情参见其 [Github repo][6] 中的 PDF 和 .org 文件。
-
+* 很棒的资源: refcard-org-beamer
+ * 详情参见其 [Github repo][6] 中的 PDF 和 .org 文件。
* 很漂亮的主题: [Theme matrix][7]
#### 4.2 下一个 Emacs 系列
@@ -148,9 +143,9 @@ mu4e 邮件!
via: http://changelog.complete.org/archives/9900-emacs-5-documents-and-presentations-with-org-mode
作者:[John Goerzen][a]
-译者:[oneforalone](https://github.com/oneforalone)
-校对:[校对者ID](https://github.com/校对者ID)
选题:[lujun9972](https://github.com/lujun9972)
+译者:[oneforalone](https://github.com/oneforalone)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@@ -174,3 +169,9 @@ via: http://changelog.complete.org/archives/9900-emacs-5-documents-and-presentat
[17]:https://orgmode.org/worg/org-tutorials/non-beamer-presentations.html#org-tree-slide
[18]:https://orgmode.org/worg/org-tutorials/non-beamer-presentations.html
[19]:https://www.emacswiki.org/emacs/ELPA
+[20]:https://changelog.complete.org/archives/tag/emacs2018
+[21]:https://github.com/jgoerzen/public-snippets/blob/master/emacs/emacs-org-beamer/emacs-org-beamer.org
+[22]:http://changelog.complete.org/archives/9900-emacs-5-documents-and-presentations-with-org-mode
+[23]:https://github.com/jgoerzen/public-snippets/raw/master/emacs/emacs-org-beamer/emacs-org-beamer.pdf
+[24]:https://github.com/jgoerzen/public-snippets/raw/master/emacs/emacs-org-beamer/emacs-org-beamer-document.pdf
+
From 8b00b53b68563c53f5638f657a0928b5c9321a02 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 23:00:14 +0800
Subject: [PATCH 076/119] PUB:20180404 Emacs -5- Documents and Presentations
with org-mode.md
@oneforalone https://linux.cn/article-10340-1.html
---
...0180404 Emacs -5- Documents and Presentations with org-mode.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180404 Emacs -5- Documents and Presentations with org-mode.md (100%)
diff --git a/translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md b/published/20180404 Emacs -5- Documents and Presentations with org-mode.md
similarity index 100%
rename from translated/tech/20180404 Emacs -5- Documents and Presentations with org-mode.md
rename to published/20180404 Emacs -5- Documents and Presentations with org-mode.md
From 72e45075741d7dec39dff3c040df4d19295d82ca Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 12 Dec 2018 23:01:02 +0800
Subject: [PATCH 077/119] PRF:20180404 Emacs -5- Documents and Presentations
with org-mode.md
---
...80404 Emacs -5- Documents and Presentations with org-mode.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/published/20180404 Emacs -5- Documents and Presentations with org-mode.md b/published/20180404 Emacs -5- Documents and Presentations with org-mode.md
index 9ed04db2cb..5082ec2fc9 100644
--- a/published/20180404 Emacs -5- Documents and Presentations with org-mode.md
+++ b/published/20180404 Emacs -5- Documents and Presentations with org-mode.md
@@ -1,4 +1,4 @@
-Emacs 系列(五):org 模式之文档与演示稿
+Emacs 系列(五):Org 模式之文档与演示稿
======
这是 [Emacs 和 Org 模式系列][20]的第五篇。
From 736866a3ca27f2edb8191feaf85029b086ca3e5d Mon Sep 17 00:00:00 2001
From: geekpi
Date: Thu, 13 Dec 2018 08:54:41 +0800
Subject: [PATCH 078/119] translated
---
... a containerized machine learning model.md | 48 +++++++++----------
1 file changed, 24 insertions(+), 24 deletions(-)
rename {sources => translated}/tech/20181102 Create a containerized machine learning model.md (59%)
diff --git a/sources/tech/20181102 Create a containerized machine learning model.md b/translated/tech/20181102 Create a containerized machine learning model.md
similarity index 59%
rename from sources/tech/20181102 Create a containerized machine learning model.md
rename to translated/tech/20181102 Create a containerized machine learning model.md
index d0a57d0b72..7c48ba6af7 100644
--- a/sources/tech/20181102 Create a containerized machine learning model.md
+++ b/translated/tech/20181102 Create a containerized machine learning model.md
@@ -7,46 +7,46 @@
[#]: author: (Sven Bösiger)
[#]: url: ( )
-Create a containerized machine learning model
+创建一个容器化的机器学习模型
======

-After data scientists have created a machine learning model, it has to be deployed into production. To run it on different infrastructures, using containers and exposing the model via a REST API is a common way to deploy a machine learning model. This article demonstrates how to roll out a [TensorFlow][1] machine learning model, with a REST API delivered by [Connexion][2] in a container with [Podman][3].
+数据科学家在创建机器学习模型后,必须将其部署到生产中。要在不同的基础架构上运行它,使用容器并通过 REST API 公开模型是部署机器学习模型的常用方法。本文演示了如何在 [Podman][3] 容器中使用 [Connexion][2] 推出使用 REST API 的 [TensorFlow][1] 机器学习模型。
-### Preparation
+### 准备
-First, install Podman with the following command:
+首先,使用以下命令安装 Podman:
```
sudo dnf -y install podman
```
-Next, create a new folder for the container and switch to that directory.
+接下来,为容器创建一个新文件夹并切换到该目录。
```
mkdir deployment_container && cd deployment_container
```
-### REST API for the TensorFlow model
+### TensorFlow 模型的 REST API
-The next step is to create the REST-API for the machine learning model. This [github repository][4] contains a pretrained model, and well as the setup already configured for getting the REST API working.
+下一步是为机器学习模型创建 REST API。这个 [github 仓库][4]包含一个预训练模型,以及能让 REST API 工作的设置。
-Clone this in the deployment_container directory with the command:
+使用以下命令在 deployment_container 目录中克隆它:
```
git clone https://github.com/svenboesiger/titanic_tf_ml_model.git
```
-#### prediction.py & ml_model/
+#### prediction.py 和 ml_model/
-The [prediction.py][5] file allows for a Tensorflow prediction, while the weights for the 20x20x20 neural network are located in folder [ml_model/][6].
+[prediction.py][5] 能进行 Tensorflow 预测,而 20x20x20 神经网络的权重位于文件夹 [ml_model/][6] 中。
#### swagger.yaml
-The file swagger.yaml defines the API for the Connexion library using the [Swagger specification][7]. This file contains all of the information necessary to configure your server to provide input parameter validation, output response data validation, URL endpoint definition.
+swagger.yaml 使用 [Swagger规范][7] 定义 Connexion 库的 API。此文件包含让你的服务器提供输入参数验证、输出响应数据验证、URL 端点定义所需的所有信息。
-As a bonus Connexion will provide you also with a simple but useful single page web application that demonstrates using the API with JavaScript and updating the DOM with it.
+额外地,Connexion 还将给你提供一个简单但有用的单页 Web 应用,它演示了如何使用 Javascript 调用 API 和更新 DOM。
```
swagger: "2.0"
@@ -85,9 +85,9 @@ definitions:
type: object
```
-#### server.py & requirements.txt
+#### server.py 和 requirements.txt
-[server.py][8] defines an entry point to start the Connexion server.
+[server.py][8] 定义了启动 Connexion 服务器的入口点。
```
import connexion
@@ -100,7 +100,7 @@ if __name__ == '__main__':
app.run(debug=True)
```
-[requirements.txt][9] defines the python requirements we need to run the program.
+[requirements.txt][9] 定义了运行程序所需的 python 包。
```
connexion
@@ -108,9 +108,9 @@ tensorflow
pandas
```
-### Containerize!
+### 容器化!
-For Podman to be able to build an image, create a new file called “Dockerfile” in the **deployment_container** directory created in the preparation step above:
+为了让 Podman 构建映像,请在上面的准备步骤中创建的 **deployment_container** 目录中创建一个名为 “Dockerfile” 的新文件:
```
FROM fedora:28
@@ -143,25 +143,25 @@ WORKDIR /titanic_tf_ml_model
CMD python3 server.py
```
-Next, build the container image with the command:
+接下来,使用以下命令构建容器镜像:
```
podman build -t ml_deployment .
```
-### Run the container
+### 运行容器
-With the Container image built and ready to go, you can run it locally with the command:
+随着容器镜像的构建和准备就绪,你可以使用以下命令在本地运行它:
```
podman run -p 5000:5000 ml_deployment
```
-Navigate to [http://0.0.0.0:5000/ui][10] in your web browser to access the Swagger/Connexion UI and to test-drive the model:
+在 Web 浏览器中输入 [http://0.0.0.0:5000/ui][10] 访问 Swagger/Connexion UI 并测试模型:
![][11]
-Of course you can now also access the model with your application via the REST-API.
+当然,你现在也可以在应用中通过 REST API 访问模型。
--------------------------------------------------------------------------------
@@ -170,7 +170,7 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/
作者:[Sven Bösiger][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/) 荣誉推出
@@ -187,4 +187,4 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/
[8]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/server.py
[9]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/requirements.txt
[10]: http://0.0.0.0:5000/
-[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png
+[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png
\ No newline at end of file
From b55ab150a61b9565351f2fe07954dae308e46c42 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Thu, 13 Dec 2018 08:57:51 +0800
Subject: [PATCH 079/119] translating
---
... to Install Putty on Ubuntu and Other Linux Distributions.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
index 1b92a73645..2c7805cbf2 100644
--- a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
+++ b/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From f19890e1e5f4d31e7e206f08af46986a338bbd28 Mon Sep 17 00:00:00 2001
From: darksun
Date: Thu, 13 Dec 2018 12:09:12 +0800
Subject: [PATCH 080/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Top=205=20configu?=
=?UTF-8?q?ration=20management=20tools?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...12 Top 5 configuration management tools.md | 122 ++++++++++++++++++
1 file changed, 122 insertions(+)
create mode 100644 sources/tech/20181212 Top 5 configuration management tools.md
diff --git a/sources/tech/20181212 Top 5 configuration management tools.md b/sources/tech/20181212 Top 5 configuration management tools.md
new file mode 100644
index 0000000000..72aebb209a
--- /dev/null
+++ b/sources/tech/20181212 Top 5 configuration management tools.md
@@ -0,0 +1,122 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Top 5 configuration management tools)
+[#]: via: (https://opensource.com/article/18/12/configuration-management-tools)
+[#]: author: (Marco Bravo https://opensource.com/users/marcobravo)
+
+Top 5 configuration management tools
+======
+Learn about configuration management tools and figure out which will work best for your DevOps organization.
+
+
+DevOps is evolving and gaining traction as organizations discover how it enables them to produce better applications and reduce their software products' time to market.
+
+[DevOps' core values][1] are Culture, Automation, Measurement, and Sharing (CAMS), and an organization's adherence to them influences how successful it is.
+
+ * **Culture** brings people and processes together;
+ * **Automation** creates a fabric for DevOps;
+ * **Measurement** permits improvements; and
+ * **Sharing** enables the feedback loop in the CAMS cycle.
+
+
+
+Another DevOps concept is the idea that almost everything can be managed in code: servers, databases, networks, log files, application configurations, documentation, automated tests, deployment processes, and more.
+
+In this article, I'll focus on one aspect of automation: Configuration management. As part of [Infrastructure as Code][2] (IaC), configuration management tools enable the use of tested and proven software development practices for managing and provisioning data centers through plaintext definition files.
+
+By manipulating simple configuration files, a DevOps team can use application development best practices, such as version control, testing, small deployments, and design patterns. In short, this means code can be written to provision and manage an infrastructure as well as automate processes.
+
+### Why use configuration management tools?
+
+Configuration management tools enable changes and deployments to be faster, repeatable, scalable, predictable, and able to maintain the desired state, which brings controlled assets into an expected state.
+
+Some advantages of using configuration management tools include:
+
+ * Adherence to coding conventions that make it easier to navigate code
+ * Idempotency, which means that the end state remains the same, no matter how many times the code is executed
+ * Distribution design to improve managing large numbers of remote servers
+
+
+
+Some configuration management tools use a pull model, in which an agent installed on the servers runs periodically to pull the latest definitions from a central repository and apply them to the server. Other tools use a push model, where a central server triggers updates to managed servers.
+
+### Top 5 configuration management tools
+
+There are a variety of configuration management tools available, and each has specific features that make it better for some situations than others. Yet the top five configuration management tools, presented below in alphabetical order, have several things in common that I believe are essential for DevOps success: all have an open source license, use externalized configuration definition files, run unattended, and are scriptable. All of the descriptions are based on information from the tools' software repositories and websites.
+
+#### Ansible
+
+"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications—automate in a language that approaches plain English, using SSH, with no agents to install on remote systems." —[GitHub repository][3]
+
+Ansible is one of my favorite tools; I started using it several years ago and fell in love with it. You can use Ansible to execute the same command for a list of servers from the command line. You can also use it to automate tasks using "playbooks" written into a YAML file, which facilitate communication between teams and non-technical people. Its main advantages are that it is simple, agentless, and easy to read (especially for non-programmers).
+
+Because agents are not required, there is less overhead on servers. An SSH connection is necessary when running in push mode (which is the default), but pull mode is available if needed. [Playbooks][4] can be written with a minimal set of commands or they can be scaled for more elaborate automation tasks that could include roles, variables, and modules written by other people.
+
+You can combine Ansible with other tools to create a central console to control processes. Those tools include Ansible Works (AWX), Jenkins, RunDeck, and [ARA][5], which offers [traceability when running playbooks][6].
+
+### CFEngine
+
+"CFEngine 3 is a popular open source configuration management system. Its primary function is to provide automated configuration and maintenance of large-scale computer systems." —[GitHub repository][7]
+
+CFEngine was introduced by Mark Burgess in 1993 as a scientific approach to automated configuration management. The goal was to deal with the entropy in computer systems' configuration and resolve it with end-state "convergence." Convergence means a desired end-state and elaborates on idempotence as a capacity to reach the desired end-state. Burgess' research evolved in 2004 when he proposed the [Promise theory][8] as a model of voluntary cooperation between agents.
+
+The current version of CFEngine incorporates Promise theory and uses agents running on each server that pull the configuration from a central repository. It requires some expert knowledge to deal with configurations, so it's best suited for technical people.
+
+### Chef
+
+"A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure." —[GitHub repository][9]
+
+Chef uses "recipes" written in Ruby to keep your infrastructure running up-to-date and compliant. The recipes describe a series of resources that should be in a particular state. Chef can run in client/server mode or in a standalone configuration named [chef-solo][10]. It has good integration with the major cloud providers to automatically provision and configure new machines.
+
+Chef has a solid user base and provides a full toolset to allow people with different technical backgrounds and skills to interact around the recipes. But, at its base, it is more technically oriented tool.
+
+### Puppet
+
+"Puppet, an automated administrative engine for your Linux, Unix, and Windows systems, performs administrative tasks (such as adding users, installing packages, and updating server configurations) based on a centralized specification." —[GitHub repository][11]
+
+Conceived as a tool oriented toward operations and sysadmins, Puppet has consolidated as a configuration management tool. It usually works in a client-server architecture, and an agent communicates with the server to fetch configuration instructions.
+
+Puppet uses a declarative language or Ruby to describe the system configuration. It is organized in modules, and manifest files contain the desired-state goals to keep everything as required. Puppet uses the push model by default, and the pull model can be configured.
+
+### Salt
+
+"Software to automate the management and configuration of any infrastructure or application at scale." — [GitHub repository][12]
+
+Salt was created for high-speed data collection and scale beyond tens of thousands of servers. It uses Python modules to handle configuration details and specific actions. These modules manage all of Salt's remote execution and state management behavior. Some level of technical skills are required to configure the modules.
+
+Salt uses a client-server topology (with the Salt master as server and Salt minions as clients). Configurations are kept in Salt state files, which describe everything required to keep a system in the desired state.
+
+### Conclusion
+
+The landscape of DevOps tools is evolving all the time, and it is important to keep an eye on the changes. I hope this article will encourage you to explore these concepts and tools further. If so, the Cloud Native Computing Foundation (CNCF) maintains a good reference in the [Cloud Native Landscape Project][13].
+
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/configuration-management-tools
+
+作者:[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
+[b]: https://github.com/lujun9972
+[1]: https://www.oreilly.com/learning/why-use-terraform
+[2]: https://www.oreilly.com/library/view/infrastructure-as-code/9781491924334/ch04.html
+[3]: https://github.com/ansible/ansible
+[4]: https://opensource.com/article/18/8/ansible-playbooks-you-should-try
+[5]: https://github.com/openstack/ara
+[6]: https://opensource.com/article/18/5/analyzing-ansible-runs-using-ara
+[7]: https://github.com/cfengine/core
+[8]: https://en.wikipedia.org/wiki/Promise_theory
+[9]: https://github.com/chef/chef
+[10]: https://docs.chef.io/chef_solo.html
+[11]: https://github.com/puppetlabs/puppet
+[12]: https://github.com/saltstack/salt
+[13]: https://github.com/cncf/landscape
From 0aa789c045caa50a8d1ddf082c75098212df9a60 Mon Sep 17 00:00:00 2001
From: darksun
Date: Thu, 13 Dec 2018 12:10:55 +0800
Subject: [PATCH 081/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Patch=20into=20Th?=
=?UTF-8?q?e=20Matrix=20at=20the=20Linux=20command=20line?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...to The Matrix at the Linux command line.md | 54 +++++++++++++++++++
1 file changed, 54 insertions(+)
create mode 100644 sources/tech/20181212 Patch into The Matrix at the Linux command line.md
diff --git a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md
new file mode 100644
index 0000000000..c07e71fc28
--- /dev/null
+++ b/sources/tech/20181212 Patch into The Matrix at the Linux command line.md
@@ -0,0 +1,54 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Patch into The Matrix at the Linux command line)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-cmatrix)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+
+Patch into The Matrix at the Linux command line
+======
+Recreate the classic look and feel of everyone's favorite 1990s sci-fi movie code scroller with cmatrix.
+
+
+You've found your way to today's entry from the Linux command-line toys advent calendar. If this is your first visit to the series, you might be wondering what a command-line toy even is? It's anything that's an entertaining diversion at the terminal, be it a game, a fun utility, or a simple distraction.
+
+Some of these are classics, and some are completely new (at least to me), but I hope all of you find something you enjoy in this series.
+
+As we come to the close of another year, it's a good time for looking back, and looking forward. What will 2019 hold for you? What does it mean to be 2019?
+
+I'm reminded that 2019 will mark the twentieth anniversary of one of my favorite science fiction movies from my teenage years, that at the time had me thinking a lot about what the future would hold: [The Matrix][1]. For a computer nerd kid like me, it was the ultimate story of a computer programmer rising up and becoming an action hero in a virtual universe by tapping into the power of his mind.
+
+At the time, there was no movie that seemed more futuristic to me; both in the story itself, and in the mesmerizing special effects. Realizing that it was filmed over twenty years ago doesn't change that in my mind.
+
+Bringing it back to our command-line toy for today, let's recreate the downward flowing code of the Matrix at our terminal with **cmatrix**. **cmatrix** was an easy install for me, packaged for Fedora, so installing it took simply:
+
+```
+$ dnf install cmatrix
+```
+
+Then, just type **cmatrix **at your terminal to run.
+
+You can find the source code for **** **cmatrix** [on GitHub][2] under a GPL license.
+
+Do you have a favorite command-line toy that you think I ought to include? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
+
+Check out yesterday's toy, [Winterize your Bash prompt in Linux][3], and check back tomorrow for another!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-cmatrix
+
+作者:[Jason Baker][a]
+选题:[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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://en.wikipedia.org/wiki/The_Matrix
+[2]: https://github.com/abishekvashok/cmatrix
+[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt
From 28f5cd2500dcdbba06bced3225f95d5fef3a2f61 Mon Sep 17 00:00:00 2001
From: darksun
Date: Thu, 13 Dec 2018 12:21:33 +0800
Subject: [PATCH 082/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20What=20is=20PPA?=
=?UTF-8?q?=3F=20Everything=20You=20Need=20to=20Know=20About=20PPA=20in=20?=
=?UTF-8?q?Linux?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ing You Need to Know About PPA in Linux.md | 315 ++++++++++++++++++
1 file changed, 315 insertions(+)
create mode 100644 sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md
diff --git a/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md
new file mode 100644
index 0000000000..194dc31ef3
--- /dev/null
+++ b/sources/tech/20181213 What is PPA- Everything You Need to Know About PPA in Linux.md
@@ -0,0 +1,315 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (What is PPA? Everything You Need to Know About PPA in Linux)
+[#]: via: (https://itsfoss.com/ppa-guide/)
+[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+
+What is PPA? Everything You Need to Know About PPA in Linux
+======
+
+**Brief: An in-depth article that covers almost all the questions around using PPA in Ubuntu and other Linux distributions.**
+
+If you have been using Ubuntu or some other Linux distribution based on Ubuntu such as Linux Mint, Linux Lite, Zorin OS etc, you may have come across three magical lines of this sort:
+
+```
+sudo add-apt-repository ppa:dr-akulavich/lighttable
+sudo apt-get update
+sudo apt-get install lighttable-installer
+```
+
+A number of websites suggest these kind of lines to [install applications in Ubuntu][1]. This is what is called installing an application using PPA.
+
+But what is PPA? Why is it used? Is it safe to use PPA? How to properly use PPA? How to delete a PPA?
+
+I’ll answer all of the above questions in this detailed guide. Even if you already know a few things about PPAs, I am sure this article will still add to your knowledge.
+
+Do note that I am writing this article using Ubuntu. Therefore I’ll use the term Ubuntu almost everywhere but the explanations and steps are also applicable to other Debian/Ubuntu based distributions.
+
+### What is PPA? Why is it used?
+
+![Everything you need to know about PPA in Ubuntu Linux][2]
+
+PPA stands for Personal Package Archive.
+
+Does that make sense? Probably not.
+
+Before you understand PPA, you should know the concept of repositories in Linux. I won’t go into details here though.
+
+#### Concept of repositories and package management
+
+A repository is a collection of files that has information about various software, their versions and some other details like the checksum. Each Ubuntu version has its own official set of four repositories:
+
+ * **Main** – Canonical-supported free and open-source software.
+
+ * **Universe** – Community-maintained free and open-source software.
+
+ * **Restricted** – Proprietary drivers for devices.
+
+ * **Multiverse** – Software restricted by copyright or legal issues.
+
+
+
+
+You can see such repositories for all Ubuntu versions [here][3]. You can browse through them and also go to the individual repositories. For example, Ubuntu 16.04 main repository can be found [here][4].
+
+So basically it’s a web URL that has information about the software. How does your system know where are these repositories?
+
+This information is stored in the sources.list file in the directory /etc/apt. If you look at its content, you’ll see that it has the URL of the repositories. The lines with # at the beginning are ignored.
+
+Now when you run the command sudo apt update, your system uses [APT tool][5] to check against the repo and stores the information about the software and their version in a cache. When you use the command sudo apt install package_name, it uses the information to get that package from the URL where the actual software is stored.
+
+If the repository doesn’t have the information about a certain package, you’ll see an error like:
+
+```
+E: Unable to locate package
+```
+
+At this point, I recommend reading my [guide to using apt commands][6]. This will give you a much better understanding of apt commands, update etc.
+
+So this was about repositories. But what is PPA? How does it enter into the picture?
+
+#### Why is PPA used?
+
+As you can see, Ubuntu controls what software and more importantly which version of a software you get on your system. But imagine if a software developer releases a new version of the software.
+
+Ubuntu won’t make it available immediately. There is a procedure to check if the new version of the software is compatible with the system or not. This ensures the stability of the system.
+
+But this also means that it will be some weeks or in some cases, some months before it is made available by Ubuntu. Not everyone would want to wait that long to get their hands on the new version of their favorite software.
+
+Similarly, suppose someone develops a software and wants Ubuntu to include that software in the official repositories. It again will take months before Ubuntu makes a decision and includes it in the official repositories.
+
+Another case would be during beta testing. Even if a stable version of the software is available in the official repositories, a software developer may want some end users to test their upcoming release. How do they enable the end user to beta test the upcoming release?
+
+Enter PPA!
+
+### How to use PPA? How does PPA work?
+
+[PPA][7], as I already told you, means Personal Package Archive. Mind the word ‘Personal’ here. That gives the hint that this is something exclusive to a developer and is not officially endorsed by the distribution.
+
+Ubuntu provides a platform called Launchpad that enables software developers to create their own repositories. An end user i.e. you can add the PPA repository to your sources.list and when you update your system, your system would know about the availability of this new software and you can install it using the standard sudo apt install command like this.
+
+`sudo add-apt-repository ppa:dr-akulavich/lighttable`
+`sudo apt-get update`
+`sudo apt-get install lighttable-installer`
+
+To summarize:
+
+ * sudo add-apt-repository <– This command adds the PPA repository to the list.
+ * sudo apt-get update <– This command updates the list of the packages that can be installed on the system.
+ * sudo apt-get install <– This command installs the package.
+
+
+
+You see that it is important to use the command sudo apt update or else your system will not know when a new package is available.
+
+Now let’s take a look at the first command in a bit more detail.
+
+```
+sudo add-apt-repository ppa:dr-akulavich/lighttable
+```
+
+You would notice that this command doesn’t have a URL to the repository. This is because the tool has been designed to abstract the information about URL from you.
+
+Just a small note. If you add ppa:dr-akulavich/lighttable, you get Light Table. But if you add ppa:dr-akulavich, you’ll get all the repository or packages mentioned in the ‘upper repository’. It’s hierarchical.
+
+Basically, when you add a PPA using add-apt-repository, it will do the same action as if you manually run these commands:
+
+```
+deb http://ppa.launchpad.net/dr-akulavich/lighttable/ubuntu YOUR_UBUNTU_VERSION_HERE main
+deb-src http://ppa.launchpad.net/dr-akulavich/lighttable/ubuntu YOUR_UBUNTU_VERSION_HERE main
+```
+
+The above two lines are the traditional way to add any repositories to your sources.list. But PPA does it automatically for you, without wondering about the exact repository URL and operating system version.
+
+One important thing to not here is that when you use PPA, it doesn’t change your original sources.list. Instead, it creates two files in /etc/apt/sources.d directory, a list and a back up file with suffix ‘save’.
+
+![Using a PPA in Ubuntu][8]PPA create separate sources.list
+
+The files with suffix ‘list’ has the command that adds the information about the repository.
+
+![PPA add repository information][9]Content of source.list of a PPA
+
+This is a safety measure to ensure that adding PPAs don’t mess with the original sources.list. It also helps in removing the PPA.
+
+#### Why PPA? Why not DEB packages?
+
+You may ask why should you use PPA when it involves using command line which might not be preferred by everyone. Why not just distribute a DEB package that can be installed graphically?
+
+The answer lies in the update procedure. If you install a software using a DEB package, there is no guarantee that the installed software will be updated to a newer version when you run sudo apt update && sudo apt upgrade.
+
+It’s because the apt upgrade procedure relies on the sources.list. If there is no entry for a software, it doesn’t get the update via the standard software updater.
+
+So does it mean software installed using DEB never gets an update? No, not really. It depends on how the package was created.
+
+Some developers automatically add an entry to the sources.list and then it is updated like a regular software. Google Chrome is one such example.
+
+Some software would notify you of availability of a new version when you try to run it. You’ll have to download the new DEB package and run it again to update the current software to a newer version. Oracle Virtual Box is an example in this case.
+
+For the rest of the DEB packages, you’ll have to manually look for an update and this is not convenient, especially if your software is meant for beta testers. You need to add more updates frequently. This is where PPA come to the rescue.
+
+#### Offical PPA vs unofficial PPA
+
+You may also hear the term official PPA or unofficial PPA. What’s the difference?
+
+When developers create PPA for their software, it is called the official PPA. Quite obviously because it is coming from none other than the project developers.
+
+But at times, individuals create PPA of projects that were created by other developers.
+
+Why would someone do that? Because many developers just provide the source code of the software and you know that [installing software from source code in Linux][10] is a pain and not everyone could or would do that.
+
+This is why volunteers take it upon themselves to create a PPA from those source code so that other users can install the software easily. After all, using those 3 lines is a lot easier than battling the source code installation.
+
+#### Make sure that a PPA is available for your distribution version
+
+When it comes to using PPA in Ubuntu or any other Debian based distribution, there are a few things you should keep in mind.
+
+Not every PPA is available for your particular version. You should know [which Ubuntu version][11] you are using. The codename of the release is important because when you go to the webpage of a certain PPA, you can see which Ubuntu versions are supported by the PPA.
+
+For other Ubuntu-based distributions, you can check the content of /etc/os-release to [find out the Ubuntu version][11] information.
+
+![Verify PPA availability for Ubuntu version][12]Check if PPA is available for your Ubuntu version
+
+How to know the PPA url? Simply search on the internet with the PPA name like ppa:dr-akulavich/lighttable and you’ll get the first result from [Launchpad][13], the official platform for hosting PPA. You can also go to Launchpad and search for the required PPA directly there.
+
+If you don’t verify and add the PPA, you may see an error like this when you try to install a software not available for your version.
+
+```
+E: Unable to locate package
+```
+
+What’s worse is that since it has been added to your source.list, each time you run software updater, you’ll see an error “[Failed to download repository information][14]“.
+
+![Failed to download repository information Ubuntu 13.04][15]
+
+If you run sudo apt update in the terminal, the error will have more details about which repository is causing the trouble. You can see something like this in the end of the output of sudo apt update:
+
+```
+W: Failed to fetch http://ppa.launchpad.net/venerix/pkg/ubuntu/dists/raring/main/binary-i386/Packages 404 Not Found
+E: Some index files failed to download. They have been ignored, or old ones used instead.
+```
+
+Which is self-explanatory because the system cannot find the repository for your version. Remember what we saw earlier about repository structure? APT will try to look for software information in the place /ubuntu/dists/Ubuntu_Version
+
+And if the PPA for the specific version is not available, it will never be able to open the URL and you get the famous 404 error.
+
+#### Why are PPAs not available for all the Ubuntu release versions?
+
+It is because someone has to compile the software and create a PPA out of it on the specific versions. Considering that a new Ubuntu version is released every six months, it’s a tiresome task to update the PPA for every Ubuntu release. Not all developers have time to do that.
+
+#### How to install the application if PPA is not available for your version?
+
+It is possible that though the PPA is not available for your Ubuntu version, you could still download the DEB file and install the application
+
+Let’s say that you go to the Light Table PPA. Using the knowledge about PPA you just learned, you realize that the PPA is not available for your specific Ubuntu release.
+
+What you can do is to click on the ‘View package details’.
+
+![Get DEB file from PPA][16]
+
+And in here, you can click on a package to reveal more details. You’ll also find the source code and the DEB file of the package here.
+
+![Download DEB file from PPA][17]
+
+I advise [using Gdebi to install these DEB files][18] instead of the Software Center because Gdebi is a lot better at handling dependencies.
+
+Do note that the package installed this way might not get any future updates.
+
+I think you have read enough about adding PPAs. How about removing a PPA and the software installed by it?
+
+### How to delete PPA?
+
+I have written about [deleting PPA][19] in the past. I am going to describe the same methods here as well.
+
+I advise deleting the software that you installed from a PPA before removing the PPA. If you just remove the PPA, the installed software remains in the system but it won’t get any updates. You wouldn’t want that, would you?
+
+So, the question comes, how to know which application was installed by which PPA?
+
+#### Find packages installed by a PPA and remove them
+
+Ubuntu Software Center doesn’t help here. You’ll have to use Synaptic package manager here which has more advanced features.
+
+You can install Synaptic from Software Center or use the command below:
+
+```
+sudo apt install synaptic
+```
+
+Once installed, start Synaptic package manager and select Origin. You’ll see various repositories added to the system. PPA entries will be labeled with prefix PPA. Click on them to see the packages that are available by the PPA. Installed software will have appropriate symbol before it.
+
+![Managing PPA with Synaptic package manager][20]Find packages installed via a PPA
+
+Once you have found the packages, you can delete them from Synaptic itself. Otherwise, you always have the option to use the command line:
+
+```
+sudo apt remove package_name
+```
+
+Once you have removed the packages installed by a PPA, you can continue to remove the PPA from your sources.list.
+
+#### Remove a PPA graphically
+
+Go to Software & Updates and then go to tab Other Software. Look for the PPA that you want to remove:
+
+![Delete a PPA from Software Source][21]
+
+You have two options here. Either you deselect the PPA or you choose the Remove option.
+
+The difference is that when you deselect a PPA entry, your system will comment out the repository entry in its ppa_name.list file in /etc/apt/sources.list.d but if you choose the Remove option, it will delete the repository entry from its ppa_name.list file in /etc/apt/sources.list.d directory.
+
+In both the cases, the files ppa_name.list remains in the said directory, even if it is empty.
+
+### Is it safe to use PPA?
+
+It is a subjective question. Purists abhor PPA because most of the time PPAs are from third-party developers. But at the same time, PPAs are popular in the Debian/Ubuntu world as they provide an easier installation option.
+
+As far as the security is concerned, it’s less likely that you use a PPA and your Linux system is hacked or injected with malware. I don’t recall such an incident ever happened so far.
+
+Official PPAs can be used without thinking twice. Using unofficial PPA is entirely your decision.
+
+As a rule of thumb, you should avoid installing a program via a third party PPA if it the program requires sudo access to run.
+
+### What do you think about using PPA?
+
+I know it’s a long read but I wanted to give you a better understanding of PPA. I hope this detailed guide answered most of your questions about using PPA.
+
+If you have more questions about PPA, please feel free to ask in the comment section.
+
+If you notice any technical or grammatical error or if you have suggestions for improving this article, please let me know.
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/ppa-guide/
+
+作者:[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/remove-install-software-ubuntu/
+[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/12/what-is-ppa.png?resize=800%2C450&ssl=1
+[3]: http://archive.ubuntu.com/ubuntu/dists/
+[4]: http://archive.ubuntu.com/ubuntu/dists/xenial/main/
+[5]: https://wiki.debian.org/Apt
+[6]: https://itsfoss.com/apt-command-guide/
+[7]: https://launchpad.net/ubuntu/+ppas
+[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/01/ppa-sources-list-files.png?resize=800%2C259&ssl=1
+[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/01/content-of-ppa-list.png?ssl=1
+[10]: https://itsfoss.com/install-software-from-source-code/
+[11]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
+[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/12/verify-ppa-availibility-version.jpg?resize=800%2C481&ssl=1
+[13]: https://launchpad.net/
+[14]: https://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/
+[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2013/04/Failed-to-download-repository-information-Ubuntu-13.04.png?ssl=1
+[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/deb-from-ppa.jpg?resize=800%2C483&ssl=1
+[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2018/12/deb-from-ppa-2.jpg?resize=800%2C477&ssl=1
+[18]: https://itsfoss.com/gdebi-default-ubuntu-software-center/
+[19]: https://itsfoss.com/how-to-remove-or-delete-ppas-quick-tip/
+[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2018/01/ppa-synaptic-manager.jpeg?resize=800%2C394&ssl=1
+[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2012/08/Delete-a-PPA.jpeg?ssl=1
From 13ff6637819c36727ddefbb0ce96c75599111d26 Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Thu, 13 Dec 2018 12:38:47 +0800
Subject: [PATCH 083/119] Translating by qhwdw
---
sources/tech/20180911 Know Your Storage- Block, File - Object.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/sources/tech/20180911 Know Your Storage- Block, File - Object.md b/sources/tech/20180911 Know Your Storage- Block, File - Object.md
index 24f179d9d5..0b7c2cc338 100644
--- a/sources/tech/20180911 Know Your Storage- Block, File - Object.md
+++ b/sources/tech/20180911 Know Your Storage- Block, File - Object.md
@@ -1,3 +1,4 @@
+Translating by qhwdw
Know Your Storage: Block, File & Object
======
From ccd64b8fa7072bde0c70959003aa18b5198046ed Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Thu, 13 Dec 2018 12:42:49 +0800
Subject: [PATCH 084/119] Translating by qhwdw
---
sources/tech/20181210 How to get started in AI.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181210 How to get started in AI.md b/sources/tech/20181210 How to get started in AI.md
index b0ac291557..0dfb5761aa 100644
--- a/sources/tech/20181210 How to get started in AI.md
+++ b/sources/tech/20181210 How to get started in AI.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (qhwdw)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From f2dfbd01027a7b24d6e0d856d9fc21220b9d1cfa Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Thu, 13 Dec 2018 13:24:19 +0800
Subject: [PATCH 085/119] Check translation of 7 command-line tools for
writers.
---
...line tools for writers - Opensource.com.md | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index ead46909ff..2073fd9279 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -1,9 +1,9 @@
给写作者们的 7 个命令行工具 | Opensource.com
======
-扔掉你的打字机,然后使用这些开源工具在命令行上编辑吧。
+扔掉你的打字机,然后使用这些开源工具在命令行上写作吧。

-对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有很多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。
+对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有许多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。
在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等——无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。
@@ -11,9 +11,9 @@
### 编辑器
-没错,你_可以_在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器并不是[aren't the only games in town][6]。文本编辑器的优势在于它们简单易用和专注。它们非常适合于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。
+没错,你可以在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器[并非屈指可数][6]。文本编辑器的优势在于它们简单易用以及更专注于文本。非常适合用于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。
-如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下[WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown, ODT, LaTeX, 以及 HTML等格式导出。
+如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下 [WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown,ODT,LaTeX,或者 HTML 等格式导出。
### 拼写检查
@@ -25,19 +25,19 @@
### Prose linters
-软件开发人员使用[linters][11]来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的linters;而命令行会认为这些错误是_样式元素_。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
+软件开发人员使用 [linters][11] 来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的 linters;而命令行会认为这些错误是样式元素。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
-[Proselint][12]是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。
+[Proselint][12] 是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。
-[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为Markdown或HTML的文档使用它。 Alex 会对 “性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞” 产生警告。 如果你想要试试看 Alex,这里有一个在线[demo][15].
+[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为 Markdown 或 HTML 的文档使用它。Alex 会对“性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞”产生警告。如果你想要试试看 Alex,这里有一个在线 [demo][15]。
### 其他工具
-有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行[Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。
+有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行 [Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。
-即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用Markdown格式的文件转换成其他格式。这就是[Pandoc][18]的用武之地。你可以用它来将你的文档转换成 HTML, Word, LibreOffice Writer, LaTeX, EPUB以及其他格式。你甚至可以用Pandoc来生成书籍和[研究论文][19]。
+即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用 Markdown 格式的文件转换成其他格式。这就是 [Pandoc][18] 的用武之地。你可以用它来将你的文档转换成 HTML,Word,LibreOffice Writer,LaTeX,EPUB 以及其他格式。你甚至可以用 Pandoc 来生成书籍和[研究论文][19]。
-你有一个最喜欢的命令行写作工具吗?在Opensource.com社区发表评论分享它。
+你有最喜欢的命令行写作工具吗?在 Opensource.com 社区发表评论分享它吧。
--------------------------------------------------------------------------------
From 6f8d06190e07799f7ca0db0ff87587a3ff4de123 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 16:34:57 +0800
Subject: [PATCH 086/119] PRF:20180208 Gathering project requirements using the
Open Decision Framework.md
@geekpi
---
...t requirements using the Open Decision Framework.md | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md b/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md
index ea4dced8f8..41416d110a 100644
--- a/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md
+++ b/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md
@@ -1,9 +1,11 @@
-使用开放决策框架收集项目需求
+降低项目失败率的三个原则
======
+> 透明和包容性的项目要求可以降低您的失败率。 以下是如何协作收集它们。
+

-众所周知,明确、简洁和可衡量的需求会带来更多成功的项目。一项关于[麦肯锡与牛津大学][1]的大型项目的研究表明:“平均而言,大型 IT 项目超出预算 45%,时间每推移 7%,价值就比预期低 56% “。该研究还表明,造成这种失败的一些原因是“模糊的业务目标,不同步的利益相关者以及过度的返工”。
+众所周知,明确、简洁和可衡量的需求会带来更多成功的项目。一项[麦肯锡与牛津大学][1]的关于大型项目的研究表明:“平均而言,大型 IT 项目超出预算 45%,时间每推移 7%,价值就比预期低 56% 。”该研究还表明,造成这种失败的一些原因是“模糊的业务目标,不同步的利益相关者以及过度的返工。”
业务分析师经常发现自己通过持续对话来构建这些需求。为此,他们必须吸引多个利益相关方,并确保参与者提供明确的业务目标。这样可以减少返工,提高更多项目的成功率。
@@ -29,7 +31,7 @@ via: https://opensource.com/open-organization/18/2/constructing-project-requirem
作者:[Tracy Buckner][a]
译者:[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/) 荣誉推出
@@ -37,4 +39,4 @@ via: https://opensource.com/open-organization/18/2/constructing-project-requirem
[1]:http://calleam.com/WTPF/?page_id=1445
[2]:https://opensource.com/open-organization/resources/open-decision-framework
[3]:https://opensource.com/open-organization/resources/open-org-definition
-[4]:https://opensource.com/open-organization/16/6/introducing-open-decision-framework
\ No newline at end of file
+[4]:https://opensource.com/open-organization/16/6/introducing-open-decision-framework
From 03eca5c9fb7de3093425aa711039bc7fb3980c48 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 16:35:15 +0800
Subject: [PATCH 087/119] PUB:20180208 Gathering project requirements using the
Open Decision Framework.md
@geekpi https://linux.cn/article-10341-1.html
---
...ring project requirements using the Open Decision Framework.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/talk => published}/20180208 Gathering project requirements using the Open Decision Framework.md (100%)
diff --git a/translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md b/published/20180208 Gathering project requirements using the Open Decision Framework.md
similarity index 100%
rename from translated/talk/20180208 Gathering project requirements using the Open Decision Framework.md
rename to published/20180208 Gathering project requirements using the Open Decision Framework.md
From 92e61ae3bd4c223039482f569b01f822e6bd8cce Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Thu, 13 Dec 2018 16:59:36 +0800
Subject: [PATCH 088/119] Delete 20181119 7 command-line tools for writers -
Opensource.com.md
---
...line tools for writers - Opensource.com.md | 75 -------------------
1 file changed, 75 deletions(-)
delete mode 100644 sources/tech/20181119 7 command-line tools for writers - Opensource.com.md
diff --git a/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md b/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md
deleted file mode 100644
index a222389079..0000000000
--- a/sources/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ /dev/null
@@ -1,75 +0,0 @@
-Translating by LazyWolfLin
-
-7 command-line tools for writers | Opensource.com
-======
-Put away your word processor and start writing from the command line using these open source tools.
-
-
-For most people (especially non-techies), the act of writing means tapping out words using LibreOffice Writer or another GUI word processing application. But there are many other options available to help anyone communicate their message in writing, especially for the growing number of writers [embracing plaintext][1].
-
-There's also room in a GUI writer's world for command line tools that can help them write, check their writing, and more—regardless of whether they're banging out an article, blog post, or story; writing a README; or prepping technical documentation.
-
-Here's a look at some command-line tools that any writer will find useful.
-
-### Editors
-
-Yes, you _can_ do actual writing at the command line. I know writers who do their work using editors like [Nano][2], [Vim][3], [Emacs][4], and [Jove][5] in a terminal window. And those editors [aren't the only games in town][6]. Text editors are great because they (at a basic level, anyway) are easy to use and distraction free. They're perfect for tapping out a first draft of anything or even completing a long and complicated writing project.
-
-If you want a more word processor-like experience at the command line, take a look at [WordGrinder][7] . WordGrinder is a bare-bones word processor, but it has more than enough features for writing and publishing your work. It supports basic formatting and styles, and you can export your writing to formats like Markdown, ODT, LaTeX, and HTML.
-
-### Spell checkers
-
-Every writer does (or at least should do) a spelling check on their work at least once. Why? An immutable law of the writing universe states that, no matter how many times you look over your manuscript, a spelling mistake or typo will creep in.
-
-My favorite command-line spelling checker is [GNU Aspell][8], which I previously [looked at][9] in detail. Aspell checks plaintext documents interactively and not only highlights errors but often puts the best correction at the top of its list of suggestions. Aspell also ignores many markup languages while doing its thing.
-
-A much older but still useful alternative is [Ispell][10]. It's a bit slower than Aspell, but both utilities work the same way. As you interact with your text file, Ispell suggests corrections. Ispell also has good support for foreign languages.
-
-### Prose linters
-
-Software developers use [linters][11] to check their code for errors or bugs. There are also linters for prose that check for style and syntax errors; think of them as the _Elements of Style_ for the command line. While any writer can (and probably should) use one, a prose linter is especially useful for team documentation projects that require a consistent voice and style.
-
-[Proselint][12] is a comprehensive tool for checking what you're writing. It looks for jargon, hyperbole, incorrect date and time format, misused terms, and [much more][13]. It's also easy to run and ignores markup in a plaintext file.
-
-[Alex][14] is a simple yet powerful prose linter. Run it against a plaintext document or one formatted with Markdown or HTML. Alex pumps out warnings of "gender favouring, polarising, race related, religion inconsiderate, or other unequal phrasing in text." If you want to give Alex a test drive, there's an [online demo][15].
-
-### Other tools
-
-Sometimes you just can't find the right synonym for a word. But you don't need to grab a "dead tree" thesaurus or go to a dedicated website to perfect your word choice. Just run [Aiksaurus][16] against the word you want to replace, and it does the work for you. This utility's main drawback, though, is that it supports English only.
-
-Even writers with few (if any) technical skills are embracing [Markdown][17] to quickly and easily format their work. Sometimes, though, you need to convert files formatted with Markdown to something else. That's where [Pandoc][18] comes in. You can use it to convert your documents to HTML, Word, LibreOffice Writer, LaTeX, EPUB, and other formats. You can even use Pandoc to produce books and [research papers][19].
-
-Do you have a favorite command-line tool for writing? Share it with the Opensource.com community by leaving a comment.
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/11/command-line-tools-writers
-
-作者:[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://plaintextproject.online
-[2]: https://www.nano-editor.org/
-[3]: https://www.vim.org
-[4]: https://www.gnu.org/software/emacs/
-[5]: https://opensource.com/article/17/1/jove-lightweight-alternative-vim
-[6]: https://en.wikipedia.org/wiki/List_of_text_editors#Text_user_interface
-[7]: https://cowlark.com/wordgrinder/
-[8]: http://aspell.net/
-[9]: https://opensource.com/article/18/2/how-check-spelling-linux-command-line-aspell
-[10]: https://www.cs.hmc.edu/~geoff/ispell.html
-[11]: https://en.wikipedia.org/wiki/Lint_(software)
-[12]: http://proselint.com/
-[13]: http://proselint.com/checks/
-[14]: https://github.com/get-alex/alex
-[15]: https://alexjs.com/#demo
-[16]: http://aiksaurus.sourceforge.net/
-[17]: https://en.wikipedia.org/wiki/Markdown
-[18]: https://pandoc.org
-[19]: https://opensource.com/article/18/9/pandoc-research-paper
From 29a89180632d396f32dfc9fcc217e19ceca64146 Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Thu, 13 Dec 2018 21:54:51 +0800
Subject: [PATCH 089/119] Translated by qhwdw
---
...Know Your Storage- Block, File - Object.md | 63 -------------------
...Know Your Storage- Block, File - Object.md | 60 ++++++++++++++++++
2 files changed, 60 insertions(+), 63 deletions(-)
delete mode 100644 sources/tech/20180911 Know Your Storage- Block, File - Object.md
create mode 100644 translated/tech/20180911 Know Your Storage- Block, File - Object.md
diff --git a/sources/tech/20180911 Know Your Storage- Block, File - Object.md b/sources/tech/20180911 Know Your Storage- Block, File - Object.md
deleted file mode 100644
index 0b7c2cc338..0000000000
--- a/sources/tech/20180911 Know Your Storage- Block, File - Object.md
+++ /dev/null
@@ -1,63 +0,0 @@
-Translating by qhwdw
-Know Your Storage: Block, File & Object
-======
-
-
-
-Dealing with the tremendous amount of data generated today presents a big challenge for companies who create or consume such data. It’s a challenge for tech companies that are dealing with related storage issues.
-
-“Data is growing exponentially each year, and we find that the majority of data growth is due to increased consumption and industries adopting transformational projects to expand value. Certainly, the Internet of Things (IoT) has contributed greatly to data growth, but the key challenge for software-defined storage is how to address the use cases associated with data growth,” said Michael St. Jean, principal product marketing manager, Red Hat Storage.
-
-Every challenge is an opportunity. “The deluge of data being generated by old and new sources today is certainly presenting us with opportunities to meet our customers escalating needs in the areas of scale, performance, resiliency, and governance,” said Tad Brockway, General Manager for Azure Storage, Media and Edge.
-
-### Trinity of modern software-defined storage
-
-There are three different kinds of storage solutions -- block, file, and object -- each serving a different purpose while working with the others.
-
-Block storage is the oldest form of data storage, where data is stored in fixed-length blocks or chunks of data. Block storage is used in enterprise storage environments and usually is accessed using Fibre Channel or iSCSI interface. “Block storage requires an application to map where the data is stored on the storage device,” according to SUSE’s Larry Morris, Sr. Product Manager, Software Defined Storage.
-
-Block storage is virtualized in storage area network and software defined storage systems, which are abstracted logical devices that reside on a shared hardware infrastructure and are created and presented to the host operating system of a server, virtual server, or hypervisor via protocols like SCSI, SATA, SAS, FCP, FCoE, or iSCSI.
-
-“Block storage splits a single storage volume (like a virtual or cloud storage node, or a good old fashioned hard disk) into individual instances known as blocks,” said St. Jean.
-
-Each block exists independently and can be formatted with its own data transfer protocol and operating system — giving users complete configuration autonomy. Because block storage systems aren’t burdened with the same investigative file-finding duties as the file storage systems, block storage is a faster storage system. Pairing that speed with configuration flexibility makes block storage ideal for raw server storage or rich media databases.
-
-Block storage can be used to host operating systems, applications, databases, entire virtual machines and containers. Traditionally, block storage can only be accessed by individual machine, or machines in a cluster, to which it has been presented.
-
-### File-based storage
-
-File-based storage uses a filesystem to map where the data is stored on the storage device. It’s a dominant technology used on direct- and networked-attached storage system, and it takes care of two things: organizing data and representing it to users. “With file storage, data is arranged on the server side in the exact same format as the clients see it. This allows the user to request a file by some unique identifier — like a name, location, or URL — which is communicated to the storage system using specific data transfer protocols,” said St. Jean.
-
-The result is a type of hierarchical file structure that can be navigated from top to bottom. File storage is layered on top of block storage, allowing users to see and access data as files and folders, but restricting access to the blocks that stand up those files and folders.
-
-“File storage is typically represented by shared filesystems like NFS and CIFS/SMB that can be accessed by many servers over an IP network. Access can be controlled at a file, directory, and export level via user and group permissions. File storage can be used to store files needed by multiple users and machines, application binaries, databases, virtual machines, and can be used by containers,” explained Brockway.
-
-### Object storage
-
-Object storage is the newest form of data storage, and it provides a repository for unstructured data which separates the content from the indexing and allows the concatenation of multiple files into an object. An object is a piece of data paired with any associated metadata that provides context about the bytes contained within the object (things like how old or big the data is). Those two things together — the data and metadata — make an object.
-
-One advantage of object storage is the unique identifier associated with each piece of data. Accessing the data involves using the unique identifier and does not require the application or user to know where the data is actually stored. Object data is accessed through APIs.
-
-“The data stored in objects is uncompressed and unencrypted, and the objects themselves are arranged in object stores (a central repository filled with many other objects) or containers (a package that contains all of the files an application needs to run). Objects, object stores, and containers are very flat in nature — compared to the hierarchical structure of file storage systems — which allow them to be accessed very quickly at huge scale,” explained St. Jean.
-
-Object stores can scale to many petabytes to accommodate the largest datasets and are a great choice for images, audio, video, logs, backups, and data used by analytics services.
-
-### Conclusion
-
-Now you know about the various types of storage and how they are used. Stay tuned to learn more about software-defined storage as we examine the topic in the future.
-
-Join us at [Open Source Summit + Embedded Linux Conference Europe][1] in Edinburgh, UK on October 22-24, 2018, for 100+ sessions on Linux, Cloud, Containers, AI, Community, and more.
-
---------------------------------------------------------------------------------
-
-via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object
-
-作者:[Swapnil Bhartiya][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/arnieswap
-[1]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/
diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/translated/tech/20180911 Know Your Storage- Block, File - Object.md
new file mode 100644
index 0000000000..3dc77ad8e3
--- /dev/null
+++ b/translated/tech/20180911 Know Your Storage- Block, File - Object.md
@@ -0,0 +1,60 @@
+认识存储:块、文件和对象
+======
+
+
+
+现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。
+
+ Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“
+
+任何挑战都意味着机遇。Azure 存储、介质和边缘总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。”
+
+### 现代软件定义存储的三种类型
+
+这里有三个不同类型的存储解决方案 — 块、文件、和对象 — 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。
+
+块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置”。
+
+块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,它创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。
+
+St. Jean 说“块存储将单个的存储卷(像一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。“
+
+每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 — 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。
+
+块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器、或集群中呈现出的机器访问。
+
+### 基于文件的存储
+
+基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直接或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。 St. Jean 说,”使用文件存储时,数据在服务器侧的排列格式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。
+
+最终成为了一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是限制访问处于这些文件和文件夹之下的数据块。
+
+Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录、和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“
+
+### 对象存储
+
+对象存储是最新的数据存储形式,它为非结构化数据提供一个库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 — 数据和元数据 — 构成了一个对象。
+
+对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。
+
+St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被安排在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 — 这使得它们在存储规模巨大时访问速度很快。”
+
+对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。
+
+### 结论
+
+现在你已经知道了各种类型的存储以及它们的用处。后面我们将继续研究这个主题的更多内容,敬请关注。
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/blog/2018/9/know-your-storage-block-file-object
+
+作者:[Swapnil Bhartiya][a]
+选题:[lujun9972](https://github.com/lujun9972)
+译者:[qhwdw](https://github.com/qhwdw)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://www.linux.com/users/arnieswap
+[1]: https://events.linuxfoundation.org/events/elc-openiot-europe-2018/
From 690b6cc853497a5357a66e229d78746c99b63988 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 22:12:13 +0800
Subject: [PATCH 090/119] PRF:20180422 Command Line Tricks For Data Scientists
- kade killary.md
@GraveAccent
---
...icks For Data Scientists - kade killary.md | 266 +++++++++---------
1 file changed, 140 insertions(+), 126 deletions(-)
diff --git a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
index a02057f65a..e4190cf7dd 100644
--- a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
+++ b/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
@@ -3,30 +3,29 @@

-对于许多数据科学家来说,数据操作始于和结束于 Pandas 或 Tidyverse。从理论上讲,这样做没有任何问题。毕竟,这就是这些工具存在的原因。然而,对于像分隔符转换这样的简单任务,这些工具是大材小用了。
+对于许多数据科学家来说,数据操作从始至终就是 Pandas 或 Tidyverse。从理论上讲,这样做没有任何问题。毕竟,这就是这些工具存在的原因。然而,对于像分隔符转换这样的简单任务,这些工具是大材小用了。
-立志掌握命令行应该在每个开发人员的清单上,特别是数据科学家。学习 shell 的来龙去脉将无可否认地提高你的生产力。除此之外,命令行还是计算领域的一个重要历史课程。例如,awk - 一种数据驱动的脚本语言。1977年,在传奇的 [K&R 书][2]中 K 即 [Brain Kernighan][1] 的帮助下,Awk 首次出现。今天,大约五十年过去了,awk 仍然和每年出现的[新书][3]相关。因此,可以安全地假设对命令行魔法的投资不会很快贬值。
+立志掌握命令行应该在每个开发人员的学习清单上,特别是数据科学家。学习 shell 的来龙去脉将无可否认地提高你的生产力。除此之外,命令行还是计算领域的一个重要历史课程。例如,awk —— 一种数据驱动的脚本语言。1977 年,在 [Brain Kernighan][1](即传奇的 [K&R 书][2]中 K)的帮助下,awk 首次出现。今天,大约五十年过去了,awk 仍然活跃在每年[新出版的书][3]里面。因此,可以安全地假设对命令行魔法的付出不会很快贬值。
### 我们将涵盖什么
- * ICONV
- * HEAD
- * TR
- * WC
- * SPLIT
- * SORT & UNIQ
- * CUT
- * PASTE
- * JOIN
- * GREP
- * SED
- * AWK
-
-
+* ICONV
+* HEAD
+* TR
+* WC
+* SPLIT
+* SORT & UNIQ
+* CUT
+* PASTE
+* JOIN
+* GREP
+* SED
+* AWK
### ICONV
-文件编码可能会很棘手。现在大部分文件都是 UTF-8 编码的。要了解 UTF-8 背后的一些魔力,请查看这个出色的[视频][4]。尽管如此,有时我们收到的文件不是这种格式。这可能引起对改变编码模式的一些不靠谱尝试。这里,iconv 是一个拯救者。Iconv 是一个简单的程序,它将获取采用一种编码的文本并输出采用另一种编码的文本。
+文件编码可能会很棘手。现在大部分文件都是 UTF-8 编码的。要了解 UTF-8 背后的一些魔力,请查看这个出色的[视频][4]。尽管如此,有时我们收到的文件不是这种编码。这可能引起对改变编码模式的一些胡乱尝试。这里,`iconv` 是一个拯救者。`iconv` 是一个简单的程序,它将获取采用一种编码的文本并输出采用另一种编码的文本。
+
```
# Converting -f (from) latin1 (ISO-8859-1)
# -t (to) standard UTF_8
@@ -34,16 +33,15 @@
iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt
```
- * 实用选项:
-
- * `iconv -l` 列出所有已知编码
- * `iconv -c` 默默丢弃无法转换的字符
-
+实用选项:
+* `iconv -l` 列出所有已知编码
+* `iconv -c` 默默丢弃无法转换的字符
### HEAD
-如果你是一个频繁的 Pandas 用户,那么会很熟悉 `head`。通常在处理新数据时,我们想做的第一件事就是了解其内容。这导致启动 Pandas,读取数据然后调用 `df.head()` \- 这至少是费劲的。没有任何标志的 Head 将打印出文件的前10行。`head` 的真正力量在于测试出来干净利落的操作。例如,如果我们想将文件的分隔符从逗号更改为管道。一个快速测试将是:`head mydata.csv | sed 's/,/|/g'`。
+如果你是一个 Pandas 重度用户,那么会很熟悉 `head`。通常在处理新数据时,我们想做的第一件事就是了解其内容。这就得启动 Pandas,读取数据然后调用 `df.head()` —— 要说这有点费劲。没有任何选项的 `head` 将打印出文件的前 10 行。`head` 的真正力量在于干净利落的测试操作。例如,如果我们想将文件的分隔符从逗号更改为管道。一个快速测试将是:`head mydata.csv | sed 's/,/|/g'`。
+
```bash
# Prints out first 10 lines
head filename.csv
@@ -52,63 +50,61 @@ head filename.csv
head -n 3 filename.csv
```
- * 实用选项:
-
- * `head -n` 打印特定行数
- * `head -c` 打印具体的字节数
-
+实用选项:
+* `head -n` 打印特定行数
+* `head -c` 打印特定字节数
### TR
-Tr 类似于翻译。这个功能强大的实用程序是基本文件清理的主力。理想的用例是交换文件中的分隔符。
+`tr` 类似于翻译。这个功能强大的实用程序是文件基础清理的主力。理想的用例是替换文件中的分隔符。
+
```bash
# Converting a tab delimited file into commas
cat tab_delimited.txt | tr "\t" "," comma_delimited.csv
```
-`tr` 另一个功能是在你支配中的内建 `[:class:]` 变量(POSIX 字符类)。这些包括了:
+`tr` 另一个功能是你可以用内建 `[:class:]` 变量(POSIX 字符类)发挥威力。这些包括了:
-```
-[:alnum:] all letters and digits
-[:alpha:] all letters
-[:blank:] all horizontal whitespace
-[:cntrl:] all control characters
-[:digit:] all digits
-[:graph:] all printable characters, not including space
-[:lower:] all lower case letters
-[:print:] all printable characters, including space
-[:punct:] all punctuation characters
-[:space:] all horizontal or vertical whitespace
-[:upper:] all upper case letters
-[:xdigit:] all hexadecimal digits
-```
+- `[:alnum:]` 所有字母和数字
+- `[:alpha:]` 所有字母
+- `[:blank:]` 所有水平空白
+- `[:cntrl:]` 所有控制字符
+- `[:digit:]` 所有数字
+- `[:graph:]` 所有可打印字符,但不包括空格
+- `[:lower:]` 所有小写字母
+- `[:print:]` 所有可打印字符,包括空格
+- `[:punct:]` 所有标点符号
+- `[:space:]` 所有水平或垂直空白
+- `[:upper:]` 所有大写字母
+- `[:xdigit:]` 所有 16 进制数字
+
+你可以将这些连接在一起以组成强大的程序。以下是一个基本的字数统计程序,可用于检查 README 是否被滥用。
-你可以将这些连接在一起以组成强大的程序。以下是一个基本的字数统计程序,可用于检查自述文件是否过度使用。
```
cat README.md | tr "[:punct:][:space:]" "\n" | tr "[:upper:]" "[:lower:]" | grep . | sort | uniq -c | sort -nr
```
另一个使用基本正则表达式的例子:
+
```
# Converting all upper case letters to lower case
cat filename.csv | tr '[A-Z]' '[a-z]'
```
- * 实用选项:
-
- * `tr -d` 删除字符
- * `tr -s` 压缩字符
- * `\b` 退格
- * `\f` 换页
- * `\v` 垂直制表符
- * `\NNN` 八进制字符
-
+实用选项:
+* `tr -d` 删除字符
+* `tr -s` 压缩字符
+* `\b` 退格
+* `\f` 换页
+* `\v` 垂直制表符
+* `\NNN` 八进制字符
### WC
-单词数量。它的值主要来自 `-l` 标志,它会给你提供行数。
+单词计数。它的价值主要来自其 `-l` 选项,它会给你提供行数。
+
```
# Will return number of lines in CSV
wc -l gigantic_comma.csv
@@ -116,18 +112,17 @@ wc -l gigantic_comma.csv
这个工具可以方便地确认各种命令的输出。所以,如果我们在转换文件中的分隔符之后运行 `wc -l`,我们会期待总行数是一样的,如果不一致,我们就知道有地方出错了。
- * 实用选项:
-
- * `wc -c` 打印字节数
- * `wc -m` 打印字符数
- * `wc -L` 打印最长行的长度
- * `wc -w` 打印单词数量
-
+实用选项:
+* `wc -c` 打印字节数
+* `wc -m` 打印字符数
+* `wc -L` 打印最长行的长度
+* `wc -w` 打印单词数量
### SPLIT
-文件大小的范围可以很广。取决于任务,拆分文件可以是有益的,所以使用 `split` 吧。split的基本语法是:
+文件大小的范围可以很广。对于有的任务,拆分文件或许是有好处的,所以使用 `split` 吧。`split` 的基本语法是:
+
```bash
# We will split our CSV into new_filename every 500 lines
split -l 500 filename.csv new_filename_
@@ -138,7 +133,8 @@ split -l 500 filename.csv new_filename_
# new_filename_aa
```
-两个奇怪的地方是命名约定和缺少文件扩展名。后缀约定可以通过 `-d` 标志变为数字。要添加文件扩展名,你需要运行以下 `find` 命令。它将通过附加 `.csv`更改当前目录中所有文件的名称,所以小心了。
+它有两个奇怪的地方是命名约定和缺少文件扩展名。后缀约定可以通过 `-d` 标志变为数字。要添加文件扩展名,你需要运行以下 `find` 命令。它将通过附加 `.csv` 扩展名来更改当前目录中所有文件的名称,所以小心了。
+
```bash
find . -type f -exec mv '{}' '{}'.csv \;
# ls output
@@ -148,19 +144,18 @@ find . -type f -exec mv '{}' '{}'.csv \;
# new_filename_aac.csv
```
- * 实用选项:
-
- * `split -b` 按特定字节大小分割
- * `split -a` 生成长度为 N 的后缀
- * `split -x` 使用十六进制后缀分割
-
+实用选项:
+* `split -b N` 按特定字节大小分割
+* `split -a N` 生成长度为 N 的后缀
+* `split -x` 使用十六进制后缀
### SORT & UNIQ
-以上两个命令很明显:他们的作用就是字面意思。这两者结合起来可以提供最强大的冲击 (i.e. 单独单词数量)。这是由于 `uniq` 只作用于重复的相邻行。这也是在输出前 `sort` 的原因。一个有趣的纪录是 `sort -u` 会达到和典型的 `sort file.txt | uniq` 模式一样的结果。
+上面两个命令很明显:它们的作用就是字面意思。这两者结合起来可以提供最强大的冲击 (例如,唯一单词的数量)。这是由于 `uniq` 只作用于重复的相邻行。这也是在输出前进行 `sort` 的原因。一个有趣的事情是 `sort -u` 会达到和典型的 `sort file.txt | uniq` 模式一样的结果。
+
+`sort` 对数据科学家来说确实具有潜在的有用能力:能够根据特定列对整个 CSV 进行排序。
-Sort 对数据科学家来说确实具有潜在的有用能力:能够根据特定列对整个 CSV 进行排序。
```bash
# Sorting a CSV file by the second column alphabetically
sort -t"," -k2,2 filename.csv
@@ -172,37 +167,39 @@ sort -t"," -k2n,2 filename.csv
sort -t"," -k2nr,2 filename.csv
```
-这里的 `-t` 选项将逗号指定为分隔符。通常假设分隔符是空格或制表符。此外,`-k` 标志是为了确定我们的 key。这里的语法是 `-km,n`,`m` 作为开始列,`n` 作为结束列。
-
- * 实用选项:
-
- * `sort -f` 忽略大小写
- * `sort -r` 反向排序
- * `sort -R` 乱序
- * `uniq -c` 统计出现次数
- * `uniq -d` 只打印重复行
+这里的 `-t` 选项将逗号指定为分隔符,通常假设分隔符是空格或制表符。此外,`-k` 选项是为了确定我们的键。这里的语法是 `-km,n`,`m` 作为开始列,`n` 作为结束列。
+实用选项:
+* `sort -f` 忽略大小写
+* `sort -r` 反向排序
+* `sort -R` 乱序
+* `uniq -c` 统计出现次数
+* `uniq -d` 只打印重复行
### CUT
-Cut 用于删除列。为了演示,如果我们只想删除第一和第三列。
+`cut` 用于删除列。作为演示,如果我们只想删除第一和第三列。
+
```bash
cut -d, -f 1,3 filename.csv
```
-选择除了第一行外的所有行。
+要选择除了第一行外的所有行。
+
```bash
cut -d, -f 2- filename.csv
```
-结合其他命令,将`cut` 用作过滤器。
+结合其他命令,将 `cut` 用作过滤器。
+
```bash
# Print first 10 lines of column 1 and 3, where "some_string_value" is present
head filename.csv | grep "some_string_value" | cut -d, -f 1,3
```
查出第二列中唯一值的数量。
+
```bash
cat filename.csv | cut -d, -f 2 | sort | uniq | wc -l
@@ -212,7 +209,8 @@ cat filename.csv | cut -d, -f 2 | sort | uniq -c | head
### PASTE
-Paste 是一个带有趣味性功能的粘贴命令。如果你有两个需要合并的文件,并且它们已经排序了,`paste` 帮你解决了接下来的步骤。
+`paste` 是一个带有趣味性功能的特定命令。如果你有两个需要合并的文件,并且它们已经排序好了,`paste` 帮你解决了接下来的步骤。
+
```bash
# names.txt
adam
@@ -233,37 +231,38 @@ john,youtuber
zach,developer
```
-查看更多 SQL_-esque 变种,见下文。
+更多 SQL 式变种,见下文。
### JOIN
-Join 是一个简单准切向的 SQL。最大的区别是 `join` 将返回所有列以及只能在一个字段上匹配。默认情况下,`join` 将尝试使用第一列作为匹配键。为了获得不同结果,必须使用以下语法:
+`join` 是一个简单的、准切向的 SQL。最大的区别是 `join` 将返回所有列以及只能在一个字段上匹配。默认情况下,`join` 将尝试使用第一列作为匹配键。为了获得不同结果,必须使用以下语法:
+
```bash
# Join the first file (-1) by the second column
# and the second file (-2) by the first
join -t "," -1 2 -2 1 first_file.txt second_file.txt
```
-标准的 join 是内连接。然而,外连接通过 `-a` 标志也是可行的。另一个值得一提的技巧是 `-q` 标志,如果发现有缺失的字段,可用于替换值。
+标准的 `join` 是内连接。然而,外连接通过 `-a` 选项也是可行的。另一个值得一提的技巧是 `-q` 标志,如果发现有缺失的字段,可用于替换值。
+
```bash
# Outer join, replace blanks with NULL in columns 1 and 2
# -o which fields to substitute - 0 is key, 1.1 is first column, etc...
join -t"," -1 2 -a 1 -a2 -e ' NULL' -o '0,1.1,2.2' first_file.txt second_file.txt
```
-不是最用户友好的命令,而是绝望时刻的绝望措施。
-
- * 实用选项:
-
- * `join -a` 打印不可配对的行
- * `join -e` 替换丢失的输入字段
- * `join -j` 相当于 `-1 FIELD -2 FIELD`
+它不是最用户友好的命令,而是绝望时刻的绝望措施。
+实用选项:
+* `join -a` 打印不可配对的行
+* `join -e` 替换丢失的输入字段
+* `join -j` 相当于 `-1 FIELD -2 FIELD`
### GREP
-用正则表达式全局搜索并且打印,或者 `grep`,可能是最有名的命令并且有充分的理由。Grep 很强大,特别适合在大型代码库中找到路径。在数据科学的王国里,它充当其他命令的提炼机制。虽然它的标准用途也很有价值。
+`grep` 即 用正则表达式全局搜索并且打印,可能是最有名的命令,并且名副其实。`grep` 很强大,特别适合在大型代码库中查找。在数据科学的王国里,它充当其他命令的提炼机制。虽然它的标准用途也很有价值。
+
```
# Recursively search and list all files in directory containing 'word'
@@ -276,6 +275,7 @@ grep -lr 'word' . | wc -l
```
计算包含单词或模式的总行数。
+
```
grep -c 'some_value' filename.csv
@@ -284,39 +284,40 @@ grep -c 'some_value' filename.csv
grep -c 'some_value' *
```
-使用 or 运算符 - `\|` 为多个值 Grep。
+对多个值使用“或”运算符: `\|`。
+
```
grep "first_value\|second_value" filename.csv
```
- * 实用选项:
-
- * `alias grep="grep --color=auto"` 使 grep 丰富多彩
- * `grep -E` 使用扩展的 regexp
- * `grep -w` 只匹配整个单词
- * `grep -l` 打印匹配的文件名
- * `grep -v` 倒置匹配
-
+实用选项:
+* `alias grep="grep --color=auto"` 使 grep 色彩丰富
+* `grep -E` 使用扩展正则表达式
+* `grep -w` 只匹配整个单词
+* `grep -l` 打印匹配的文件名
+* `grep -v` 非匹配
### 大人物们
-Sed 和 Awk 是本文中最强大的两个命令。为简介起见,我不打算详细讨论这两个命令。相反,我将介绍各种能证明其令人印象深刻的力量的命令。如果你想了解更多,[这儿就有一本书][5]是关于它们的。
+`sed` 和 `awk` 是本文中最强大的两个命令。为简洁起见,我不打算详细讨论这两个命令。相反,我将介绍各种能证明其令人印象深刻的力量的命令。如果你想了解更多,[这儿就有一本书][5]是关于它们的。
### SED
`sed` 本质上是一个流编辑器。它擅长替换,但也可以用于所有输出重构。
-最基本的 `sed` 命令由 `s/old/new/g` 组成。这转换为搜索旧值,全局替换为新值。 如果没有 `/g`,我们的命令将在旧值第一次出现后终止。
+最基本的 `sed` 命令由 `s/old/new/g` 组成。它的意思是搜索 `old`,全局替换为 `new`。 如果没有 `/g`,我们的命令将在 `old` 第一次出现后终止。
+
+为了快速了解它的功能,我们可以深入了解一个例子。 在以下情景中,你已有以下文件:
-为了快速了解它的功能,我们可以深入了解一个例子。 在以下情景中,你已获得以下文件:
```
balance,name
$1,000,john
$2,000,jack
```
-我们可能想要做的第一件事是删除美元符号。`-i` 标志表示原位。`''` 表示零长度文件扩展名,从而覆盖我们的初始文件。理想情况下,你可以单独测试每个,然后输出到新文件。
+我们可能想要做的第一件事是删除美元符号。`-i` 标志表示原位。`''` 表示零长度文件扩展名,从而覆盖我们的初始文件。理想情况下,你可以单独测试,然后输出到新文件。
+
```
sed -i '' 's/\$//g' data.txt
# balance,name
@@ -324,7 +325,8 @@ sed -i '' 's/\$//g' data.txt
# 2,000,jack
```
-接下来, `blance` 列的逗号。
+接下来,去除 `blance` 列的逗号。
+
```
sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt
# balance,name
@@ -332,7 +334,8 @@ sed -i '' 's/\([0-9]\),\([0-9]\)/\1\2/g' data.txt
# 2000,jack
```
-最后杰克有一天决定退出。所以,再见了,我的朋友。
+最后 jack 有一天决定辞职。所以,再见了,我的朋友。
+
```
sed -i '' '/jack/d' data.txt
# balance,name
@@ -343,33 +346,35 @@ sed -i '' '/jack/d' data.txt
### AWK
-最好的留在最后。Awk 不仅仅是一个简单的命令:它是一个成熟的语言。在本文中涉及的所有内容中,`awk` 是目前为止最酷的。如果你发现自己对其印象深刻,这里有很多很棒的资源 - 看 [这里][6], [这里][7] 和 [这里][8]。
+最好的留在最后。`awk` 不仅仅是一个简单的命令:它是一个成熟的语言。在本文中涉及的所有内容中,`awk` 是目前为止最酷的。如果你感兴趣,这里有很多很棒的资源 —— 看 [这里][6]、[这里][7] 和 [这里][8]。
`awk` 的常见用例包括:
- * 文字处理
- * 格式化文本报告
- * 执行算术运算
- * 执行字符串操作
+* 文字处理
+* 格式化文本报告
+* 执行算术运算
+* 执行字符串操作
+`awk` 可以以最原生的形式并行 `grep`。
-
-Awk 可以以最原生的形式并行 `grep`。
```
awk '/word/' filename.csv
```
-或者更加神奇:将 `grep` 和 `cut` 组合起来。在这里,`awk` 打印第三和第四列,用 tab 分隔,对于所有带我们指定单词的行。`-F,` 只是改变我们的分隔符为逗号。
+或者更加神奇:将 `grep` 和 `cut` 组合起来。在这里,对于所有带我们指定单词 `word` 的行,`awk` 打印第三和第四列,用 `tab` 分隔。`-F,` 用于指定切分时的列分隔符为逗号。
+
```bash
awk -F, '/word/ { print $3 "\t" $4 }' filename.csv
```
-Awk 内置了许多精巧的变量。比如,`NF` \- 字段数 - 和 `NR` \- 记录数。要获取文件中的第53条记录:
+`awk` 内置了许多精巧的变量。比如,`NF` —— 字段数,和 `NR` —— 记录数。要获取文件中的第 53 条记录:
+
```bash
awk -F, 'NR == 53' filename.csv
```
-增加的代码是基于一个或多个值进行过滤的能力。下面的第一个示例将打印第一列等于给定字符串的记录的行号和列。
+更多的花招是其基于一个或多个值进行过滤的能力。下面的第一个示例将打印第一列等于给定字符串的行的行号和列。
+
```bash
awk -F, ' $1 == "string" { print NR, $0 } ' filename.csv
@@ -378,6 +383,7 @@ awk -F, ' $2 == 1000 { print NR, $0 } ' filename.csv
```
多个数值表达式:
+
```bash
# Print line number and columns where column three greater
# than 2005 and column five less than one thousand
@@ -386,16 +392,19 @@ awk -F, ' $3 >= 2005 && $5 <= 1000 { print NR, $0 } ' filename.csv
```
求出第三列的总和:
+
```bash
awk -F, '{ x+=$3 } END { print x }' filename.csv
```
-在第一列等于 “something”的那些行,求出第三列值的总和。
+在第一列等于 `something` 的那些行,求出第三列值的总和。
+
```bash
awk -F, '$1 == "something" { x+=$3 } END { print x }' filename.csv
```
-获取文件的尺寸:
+获取文件的行列数:
+
```bash
awk -F, 'END { print NF, NR }' filename.csv
@@ -404,11 +413,13 @@ awk -F, 'BEGIN { print "COLUMNS", "ROWS" }; END { print NF, NR }' filename.csv
```
打印出现了两次的行:
+
```bash
awk -F, '++seen[$0] == 2' filename.csv
```
删除重复的行:
+
```bash
# Consecutive lines
awk 'a !~ $0; {a=$0}']
@@ -421,16 +432,19 @@ awk '!($0 in a) {a[$0];print}
```
使用内置函数 `gsub()` 替换多个值。
+
```bash
awk '{gsub(/scarlet|ruby|puce/, "red"); print}'
```
这个 `awk` 命令将组合多个 CSV 文件,忽略标题,然后在最后附加它。
+
```bash
awk 'FNR==1 && NR!=1{next;}{print}' *.csv > final_file.csv
```
-需要缩小一个庞大的文件? `awk` 可以在 `sed` 的帮助下处理它。具体来说,该命令根据行数将一个大文件分成多个较小的文件。这个 one-liner 也将增加一个扩展。
+需要缩小一个庞大的文件? `awk` 可以在 `sed` 的帮助下处理它。具体来说,该命令根据行数将一个大文件分成多个较小的文件。这个一行脚本将增加一个扩展名。
+
```bash
sed '1d;$d' filename.csv | awk 'NR%NUMBER_OF_LINES==1{x="filename-"++i".csv";}{print > x}'
@@ -440,7 +454,7 @@ sed '1d;$d' big_data.csv | awk 'NR%100000==1{x="data_"++i".csv";}{print > x}'
### 结语
-命令行拥有无穷无尽的力量。本文中介绍的命令足以将你从一无所知提升到英雄人物。除了涵盖的内容之外,还有许多实用程序需要考虑用于日常数据操作。[Csvkit][9], [xsv][10] 还有 [q][11] 是需要记住的三个。如果你希望更深入地了解命令行数据科学,查看[这本书][12]。它也可以[免费][13]在线获得!
+命令行拥有无穷无尽的力量。本文中介绍的命令足以将你从一无所知提升到英雄人物。除了涵盖的内容之外,还有许多实用程序可以考虑用于日常数据操作。[Csvkit][9]、[xsv][10] 还有 [q][11] 是需要记住的三个。如果你希望更深入地了解命令行数据科学,查看[这本书][12]。它也可以[免费][13]在线获得!
--------------------------------------------------------------------------------
@@ -449,7 +463,7 @@ via: http://kadekillary.work/post/cli-4-ds/
作者:[Kade Killary][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[GraveAccent](https://github.com/graveaccent)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From f2ad49f85dc80284746c8fe2489e8b33a3cf55d7 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 22:12:43 +0800
Subject: [PATCH 091/119] PUB:20180422 Command Line Tricks For Data Scientists
- kade killary.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@GraveAccent 翻译的不错 https://linux.cn/article-10342-1.html
---
...0422 Command Line Tricks For Data Scientists - kade killary.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180422 Command Line Tricks For Data Scientists - kade killary.md (100%)
diff --git a/translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md b/published/20180422 Command Line Tricks For Data Scientists - kade killary.md
similarity index 100%
rename from translated/tech/20180422 Command Line Tricks For Data Scientists - kade killary.md
rename to published/20180422 Command Line Tricks For Data Scientists - kade killary.md
From 3e7ec97f2c434a2b52b04187dc5769bbbc4aa60d Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 22:43:57 +0800
Subject: [PATCH 092/119] PRF:20181119 7 command-line tools for writers -
Opensource.com.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@LazyWolfLin 恭喜你,完成了第一篇翻译!
---
...line tools for writers - Opensource.com.md | 26 ++++++++++---------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
index 2073fd9279..9d66c6a0fe 100644
--- a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
+++ b/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
@@ -1,11 +1,13 @@
-给写作者们的 7 个命令行工具 | Opensource.com
+给写作者们的 7 个命令行工具
======
-扔掉你的打字机,然后使用这些开源工具在命令行上写作吧。
+
+> 扔掉你的文字编辑器,然后使用这些开源工具在命令行上写作吧。
+

-对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文本编辑器上编辑文本。但是还有许多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。
+对于大多数人(尤其是非技术人员),写作意味着在 LibreOffice Writer 或者其他带图形界面的文字处理应用上编辑文本。但是还有许多可行的方法可以让任何人通过文本传递他们的信息,尤其是越来越多的作者选择[拥抱纯文本][1]。
-在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等——无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。
+在使用图形界面写作的世界同样有命令行工具的一席之地。这些命令行工具可以帮助他们进行写作,检查他们的拼写等等 —— 无论是在写一篇文章、博客或者故事;写一个 README 文件;或者准备一份技术文档的时候。
下面是一些在任何写作情况下都有用的命令行工具。
@@ -13,7 +15,7 @@
没错,你可以在命令行进行真正的写作。我知道一些写作者会使用 [Nano][2]、[Vim][3]、[Emacs][4]、以及 [Jove][5] 等编辑器在终端窗口中进行工作。而这些编辑器[并非屈指可数][6]。文本编辑器的优势在于它们简单易用以及更专注于文本。非常适合用于编辑任何文本的初稿甚至完成一个漫长而复杂的写作项目。
-如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下 [WordGrinder][7]。WordGrinder 是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown,ODT,LaTeX,或者 HTML 等格式导出。
+如果你想在命令行中获得更像文字编辑器的体验,不妨了解一下 [WordGrinder][7]。它是一款简单但拥有足够的编写和发布功能的文字编辑器。它支持基本的格式和样式,并且你可以将你的文字以 Markdown、ODT、LaTeX 或者 HTML 等格式导出。
### 拼写检查
@@ -23,21 +25,21 @@
另一个够老但仍然有用的代替品是 [Ispell][10]。虽然它比 Aspell 稍慢一点,但它们都以相同的方式工作。当你在你的文本文件上工作时,Ispell 将提供正确的建议。Ispell 同样也对英语以外的语言提供了良好的支持。
-### Prose linters
+### 文章 linter
-软件开发人员使用 [linters][11] 来检查他们的代码是否存在错误或者 bugs。同样也有用于检查文本样式或语法错误的 linters;而命令行会认为这些错误是样式元素。任何写作者都可以(也应该)使用它,一个 prose linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
+软件开发人员使用 [linter][11] 来检查他们的代码是否存在错误或者 bug。同样也有用于检查文本样式或语法错误的 linter;而该命令行工具会认为这些错误是样式元素。任何写作者都可以(也应该)使用它,一个文章 linter 对于要求文档风格和样式一致的文档团队项目而言尤其有用。
-[Proselint][12] 是一款全能的实时检查工具。它会找出行话,大话,不正确日期和时间格式,滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。
+[Proselint][12] 是一款全能的实时检查工具。它会找出行话、大话、不正确日期和时间格式、滥用的术语[等等][13]。它也很容易运行并忽略文本中的标记。
-[Alex][14] 是一个简单但有用的 prose linter。 对明文文本或者格式为 Markdown 或 HTML 的文档使用它。Alex 会对“性别偏好,极端主义,种族相关,宗教,或者文章中其他不平等的措辞”产生警告。如果你想要试试看 Alex,这里有一个在线 [demo][15]。
+[Alex][14] 是一个简单但有用的文章 linter。 对明文文本或者格式为 Markdown 或 HTML 的文档使用它。Alex 会对“性别偏好、极端主义、种族相关、宗教,或者文章中其他不平等的措辞”产生警告。如果你想要试试看 Alex,这里有一个在线 [demo][15]。
### 其他工具
有时候你找不到一个单词的恰当的同义词。但你不需要去呆板的词库中抓取或者去专门的网站完善你的单词完整。仅仅需要对你想要替换的单词运行 [Aiksaurus][16],然后它就会为你完成这个工作。但是,这个程序最大的缺点是它只支持英语。
-即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用 Markdown 格式的文件转换成其他格式。这就是 [Pandoc][18] 的用武之地。你可以用它来将你的文档转换成 HTML,Word,LibreOffice Writer,LaTeX,EPUB 以及其他格式。你甚至可以用 Pandoc 来生成书籍和[研究论文][19]。
+即使是只会很少(甚至只有一项)技术技能的写作者都能接受 [Markdown][17] 来快速而简单地格式化他们的作品。但是,有时候你也需要将使用 Markdown 格式的文件转换成其他格式。这就是 [Pandoc][18] 的用武之地。你可以用它来将你的文档转换成 HTML、Word、LibreOffice Writer、LaTeX、EPUB 以及其他格式。你甚至可以用 Pandoc 来生成书籍和[研究论文][19]。
-你有最喜欢的命令行写作工具吗?在 Opensource.com 社区发表评论分享它吧。
+你有最喜欢的命令行写作工具吗?在社区发表评论分享它吧。
--------------------------------------------------------------------------------
@@ -46,7 +48,7 @@ via: https://opensource.com/article/18/11/command-line-tools-writers
作者:[Scott Nesbitt][a]
选题:[lujun9972][b]
译者:[LazyWolfLin](https://github.com/LazyWolfLin)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 32d5ada6211bd3ee5b83694f373cd3afb3e63123 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 22:45:13 +0800
Subject: [PATCH 093/119] PUB:20181119 7 command-line tools for writers -
Opensource.com.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@LazyWolfLin 本文首发地址: https://linux.cn/article-10343-1.html
您的 LCTT 专页:https://linux.cn/lctt/LazyWolfLin
请注册领取 LCCN: https://lctt.linux.cn/
---
.../20181119 7 command-line tools for writers - Opensource.com.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20181119 7 command-line tools for writers - Opensource.com.md (100%)
diff --git a/translated/tech/20181119 7 command-line tools for writers - Opensource.com.md b/published/20181119 7 command-line tools for writers - Opensource.com.md
similarity index 100%
rename from translated/tech/20181119 7 command-line tools for writers - Opensource.com.md
rename to published/20181119 7 command-line tools for writers - Opensource.com.md
From 23a778d8f807667686a30f4e16a24ffc2a2aed55 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 23:48:09 +0800
Subject: [PATCH 094/119] PRF:20181121 Coupled commands with control operators
in Bash.md
@Jamskr
---
...commands with control operators in Bash.md | 21 ++++++++++---------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/translated/tech/20181121 Coupled commands with control operators in Bash.md b/translated/tech/20181121 Coupled commands with control operators in Bash.md
index f5f388e763..e5d4dcb2c0 100644
--- a/translated/tech/20181121 Coupled commands with control operators in Bash.md
+++ b/translated/tech/20181121 Coupled commands with control operators in Bash.md
@@ -1,10 +1,11 @@
Bash 中使用控制运算符连接命令
======
-在命令行中,使用控制运算符为复合命令添加逻辑。
+
+> 在命令行中,使用控制运算符为复合命令添加逻辑。

-一些简单的复合指令——比如说在一个命令行中连接几个命令——是经常使用的。这些命令使用分号分隔,表示一个命令结束。为了在一个命令行中创建一系列简单的 shell 命令,只需要使用分号把每一条命令分隔开,就像下面这样:
+经常会使用一些简单的复合指令,比如说在一个命令行中连接几个命令。这些命令使用分号分隔,表示一个命令结束。为了在一个命令行中创建一系列简单的 shell 命令,只需要使用分号把每一条命令分隔开,就像下面这样:
```
command1 ; command2 ; command3 ; command4 ;
@@ -12,7 +13,7 @@ command1 ; command2 ; command3 ; command4 ;
最后一个分号你可以不用添加,因为当你按下回车键时就表示一个命令的结束,但是为了和其它的保持一致,还是建议加上比较好。
-所有的命令执行都没有什么问题——只要没有什么意外发生。但是当出问题时到底发生了什么呢?我们可以预测,并且通过 Bash 中内置的 `&&` 和 `||` 运算符跟踪这些错误。这两个控制运算符提供了一些流控制,可以让我们改变代码执行队列的顺序。分号和 **换行符** 也被认为是 Bash 的控制运算符。
+所有的命令执行都没有什么问题 —— 只要没有什么意外发生。但是当出问题时到底发生了什么呢?我们可以预测,并且通过 Bash 中内置的 `&&` 和 `||` 运算符跟踪这些错误。这两个控制运算符提供了一些流控制,可以让我们改变代码执行队列的顺序。分号和换行符也被认为是 Bash 的控制运算符。
`&&` 运算符意义简单来说就是“如果 `command1` 执行成功,就接着执行 `command2`。”如果 `command1` 因为任何原因执行失败,那么 `command2` 将不执行。这个语法看下来像这样:
@@ -20,9 +21,9 @@ command1 ; command2 ; command3 ; command4 ;
command1 && command2
```
-这样写是允许的,因为每一个命令都会返回一个值给 shell 来表示这个命令在执行的过程中是否执行成功或者失败。通常,返回值是 0 表示成功,而一个正数值表示不同种类的错误。有一些系统管理工具仅仅返回一个 1 来表示所有的错误,但是也有很多工具使用其它的正数的返回值来表示各种类型错误。
+这样写是允许的,因为每一个命令都会返回一个值(RC)给 shell 来表示这个命令在执行的过程中是否执行成功或者失败。通常,返回值是 `0` 表示成功,而一个正数值表示不同种类的错误。有一些系统管理工具仅仅返回一个 `1` 来表示所有的错误,但是也有很多工具使用其它的正数的返回值来表示各种类型错误。
-我们可以很容易的使用脚本, 命令列表中的下一个命令,或者可以直接使用系统管理工具来检查 shell 变量 `$?` 。我们一起来看这些返回值。运行一个简单的命令然后立即检查它的返回值,这个返回值始终是属于最后一个运行的命令。
+我们可以很容易的使用脚本来检查 shell 变量 `$?`,可以通过命令列表中的下一个命令,或者可以直接使用系统管理工具检查。我们一起来看这些返回值。运行一个简单的命令然后立即检查它的返回值,这个返回值始终是属于最后一个运行的命令。
```
[student@studentvm1 ~]$ ll ; echo "RC = $?"
@@ -35,7 +36,7 @@ RC = 0
[student@studentvm1 ~]$
```
-这个返回值是 0,表示这个命令执行成功了。现在尝试使用同样的命令在一些我们没有权限的目录上。
+这个返回值是 `0`,表示这个命令执行成功了。现在尝试使用同样的命令在一些我们没有权限的目录上。
```
[student@studentvm1 ~]$ ll /root ; echo "RC = $?"
@@ -44,7 +45,7 @@ RC = 2
[student@studentvm1 ~]$
```
-这个返回值的含义可以在 [`ls` 命令的 man 页面][1] 中找到。
+这个返回值的含义可以在 [ls 命令的 man 页面][1] 中找到。
现在我们来试试 `&&` 这个控制运算符,因为它也可能会被用在一个命令行程序中。我们将从一个简单的示例开始:创建一个新目录,如果创建成功就在这个目录中创建一个文件。
@@ -54,7 +55,7 @@ RC = 2
[student@studentvm1 ~]$ cd ; mkdir testdir
```
-在 `~/testdir` 中新建一个目录,这也应该是一个空目录,因为是你刚刚创建的,然后创建一个新的,空文件在这个新目录中。下面的命令可以做这些事情。
+在 `~/testdir` 中新建一个目录,这也应该是一个空目录,因为是你刚刚创建的,然后创建一个新的空文件在这个新目录中。下面的命令可以做这些事情。
```
[student@studentvm1 ~]$ mkdir ~/testdir/testdir2 && touch ~/testdir/testdir2/testfile1
@@ -64,7 +65,7 @@ total 0
[student@studentvm1 ~]$
```
-我们看到一切都运行得很好,因为 `testdir` 目录是访问且可写的。然后我们改变 `testdir` 目录的权限,让用户 **student** 不再具有访问的权限。操作如下:
+我们看到一切都运行得很好,因为 `testdir` 目录是访问且可写的。然后我们改变 `testdir` 目录的权限,让用户 `student` 不再具有访问的权限。操作如下:
```
[student@studentvm1 ~]$ chmod 076 testdir ; ll | grep testdir
@@ -116,7 +117,7 @@ via: https://opensource.com/article/18/11/control-operators-bash-shell
作者:[David Both][a]
选题:[lujun9972][b]
译者:[Jamskr](https://github.com/Jamskr)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 6796eac9f56f49d511213fbeea8dd30696ec64b1 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 13 Dec 2018 23:48:28 +0800
Subject: [PATCH 095/119] PUB:20181121 Coupled commands with control operators
in Bash.md
@Jamskr https://linux.cn/article-10344-1.html
---
.../20181121 Coupled commands with control operators in Bash.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20181121 Coupled commands with control operators in Bash.md (100%)
diff --git a/translated/tech/20181121 Coupled commands with control operators in Bash.md b/published/20181121 Coupled commands with control operators in Bash.md
similarity index 100%
rename from translated/tech/20181121 Coupled commands with control operators in Bash.md
rename to published/20181121 Coupled commands with control operators in Bash.md
From 5f91ccd934028f7fb62854b6a3f7171e350783a1 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Fri, 14 Dec 2018 09:10:20 +0800
Subject: [PATCH 096/119] translated
---
...olor to your Linux terminal with lolcat.md | 60 -------------------
...olor to your Linux terminal with lolcat.md | 60 +++++++++++++++++++
2 files changed, 60 insertions(+), 60 deletions(-)
delete mode 100644 sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
create mode 100644 translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md
diff --git a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
deleted file mode 100644
index 3e070414ae..0000000000
--- a/sources/tech/20181205 Bring some color to your Linux terminal with lolcat.md
+++ /dev/null
@@ -1,60 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: reviewer: ( )
-[#]: publisher: ( )
-[#]: subject: (Bring some color to your Linux terminal with lolcat)
-[#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat)
-[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
-[#]: url: ( )
-
-Bring some color to your Linux terminal with lolcat
-======
-With this simple utility, you can add a rainbow of color to the output of any program you want.
-
-
-Today marks the fifth day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal.
-
-It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.
-
-Today's selection, **lolcat** , is the first utility I'm including that wasn't packaged for my Linux distribution, but it was still an easy install. It's a Ruby program that you ought to be able to easily add to your system with the following.
-
-```
-$ gem install lolcat
-```
-
-After that, simply pipe some text to it to see the output in the colors of the rainbow. For example, using a couple of utilities from earlier days in our advent calendar, try the following:
-
-```
-$ fortune | boxes -a c -d parchment | lolcat
-```
-
-Depending on what good fortune you have, you'll likely get something like this:
-
-
-There are a few parameters you can pass to **lolcat** , and rather than repeat them all here, I'd suggest you either visit the **lolcat** [GitHub page][1] or just see them at the terminal by typing **lolcat --help**. But generally, they're helpful to set the spread and frequency of your rainbow, and my personal favorite, enabling animation. Who doesn't like animated rainbow printing at the terminal? Let's try the above again, with a different box (cat-themed, of course) and a cat-appropriate fortune that was in my fortunes list, with the following.
-
-```
-fortune -m "nine tails" | boxes -a c -d cat | lolcat -a
-```
-
-**lolcat** is open source under a BSD license.
-
-Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.
-
-Check out yesterday's toy, [Have a cow at the Linux command line][2], and check back tomorrow for another!
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/12/linux-toy-lolcat
-
-作者:[Jason Baker][a]
-选题:[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/jason-baker
-[b]: https://github.com/lujun9972
-[1]: https://github.com/busyloop/lolcat
-[2]: https://opensource.com/article/18/12/linux-toy-cowsay
diff --git a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md
new file mode 100644
index 0000000000..eb23d85e36
--- /dev/null
+++ b/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md
@@ -0,0 +1,60 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Bring some color to your Linux terminal with lolcat)
+[#]: via: (https://opensource.com/article/18/12/linux-toy-lolcat)
+[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
+[#]: url: ( )
+
+使用 lolcat 为你的 Linux 终端带来一些颜色
+======
+使用这个简单的程序,你可以为所需的任何程序的输出添加彩色。
+
+
+今天是 Linux 命令行玩具日历的第五天。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏,或任何简单的可以帮助你在终端玩得开心的东西。
+
+很可能你们中的一些人之前已经看过我们日历中的各种选择,但我们希望每个人至少见到一件新事物。
+
+今日的选择,**lolcat**,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。
+
+```
+$ gem install lolcat
+```
+
+之后,只需将一些文本传送给它,就可以看到彩色的输出。例如,尝试几个之前在我们的日历中出现的程序,使用以下命令:
+
+```
+$ fortune | boxes -a c -d parchment | lolcat
+```
+
+根据你的运气,你可能会看到这样:
+
+
+你可以传递给 **lolcat** 一些参数而不必重复它们,我建议你访问 **lolcat** 的 [GitHub 页面][1] 或者在终端输入 **lolcat --help** 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画打印?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的句子列表中的适合猫的句子。
+
+```
+fortune -m "nine tails" | boxes -a c -d cat | lolcat -a
+```
+
+**lolcat** 是 BSD 许可下的开源软件。
+
+你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
+
+了解一下昨天的玩具,[在 Linux 命令行中拥有一头牛][2],还有记得明天再来!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-lolcat
+
+作者:[Jason Baker][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/jason-baker
+[b]: https://github.com/lujun9972
+[1]: https://github.com/busyloop/lolcat
+[2]: https://opensource.com/article/18/12/linux-toy-cowsay
\ No newline at end of file
From 9a64f2f248272e42575bf2bfea5e92617ac97731 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Fri, 14 Dec 2018 09:18:25 +0800
Subject: [PATCH 097/119] translating
---
...81205 How To Fix Broken Ubuntu OS Without Reinstalling It.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
index a00541b536..0d24e0d7c6 100644
--- a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
+++ b/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (How To Fix Broken Ubuntu OS Without Reinstalling It)
From 33ef858c9cc0afaa1d694b1848c2777e87d7f214 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 12:37:57 +0800
Subject: [PATCH 098/119] PRF:20180412 A new approach to security
instrumentation.md
@hopefully2333
---
...ew approach to security instrumentation.md | 26 +++++++++----------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/translated/talk/20180412 A new approach to security instrumentation.md b/translated/talk/20180412 A new approach to security instrumentation.md
index c177e8f5fe..1d11efb63f 100644
--- a/translated/talk/20180412 A new approach to security instrumentation.md
+++ b/translated/talk/20180412 A new approach to security instrumentation.md
@@ -1,11 +1,13 @@
-一种新的用于安全检测的方法
+一种新的安全检测的方法
======
+> 不要只测试已有系统,强安全要求更积极主动的策略。
+

我们当中有多少人曾说出过下面这句话:“我希望这能起到作用!”?
-毫无疑问,我们中的大多数人可能都不止一次地说过这句话。这句话不是用来激发信心的,相反它揭示了我们对自身能力和当前正在测试功能的怀疑。不幸的是,这句话非常好地描述了我们传统的安全模型。我们的运营基于这样的假设,并希望我们实施的控制措施——从 web 应用的漏扫到终端上的杀毒软件——防止恶意的病毒和软件进入我们的系统,损坏或偷取我们的信息。
+毫无疑问,我们中的大多数人可能都不止一次地说过这句话。这句话不是用来激发信心的,相反它揭示了我们对自身能力和当前正在测试的功能的怀疑。不幸的是,这句话非常好地描述了我们传统的安全模型。我们的运营基于这样的假设,并希望我们实施的控制措施 —— 从 web 应用的漏扫到终端上的杀毒软件 —— 防止恶意的病毒和软件进入我们的系统,损坏或偷取我们的信息。
渗透测试通过积极地尝试侵入网络、向 web 应用注入恶意代码或者通过发送钓鱼邮件来传播病毒等等这些步骤来避免我们对假设的依赖。由于我们在不同的安全层面上来发现和渗透漏洞,手动测试无法解决漏洞被主动打开的情况。在安全实验中,我们故意在受控的情形下创造混乱,模拟事故的情形,来客观地检测我们检测、阻止这类问题的能力。
@@ -13,15 +15,15 @@
在分布式系统的安全性和复杂性方面,需要反复地重申混沌工程界的一句名言,“希望不是一种有效的策略”。我们多久会主动测试一次我们设计或构建的系统,来确定我们是否已失去对它的控制?大多数组织都不会发现他们的安全控制措施失效了,直到安全事件的发生。我们相信“安全事件不是侦察措施”,而且“希望不要出事也不是一个有效的策略”应该是 IT 专业人士执行有效安全实践的口号。
-工业在传统上强调预防性的安全措施和纵深防御,但我们的任务是通过侦探实验来驱动对安全工具链新的知识和见解。因为过于专注于预防机制,我们很少尝试一次以上地或者年度性地手动测试要求的安全措施,来验证这些控件是否按设计的那样执行。
+行业在传统上强调预防性的安全措施和纵深防御,但我们的任务是通过侦探实验来驱动对安全工具链的新知识和见解。因为过于专注于预防机制,我们很少尝试一次以上地或者年度性地手动测试要求的安全措施,来验证这些控件是否按设计的那样执行。
-随着现代分布式系统中的无状态变量的不断改变,人们很难充分理解他们的系统的行为,因为会随时变化。解决这个问题的一种途径是通过强大的系统性的设备进行检测,对于安全性检测,你可以将这个问题分成两个主要方面,测试,和我们称之为实验的部分。测试是对我们已知部分的验证和评估,简单来说,就是我们在开始找之前,要先弄清楚我们在找什么。另一方面,实验是去寻找获得我们之前并不清楚的见解和知识。虽然测试对于一个成熟的安全团队来说是一项重要实践,但以下示例会有助于进一步地阐述两者之间的差异,并对实验的附加价值提供一个更为贴切的描述。
+随着现代分布式系统中的无状态变量的不断改变,人们很难充分理解他们的系统的行为,因为会随时变化。解决这个问题的一种途径是通过强大的系统性的设备进行检测,对于安全性检测,你可以将这个问题分成两个主要方面:**测试**,和我们称之为**实验**的部分。测试是对我们已知部分的验证和评估,简单来说,就是我们在开始找之前,要先弄清楚我们在找什么。另一方面,实验是去寻找获得我们之前并不清楚的见解和知识。虽然测试对于一个成熟的安全团队来说是一项重要实践,但以下示例会有助于进一步地阐述两者之间的差异,并对实验的附加价值提供一个更为贴切的描述。
### 示例场景:精酿啤酒
思考一个用于接收精酿啤酒订单的 web 服务或者 web 应用。
-这是这家精酿啤酒运输公司的一项重要服务,这些订单来自客户的移动设备,网页,和通过为这家公司精酿啤酒提供服务的餐厅的 API。这项重要服务运行在 AWS EC2 环境上,并且公司认为它是安全的。这家公司去年成功地通过了 PCI 规则,并且每年都会请第三方进行渗透测试,所以公司认为这个系统是安全的。
+这是这家精酿啤酒运输公司的一项重要服务,这些订单来自客户的移动设备、网页,和通过为这家公司精酿啤酒提供服务的餐厅的 API。这项重要服务运行在 AWS EC2 环境上,并且公司认为它是安全的。这家公司去年成功地通过了 PCI 规则,并且每年都会请第三方进行渗透测试,所以公司认为这个系统是安全的。
这家公司有时一天两次部署来进行 DevOps 和持续交付工作,公司为其感到自豪。
@@ -35,10 +37,8 @@
* 该配置会从已选择的目标中随机指定对象,同时端口的范围和数量也会被改变。
* 团队还会设置进行实验的时间并缩小爆破攻击的范围,来确保对业务的影响最小。
* 对于第一次测试,团队选择在他们的测试环境中运行实验并运行一个单独的测试。
- * 在真实的游戏日风格里,团队在预先计划好的两个小时的窗口期内,选择灾难大师来运行实验。在那段窗口期内,灾难大师会在 EC2 实例安全组中的一个上执行这次实验。
- * 一旦游戏日结束,团队就会开始进行一个彻底的、无可指责的事后练习。它的重点在于针对稳定状态和原始假设的实验结果。问题会类似于下面这些:
-
-
+ * 在真实的游戏日风格里,团队在预先计划好的两个小时的窗口期内,选择灾难大师来运行实验。在那段窗口期内,灾难大师会在 EC2 实例安全组中的一个实例上执行这次实验。
+ * 一旦游戏日结束,团队就会开始进行一个彻底的、免于指责的事后练习。它的重点在于针对稳定状态和原始假设的实验结果。问题会类似于下面这些:
### 事后验证问题
@@ -53,24 +53,22 @@
* 获得警报的 SOC 分析师是否能对警报采取措施,还是缺少必要的信息?
* 如果 SOC 确定警报是真实的,那么安全事件响应是否能简单地从数据中进行分类活动?
-
-
我们系统中对失败的承认和预期已经开始揭示我们对系统工作的假设。我们的使命是利用我们所学到的,并更加广泛地应用它。以此来真正主动地解决安全问题,来超越当前传统主流的被动处理问题的安全模型。
随着我们继续在这个新领域内进行探索,我们一定会发布我们的研究成果。如果您有兴趣想了解更多有关研究的信息或是想参与进来,请随时联系 Aaron Rinehart 或者 Grayson Brewer。
特别感谢 Samuel Roden 对本文提供的见解和想法。
-**[看我们相关的文章,是否需要 DevSecOps 这个词?][3]]**
+- [看我们相关的文章:是否需要 DevSecOps 这个词?][3]
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/4/new-approach-security-instrumentation
作者:[Aaron Rinehart][a]
-译者:[hopefully2333](https://github.com/hopefully2333)
-校对:[校对者ID](https://github.com/校对者ID)
选题:[lujun9972](https://github.com/lujun9972)
+译者:[hopefully2333](https://github.com/hopefully2333)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 7c5916acf360265c794986ab1717a112afa72927 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 12:38:18 +0800
Subject: [PATCH 099/119] PUB:20180412 A new approach to security
instrumentation.md
@hopefully2333 https://linux.cn/article-10345-1.html
---
.../20180412 A new approach to security instrumentation.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/talk => published}/20180412 A new approach to security instrumentation.md (100%)
diff --git a/translated/talk/20180412 A new approach to security instrumentation.md b/published/20180412 A new approach to security instrumentation.md
similarity index 100%
rename from translated/talk/20180412 A new approach to security instrumentation.md
rename to published/20180412 A new approach to security instrumentation.md
From 16e2c4165820d030e759b31a99bd6d0d3c88d1ea Mon Sep 17 00:00:00 2001
From: darksun
Date: Fri, 14 Dec 2018 12:58:38 +0800
Subject: [PATCH 100/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Build?=
=?UTF-8?q?=20a=20Netboot=20Server,=20Part=202?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...2 How to Build a Netboot Server, Part 2.md | 454 ++++++++++++++++++
1 file changed, 454 insertions(+)
create mode 100644 sources/tech/20181212 How to Build a Netboot Server, Part 2.md
diff --git a/sources/tech/20181212 How to Build a Netboot Server, Part 2.md b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md
new file mode 100644
index 0000000000..0301a34da5
--- /dev/null
+++ b/sources/tech/20181212 How to Build a Netboot Server, Part 2.md
@@ -0,0 +1,454 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (How to Build a Netboot Server, Part 2)
+[#]: via: (https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/)
+[#]: author: (Gregory Bartholomew https://fedoramagazine.org/author/glb/)
+
+How to Build a Netboot Server, Part 2
+======
+
+
+
+The article [How to Build a Netboot Server, Part 1][1] showed you how to create a netboot image with a “liveuser” account whose home directory lives in volatile memory. Most users probably want to preserve files and settings across reboots, though. So this second part of the netboot series shows how to reconfigure the netboot image from part one so that [Active Directory][2] user accounts can log in and their home directories can be automatically mounted from a NFS server.
+
+Part 3 of this series will show how to make an interactive and centrally-configurable iPXE boot menu for the netboot clients.
+
+### Setup NFS4 Home Directories with KRB5 Authentication
+
+Follow the directions from the previous post “[Share NFS Home Directories Securely with Kerberos][3],” then return here.
+
+### Remove the Liveuser Account
+
+Remove the “liveuser” account created in part one of this series:
+
+```
+$ sudo -i
+# sed -i '/automaticlogin/Id' /fc28/etc/gdm/custom.conf
+# rm -f /fc28/etc/sudoers.d/liveuser
+# for i in passwd shadow group gshadow; do sed -i '/^liveuser:/d' /fc28/etc/$i; done
+```
+
+### Configure NTP, KRB5 and SSSD
+
+Next, we will need to duplicate the NTP, KRB5, and SSSD configuration that we set up on the server in the client image so that the same accounts will be available:
+
+```
+# MY_HOSTNAME=$(> /fc28/etc/$i; done
+```
+
+### Join Active Directory
+
+Next, you’ll perform a chroot to join the client image to Active Directory. Begin by deleting any pre-existing computer account with the same name your netboot image will use:
+
+```
+# MY_USERNAME=jsmith
+# MY_CLIENT_HOSTNAME=$( /fc28/root/.bash_history
+```
+
+### Install and Configure PAM Mount
+
+We want our clients to automatically mount the user’s home directory when they log in. To accomplish this, we’ll use the “pam_mount” module. Install and configure pam_mount:
+
+```
+# dnf install -y --installroot=/fc28 pam_mount
+# cat << END > /fc28/etc/security/pam_mount.conf.xml
+
+
+
+
+
+
+Password:
+
+END
+```
+
+Reconfigure PAM to use pam_mount:
+
+```
+# dnf install -y patch
+# cp -r /fc28/usr/share/authselect/default/sssd /fc28/etc/authselect/custom
+# echo 'initgroups: files' >> /fc28/etc/authselect/custom/sssd/nsswitch.conf
+# patch /fc28/etc/authselect/custom/sssd/system-auth << END
+@@ -12 +12,2 @@
+-auth sufficient pam_sss.so forward_pass
++auth requisite pam_mount.so {include if "with-pammount"}
++auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass}
+@@ -35,2 +36,3 @@
+ session required pam_unix.so
++session optional pam_mount.so {include if "with-pammount"}
+ session optional pam_sss.so
+END
+# patch /fc28/etc/authselect/custom/sssd/password-auth << END
+@@ -9 +9,2 @@
+-auth sufficient pam_sss.so forward_pass
++auth requisite pam_mount.so {include if "with-pammount"}
++auth sufficient pam_sss.so {if "with-pammount":use_first_pass|forward_pass}
+@@ -32,2 +33,3 @@
+ session required pam_unix.so
++session optional pam_mount.so {include if "with-pammount"}
+ session optional pam_sss.so
+END
+# chroot /fc28 authselect select custom/sssd with-pammount --force
+```
+
+Also ensure the NFS server’s hostname is always resolvable from the client:
+
+```
+# MY_IP=$(host -t A $MY_HOSTNAME | awk '{print $4}')
+# echo "$MY_IP $MY_HOSTNAME ${MY_HOSTNAME%%.*}" >> /fc28/etc/hosts
+```
+
+Optionally, allow all users to run sudo:
+
+```
+# echo '%users ALL=(ALL) NOPASSWD: ALL' > /fc28/etc/sudoers.d/users
+```
+
+### Convert the NFS Root to an iSCSI Backing-Store
+
+Current versions of nfs-utils may have difficulty establishing a second connection from the client back to the NFS server for home directories when an nfsroot connection is already established. The client hangs when attempting to access the home directory. So, we will work around the problem by using a different protocol (iSCSI) for sharing our netboot image.
+
+First chroot into the image to reconfigure its initramfs for booting from an iSCSI root:
+
+```
+# for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc28/$i; done
+# chroot /fc28 /usr/bin/bash --login
+# dnf install -y iscsi-initiator-utils
+# sed -i 's/nfs/iscsi/' /etc/dracut.conf.d/netboot.conf
+# echo 'omit_drivers+=" qedi "' > /etc/dracut.conf.d/omit-qedi.conf
+# echo 'blacklist qedi' > /etc/modprobe.d/blacklist-qedi.conf
+# KERNEL=$(ls -c /lib/modules | head -n 1)
+# INITRD=$(find /boot -name 'init*' | grep -m 1 $KERNEL)
+# dracut -f $INITRD $KERNEL
+# logout
+# for i in run sys proc dev/shm dev/pts dev; do umount /fc28/$i; done
+# > /fc28/root/.bash_history
+```
+
+The qedi driver broke iscsi during testing, so it’s been disabled here.
+
+Next, create a fc28.img [sparse file][4]. This file serves as the iSCSI target’s backing store:
+
+```
+# FC28_SIZE=$(du -ms /fc28 | cut -f 1)
+# dd if=/dev/zero of=/fc28.img bs=1MiB count=0 seek=$(($FC28_SIZE*2))
+```
+
+(If you have one available, a separate partition or disk drive can be used instead of creating a file.)
+
+Next, format the image with a filesystem, mount it, and copy the netboot image into it:
+
+```
+# mkfs -t xfs -L NETROOT /fc28.img
+# TEMP_MNT=$(mktemp -d)
+# mount /fc28.img $TEMP_MNT
+# cp -a /fc28/* $TEMP_MNT
+# umount $TEMP_MNT
+```
+
+During testing using SquashFS, the client would occasionally stutter. It seems that SquashFS does not perform well when doing random I/O from a multiprocessor client. (See also [The curious case of stalled squashfs reads][5].) If you want to improve throughput performance with filesystem compression, [ZFS][6] is probably a better option.
+
+If you need extremely high throughput from the iSCSI server (say, for hundreds of clients), it might be possible to [load balance][7] a [Ceph][8] cluster. For more information, see [Load Balancing Ceph Object Gateway Servers with HAProxy and Keepalived][9].
+
+### Install and Configure iSCSI
+
+Install the scsi-target-utils package which will provide the iSCSI daemon for serving our image out to our clients:
+
+```
+# dnf install -y scsi-target-utils
+```
+
+Configure the iSCSI daemon to serve the fc28.img file:
+
+```
+# MY_REVERSE_HOSTNAME=$(echo $MY_HOSTNAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_HOSTNAME})
+# cat << END > /etc/tgt/conf.d/fc28.conf
+
+ backing-store /fc28.img
+ readonly 1
+
+END
+```
+
+The leading iqn. is expected by /usr/lib/dracut/modules.d/40network/net-lib.sh.
+
+Add an exception to the firewall and enable and start the service:
+
+```
+# firewall-cmd --add-service=iscsi-target
+# firewall-cmd --runtime-to-permanent
+# systemctl enable tgtd.service
+# systemctl start tgtd.service
+```
+
+You should now be able to see the image being shared with the tgtadm command:
+
+```
+# tgtadm --mode target --op show
+```
+
+The above command should output something similar to the following:
+
+```
+Target 1: iqn.edu.example.server-01:fc28
+ System information:
+ Driver: iscsi
+ State: ready
+ I_T nexus information:
+ LUN information:
+ LUN: 0
+ Type: controller
+ SCSI ID: IET 00010000
+ SCSI SN: beaf10
+ Size: 0 MB, Block size: 1
+ Online: Yes
+ Removable media: No
+ Prevent removal: No
+ Readonly: No
+ SWP: No
+ Thin-provisioning: No
+ Backing store type: null
+ Backing store path: None
+ Backing store flags:
+ LUN: 1
+ Type: disk
+ SCSI ID: IET 00010001
+ SCSI SN: beaf11
+ Size: 10488 MB, Block size: 512
+ Online: Yes
+ Removable media: No
+ Prevent removal: No
+ Readonly: Yes
+ SWP: No
+ Thin-provisioning: No
+ Backing store type: rdwr
+ Backing store path: /fc28.img
+ Backing store flags:
+ Account information:
+ ACL information:
+ ALL
+```
+
+We can now remove the NFS share that we created in part one of this series:
+
+```
+# rm -f /etc/exports.d/fc28.exports
+# exportfs -rv
+# umount /export/fc28
+# rmdir /export/fc28
+# sed -i '/^\/fc28 /d' /etc/fstab
+```
+
+You can also delete the /fc28 filesystem, but you may want to keep it for performing future updates.
+
+### Update the ESP to use the iSCSI Kernel
+
+Ipdate the ESP to contain the iSCSI-enabled initramfs:
+
+```
+$ rm -vf $HOME/esp/linux/*.fc28.*
+$ MY_KRNL=$(ls -c /fc28/lib/modules | head -n 1)
+$ cp $(find /fc28/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $HOME/esp/linux/vmlinuz-$MY_KRNL
+$ cp $(find /fc28/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img
+```
+
+Update the boot.cfg file to pass the new root and netroot parameters:
+
+```
+$ MY_NAME=server-01.example.edu
+$ MY_EMAN=$(echo $MY_NAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_NAME})
+$ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}')
+$ sed -i "s! root=[^ ]*! root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc28-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc28!" $HOME/esp/linux/boot.cfg
+```
+
+Now you just need to copy the updated files from your $HOME/esp/linux directory out to the ESPs of all your client systems. You should see results similar to what is shown in the below screenshot:
+
+![][10]
+
+### Upgrading the Image
+
+First, make a copy of the current image:
+
+```
+# cp -a /fc28 /fc29
+```
+
+Chroot into the new copy of the image:
+
+```
+# for i in dev dev/pts dev/shm proc sys run; do mount -o bind /$i /fc29/$i; done
+# chroot /fc29 /usr/bin/bash --login
+```
+
+Allow updating the kernel:
+
+```
+# sed -i 's/^exclude=kernel-\*$/#exclude=kernel-*/' /etc/dnf/dnf.conf
+```
+
+Perform the upgrade:
+
+```
+# dnf distro-sync -y --releasever=29
+```
+
+Prevent the kernel from being updated:
+
+```
+# sed -i 's/^#exclude=kernel-\*$/exclude=kernel-*/' /etc/dnf/dnf.conf
+```
+
+The above command is optional, but saves you from having to copy a new kernel out to the clients if you add or update a few packages in the image at some future time.
+
+Clean up dnf’s package cache:
+
+```
+# dnf clean all
+```
+
+Exit the chroot and clear root’s command history:
+
+```
+# logout
+# for i in run sys proc dev/shm dev/pts dev; do umount /fc29/$i; done
+# > /fc29/root/.bash_history
+```
+
+Create the iSCSI image:
+
+```
+# FC29_SIZE=$(du -ms /fc29 | cut -f 1)
+# dd if=/dev/zero of=/fc29.img bs=1MiB count=0 seek=$(($FC29_SIZE*2))
+# mkfs -t xfs -L NETROOT /fc29.img
+# TEMP_MNT=$(mktemp -d)
+# mount /fc29.img $TEMP_MNT
+# cp -a /fc29/* $TEMP_MNT
+# umount $TEMP_MNT
+```
+
+Define a new iSCSI target that points to our new image and export it:
+
+```
+# MY_HOSTNAME=$( /etc/tgt/conf.d/fc29.conf
+
+ backing-store /fc29.img
+ readonly 1
+
+END
+# tgt-admin --update ALL
+```
+
+Add the new kernel and initramfs to the ESP:
+
+```
+$ MY_KRNL=$(ls -c /fc29/lib/modules | head -n 1)
+$ cp $(find /fc29/lib/modules -maxdepth 2 -name 'vmlinuz' | grep -m 1 $MY_KRNL) $HOME/esp/linux/vmlinuz-$MY_KRNL
+$ cp $(find /fc29/boot -name 'init*' | grep -m 1 $MY_KRNL) $HOME/esp/linux/initramfs-$MY_KRNL.img
+```
+
+Update the boot.cfg in the ESP:
+
+```
+$ MY_DNS1=192.0.2.91
+$ MY_DNS2=192.0.2.92
+$ MY_NAME=server-01.example.edu
+$ MY_EMAN=$(echo $MY_NAME | tr '.' "\n" | tac | tr "\n" '.' | cut -b -${#MY_NAME})
+$ MY_ADDR=$(host -t A $MY_NAME | awk '{print $4}')
+$ cat << END > $HOME/esp/linux/boot.cfg
+#!ipxe
+
+kernel --name kernel.efi \${prefix}/vmlinuz-$MY_KRNL initrd=initrd.img ro ip=dhcp rd.peerdns=0 nameserver=$MY_DNS1 nameserver=$MY_DNS2 root=/dev/disk/by-path/ip-$MY_ADDR:3260-iscsi-iqn.$MY_EMAN:fc29-lun-1 netroot=iscsi:$MY_ADDR::::iqn.$MY_EMAN:fc29 console=tty0 console=ttyS0,115200n8 audit=0 selinux=0 quiet
+initrd --name initrd.img \${prefix}/initramfs-$MY_KRNL.img
+boot || exit
+END
+```
+
+Finally, copy the files from your $HOME/esp/linux directory out to the ESPs of all your client systems and enjoy!
+
+
+--------------------------------------------------------------------------------
+
+via: https://fedoramagazine.org/how-to-build-a-netboot-server-part-2/
+
+作者:[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/how-to-build-a-netboot-server-part-1/
+[2]: https://en.wikipedia.org/wiki/Active_Directory
+[3]: https://fedoramagazine.org/secure-nfs-home-directories-kerberos
+[4]: https://en.wikipedia.org/wiki/Sparse_file
+[5]: https://chrisdown.name/2018/04/17/kernel-adventures-the-curious-case-of-squashfs-stalls.html
+[6]: https://en.wikipedia.org/wiki/ZFS
+[7]: https://en.wikipedia.org/wiki/Load_balancing_(computing)
+[8]: http://docs.ceph.com/docs/mimic/rbd/iscsi-overview/
+[9]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/load_balancer_administration/ceph_example
+[10]: https://fedoramagazine.org/wp-content/uploads/2018/12/netboot-screenshot-1024x819.png
From c84fd905c61451cbda33612a1ece8d14876e0a59 Mon Sep 17 00:00:00 2001
From: darksun
Date: Fri, 14 Dec 2018 13:00:34 +0800
Subject: [PATCH 101/119] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Aliases:=20DIY=20?=
=?UTF-8?q?Shell=20Commands?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20181212 Aliases- DIY Shell Commands.md | 133 ++++++++++++++++++
1 file changed, 133 insertions(+)
create mode 100644 sources/tech/20181212 Aliases- DIY Shell Commands.md
diff --git a/sources/tech/20181212 Aliases- DIY Shell Commands.md b/sources/tech/20181212 Aliases- DIY Shell Commands.md
new file mode 100644
index 0000000000..d81fb03bb0
--- /dev/null
+++ b/sources/tech/20181212 Aliases- DIY Shell Commands.md
@@ -0,0 +1,133 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Aliases: DIY Shell Commands)
+[#]: via: (https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands)
+[#]: author: (Paul Brown https://www.linux.com/users/bro66)
+
+Aliases: DIY Shell Commands
+======
+
+
+
+Aliases, in the context of the Linux shell, are **commands you build yourself** by packing them with combinations of other instructions that are too long or too hard to remember.
+
+You create an alias by using the word `alias`, then the name of the command you want to create, an equal sign (`=`), and then the Bash command(s) you want your alias to run. For example, `ls` in its base form does not colorize its output, making it difficult to distinguish between directories, files, and links. You can build a new command that shows colors by making an alias like this:
+
+```
+alias lc='ls --color=auto'
+```
+
+where `lc` is the name you have picked for your new command. When creating aliases, be sure to check that the name you picked isn't already in use, or you may override an existing command. In this case, `lc` stands for "list (with) color". Notice there is no space in front of or behind the `=`. Finally, you have the regular Bash command(s) you want to run when `lc` is executed. In this case, the `ls` command with the `--color` option.
+
+After defining your alias, every time you type `lc`, the contents of the current directory will be shown in color.
+
+But, you may think, "my `ls` command already lists files in different colors!" That is because most Linux distros come with some aliases already set up for you.
+
+### Aliases you (probably) already have
+
+Indeed, you can use the `alias` instruction without any options to see what aliases you already have. These will vary by distro, but some typical preset aliases are:
+
+ * `alias ls='ls --color=auto'`: You already saw this one above. The `auto` modifier of the `--color` option tells `ls` to use color when standard output is connected to a terminal. That is, the output of `ls` is going to show up in a terminal window or a text screen, instead of, say, being piped to a file. Other alternatives for `--color` are `always` and `never`.
+ * `alias cp='cp -i'`: The `-i` option stands for _interactive_. Sometimes, when you use `cp` you may inadvertently overwrite an existing file. By using the `-i`, `cp` will ask you before clobbering anything.
+ * `alias free='free -m'`: Using `-m` with `free`you can see how much free memory you have and how much your applications are using in megabytes instead of the default bytes. This makes the output of `free` easier to read for a human.
+
+
+
+There may be more (or less, or even none), but regardless of what your distribution comes with, you can always use the base form (vs. the aliased form) of a command with the `\` modifier. For example:
+
+```
+\free
+```
+
+will execute `free` without the `-m` option, and
+
+```
+\ls
+```
+
+will execute `ls` without the `--color=auto` option.
+
+If you want to get rid or modify the preset aliases forever, note that they live in the global _.bashrc_ file which hangs out in [our old haunt, the _/etc/skel_ directory][1].
+
+### Aliases for muscle memory
+
+Distro designers try their best to predict which aliases are going to be useful for you. But every user is different and comes from a different background. If you are new to GNU+Linux, it may be because you are coming from another system, and the basic commands vary from shell to shell. If you come from a Windows/MS-DOS background, you may want to define an alias like
+
+```
+alias dir='ls'
+```
+
+to list files or directories.
+
+Likewise,
+
+```
+alias copy='cp'
+alias move='mv'
+```
+
+may also come in handy, at least until you get used to Linux's new lexicon.
+
+The other problem occurs when mistakes become ingrained in your muscle memory, so you always mistype some words the same way. I, for instance, have great difficulty typing _admnis-_... _adminsi-_... _A-D-M-I-N-I-S-T-R-A-T-I-ON_ ( _phew!_ ) at speed. That is why some users create aliases like
+
+```
+alias sl='ls'
+```
+
+and
+
+```
+alias gerp='echo "You did it *again*!"; grep'
+```
+
+Although we haven't formally introduced `grep` yet, in its most basic form, it looks for a string of characters in a file or a set of files. It's one of those commands that you will tend to use A LOT once you get to grips with it, as those ingrained mistyping habits that force you to type the instruction twice every time get annoying really quickly.
+
+Another thing to note in the `gerp` example is that it is not a single instruction, but two. The first one (`echo "You did it *again*!"`) prints out a message reminding you that you misspelled the grep command, then there is a semicolon (`;`) that separates one instruction from the other. Finally, you've got the second command (`grep`) that does the actual grepping.
+
+Using `gerp` on my system to search for the lines containing the word " _alias_ " in _/etc/skel/.bashrc_ , the output looks like this:
+
+```
+$ gerp -R alias /etc/skel/.bashrc
+You did it *again*!
+ alias ls='ls --color=auto'
+ alias grep='grep --colour=auto'
+ alias egrep='egrep --colour=auto'
+ alias fgrep='fgrep --colour=auto'
+alias cp="cp -i"
+alias df='df -h'
+alias free='free -m'
+alias np='nano -w PKGBUILD'
+alias more=less
+shopt -s expand_aliases
+```
+
+Running commands sequentially as part of an alias, or, even better, chaining commands so that one command can use the results coughed up by another, is getting us perilously close to Bash scripting. This has been in the making of this series for quite some time, and we'll start covering it in the very next article.
+
+For the time being, if you want to get rid of an alias you temporarily set up in a running terminal, use the `unalias` command:
+
+```
+unalias gerp
+```
+
+If you want to make your aliases permanent, you can drop them into the _.bashrc_ file you have in your home directory. This is the same thing we did with custom environment variables in [last week's article][2].
+
+See you next time!
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands
+
+作者:[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/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
+[2]: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise
From 44d97063b39449b536f2ec944b3dead5b77abd01 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 13:28:27 +0800
Subject: [PATCH 102/119] PRF:20181204 Have a cow at the Linux command line.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@heguangzhi 请在使用翻译工具后,自己读一遍是否通顺,是否有明显错误!
---
...04 Have a cow at the Linux command line.md | 38 ++++++++++---------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/translated/tech/20181204 Have a cow at the Linux command line.md b/translated/tech/20181204 Have a cow at the Linux command line.md
index ef08209828..3be26492fe 100644
--- a/translated/tech/20181204 Have a cow at the Linux command line.md
+++ b/translated/tech/20181204 Have a cow at the Linux command line.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (heguangzhi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (Have a cow at the Linux command line)
[#]: via: (https://opensource.com/article/18/12/linux-toy-cowsay)
@@ -8,27 +8,28 @@
[#]: url: ( )
-在Linux命令行上拥有一头奶牛
+在 Linux 命令行上拥有一头奶牛
======
-使用 cowsay 实用程序将牛的声音带到你的终端输出。
+> 使用 cowsay 实用程序将牛的话语带到你的终端输出。

欢迎来到 Linux 命令行玩具第四天。如果这是你第一次访问这个系列,你可能会问自己,什么是命令行玩具。我们也在考虑这一点,但是一般来说,这可能是一个游戏,或者任何简单的娱乐,可以帮助你在终端玩得开心。
-你们中的一些人以前会看过我们日历上的各种选项,但是我们希望每个人都至少有一个新的选项。因为几乎所有我提到这个系列的人都已经问过我了,今天的选项是必须的。
+你们中的一些人会见过我们之前的选中的各种玩具,但是我们希望至少有一个对每个人来说都是新的。因为几乎所有我告诉他这个系列的人都已经问过它了,所以今天的选中的玩具是必须提及的。
-你不认为我们会在不提及 cowsay 的情况下完成这个系列,是吗?
+你也不会认为我们会在不提及 `cowsay` 的情况下完成这个系列,对吧?
-Cowsey 是一个神奇的实用程序,它将文本作为ASCII艺术牛的口语文本输出。
+`cowsay` 是一个神奇的实用程序,它将文本作为 ASCII 艺术牛的讲话文本输出。
-你可能会发现 cowsey 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装:
+你可能会发现 `cowsey` 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装:
```
$ sudo dnf install -y cowsay
```
-然后,用 cowsey 调用它,然后是你的消息。也许你想到昨天我们谈到的 [幸运][1] [应用][1]。
+
+然后,用 `cowsey` 调用它,然后是你的消息。也许你想到昨天我们谈到的 [fortune 应用][1] 连接起来。
```
$ fortune | cowsay
@@ -43,7 +44,7 @@ $ fortune | cowsay
|| ||
```
-就这样!**CowSay** 几乎没有变化,称为 cow 文件,通常可以在 **/usr/share/cowsay** ,要查看系统上可用的 cow 文件选项,请在 cowsay 之后使用 **-l** 。然后,用 **-f** 试试其中之一。
+就这样!`cowsay` 还有点小变体,称为 cow 文件,通常可以在 `/usr/share/cowsay` 找到 ,要查看系统上可用的 cow 文件,请在 `cowsay` 之后使用 `-l` 。然后,用 `-f` 试试其中之一。
```
$ cowsay -f dragon "Run for cover, I feel a sneeze coming on."
@@ -68,10 +69,10 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~
```
-我对 **cowsay** 的真正不满是,我今天没有足够的时间来为牛的挤奶。牛排太高了,我可能会开个玩笑。
-更严重的是,我已经完全忘记了 **cowsay** 直到我在学习可翻译的剧本时再次遇到它。如果你碰巧安装了 **cowyay**,当你运行脚本时,你会从一系列奶牛身上获得产出。例如,运行本脚本:
+我对 `cowsay` 的真正不满是,我今天没有足够的时间来为牛的挤奶 —— 一语双关。牛排价格太高了,我只是开个玩笑。
+更严重的是,我已经完全忘记了 `cowsay` 直到我在学习 Ansible 的剧本时再次遇到它。如果你碰巧安装了 `cowyay`,当你运行Ansible 的剧本时,你会从一队奶牛那里获得输出。例如,运行这个剧本:
```
- hosts:
@@ -79,7 +80,8 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."
tasks:
- action: ping
```
-可能会给你以下信息:
+
+可能会给你以下信息:
```
$ ansible-playbook playbook.yml
@@ -123,14 +125,14 @@ ok: [localhost]
localhost : ok=2 changed=0 unreachable=0 failed=0
```
-**Cowsay** 在GPLV3许可证下可用,您可以在 GitHub 上找到 Perl [源代码][2]。我也见过其他语言的版本,所以看看其他变体;例如,这是 [R语言][3] 。用你选择的语言实现你自己的版本可能是一项有趣的编程学习任务。
-Now that **cowsay** is out of the way, we can move on to greener pastures.
-既然 **cowsay** 不碍事了,我们可以去更绿色的牧场了。
+`cowsay` 在 GPLv3 许可证下可用,您可以在 GitHub 上找到 它的 Perl [源代码][2]。我也见过其他语言的版本,所以可以看看其他变体;例如,这是 [R 语言版][3]。用你选择的语言实现你自己的版本可能是一项有趣的编程学习任务。
-你有最喜欢的命令行玩具吗,你认为我应该对它进行分析?这个系列的日历大部分都填好了,但我还有一些地方。在下面的评论中让我知道,梦幻篮球来看看。如果有空间,梦幻篮球会尝试把它包括进去。如果没有,但是我收到了一些好的意见书,梦幻篮球在结尾做了一个荣誉提名的总结。
+既然讲完了 `cowsay`,我们可以去更绿色的牧场了。
-看看昨天的玩具,[如何给你的Linux终端带来好运][1],明天再来看看另一个!
+你有希望我来介绍的喜欢的命令行玩具吗?这个系列的排期大部分都填好了,但我还有一些空位方。在下面的评论中让我知道,我会来看看。如果有空间,我会尝试把它包括进去。如果没有,但是我收到了一些好的意见,我在结尾提及。
+
+看看昨天的玩具,[如何给你的 Linux 终端带来好运][1],明天再来看看另一个!
--------------------------------------------------------------------------------
@@ -139,7 +141,7 @@ via: https://opensource.com/article/18/12/linux-toy-cowsay
作者:[Jason Baker][a]
选题:[lujun9972][b]
译者:[heguangzhi](https://github.com/heguangzhi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 0edbad70ff8d58c20d658fb5ddd064fb8339e500 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 13:29:20 +0800
Subject: [PATCH 103/119] PUB:20181204 Have a cow at the Linux command line.md
@heguangzhi https://linux.cn/article-10346-1.html
---
.../20181204 Have a cow at the Linux command line.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181204 Have a cow at the Linux command line.md (98%)
diff --git a/translated/tech/20181204 Have a cow at the Linux command line.md b/published/20181204 Have a cow at the Linux command line.md
similarity index 98%
rename from translated/tech/20181204 Have a cow at the Linux command line.md
rename to published/20181204 Have a cow at the Linux command line.md
index 3be26492fe..ad7b054d9a 100644
--- a/translated/tech/20181204 Have a cow at the Linux command line.md
+++ b/published/20181204 Have a cow at the Linux command line.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (heguangzhi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (Have a cow at the Linux command line)
[#]: via: (https://opensource.com/article/18/12/linux-toy-cowsay)
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10346-1.html)
在 Linux 命令行上拥有一头奶牛
From 570ff6a04195b65bd5410c4f5510ec37afa6dcbd Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Fri, 14 Dec 2018 14:16:16 +0800
Subject: [PATCH 104/119] fixed errors
---
...mputing with Open Source Cirq Framework.md | 22 +++++++++----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
index 289a62de15..fcbc89e77c 100644
--- a/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
+++ b/translated/tech/20180828 An Introduction to Quantum Computing with Open Source Cirq Framework.md
@@ -6,15 +6,15 @@
-在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “非常小”,在下面的短视频链接中有描述:
+在我们开始了解量子计算之前,必须先去了解“量子”这个术语,量子是已知的 [亚原子粒子][1] 中最小的物质。[量子][2] 这个词来自拉丁语 Quantus,意思是 “有多少”,在下面的短视频链接中有描述:
-为了易于我们理解量子计算,我们将量子计算与传统计算(也译做经典计算)进行比较。传统计算是指设计用于工作的、我们正在使用的传统计算机,正如你现在用于阅读本文的设备,就是我们所谓的传统计算设备。
+为了易于我们理解量子计算,我们将量子计算与经典计算(也有译做传统计算)进行比较。经典计算是指设计用于工作的、正在使用的计算机,正如你现在用于阅读本文的设备,就是我们所谓的经典计算设备。
-### 传统计算
+### 经典计算
-传统计算是描述传统计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。传统计算机不会理解除 1 或 0 之外的任何其它东西。
+经典计算是描述计算机如何工作的另一种方式。它们通过一个二进制系统工作,即信息使用 1 或 0 来存储。经典计算机不会理解除 1 或 0 之外的任何其它东西。
直白来说,在计算机内部一个晶体管只能是开(1)或关(0)。我们输入的任何信息都被转换为无数个 1 和 0,所以计算机只能理解和存储 1 和 0。所有的东西都只能用无数个 1 和 0 的组合来表示。
@@ -22,7 +22,7 @@
### 量子计算
-然而,量子计算不再像传统计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。
+然而,量子计算不再像经典计算那样遵循 “开或关” 的模式。而是,借助量子的名为 [叠加和纠缠][3] 的两个现象,能同时处理信息的多个状态,因此能以更快的速率加速计算,并且在信息存储方面效率更高。
请注意,叠加和纠缠 [不是同一个现象][4]。
@@ -30,9 +30,9 @@
![][5]
-就像在传统计算中,我们有比特,在量子计算中,我们相应也有量子比特(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。
+就像在经典计算中,我们有比特,在量子计算中,我们相应也有量子比特(或 Quantum bits)。想了解它们二者之间的巨大差异之处,请查看这个 [页面][6],从那里的图片中可以得到答案。
-量子计算机并不是来替代我们的传统计算机的。但是,有一些非常巨大的任务用我们的传统计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。
+量子计算机并不是来替代我们的经典计算机的。但是,有一些非常巨大的任务用我们的经典计算机是无法完成的,而那些正是量子计算机大显身手的好机会。下面链接的视频详细描述了上述情况,同时也描述了量子计算机的原理。
@@ -44,7 +44,7 @@
根据最新更新的(2018 年 7 月 31 日)研究论文,术语 “Noisy” 是指由于对量子比特未能完全控制所产生的不准确性。正是这种不准确性严重制约了量子设备短期内实现其目标。
-“中型” 指的是在接下来的几年中,量子计算机将要实现的规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。
+“中型” 指的是在接下来的几年中,量子计算机将要实现的量子规模大小,届时,量子比特的数目将可能从 50 到几百个不等。50 个量子比特是一个重大的量程碑,因为它将超越现有的最强大的 [超级计算机][8] 的 [暴力][7] 模拟能力。更多信息请阅读 [这里的][9] 论文。
随着 Cirq 出现,许多事情将会发生变化。
@@ -133,7 +133,7 @@ Cirq 的开发者在 GitHub 上已经放了学习 [教程][22]。如果你想认
#### OpenFermion-Cirq
-[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵表示费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。
+[OpenFermion][24] 是一个开源库,它是为了在量子计算机上模拟获取和操纵代表的费米系统(包含量子化学)。根据 [粒子物理学][26] 理论,按照 [费米— 狄拉克统计][27],费米系统与 [费米子][25] 的产生相关。
OpenFermion 被称为从事 [量子化学][29] 的化学家和研究人员的 [一个极好的实践工具][28]。量子化学主要专注于 [量子力学][30] 在物理模型和化学系统实验中的应用。量子化学也被称为 [分子量子力学][31]。
@@ -143,7 +143,7 @@ Cirq 的出现使 OpenFermion 通过提供程序和工具去扩展功能成为
2018 年 3 月 5 日,在洛杉矶举行的一年一度的 [美国物理学会会议][33] 上,Google 发布了 [Bristlecone][32],这是他们的最新的量子处理器。这个 [基于门的超导系统][34] 为 Google 提供了一个测试平台,用以研究 [量子比特技术][37] 的 [系统错误率][35] 和 [扩展性][36] ,以及在量子 [仿真][38]、[优化][39]、和 [机器学习][40] 方面的应用。
-Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个传统超级计算机无法在合理时间内完成的任务。
+Google 希望在不久的将来,能够制造出它的 [云可访问][41] 的 72 个量子比特的 Bristlecone 量子处理器。Bristlecone 将越来越有能力完成一个经典超级计算机无法在合理时间内完成的任务。
Cirq 将让研究人员直接在云上为 Bristlecone 写程序变得很容易,它提供了一个非常方便的、实时的、量子编程和测试的接口。
@@ -164,7 +164,7 @@ Cirq 将允许我们去:
### 总结
-最后我们总结一下,我们首先通过与传统计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。
+最后我们总结一下,我们首先通过与经典计算相比较,介绍了量子计算的概念,然后是一个非常重要的视频来介绍了自去年以来量子计算的最新发展。接着我们简单讨论了嘈杂中型量子,也就是为什么要特意构建 Cirq 的原因所在。
我们看了如何在一个 Ubuntu 系统上安装和测试 Cirq。我们也在一个更好用的 IDE 环境中做了安装测试,并使用一些资源去开始学习有关概念。
From 6e8022ff249ef730a44c50a02a6c6f19e857bd8d Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Fri, 14 Dec 2018 13:46:21 +0800
Subject: [PATCH 105/119] Update 20181210 How to Update Ubuntu.md
---
... How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
index 50ba70c073..3a9036f403 100644
--- a/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
+++ b/sources/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
@@ -1,11 +1,12 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (LazyWolfLin)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Update Ubuntu [Terminal & GUI Methods] It's FOSS)
[#]: via: (https://itsfoss.com/update-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+Translating by LazyWolfLin
How to Update Ubuntu [Terminal & GUI Methods] It's FOSS
======
From a999ca5553f426d137f9c292f2d76468ff7aed40 Mon Sep 17 00:00:00 2001
From: wwhio
Date: Fri, 14 Dec 2018 16:19:54 +0800
Subject: [PATCH 106/119] =?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
---
sources/talk/20180623 The IBM 029 Card Punch.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sources/talk/20180623 The IBM 029 Card Punch.md b/sources/talk/20180623 The IBM 029 Card Punch.md
index b8af5fb602..6b36845c2d 100644
--- a/sources/talk/20180623 The IBM 029 Card Punch.md
+++ b/sources/talk/20180623 The IBM 029 Card Punch.md
@@ -1,3 +1,6 @@
+Translating by wwhio
+
+
The IBM 029 Card Punch
======
Lines of code longer than 80 characters drive me crazy. I appreciate that this is pedantic. I’ve seen people on the internet make good arguments for why the 80-character limit ought to be respected even on our modern Retina-display screens, but those arguments hardly justify the visceral hatred I feel for even that one protruding 81st character.
From 1f801d3d030d0ff0a6675b0aa2c9c140919695b6 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 16:38:54 +0800
Subject: [PATCH 107/119] PRF:20181102 Create a containerized machine learning
model.md
@geekpi
---
...Create a containerized machine learning model.md | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/translated/tech/20181102 Create a containerized machine learning model.md b/translated/tech/20181102 Create a containerized machine learning model.md
index 7c48ba6af7..0bad5a3bc6 100644
--- a/translated/tech/20181102 Create a containerized machine learning model.md
+++ b/translated/tech/20181102 Create a containerized machine learning model.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (Create a containerized machine learning model)
[#]: via: (https://fedoramagazine.org/create-containerized-machine-learning-model/)
@@ -32,7 +32,7 @@ mkdir deployment_container && cd deployment_container
下一步是为机器学习模型创建 REST API。这个 [github 仓库][4]包含一个预训练模型,以及能让 REST API 工作的设置。
-使用以下命令在 deployment_container 目录中克隆它:
+使用以下命令在 `deployment_container` 目录中克隆它:
```
git clone https://github.com/svenboesiger/titanic_tf_ml_model.git
@@ -44,7 +44,7 @@ git clone https://github.com/svenboesiger/titanic_tf_ml_model.git
#### swagger.yaml
-swagger.yaml 使用 [Swagger规范][7] 定义 Connexion 库的 API。此文件包含让你的服务器提供输入参数验证、输出响应数据验证、URL 端点定义所需的所有信息。
+[swagger.yaml][12] 使用 [Swagger规范][7] 定义 Connexion 库的 API。此文件包含让你的服务器提供输入参数验证、输出响应数据验证、URL 端点定义所需的所有信息。
额外地,Connexion 还将给你提供一个简单但有用的单页 Web 应用,它演示了如何使用 Javascript 调用 API 和更新 DOM。
@@ -110,7 +110,7 @@ pandas
### 容器化!
-为了让 Podman 构建映像,请在上面的准备步骤中创建的 **deployment_container** 目录中创建一个名为 “Dockerfile” 的新文件:
+为了让 Podman 构建映像,请在上面的准备步骤中创建的 `deployment_container` 目录中创建一个名为 `Dockerfile` 的新文件:
```
FROM fedora:28
@@ -171,7 +171,7 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/
作者:[Sven Bösiger][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/) 荣誉推出
@@ -187,4 +187,5 @@ via: https://fedoramagazine.org/create-containerized-machine-learning-model/
[8]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/server.py
[9]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/requirements.txt
[10]: http://0.0.0.0:5000/
-[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png
\ No newline at end of file
+[11]: https://fedoramagazine.org/wp-content/uploads/2018/10/Screenshot-from-2018-10-27-14-46-56-682x1024.png
+[12]: https://github.com/svenboesiger/titanic_tf_ml_model/blob/master/swagger.yaml
From 5973f0ef5be151ca0023d5f2571d7c8a7c609242 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 16:40:28 +0800
Subject: [PATCH 108/119] REV:20181102 Create a containerized machine learning
model.md
@geekpi
---
.../20181102 Create a containerized machine learning model.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => review}/20181102 Create a containerized machine learning model.md (100%)
diff --git a/translated/tech/20181102 Create a containerized machine learning model.md b/review/20181102 Create a containerized machine learning model.md
similarity index 100%
rename from translated/tech/20181102 Create a containerized machine learning model.md
rename to review/20181102 Create a containerized machine learning model.md
From 517cd3c6f43fe63e90434c075f580ebfe2dd3c9a Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 16:43:00 +0800
Subject: [PATCH 109/119] Revert "REV:20181102 Create a containerized machine
learning model.md"
This reverts commit 5973f0ef5be151ca0023d5f2571d7c8a7c609242.
---
.../20181102 Create a containerized machine learning model.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {review => translated/tech}/20181102 Create a containerized machine learning model.md (100%)
diff --git a/review/20181102 Create a containerized machine learning model.md b/translated/tech/20181102 Create a containerized machine learning model.md
similarity index 100%
rename from review/20181102 Create a containerized machine learning model.md
rename to translated/tech/20181102 Create a containerized machine learning model.md
From 9304ca0b08e70d1af725ebc7a37945561d6f5e16 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 17:30:41 +0800
Subject: [PATCH 110/119] PRF:20180814 HTTP request routing and validation with
gorilla-mux.md
@yongshouzhang
---
...routing and validation with gorilla-mux.md | 636 ++++++------------
1 file changed, 214 insertions(+), 422 deletions(-)
diff --git a/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md b/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md
index 4699398bcc..4dcf7f7f52 100644
--- a/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md
+++ b/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md
@@ -1,68 +1,70 @@
-使用 gorilla/mux 进行HTTP请求路由和验证
+使用 gorilla/mux 进行 HTTP 请求路由和验证
======
+> gorilla/mux 包以直观的 API 提供了 HTTP 请求路由、验证和其它服务。
+

-Go 网络库包括 `http.ServeMux` 结构类型,它支持 HTTP 请求多路复用(路由):Web 服务器将托管资源的 HTTP 请求与诸如 sales4today 之类的 URI 路由到代码处理程序; 处理程序在发送 HTTP 响应(通常是 HTML 页面)之前执行适当的逻辑。 这是该体系的草图:
+Go 网络库包括 `http.ServeMux` 结构类型,它支持 HTTP 请求多路复用(路由):Web 服务器将托管资源的 HTTP 请求与诸如 `/sales4today` 之类的 URI 路由到代码处理程序;处理程序在发送 HTTP 响应(通常是 HTML 页面)之前执行适当的逻辑。 这是该体系的草图:
```
- +------------+ +--------+ +---------+
-HTTP 请求---->| web 服务器 |---->| 路由 |---->| 处理程序|
- +------------+ +--------+ +---------+
+ +-----------+ +--------+ +---------+
+HTTP 请求---->| web 服务器 |---->| 路由 |---->| 处理程序 |
+ +-----------+ +--------+ +---------+
```
-调用 `ListenAndServe` 方法后启动 HTTP 服务器
+调用 `ListenAndServe` 方法后启动 HTTP 服务器:
```
http.ListenAndServe(":8888", nil) // args: port & router
```
-
第二个参数 `nil` 意味着 `DefaultServeMux` 用于请求路由。
`gorilla/mux` 库包含 `mux.Router` 类型,可替代 `DefaultServeMux` 或自定义请求多路复用器。 在 `ListenAndServe` 调用中,`mux.Router` 实例将代替 `nil` 作为第二个参数。 下面的示例代码很好的说明了为什么 `mux.Router`如此吸引人:
-### 1\. A sample crud web app
+### 1、一个简单的 CRUD web 应用程序
+
+crud web 应用程序(见下文)支持四种 CRUD(创建/读取/更新/删除)操作,它们分别对应四种 HTTP 请求方法:POST、GET、PUT 和 DELETE。 在这个 CRUD 应用程序中,所管理的资源是套话与反套话的列表,每个都是套话及其反面的的套话,例如这对:
-crud web 应用程序(见下文)支持四种 CRUD(创建读取更新删除)操作,它们分别对应四种 HTTP 请求方法:POST,GET,PUT 和 DELETE。 在 crud 应用程序中,托管资源是陈词滥调对的列表,每个陈词滥调都是陈词滥调和冲突的陈词滥调,例如这对:
```
Out of sight, out of mind. Absence makes the heart grow fonder.
-
```
-可以添加新的陈词滥调对,可以编辑或删除现有的陈词滥调对。
+可以添加新的套话对,可以编辑或删除现有的套话对。
+
+CRUD web 应用程序:
-**crud web 应用程序**
```
package main
import (
- "gorilla/mux"
- "net/http"
- "fmt"
- "strconv"
+ "gorilla/mux"
+ "net/http"
+ "fmt"
+ "strconv"
)
const GETALL string = "GETALL"
const GETONE string = "GETONE"
-const POST string = "POST"
-const PUT string = "PUT"
+const POST string = "POST"
+const PUT string = "PUT"
const DELETE string = "DELETE"
type clichePair struct {
- Id int
- Cliche string
- Counter string
+ Id int
+ Cliche string
+ Counter string
}
// Message sent to goroutine that accesses the requested resource.
type crudRequest struct {
- verb string
- cp *clichePair
- id int
- cliche string
- counter string
- confirm chan string
+ verb string
+ cp *clichePair
+ id int
+ cliche string
+ counter string
+ confirm chan string
}
var clichesList = []*clichePair{}
@@ -72,596 +74,386 @@ var crudRequests chan *crudRequest
// GET /
// GET /cliches
func ClichesAll(res http.ResponseWriter, req *http.Request) {
- cr := &crudRequest{verb: GETALL, confirm: make(chan string)}
- completeRequest(cr, res, "read all")
+ cr := &crudRequest{verb: GETALL, confirm: make(chan string)}
+ completeRequest(cr, res, "read all")
}
// GET /cliches/id
func ClichesOne(res http.ResponseWriter, req *http.Request) {
- id := getIdFromRequest(req)
- cr := &crudRequest{verb: GETONE, id: id, confirm: make(chan string)}
- completeRequest(cr, res, "read one")
+ id := getIdFromRequest(req)
+ cr := &crudRequest{verb: GETONE, id: id, confirm: make(chan string)}
+ completeRequest(cr, res, "read one")
}
// POST /cliches
-
func ClichesCreate(res http.ResponseWriter, req *http.Request) {
-
- cliche, counter := getDataFromRequest(req)
-
- cp := new(clichePair)
-
- cp.Cliche = cliche
-
- cp.Counter = counter
-
- cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)}
-
- completeRequest(cr, res, "create")
-
+ cliche, counter := getDataFromRequest(req)
+ cp := new(clichePair)
+ cp.Cliche = cliche
+ cp.Counter = counter
+ cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)}
+ completeRequest(cr, res, "create")
}
-
-
// PUT /cliches/id
-
func ClichesEdit(res http.ResponseWriter, req *http.Request) {
-
- id := getIdFromRequest(req)
-
- cliche, counter := getDataFromRequest(req)
-
- cr := &crudRequest{verb: PUT, id: id, cliche: cliche, counter: counter, confirm: make(chan string)}
-
- completeRequest(cr, res, "edit")
-
+ id := getIdFromRequest(req)
+ cliche, counter := getDataFromRequest(req)
+ cr := &crudRequest{verb: PUT, id: id, cliche: cliche, counter: counter, confirm: make(chan string)}
+ completeRequest(cr, res, "edit")
}
-
-
// DELETE /cliches/id
-
func ClichesDelete(res http.ResponseWriter, req *http.Request) {
-
- id := getIdFromRequest(req)
-
- cr := &crudRequest{verb: DELETE, id: id, confirm: make(chan string)}
-
- completeRequest(cr, res, "delete")
-
+ id := getIdFromRequest(req)
+ cr := &crudRequest{verb: DELETE, id: id, confirm: make(chan string)}
+ completeRequest(cr, res, "delete")
}
-
-
func completeRequest(cr *crudRequest, res http.ResponseWriter, logMsg string) {
-
- crudRequests<-cr
-
- msg := <-cr.confirm
-
- res.Write([]byte(msg))
-
- logIt(logMsg)
-
+ crudRequests<-cr
+ msg := <-cr.confirm
+ res.Write([]byte(msg))
+ logIt(logMsg)
}
-
-
func main() {
+ populateClichesList()
- populateClichesList()
-
-
-
- // From now on, this gorountine alone accesses the clichesList.
-
- crudRequests = make(chan *crudRequest, 8)
-
- go func() { // resource manager
-
- for {
-
- select {
-
- case req := <-crudRequests:
-
- if req.verb == GETALL {
-
- req.confirm<-readAll()
-
- } else if req.verb == GETONE {
-
- req.confirm<-readOne(req.id)
-
- } else if req.verb == POST {
-
- req.confirm<-addPair(req.cp)
-
- } else if req.verb == PUT {
-
- req.confirm<-editPair(req.id, req.cliche, req.counter)
-
- } else if req.verb == DELETE {
-
- req.confirm<-deletePair(req.id)
-
- }
-
- }
-
- }()
-
- startServer()
-
+ // From now on, this gorountine alone accesses the clichesList.
+ crudRequests = make(chan *crudRequest, 8)
+ go func() { // resource manager
+ for {
+ select {
+ case req := <-crudRequests:
+ if req.verb == GETALL {
+ req.confirm<-readAll()
+ } else if req.verb == GETONE {
+ req.confirm<-readOne(req.id)
+ } else if req.verb == POST {
+ req.confirm<-addPair(req.cp)
+ } else if req.verb == PUT {
+ req.confirm<-editPair(req.id, req.cliche, req.counter)
+ } else if req.verb == DELETE {
+ req.confirm<-deletePair(req.id)
+ }
+ }
+ }()
+ startServer()
}
-
-
func startServer() {
+ router := mux.NewRouter()
- router := mux.NewRouter()
+ // Dispatch map for CRUD operations.
+ router.HandleFunc("/", ClichesAll).Methods("GET")
+ router.HandleFunc("/cliches", ClichesAll).Methods("GET")
+ router.HandleFunc("/cliches/{id:[0-9]+}", ClichesOne).Methods("GET")
+ router.HandleFunc("/cliches", ClichesCreate).Methods("POST")
+ router.HandleFunc("/cliches/{id:[0-9]+}", ClichesEdit).Methods("PUT")
+ router.HandleFunc("/cliches/{id:[0-9]+}", ClichesDelete).Methods("DELETE")
+ http.Handle("/", router) // enable the router
- // Dispatch map for CRUD operations.
-
- router.HandleFunc("/", ClichesAll).Methods("GET")
-
- router.HandleFunc("/cliches", ClichesAll).Methods("GET")
-
- router.HandleFunc("/cliches/{id:[0-9]+}", ClichesOne).Methods("GET")
-
-
-
- router.HandleFunc("/cliches", ClichesCreate).Methods("POST")
-
- router.HandleFunc("/cliches/{id:[0-9]+}", ClichesEdit).Methods("PUT")
-
- router.HandleFunc("/cliches/{id:[0-9]+}", ClichesDelete).Methods("DELETE")
-
-
-
- http.Handle("/", router) // enable the router
-
-
-
- // Start the server.
-
- port := ":8888"
-
- fmt.Println("\nListening on port " + port)
-
- http.ListenAndServe(port, router); // mux.Router now in play
-
+ // Start the server.
+ port := ":8888"
+ fmt.Println("\nListening on port " + port)
+ http.ListenAndServe(port, router); // mux.Router now in play
}
-
-
// Return entire list to requester.
-
func readAll() string {
-
- msg := "\n"
-
- for _, cliche := range clichesList {
-
- next := strconv.Itoa(cliche.Id) + ": " + cliche.Cliche + " " + cliche.Counter + "\n"
-
- msg += next
-
- }
-
- return msg
-
+ msg := "\n"
+ for _, cliche := range clichesList {
+ next := strconv.Itoa(cliche.Id) + ": " + cliche.Cliche + " " + cliche.Counter + "\n"
+ msg += next
+ }
+ return msg
}
-
-
// Return specified clichePair to requester.
-
func readOne(id int) string {
+ msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n"
- msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n"
-
-
-
- index := findCliche(id)
-
- if index >= 0 {
-
- cliche := clichesList[index]
-
- msg = "\n" + strconv.Itoa(id) + ": " + cliche.Cliche + " " + cliche.Counter + "\n"
-
- }
-
- return msg
-
+ index := findCliche(id)
+ if index >= 0 {
+ cliche := clichesList[index]
+ msg = "\n" + strconv.Itoa(id) + ": " + cliche.Cliche + " " + cliche.Counter + "\n"
+ }
+ return msg
}
-
-
// Create a new clichePair and add to list
-
func addPair(cp *clichePair) string {
-
- cp.Id = masterId
-
- masterId++
-
- clichesList = append(clichesList, cp)
-
- return "\nCreated: " + cp.Cliche + " " + cp.Counter + "\n"
-
+ cp.Id = masterId
+ masterId++
+ clichesList = append(clichesList, cp)
+ return "\nCreated: " + cp.Cliche + " " + cp.Counter + "\n"
}
-
-
// Edit an existing clichePair
-
func editPair(id int, cliche string, counter string) string {
-
- msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n"
-
- index := findCliche(id)
-
- if index >= 0 {
-
- clichesList[index].Cliche = cliche
-
- clichesList[index].Counter = counter
-
- msg = "\nCliche edited: " + cliche + " " + counter + "\n"
-
- }
-
- return msg
-
+ msg := "\n" + "Bad Id: " + strconv.Itoa(id) + "\n"
+ index := findCliche(id)
+ if index >= 0 {
+ clichesList[index].Cliche = cliche
+ clichesList[index].Counter = counter
+ msg = "\nCliche edited: " + cliche + " " + counter + "\n"
+ }
+ return msg
}
-
-
// Delete a clichePair
-
func deletePair(id int) string {
-
- idStr := strconv.Itoa(id)
-
- msg := "\n" + "Bad Id: " + idStr + "\n"
-
- index := findCliche(id)
-
- if index >= 0 {
-
- clichesList = append(clichesList[:index], clichesList[index + 1:]...)
-
- msg = "\nCliche " + idStr + " deleted\n"
-
- }
-
- return msg
-
+ idStr := strconv.Itoa(id)
+ msg := "\n" + "Bad Id: " + idStr + "\n"
+ index := findCliche(id)
+ if index >= 0 {
+ clichesList = append(clichesList[:index], clichesList[index + 1:]...)
+ msg = "\nCliche " + idStr + " deleted\n"
+ }
+ return msg
}
-
-
//*** utility functions
-
func findCliche(id int) int {
-
- for i := 0; i < len(clichesList); i++ {
-
- if id == clichesList[i].Id {
-
- return i;
-
- }
-
- }
-
- return -1 // not found
-
+ for i := 0; i < len(clichesList); i++ {
+ if id == clichesList[i].Id {
+ return i;
+ }
+ }
+ return -1 // not found
}
-
-
func getIdFromRequest(req *http.Request) int {
-
- vars := mux.Vars(req)
-
- id, _ := strconv.Atoi(vars["id"])
-
- return id
-
+ vars := mux.Vars(req)
+ id, _ := strconv.Atoi(vars["id"])
+ return id
}
-
-
func getDataFromRequest(req *http.Request) (string, string) {
-
- // Extract the user-provided data for the new clichePair
-
- req.ParseForm()
-
- form := req.Form
-
- cliche := form["cliche"][0] // 1st and only member of a list
-
- counter := form["counter"][0] // ditto
-
- return cliche, counter
-
+ // Extract the user-provided data for the new clichePair
+ req.ParseForm()
+ form := req.Form
+ cliche := form["cliche"][0] // 1st and only member of a list
+ counter := form["counter"][0] // ditto
+ return cliche, counter
}
-
-
func logIt(msg string) {
-
- fmt.Println(msg)
-
+ fmt.Println(msg)
}
-
-
func populateClichesList() {
+ var cliches = []string {
+ "Out of sight, out of mind.",
+ "A penny saved is a penny earned.",
+ "He who hesitates is lost.",
+ }
+ var counterCliches = []string {
+ "Absence makes the heart grow fonder.",
+ "Penny-wise and dollar-foolish.",
+ "Look before you leap.",
+ }
- var cliches = []string {
-
- "Out of sight, out of mind.",
-
- "A penny saved is a penny earned.",
-
- "He who hesitates is lost.",
-
- }
-
- var counterCliches = []string {
-
- "Absence makes the heart grow fonder.",
-
- "Penny-wise and dollar-foolish.",
-
- "Look before you leap.",
-
- }
-
-
-
- for i := 0; i < len(cliches); i++ {
-
- cp := new(clichePair)
-
- cp.Id = masterId
-
- masterId++
-
- cp.Cliche = cliches[i]
-
- cp.Counter = counterCliches[i]
-
- clichesList = append(clichesList, cp)
-
- }
-
+ for i := 0; i < len(cliches); i++ {
+ cp := new(clichePair)
+ cp.Id = masterId
+ masterId++
+ cp.Cliche = cliches[i]
+ cp.Counter = counterCliches[i]
+ clichesList = append(clichesList, cp)
+ }
}
-
```
-为了专注于请求路由和验证,crud 应用程序不使用 HTML 页面作为请求响应。 相反,请求会产生明文响应消息:陈词滥调对的列表是对 GET 请求的响应,确认新的陈词滥调对已添加到列表中是对 POST 请求的响应,依此类推。 这种简化使得使用命令行实用程序(如 [curl] [1])可以轻松地测试应用程序,尤其是 `gorilla/mux` 组件。
+为了专注于请求路由和验证,CRUD 应用程序不使用 HTML 页面作为请求响应。 相反,请求会产生明文响应消息:套话对的列表是对 GET 请求的响应,确认新的套话对已添加到列表中是对 POST 请求的响应,依此类推。 这种简化使得使用命令行实用程序(如 [curl][1])可以轻松地测试应用程序,尤其是 `gorilla/mux` 组件。
-`gorilla/mux` 包可以从 [GitHub] [2] 安装。 crud app 无限期运行; 因此,应使用 Control-C 或同等命令终止。 crud 应用程序的代码,以及自述文件和简单的 curl 测试,可以在[我的网站] [3]上找到。
+`gorilla/mux` 包可以从 [GitHub][2] 安装。 CRUD app 无限期运行;因此,应使用 `Control-C` 或同等命令终止。 CRUD 应用程序的代码,以及自述文件和简单的 curl 测试,可以在[我的网站] [3]上找到。
-### 2\. 请求路由
+### 2、请求路由
-`mux.Router` 扩展了 REST 风格的路由,它赋给 HTTP 方法(例如,GET)和 URL 末尾的 URI 或路径(例如/cliches)相同的权重。 URI 用作 HTTP 动词(方法)的名词。 例如,在HTTP请求中有一个起始行,例如
+`mux.Router` 扩展了 REST 风格的路由,它赋给 HTTP 方法(例如,GET)和 URL 末尾的 URI 或路径(例如 `/cliches`)相同的权重。 URI 用作 HTTP 动词(方法)的名词。 例如,在HTTP请求中有一个起始行,例如:
```
GET /cliches
-
```
-意味着得到所有的陈词滥调对,而一个起始线,如
+意味着得到所有的套话对,而一个起始线,如:
```
POST /cliches
-
```
-意味着从HTTP正文中的数据创建一个陈词滥调对。
+意味着从 HTTP 正文中的数据创建一个套话对。
+
+在 CRUD web 应用程序中,有五个函数充当 HTTP 请求的五种变体的请求处理程序:
-在 crud web 应用程序中,有五个函数充当HTTP请求的五种变体的请求处理程序:
```
-ClichesAll(...) # GET: 获取所有的陈词滥调对
-
-ClichesOne(...) # GET: 获取指定的陈词滥调对
-
-ClichesCreate(...) # POST: 创建新的陈词滥调对
-
-ClichesEdit(...) # PUT: 编辑现有的陈词滥调对
-
-ClichesDelete(...) # DELETE: 删除指定的陈词滥调对
-
+ClichesAll(...) # GET: 获取所有的套话对
+ClichesOne(...) # GET: 获取指定的套话对
+ClichesCreate(...) # POST: 创建新的套话对
+ClichesEdit(...) # PUT: 编辑现有的套话对
+ClichesDelete(...) # DELETE: 删除指定的套话对
```
每个函数都有两个参数:一个 `http.ResponseWriter` 用于向请求者发送一个响应,一个指向 `http.Request` 的指针,该指针封装了底层 HTTP 请求的信息。 使用 `gorilla/mux` 包可以轻松地将这些请求处理程序注册到Web服务器,并执行基于正则表达式的验证。
-crud 应用程序中的 `startServer` 函数注册请求处理程序。 考虑这对注册,`router` 作为 `mux.Router` 实例:
+CRUD 应用程序中的 `startServer` 函数注册请求处理程序。 考虑这对注册,`router` 作为 `mux.Router` 实例:
+
```
router.HandleFunc("/", ClichesAll).Methods("GET")
-
router.HandleFunc("/cliches", ClichesAll).Methods("GET")
-
```
-这些语句意味着对单斜线/ 或 /cliches 的 GET 请求应该路由到 `ClichesAll` 函数,然后处理请求。 例如,curl 请求(使用%作为命令行提示符)
+这些语句意味着对单斜线 `/` 或 `/cliches` 的 GET 请求应该路由到 `ClichesAll` 函数,然后处理请求。 例如,curl 请求(使用 `%` 作为命令行提示符):
```
% curl --request GET localhost:8888/
-
```
-会产生如下结果
+会产生如下结果:
+
```
1: Out of sight, out of mind. Absence makes the heart grow fonder.
-
2: A penny saved is a penny earned. Penny-wise and dollar-foolish.
-
3: He who hesitates is lost. Look before you leap.
-
```
-三个陈词滥调对是 crud 应用程序中的初始数据。
+这三个套话对是 CRUD 应用程序中的初始数据。
+在这句注册语句中:
-在这句注册语句中
```
router.HandleFunc("/cliches", ClichesAll).Methods("GET")
-
router.HandleFunc("/cliches", ClichesCreate).Methods("POST")
-
```
-URI是相同的(/cliches),但动词不同:第一种情况下为 GET 请求,第二种情况下为 POST 请求。 此注册举例说明了 REST 样式的路由,因为仅动词的不同就足以将请求分派给两个不同的处理程序。
+URI 是相同的(`/cliches`),但动词不同:第一种情况下为 GET 请求,第二种情况下为 POST 请求。 此注册举例说明了 REST 样式的路由,因为仅动词的不同就足以将请求分派给两个不同的处理程序。
注册中允许多个 HTTP 方法,尽管这会影响 REST 风格路由的精髓:
```
router.HandleFunc("/cliches", DoItAll).Methods("POST", "GET")
-
```
+
除了动词和 URI 之外,还可以在功能上路由 HTTP 请求。 例如,注册
```
router.HandleFunc("/cliches", ClichesCreate).Schemes("https").Methods("POST")
-
```
-要求对 POST 请求进行 HTTPS 访问以创建新的陈词滥调对。 以类似的方式,注册可能需要具有指定的 HTTP 头元素(例如,认证凭证)的请求。
-### 3\. Request validation
+要求对 POST 请求进行 HTTPS 访问以创建新的套话对。以类似的方式,注册可能需要具有指定的 HTTP 头元素(例如,认证凭证)的请求。
+
+### 3、 Request validation
`gorilla/mux` 包采用简单,直观的方法通过正则表达式进行请求验证。 考虑此请求处理程序以获取一个操作:
+
```
router.HandleFunc("/cliches/{id:[0-9]+}", ClichesOne).Methods("GET")
-
```
-此注册排除了 HTTP 请求,例如
+
+此注册排除了 HTTP 请求,例如:
+
```
% curl --request GET localhost:8888/cliches/foo
-
```
-因为 foo 不是十进制数字。 该请求导致熟悉的 404(未找到)状态码。 在此处理程序注册中包含正则表达式模式可确保仅在请求 URI 以十进制整数值结束时才调用 `ClichesOne` 函数来处理请求:
+因为 foo 不是十进制数字。该请求导致熟悉的 404(未找到)状态码。 在此处理程序注册中包含正则表达式模式可确保仅在请求 URI 以十进制整数值结束时才调用 `ClichesOne` 函数来处理请求:
```
% curl --request GET localhost:8888/cliches/3 # ok
-
```
-另一个例子,请求如下
+另一个例子,请求如下:
+
```
% curl --request PUT --data "..." localhost:8888/cliches
-
```
-此请求导致状态代码为 405(错误方法),因为 /cliches URI 在 crud 应用程序中仅在 GET 和 POST 请求中注册。 像 GET 请求一样,PUT 请求必须在 URI 的末尾包含一个数字id:
+
+此请求导致状态代码为 405(错误方法),因为 /cliches URI 在 CRUD 应用程序中仅在 GET 和 POST 请求中注册。 像 GET 请求一样,PUT 请求必须在 URI 的末尾包含一个数字 id:
```
router.HandleFunc("/cliches/{id:[0-9]+}", ClichesEdit).Methods("PUT")
-
```
-### 4\. 并发问题
+### 4、并发问题
-`gorilla/mux` 路由器作为单独的 goroutine 执行对已注册的请求处理程序的每次调用,这意味着并发性被烘焙到包中。 例如,如果有十个同时发出的请求,例如
+`gorilla/mux` 路由器作为单独的 Go 协程执行对已注册的请求处理程序的每次调用,这意味着并发性被内置于包中。 例如,如果有十个同时发出的请求,例如
```
% curl --request POST --data "..." localhost:8888/cliches
-
```
-然后 `mux.Router` 启动十个 goroutines 来执行 `ClichesCreate` 处理程序。
+然后 `mux.Router` 启动十个 Go 协程来执行 `ClichesCreate` 处理程序。
-GET all,GET one,POST,PUT 和 DELETE 中的五个请求操作中,最后三个改变了所请求的资源,即包含陈词滥调对的共享 `clichesList`。 因此,crudapp 需要通过协调对`clichesList` 的访问来保证安全的并发性。 在不同但等效的术语中,crud app 必须防止 `clichesList` 上的竞争条件。 在生产环境中,可以使用数据库系统来存储诸如 `clichesList` 之类的资源,然后可以通过数据库事务来管理安全并发。
+GET all、GET one、POST、PUT 和 DELETE 中的五个请求操作中,最后三个改变了所请求的资源,即包含套话对的共享 `clichesList`。 因此,CRUD app 需要通过协调对 `clichesList` 的访问来保证安全的并发性。 在不同但等效的术语中,CRUD app 必须防止 `clichesList` 上的竞争条件。 在生产环境中,可以使用数据库系统来存储诸如 `clichesList` 之类的资源,然后可以通过数据库事务来管理安全并发。
-crud 应用程序采用推荐的Go方法来实现安全并发:
+CRUD 应用程序采用推荐的Go方法来实现安全并发:
-* 只有一个 goroutine,资源管理器在 crud app`startServer` 函数中启动,一旦 Web 服务器开始侦听请求,就可以访问 `clichesList`。
+* 只有一个 Go 协程,资源管理器在 CRUD app `startServer` 函数中启动,一旦 Web 服务器开始侦听请求,就可以访问 `clichesList`。
* 诸如 `ClichesCreate` 和 `ClichesAll` 之类的请求处理程序向 Go 通道发送(指向)`crudRequest` 实例(默认情况下是线程安全的),并且资源管理器单独从该通道读取。 然后,资源管理器对 `clichesList` 执行请求的操作。
安全并发体系结构绘制如下:
```
- crudRequest 读/写
+ crudRequest 读/写
-请求处理程序 -------------> 资源托管者 ------------> 陈词滥调列表
+请求处理程序 -------------> 资源托管者 ------------> 套话列表
```
-在这种架构中,不需要显式锁定 `clichesList`,因为一旦 CRUD 请求开始进入,只有一个 goroutine(资源管理器)访问 `clichesList`。
+在这种架构中,不需要显式锁定 `clichesList`,因为一旦 CRUD 请求开始进入,只有一个 Go 协程(资源管理器)访问 `clichesList`。
-为了使 crud 应用程序尽可能保持并发,在一方请求处理程序与另一方的单一资源管理器之间进行有效的分工至关重要。 在这里,为了审查,是 `ClichesCreate` 请求处理程序:
+为了使 CRUD 应用程序尽可能保持并发,在一方请求处理程序与另一方的单一资源管理器之间进行有效的分工至关重要。 在这里,为了审查,是 `ClichesCreate` 请求处理程序:
```
func ClichesCreate(res http.ResponseWriter, req *http.Request) {
-
- cliche, counter := getDataFromRequest(req)
-
- cp := new(clichePair)
-
- cp.Cliche = cliche
-
- cp.Counter = counter
-
- cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)}
-
- completeRequest(cr, res, "create")
-
-}ClichesCreateres httpResponseWriterreqclichecountergetDataFromRequestreqcpclichePaircpClicheclichecpCountercountercr&crudRequestverbPOSTcpcpconfirmcompleteRequestcrres
-
+ cliche, counter := getDataFromRequest(req)
+ cp := new(clichePair)
+ cp.Cliche = cliche
+ cp.Counter = counter
+ cr := &crudRequest{verb: POST, cp: cp, confirm: make(chan string)}
+ completeRequest(cr, res, "create")
+}
```
-`ClichesCreate` 调用实用函数 `getDataFromRequest`,它从 POST 请求中提取新的陈词滥调和反陈词滥调。 然后 `ClichesCreate` 函数创建一个新的 `ClichePair`,设置两个字段,并创建一个 `crudRequest` 发送给单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问 `clichesList`。
-请求处理程序调用实用程序函数,该函数从 POST 请求中提取新的陈词滥调和反陈词滥调。 然后,该函数创建一个新的,设置两个字段,并创建 ato 发送到单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问它。
+`ClichesCreate` 调用实用函数 `getDataFromRequest`,它从 POST 请求中提取新的套话和反套话。 然后 `ClichesCreate` 函数创建一个新的 `ClichePair`,设置两个字段,并创建一个 `crudRequest` 发送给单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问 `clichesList`。
+
+请求处理程序调用实用程序函数,该函数从 POST 请求中提取新的套话和反套话。 然后,该函数创建一个新的,设置两个字段,并创建一个 crudRequest 发送到单个资源管理器。 此请求包括一个确认通道,资源管理器使用该通道将信息返回给请求处理程序。 所有设置工作都可以在不涉及资源管理器的情况下完成,因为尚未访问它。
+
+`completeRequest` 实用程序函数在 `ClichesCreate` 函数和其他请求处理程序的末尾调用:
-`completeRequest` 实用程序函数在 `ClichesCreate` 函数和其他请求处理程序的末尾调用
```
completeRequest(cr, res, "create") // shown above
-
```
通过将 `crudRequest` 放入 `crudRequests` 频道,使资源管理器发挥作用:
+
```
func completeRequest(cr *crudRequest, res http.ResponseWriter, logMsg string) {
-
crudRequests<-cr // 向资源托管者发送请求
-
msg := <-cr.confirm // 等待确认
-
res.Write([]byte(msg)) // 向请求方发送确认
-
logIt(logMsg) // 打印到标准输出
-
}
-
```
+
对于 POST 请求,资源管理器调用实用程序函数 `addPair`,它会更改 `clichesList` 资源:
+
```
func addPair(cp *clichePair) string {
-
cp.Id = masterId // 分配一个唯一的 ID
-
masterId++ // 更新 ID 计数器
-
clichesList = append(clichesList, cp) // 更新列表
-
return "\nCreated: " + cp.Cliche + " " + cp.Counter + "\n"
-
}
-
```
-资源管理器为其他CRUD操作调用类似的实用程序函数。 值得重复的是,一旦 Web 服务器开始接受请求,资源管理器就是唯一可以读取或写入 `clichesList` 的 goroutine。
+资源管理器为其他 CRUD 操作调用类似的实用程序函数。 值得重复的是,一旦 Web 服务器开始接受请求,资源管理器就是唯一可以读取或写入 `clichesList` 的 goroutine。
-对于任何类型的 Web 应用程序,`gorilla/mux` 包在简单直观的API中提供请求路由,请求验证和相关服务。 crud web 应用程序突出了软件包的主要功能。 给包裹一个测试驱动,你可能会成为买主。
+对于任何类型的 Web 应用程序,`gorilla/mux` 包在简单直观的 API 中提供请求路由、请求验证和相关服务。 CRUD web 应用程序突出了软件包的主要功能。
--------------------------------------------------------------------------------
@@ -670,7 +462,7 @@ via: https://opensource.com/article/18/8/http-request-routing-validation-gorilla
作者:[Marty Kalin][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[yongshouzhang](https://github.com/yongshouzhang)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 34b70e2c91e67a2b53c5988f9e383dd77b11549e Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 18:28:47 +0800
Subject: [PATCH 111/119] PRF:20180104 How Creative Commons benefits artists
and big business.md
@Valoniakim
---
...mmons benefits artists and big business.md | 43 +++++++++++--------
1 file changed, 25 insertions(+), 18 deletions(-)
diff --git a/translated/talk/20180104 How Creative Commons benefits artists and big business.md b/translated/talk/20180104 How Creative Commons benefits artists and big business.md
index c04ed4c240..aefc804479 100644
--- a/translated/talk/20180104 How Creative Commons benefits artists and big business.md
+++ b/translated/talk/20180104 How Creative Commons benefits artists and big business.md
@@ -1,42 +1,49 @@
-知识共享是怎样造福艺术家和大企业的
+你所不知道的知识共享(CC)
======
+
+> 知识共享为艺术家提供访问权限和原始素材。大公司也从中受益。
+

-我毕业于电影学院,毕业后在一所电影学校教书,之后进入一家主流电影工作室,我一直在从事电影相关的工作。创造业的方方面面面临着同一个问题:创造者需要原材料。有趣的是,自由文化运动提出了解决方案,具体来说是在自由文化运动中出现的知识共享组织。
+我毕业于电影学院,毕业后在一所电影学校教书,之后进入一家主流电影工作室,我一直在从事电影相关的工作。创意产业的方方面面面临着同一个问题:创作者需要原材料。有趣的是,自由文化运动提出了解决方案,具体来说是在自由文化运动中出现的知识共享组织。
-###知识共享能够为我们提供展示片段和小样
+### 知识共享能够为我们提供展示片段和小样
-和其他事情一样,创造力也需要反复练习。幸运的是,在我刚开始接触电脑时,就在一本渲染工场的专业杂志中接触到了开源这个存在。当时我并不理解所谓的“开源”是什么,但我知道只有开源工具能帮助我在领域内稳定发展。对我来说,知识共享也是如此。知识共享可以为艺术家们提供充满丰富艺术资源的工作室。
+和其他事情一样,创造力也需要反复练习。幸运的是,在我刚开始接触电脑时,就在一本关于渲染工场的专业杂志中接触到了开源这个存在。当时我并不理解所谓的“开源”是什么,但我知道只有开源工具能帮助我在领域内稳定发展。对我来说,知识共享也是如此。知识共享可以为艺术家们提供充满丰富艺术资源的工作室。
-我在电影学院任教时,经常需要给学生们准备练习编辑、录音、拟音、分级、评分的脚本。在 Jim Munroe 的独立作品 [Infest Wisely][1] 中和 [Vimeo][2] 上的知识共享里我总能找到我想要的。这些写实的脚本覆盖内容十分广泛,从独立影院出品到昂贵的高质的升降镜头(一般都会用无人机代替)都有。
+我在电影学院任教时,经常需要给学生们准备练习编辑、录音、拟音、分级、评分的示例录像。在 Jim Munroe 的独立作品 [Infest Wisely][1] 中和 [Vimeo][2] 上的知识共享内容里我总能找到我想要的。这些逼真的镜头覆盖内容十分广泛,从独立制作到昂贵的高品质的升降镜头(一般都会用无人机代替)都有。
-对实验艺术来说,确有无尽可能。知识共享提供了丰富的底片材料,这些材料可以用来整合,混剪等等,可以满足一位视觉先锋能够想到的任何用途。
+
-在接触知识共享之前,如果我想要使用写实脚本,我只能用之前的学生和老师拍摄的或者直接使用版权库里的脚本,但这些都有很多局限性。
+对实验主义艺术来说,确有无尽可能。知识共享提供了丰富的素材,这些材料可以用来整合、混剪等等,可以满足一位视觉先锋能够想到的任何用途。
-###坚守版权的底线很重要
+在接触知识共享之前,如果我想要使用写实镜头,如果在大学,只能用之前的学生和老师拍摄的或者直接使用版权库里的镜头,或者使用有受限的版权保护的镜头。
-知识共享同样能够创造经济效益。在某大型计算机公司的渲染工场工作时,我负责在某些硬件设施上测试渲染的运行情况,而这个测试时刻面临着被搁置的风险。做这些测试时,我用的都是[大雄兔][3]的资源,因为这个电影和它的组件都是可以免费使用和分享的。如果没有这个小短片,在接触写实资源之前我都没法完成我的实验,因为对于一个计算机公司来说,雇佣一只3D艺术家来应召布景是不太现实的。
+### 坚守版权的底线很重要
-令我震惊的是,与开源类似,知识共享已经用我们难以想象的方式支撑起了大公司。知识共享的使用或有或无地影响着公司的日常程序,但它填补了不足,让工作流程顺利进行。我没见到谁在他们的书中将流畅工作归功于知识共享的应用,但它确实无处不在。
+知识共享同样能够创造经济效益。在某大型计算机公司的渲染工场工作时,我负责在某些硬件设施上测试渲染的运行情况,而这个测试时刻面临着被搁置的风险。做这些测试时,我用的都是[大雄兔][3]的资源,因为这个电影和它的组件都是可以免费使用和分享的。如果没有这个小短片,在接触写实资源之前我都没法完成我的实验,因为对于一个计算机公司来说,雇佣一只 3D 艺术家来按需布景是不太现实的。
-我也见过一些开放版权的电影,比如[辛特尔][4],在最近的电视节目中播放了它的短片,那时的电视比现在的网络媒体要火得多。
+令我震惊的是,与开源类似,知识共享已经用我们难以想象的方式支撑起了大公司。知识共享的使用可能会也可能不会影响公司的日常流程,但它填补了不足,让工作流程顺利进行。我没见到谁在他们的书中将流畅工作归功于知识共享的应用,但它确实无处不在。
-###知识共享可以提供大量原材料
+
-艺术家需要原材料。画家需要颜料,画笔和画布。雕塑家需要陶土和工具。数字内容编辑师需要数字内容,无论它是剪贴画还是音效或者是电子游戏里的成品精灵。
+我也见过一些开放版权的电影,比如[辛特尔][4],在最近的电视节目中播放了它的短片,电视的分辨率已经超过了标准媒体。
+
+### 知识共享可以提供大量原材料
+
+艺术家需要原材料。画家需要颜料、画笔和画布。雕塑家需要陶土和工具。数字内容编辑师需要数字内容,无论它是剪贴画还是音效或者是电子游戏里的现成的精灵。
数字媒介赋予了人们超能力,让一个人就能完成需要一组人员才能完成的工作。事实上,我们大部分都好高骛远。我们想做高大上的项目,想让我们的成果不论是视觉上还是听觉上都无与伦比。我们想塑造的是宏大的世界,紧张的情节,能引起共鸣的作品,但我们所拥有的时间精力和技能与之都不匹配,达不到想要的效果。
-是知识共享再一次拯救了我们,用 [Freesound.org][5], [Openclipart.org][6], [OpenGameArt.org][7] 等等网站上那些细小的开放版权艺术材料。通过知识共享,艺术家可以使用各种他们自己没办法创造的原材料,来完成他们原本完不成的工作。
+是知识共享再一次拯救了我们,在 [Freesound.org][5]、 [Openclipart.org][6]、 [OpenGameArt.org][7] 等等网站上都有大量的开放版权艺术材料。通过知识共享,艺术家可以使用各种他们自己没办法创造的原材料,来完成他们原本完不成的工作。
-最神奇的是,不用自己投资,你放在网上给大家使用的原材料就能变成精美的作品,而这是你从没想过的。我在知识共享上面分享了很多音乐素材,它们现在用于无数的专辑和电子游戏里。有些人用了我的材料会通知我,有些是我自己发现的,所以这些材料的应用可能比我知道的还有多得多。有时我会偶然看到我亲手画的标志出现在我从没听说过的软件里。我见到过我为[开源网站][8]写的文章在别处发表,有的是论文的参考文献,白皮书或者参考资料中。
+最神奇的是,不用自己投资,你放在网上给大家使用的原材料就能变成精美的作品,而这是你从没想过的。我在知识共享上面分享了很多音乐素材,它们现在用于无数的专辑和电子游戏里。有些人用了我的材料会通知我,有些是我自己发现的,所以这些材料的应用可能比我知道的还有多得多。有时我会偶然看到我亲手画的标志出现在我从没听说过的软件里。我见到过我为 [Opensource.com][8] 写的文章在别处发表,有的是论文的参考文献,白皮书或者参考资料中。
-###知识共享所代表的自由文化也是一种文化
+### 知识共享所代表的自由文化也是一种文化
“自由文化”这个说法过于累赘,文化,从概念上来说,是一个有机的整体。在这种文化中社会逐渐成长发展,从一个人到另一个。它是人与人之间的互动和思想交流。自由文化是自由缺失的现代世界里的特殊产物。
-如果你也想对这样的局限进行反抗,想把你的思想、作品,你自己的文化分享给全世界的人,那么就来和我们一起,使用知识共享吧!
+如果你也想对这样的局限进行反抗,想把你的思想、作品、你自己的文化分享给全世界的人,那么就来和我们一起,使用知识共享吧!
--------------------------------------------------------------------------------
@@ -44,7 +51,7 @@ via: https://opensource.com/article/18/1/creative-commons-real-world
作者:[Seth Kenlon][a]
译者:[Valoniakim](https://github.com/Valoniakim)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 1bdb61b88273c9c95a71b6150a591cf6cc0e787f Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Fri, 14 Dec 2018 18:31:29 +0800
Subject: [PATCH 112/119] PUB:20180104 How Creative Commons benefits artists
and big business.md
@Valoniakim https://linux.cn/article-10347-1.html
---
...0104 How Creative Commons benefits artists and big business.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/talk => published}/20180104 How Creative Commons benefits artists and big business.md (100%)
diff --git a/translated/talk/20180104 How Creative Commons benefits artists and big business.md b/published/20180104 How Creative Commons benefits artists and big business.md
similarity index 100%
rename from translated/talk/20180104 How Creative Commons benefits artists and big business.md
rename to published/20180104 How Creative Commons benefits artists and big business.md
From 4a5986dc8a11fb53aaa95123a3423ca660d0c172 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sat, 15 Dec 2018 09:11:52 +0800
Subject: [PATCH 113/119] PUB:20180814 HTTP request routing and validation with
gorilla-mux.md
@yongshouzhang https://linux.cn/article-10348-1.html
---
...180814 HTTP request routing and validation with gorilla-mux.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180814 HTTP request routing and validation with gorilla-mux.md (100%)
diff --git a/translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md b/published/20180814 HTTP request routing and validation with gorilla-mux.md
similarity index 100%
rename from translated/tech/20180814 HTTP request routing and validation with gorilla-mux.md
rename to published/20180814 HTTP request routing and validation with gorilla-mux.md
From e5fa1a19976943ee9d7a78fd4b9d8dc64f9320d2 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sat, 15 Dec 2018 09:18:45 +0800
Subject: [PATCH 114/119] PUB:20181102 Create a containerized machine learning
model.md
@geekpi https://linux.cn/article-10349-1.html
---
.../20181102 Create a containerized machine learning model.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181102 Create a containerized machine learning model.md (98%)
diff --git a/translated/tech/20181102 Create a containerized machine learning model.md b/published/20181102 Create a containerized machine learning model.md
similarity index 98%
rename from translated/tech/20181102 Create a containerized machine learning model.md
rename to published/20181102 Create a containerized machine learning model.md
index 0bad5a3bc6..a58b658398 100644
--- a/translated/tech/20181102 Create a containerized machine learning model.md
+++ b/published/20181102 Create a containerized machine learning model.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (Create a containerized machine learning model)
[#]: via: (https://fedoramagazine.org/create-containerized-machine-learning-model/)
[#]: author: (Sven Bösiger)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10349-1.html)
创建一个容器化的机器学习模型
======
From 82e68c686fb9eed12811e758103c9a519f74b970 Mon Sep 17 00:00:00 2001
From: HankChow <280630620@qq.com>
Date: Sat, 15 Dec 2018 12:24:27 +0800
Subject: [PATCH 115/119] hankchow translated
---
... Variables- Environmental and Otherwise.md | 222 ------------------
... Variables- Environmental and Otherwise.md | 212 +++++++++++++++++
2 files changed, 212 insertions(+), 222 deletions(-)
delete mode 100644 sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
create mode 100644 translated/tech/20181205 Bash Variables- Environmental and Otherwise.md
diff --git a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md b/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
deleted file mode 100644
index 4df8c10143..0000000000
--- a/sources/tech/20181205 Bash Variables- Environmental and Otherwise.md
+++ /dev/null
@@ -1,222 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (HankChow)
-[#]: reviewer: ( )
-[#]: publisher: ( )
-[#]: subject: (Bash Variables: Environmental and Otherwise)
-[#]: via: (https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise)
-[#]: author: (Paul Brown https://www.linux.com/users/bro66)
-[#]: url: ( )
-
-Bash Variables: Environmental and Otherwise
-======
-
-
-Bash variables, including those pesky _environment variables_ , have been popped up several times in previous articles, and it’s high time you get to know them better and how they can help you.
-
-So, open your terminal window and let's get started.
-
-### Environment Variables
-
-Consider `HOME`. Apart from the cozy place where you lay down your hat, in Linux it is a variable that contains the path to the current user's home directory. Try this:
-
-```
-echo $HOME
-```
-
-This will show the path to your home directory, usually _/home/_.
-
-As the name indicates, variables can change according to the context. Indeed, each user on a Linux system will have a `HOME` variable containing a different value. You can also change the value of a variable by hand:
-
-```
-HOME=/home//Documents
-```
-
-will make `HOME` point to your _Documents/_ folder.
-
-There are three things to notice here:
-
- 1. There are no spaces between the name of the variable and the `=` or between the `=` and the value you are putting into the variable. Spaces have their own meaning in the shell and cannot be used any old way you want.
- 2. If you want to put a value into a variable or manipulate it in any way, you just have to write the name of the variable. If you want to see or use the contents of a variable, you put a `$` in front of it.
- 3. Changing `HOME` is risky! A lot programs rely on `HOME` to do stuff and changing it can have unforeseeable consequences. For example, just for laughs, change `HOME` as shown above and try typing `cd` and then [Enter]. As we have seen elsewhere in this series, you use `cd` to _c_ hange to another _d_ irectory. Without any parameters, `cd` takes you to your home directory. If you change the `HOME` variable, `cd` will take you to the new directory `HOME` points to.
-
-
-
-Changes to environment variables like the one described in point 3 above are not permanent. If you close your terminal and open it back up, or even open a new tab in your terminal window and move there, `echo $HOME` will show its original value.
-
-Before we go on to how you make changes permanent, let's look at another environment variable that it does make sense changing.
-
-### PATH
-
-The `PATH` variable lists directories that contain executable programs. If you ever wondered where your applications go when they are installed and how come the shell seems to magically know which programs it can run without you having to tell it where to look for them, `PATH` is the reason.
-
-Have a look inside `PATH` and you will see something like this:
-
-```
-$ echo $PATH
-/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
-```
-
-Each directory is separated by a colon (`:`) and if you want to run an application installed in any directory other than the ones listed in `PATH`, you will have to tell the shell where to find it:
-
-```
-/home//bin/my_program.sh
-```
-
-This will run a program calle _my_program.sh_ you have copied into a _bin/_ directory in your home directory.
-
-This is a common problem: you don't want to clutter up your system's _bin/_ directories, or you don't want other users running your own personal scripts, but you don't want to have to type out the complete path every time you need to run a script you use often. The solution is to create your own _bin/_ directory in your home directory:
-
-```
-mkdir $HOME/bin
-```
-
-And then tell `PATH` all about it:
-
-```
-PATH=$PATH:$HOME/bin
-```
-
-After that, your _/home//bin_ will show up in your `PATH` variable. But... Wait! We said that the changes you make in a given shell will not last and will lose effect when that shell is closed.
-
-To make changes permanent for your user, instead of running them directly in the shell, put them into a file that gets run every time a shell is started. That file already exists and lives in your home directory. It is called _.bashrc_ and the dot in front of the name makes it a hidden file -- a regular `ls` won't show it, but `ls -a` will.
-
-You can open it with a text editor like [kate][1], [gedit][2], [nano][3], or [vim][4] (NOT LibreOffice Writer -- that's a word processor. Different beast entirely). You will see that _.bashrc_ is full of shell commands the purpose of which are to set up the environment for your user.
-
-Scroll to the bottom and add the following on a new, empty line:
-
-```
-export PATH=$PATH:$HOME/bin
-```
-
-Save and close the file. You'll be seeing what `export` does presently. In the meantime, to make sure the changes take effect immediately, you need to `source` _.bashrc_ :
-
-```
-source .bashrc
-```
-
-What `source` does is execute _.bashrc_ for the current open shell, and all the ones that come after it. The alternative would be to log out and log back in again for the changes to take effect, and who has the time for that?
-
-From now on, your shell will find every program you dump in _/home//bin_ without you having to specify the whole path to the file.
-
-### DYI Variables
-
-You can, of course, make your own variables. All the ones we have seen have been written with ALL CAPS, but [you can call a variable more or less whatever you want][5].
-
-Creating a new variables is straightforward: just set a value within it:
-
-```
-new_variable="Hello"
-```
-
-And you already know how to recover a value contained within a variable:
-
-```
-echo $new_variable
-```
-
-You often have a program that will require you set up a variable for things to work properly. The variable may set an option to "on", or help the program find a library it needs, and so on. When you run a program in Bash, the shell spawns a daughter process. This means it is not exactly the same shell that executes your program, but a related mini-shell that inherits some of the mother's characteristics. Unfortunately, variables, by default, are not one of them. This is because, by default again, variables are _local_. This means that, for security reasons, a variable set in one shell cannot be read in another, even if it is a daughter shell.
-
-To see what I mean, set a variable:
-
-```
-robots="R2D2 & C3PO"
-```
-
-... and run:
-
-```
-bash
-```
-
-You just ran a Bash shell program within a Bash shell program.
-
-Now see if you can read the contents of you variable with:
-
-```
-echo $robots
-```
-
-You should draw a blank.
-
-Still inside your bash-within-bash shell, set `robots` to something different:
-
-```
-robots="These aren't the ones you are looking for"
-```
-
-Check `robots`' value:
-
-```
-$ echo $robots
-These aren't the ones you are looking for
-```
-
-Exit the bash-within-bash shell:
-
-```
-exit
-```
-
-And re-check the value of `robots`:
-
-```
-$ echo $robots
-R2D2 & C3P0
-```
-
-This is very useful to avoid all sorts of messed up configurations, but this presents a problem also: if a program requires you set up a variable, but the program can't access it because Bash will execute it in a daughter process, what can you do? That is exactly what `export` is for.
-
-Try doing the prior experiment, but, instead of just starting off by setting `robots="R2D2 & C3PO"`, export it at the same time:
-
-```
-export robots="R2D2 & C3PO"
-```
-
-You'll notice that, when you enter the bash-within-bash shell, `robots` still retains the same value it had at the outset.
-
-**Interesting fact:** While the daughter process will "inherit" the value of an exported variable, if the variable is changed within the daughter process, changes will not flow upwards to the mother process. In other words, changing the value of an exported variable in a daughter process does not change the value of the original variable in the mother process.
-
-You can see all exported variables by running
-
-```
-export -p
-```
-
-The variables you create should be at the end of the list. You will also notice some other interesting variables in the list: `USER`, for example, contains the current user's user name; `PWD` points to the current directory; and `OLDPWD` contains the path to the last directory you visited and since left. That's because, if you run:
-
-```
-cd -
-```
-
-You will go back to the last directory you visited and `cd` gets the information from `OLDPWD`.
-
-You can also see all the environment variables using the `env` command.
-
-To un-export a variable, use the `-n` option:
-
-```
-export -n robots
-```
-
-### Next Time
-
-You have now reached a level in which you are dangerous to yourself and others. It is time you learned how to protect yourself from yourself by making your environment safer and friendlier through the use of _aliases,_ and that is exactly what we'll be tackling in the next episode. See you then.
-
---------------------------------------------------------------------------------
-
-via: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise
-
-作者:[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.kde.org/applications/utilities/kate/
-[2]: https://help.gnome.org/users/gedit/stable/
-[3]: https://www.nano-editor.org/
-[4]: https://www.vim.org/
-[5]: https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name
diff --git a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md
new file mode 100644
index 0000000000..d77cfd22aa
--- /dev/null
+++ b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md
@@ -0,0 +1,212 @@
+Bash 环境变量的那些事
+======
+
+
+bash 变量,尤其是讨厌的环境变量,已经是一个老生常谈的话题了。我们也更应该对它有一个详细的了解,让它为我们所用。
+
+下面就打开终端,开始吧。
+
+### 环境变量
+
+`HOME` 除了是你脱下帽子惬意休息的地方,同时也是 Linux 中的一个变量,它是当前用户主目录的路径:
+
+```
+echo $HOME
+```
+
+以上这个命令会显示当前用户的主目录路径,通常都在 `/home/` 下。
+
+顾名思义,一个变量的值并不是固定的。实际上,Linux 系统中每一个用户的 `HOME` 变量都是不一样的,当然你也可以这样自行更改 `HOME` 变量的值:
+
+```
+HOME=/home//Documents
+```
+
+以上这个命令将会把 `HOME` 变量设置为 `/home//Documents` 目录。
+
+其中有三点需要留意:
+
+ 1. `=` 符号和其两侧的内容之间不加空格。空格在 shell 中有专门的意义,不能随意地在任何地方添加空格。
+ 2. 如果你需要对变量进行赋值,只需要使用变量名称就可以了。但如果需要读取或者使用变量的值,需要在变量前面加上一个 `$` 号。
+ 3. 更改 `HOME` 变量具有一定的风险。有很多程序是依赖于 `HOME` 变量的,更改 `HOME` 变量可能会导致一些不可预见的结果。例如,如果按照上面的方式更改了 `HOME` 变量,然后执行不带有任何参数的 `cd` 命令,在通常情况下,会跳转到用户的主目录下,但在这个时候,会跳转到 `HOME` 变量指定的目录下。
+
+上面第 3 点中环境变量的更改并不是持久有效的,在终端关闭后重新打开终端,又或者是新建一个终端,执行 `echo $HOME` 命令输出的仍然会是初始的值,而不是重新自定义的值。
+
+在讨论如何持久地更改一个环境变量之前,我们先来看一下另一个比较重要的环境变量。
+
+### PATH 变量
+
+在 `PATH` 变量中存放了一系列目录,而且是放置了可执行程序的目录。正是由于 `PATH` 变量的存在,让你不需要知道应用程序具体安装到了什么目录,而 shell 却可以正确地找到这些应用程序。
+
+如果你查看 `PATH` 变量的值,大概会是以下这样:
+
+```
+$ echo $PATH
+/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin
+```
+
+每两个目录之间使用冒号(`:`)分隔。如果某个应用程序的所在目录不在 `PATH` 变量中,那么运行的时候就需要声明应用程序的目录让 shell 能够找到。
+
+```
+/home//bin/my_program.sh
+```
+
+例如以上命令就会执行当前用户 `bin/` 目录下的 `my_program.sh` 文件。
+
+有一个常见的问题:如果你不希望弄乱系统的 `bin/` 目录,同时也不希望你自己的文件被其它人运行,还不想每次运行的时候都要输入完整的路径,那么,你可以在你的主目录中创建一个独立的 `bin/` 目录:
+
+```
+mkdir $HOME/bin
+```
+
+然后将这个目录添加到 `PATH` 变量中:
+
+```
+PATH=$PATH:$HOME/bin
+```
+
+然后 `/home//bin/` 目录就会出现在 `PATH` 变量中了。但正如之前所说,这个变更只会在当前的 shell 生效,当前的 shell 一旦关闭,环境变量的值就又恢复原状了。
+
+如果要让变更对当前用户持续生效,就不能在 shell 中直接执行对应的变更,而是应该将这些变更操作卸载每次启动 shell 时都会运行的文件当中。这个文件就是当前用户主目录中的 `.bashrc` 文件。文件名前面的点号表明这是一个隐藏文件,执行普通的 `ls` 命令是不会将这个文件显示出来的,但只要在 `ls` 命令中加入 `-a` 参数就可以看到这个文件了。
+
+你可以使用诸如 [kate][1]、[gedit][2]、[nano][3] 或者 [vim][4] 这些文本编辑器来打开 `.bashrc` 文件(但不要用 LibreOffice Writer,它是一个文字处理软件,跟前面几个文字编辑器并不一个量级的东西)。打开 `.bashrc` 文件之后,你会看见里面放置了一些 shell 命令,是用于为当前用户设置环境的。
+
+在文件的末尾添加新行并输入以下内容:
+
+```
+export PATH=$PATH:$HOME/bin
+```
+
+保存并关闭 `.bashrc` 文件,接下来你就会看到 `export` 语句的效果。执行以下的命令让刚才的修改立即生效:
+
+```
+source .bashrc
+```
+
+刚才执行的 `source` 命令让 `.bashrc` 文件在当前的 shell 立即生效,并且对于之后打开的 shell 都会有效。因此另一个等效的方法是退出并重新进入 shell,但这样也太麻烦了。
+
+现在,你的 shell 就能自动寻找到 `/home//bin/` 下的程序了,执行这个目录下的程序也不需要完整地写出程序的路径。
+
+### 自定义变量
+
+当然,你也可以定义自己的变量。刚才我们看到的变量名称都是全大写的,实际上[变量名称的定义还是比较灵活的][5]。
+
+定义新变量的过程非常直观,直接对它赋值就可以了:
+
+```
+new_variable="Hello"
+```
+
+然后可以用一下的方式读取到已定义变量的值:
+
+```
+echo $new_variable
+```
+
+程序的正常工作离不开各种变量,例如要将某个选项设置为 on,又或者让程序找到所需的代码库,都需要使用变量。在 bash 中运行程序的时候会生成一个子 shell,这个子 shell 和执行原程序的父 shell 并不是完全一样的,只是继承了父 shell 的部分内容,而且默认是不继承父 shell 中的变量的。因为变量默认情况下是局部变量,出于安全原因,一个 shell 中的局部变量不会被另一个 shell 读取到,即使是子 shell 也不可以。
+
+下面举一个例子。首先定义一个变量:
+
+```
+robots="R2D2 & C3PO"
+```
+
+然后执行:
+
+```
+bash
+```
+
+现在是在 bash shell 中创建了一个子 shell。
+
+执行这个命令看看还能不能读取到刚才定义的变量:
+
+```
+echo $robots
+```
+
+你会发现读取不到。
+
+还是在这个子 shell 中,为 `robots` 变量赋一个不同的值:
+
+```
+robots="These aren't the ones you are looking for"
+```
+
+再读取一次:
+
+```
+$ echo $robots
+These aren't the ones you are looking for
+```
+
+退出这个子 shell:
+
+```
+exit
+```
+
+然后再看一下现在 `robots` 变量的值:
+
+```
+$ echo $robots
+R2D2 & C3P0
+```
+
+这一个特性可以有效避免配置过程中产生混乱,同时也会导致一个问题:如果程序中需要设置变量,但却由于子 shell 的原因无法正常访问到这个变量,该如何解决呢?这个时候就需要用到 `export` 了。
+
+重复一次刚才的过程,但这一次不是通过 `robots="R2D2 & C3PO"` 方式来设置变量,而是使用 `export` 命令:
+
+```
+export robots="R2D2 & C3PO"
+```
+
+现在你会发现,在进入子 shell 之后,`robots` 变量的值仍然是最初赋予的值。
+
+要注意的是,尽管子 shell 会继承通过 `export` 导出的变量,但如果在子 shell 中对这个变量重新赋值,是不会影响到父 shell 中对应变量的。
+
+如果要查看所有通过 `export` 导出的变量,可以执行以下命令:
+
+```
+export -p
+```
+
+自定义的变量会显示在这个列表的末尾。这个列表中还有一些常见的变量:例如 `USER` 的值是当前用户的用户名,`PWD` 的值是当前用户当前所在的目录,而 `OLDPWD` 的值则是当前用户上一个访问过的目录。因此如果执行:
+
+```
+cd -
+```
+
+就会切换到上一个访问过的目录,那是因为 `cd` 命令读取到了 `OLDPWD` 变量的值。
+
+你也可以使用 `env` 命令查看所有环境变量。
+
+如果要取消导出一个变量,可以加上 `-n` 参数:
+
+```
+export -n robots
+```
+
+### 接下来
+
+了解过环境变量的知识之后,你已经到达了可能对自己和他人造成危险的水平,接下来就需要了解如何通过使用 `_aliases` 来让环境变得更安全、更友好以保护自己了。
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/blog/learn/2018/12/bash-variables-environmental-and-otherwise
+
+作者:[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.kde.org/applications/utilities/kate/
+[2]: https://help.gnome.org/users/gedit/stable/
+[3]: https://www.nano-editor.org/
+[4]: https://www.vim.org/
+[5]: https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name
+
From 5f3454c27ba96c29819ecb9c4220a82bcb7a85c0 Mon Sep 17 00:00:00 2001
From: hopefully2333 <787016457@qq.com>
Date: Sat, 15 Dec 2018 12:52:50 +0800
Subject: [PATCH 116/119] translating by hopefully2333
translating by hopefully2333
---
...ove login security with challenge-response authentication.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/tech/20181022 Improve login security with challenge-response authentication.md b/sources/tech/20181022 Improve login security with challenge-response authentication.md
index 66ed2534b0..ff5cdba354 100644
--- a/sources/tech/20181022 Improve login security with challenge-response authentication.md
+++ b/sources/tech/20181022 Improve login security with challenge-response authentication.md
@@ -1,3 +1,5 @@
+translating by hopefully2333
+
Improve login security with challenge-response authentication
======
From 9a9757403e988a7c6b5e52073553d74484bd1ffb Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sat, 15 Dec 2018 15:06:31 +0800
Subject: [PATCH 117/119] PRF:20181205 Easily Convert Audio File Formats with
SoundConverter in Linux.md
@geekpi
---
...le Formats with SoundConverter in Linux.md | 26 +++++++++++--------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
index 0ad348edb0..30dd467e8f 100644
--- a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
+++ b/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux)
[#]: via: (https://itsfoss.com/sound-converter-linux/)
@@ -10,7 +10,7 @@
在 Linux 中使用 SoundConverter 轻松转换音频文件格式
======
-**如果你正在寻找将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中需要的工具。**
+> 如果你正在寻找将音频文件格式转换为 wav、mp3、ogg 或任何其他格式,SoundConverter 是你在 Linux 中需要的工具。
![Audio Converter in Linux][1]
@@ -18,18 +18,19 @@
不幸的是,Rhythmbox 无法播放 WAV。最重要的是,单个文件大小约为 70MB。想象一下,将这么大的音乐传输到智能手机。它会不必要地占用大量空间。
-所以我认为是时候将 WAV 文件转换为 MP3,这个长青且最流行的音乐文件格式。
+所以我认为是时候将 WAV 文件转换为 MP3 —— 这个长青且最流行的音乐文件格式。
为此,我需要一个在 Linux 中的音频转换器。在这个教程中,我将向你展示如何使用名为 SoundCoverter 的 GUI 工具轻松地将音频文件从一种格式转换为另一种格式。
### 在 Linux 中安装 SoundConverter
-[SoundConverter][3] 是一款流行的免费开源软件。它应该可以在大多数 Linux 发行版的官方仓库中找到。
+[SoundConverter][3] 是一款流行的自由开源软件。它应该可以在大多数 Linux 发行版的官方仓库中找到。
Ubuntu/Linux Mint 用户只需在软件中心搜索 SoundConverter 并从那里安装即可。
![SoundConverter application in Software Center of Ubuntu][4]
-SoundConverter 可以从软件中心安装
+
+*SoundConverter 可以从软件中心安装*
或者,你可以使用命令行方式。在基于 Debian 和 Ubuntu 的系统中,你可以使用以下命令:
@@ -45,14 +46,17 @@ sudo apt install soundconverter
默认界面看起来像这样,它不能比这简单:
-![SoundConverter application interface in Linux][5]Simple Interface
+![SoundConverter application interface in Linux][5]
+
+*简单的界面*
转换音频文件格式只要选择文件并单击转换。
但是,我建议你至少在第一次运行时检查下默认设置。默认情况下,它会将音频文件转换为 OGG 文件格式,你可能不希望这样。
![Preferences in SoundConverter][6]
-可以在“首选项”中更改默认输出设置
+
+*可以在“首选项”中更改默认输出设置*
要更改默认输出设置,请单击界面上的“首选项”图标。你会在这里看到很多可更改的选择。
@@ -62,11 +66,11 @@ sudo apt install soundconverter
你还可以更改输出文件名。默认情况下,它只会更改后缀,但你也可以选择根据曲目编号、标题、艺术家等进行命名。为此,原始文件中应包含适当的元数据。
-说到元数据,你听说过 [MusicBrainz Picard][7]吗?此工具可帮助你自动更新本地音乐文件的元数据。
+说到元数据,你听说过 [MusicBrainz Picard][7] 吗?此工具可帮助你自动更新本地音乐文件的元数据。
### 总结
-我之前用讨论过用一个小程序[在 Linux 中录制音频][8]。这些很棒的工具通过专注某个特定的任务使得生活更轻松。你可以使用成熟和更好的音频编辑工具,如 [Audacity][9],但对于较小的任务,如转换音频文件格式,它可能用起来很复杂。
+我之前用讨论过用一个小程序 [在 Linux 中录制音频][8]。这些很棒的工具通过专注某个特定的任务使得生活更轻松。你可以使用成熟和更好的音频编辑工具,如 [Audacity][9],但对于较小的任务,如转换音频文件格式,它可能用起来很复杂。
我希望你喜欢 SoundConverter。如果你使用其他工具,请在评论中提及,我会在 FOSS 中提及。使用开心!
@@ -77,7 +81,7 @@ via: https://itsfoss.com/sound-converter-linux/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@@ -91,4 +95,4 @@ via: https://itsfoss.com/sound-converter-linux/
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2018/12/sound-converter-app-linux-preferences.jpeg?resize=800%2C431&ssl=1
[7]: https://itsfoss.com/musicbrainz-picard/
[8]: https://itsfoss.com/record-streaming-audio/
-[9]: https://www.audacityteam.org/
\ No newline at end of file
+[9]: https://www.audacityteam.org/
From 7c0f1d12f41b32e847d77cf46fab84c6ad87c20f Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sat, 15 Dec 2018 15:06:58 +0800
Subject: [PATCH 118/119] PUB:20181205 Easily Convert Audio File Formats with
SoundConverter in Linux.md
@geekpi https://linux.cn/article-10350-1.html
---
...Convert Audio File Formats with SoundConverter in Linux.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md (98%)
diff --git a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md b/published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
similarity index 98%
rename from translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
rename to published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
index 30dd467e8f..345dac8ac1 100644
--- a/translated/tech/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
+++ b/published/20181205 Easily Convert Audio File Formats with SoundConverter in Linux.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (Easily Convert Audio File Formats with SoundConverter in Linux)
[#]: via: (https://itsfoss.com/sound-converter-linux/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10350-1.html)
在 Linux 中使用 SoundConverter 轻松转换音频文件格式
======
From bb8cd4ab169d8ed58c29a68d602bf255833dc2b6 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sat, 15 Dec 2018 15:14:08 +0800
Subject: [PATCH 119/119] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E6=96=87=E6=A1=A3=E5=88=B0=E6=96=B0=E7=9A=84=20Wiki=20?=
=?UTF-8?q?=E4=B8=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
LCTT翻译规范.md | 4 -
中文排版指北.md | 294 ------------------------------------------------
选题模板.txt | 65 -----------
3 files changed, 363 deletions(-)
delete mode 100644 LCTT翻译规范.md
delete mode 100644 中文排版指北.md
delete mode 100644 选题模板.txt
diff --git a/LCTT翻译规范.md b/LCTT翻译规范.md
deleted file mode 100644
index b9a514f115..0000000000
--- a/LCTT翻译规范.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Linux中国翻译规范
-1. 翻译中出现的专有名词,可参见Dict.md中的翻译。
-2. 英文人名,如无中文对应译名,一般不译。
-2. 缩写词,一般不须翻译,可考虑旁注中文全名。
\ No newline at end of file
diff --git a/中文排版指北.md b/中文排版指北.md
deleted file mode 100644
index 9888b4dbc1..0000000000
--- a/中文排版指北.md
+++ /dev/null
@@ -1,294 +0,0 @@
-# 中文文案排版指北
-[](https://david-dm.org/mzlogin/chinese-copywriting-guidelines#info=devDependencies)
-
-统一中文文案、排版的相关用法,降低团队成员之间的沟通成本,增强网站气质。
-
-Other languages:
-
-- [English](https://github.com/mzlogin/chinese-copywriting-guidelines/blob/Simplified/README.en.md)
-- [Chinese Traditional](https://github.com/sparanoid/chinese-copywriting-guidelines)
-- [Chinese Simplified](README.md)
-
------
-
-## 目录
-
-- [空格](#空格)
- - [中英文之间需要增加空格](#中英文之间需要增加空格)
- - [中文与数字之间需要增加空格](#中文与数字之间需要增加空格)
- - [数字与单位之间需要增加空格](#数字与单位之间需要增加空格)
- - [全角标点与其他字符之间不加空格](#全角标点与其他字符之间不加空格)
- - [`-ms-text-autospace` to the rescue?](#-ms-text-autospace-to-the-rescue)
-- [标点符号](#标点符号)
- - [不重复使用标点符号](#不重复使用标点符号)
-- [全角和半角](#全角和半角)
- - [使用全角中文标点](#使用全角中文标点)
- - [数字使用半角字符](#数字使用半角字符)
- - [遇到完整的英文整句、特殊名词,其內容使用半角标点](#遇到完整的英文整句特殊名词其內容使用半角标点)
-- [名词](#名词)
- - [专有名词使用正确的大小写](#专有名词使用正确的大小写)
- - [不要使用不地道的缩写](#不要使用不地道的缩写)
-- [争议](#争议)
- - [链接之间增加空格](#链接之间增加空格)
- - [简体中文不要使用直角引号](#简体中文不要使用直角引号)
-- [工具](#工具)
-- [谁在这样做?](#谁在这样做)
-- [参考文献](#参考文献)
-
-## 空格
-
-「有研究显示,打字的时候不喜欢在中文和英文之间加空格的人,感情路都走得很辛苦,有七成的比例会在 34 岁的时候跟自己不爱的人结婚,而其余三成的人最后只能把遗产留给自己的猫。毕竟爱情跟书写都需要适时地留白。
-
-与大家共勉之。」——[vinta/paranoid-auto-spacing](https://github.com/vinta/pangu.js)
-
-### 中英文之间需要增加空格
-
-正确:
-
-> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。
-
-错误:
-
-> 在LeanCloud上,数据存储是围绕`AVObject`进行的。
-
-> 在 LeanCloud上,数据存储是围绕`AVObject` 进行的。
-
-完整的正确用法:
-
-> 在 LeanCloud 上,数据存储是围绕 `AVObject` 进行的。每个 `AVObject` 都包含了与 JSON 兼容的 key-value 对应的数据。数据是 schema-free 的,你不需要在每个 `AVObject` 上提前指定存在哪些键,只要直接设定对应的 key-value 即可。
-
-例外:「豆瓣FM」等产品名词,按照官方所定义的格式书写。
-
-### 中文与数字之间需要增加空格
-
-正确:
-
-> 今天出去买菜花了 5000 元。
-
-错误:
-
-> 今天出去买菜花了 5000元。
-
-> 今天出去买菜花了5000元。
-
-### 数字与单位之间需要增加空格
-
-正确:
-
-> 我家的光纤入户宽带有 10 Gbps,SSD 一共有 20 TB。
-
-错误:
-
-> 我家的光纤入户宽带有 10Gbps,SSD 一共有 10TB。
-
-例外:度/百分比与数字之间不需要增加空格:
-
-正确:
-
-> 今天是 233° 的高温。
-
-> 新 MacBook Pro 有 15% 的 CPU 性能提升。
-
-错误:
-
-> 今天是 233 ° 的高温。
-
-> 新 MacBook Pro 有 15 % 的 CPU 性能提升。
-
-### 全角标点与其他字符之间不加空格
-
-正确:
-
-> 刚刚买了一部 iPhone,好开心!
-
-错误:
-
-> 刚刚买了一部 iPhone ,好开心!
-
-### `-ms-text-autospace` to the rescue?
-
-Microsoft 有个 [`-ms-text-autospace`](http://msdn.microsoft.com/en-us/library/ie/ms531164(v=vs.85).aspx) 的 CSS 属性可以实现自动为中英文之间增加空白。不过目前并未普及,另外在其他应用场景,例如 OS X、iOS 的用户界面目前并不存在这个特性,所以请继续保持随手加空格的习惯。
-
-## 标点符号
-
-### 不重复使用标点符号
-
-正确:
-
-> 德国队竟然战胜了巴西队!
-
-> 她竟然对你说“喵”?!
-
-错误:
-
-> 德国队竟然战胜了巴西队!!
-
-> 德国队竟然战胜了巴西队!!!!!!!!
-
-> 她竟然对你说「喵」??!!
-
-> 她竟然对你说「喵」?!?!??!!
-
-## 全角和半角
-
-不明白什么是全角(全形)与半角(半形)符号?请查看维基百科词条『[全角和半角](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)』。
-
-### 使用全角中文标点
-
-正确:
-
-> 嗨!你知道嘛?今天前台的小妹跟我说“喵”了哎!
-
-> 核磁共振成像(NMRI)是什么原理都不知道?JFGI!
-
-错误:
-
-> 嗨! 你知道嘛? 今天前台的小妹跟我说 "喵" 了哎!
-
-> 嗨!你知道嘛?今天前台的小妹跟我说"喵"了哎!
-
-> 核磁共振成像 (NMRI) 是什么原理都不知道? JFGI!
-
-> 核磁共振成像(NMRI)是什么原理都不知道?JFGI!
-
-### 数字使用半角字符
-
-正确:
-
-> 这件蛋糕只卖 1000 元。
-
-错误:
-
-> 这件蛋糕只卖 1000 元。
-
-例外:在设计稿、宣传海报中如出现极少量数字的情形时,为方便文字对齐,是可以使用全角数字的。
-
-### 遇到完整的英文整句、特殊名词,其內容使用半角标点
-
-正确:
-
-> 乔布斯那句话是怎么说的?“Stay hungry, stay foolish.”
-
-> 推荐你阅读《Hackers & Painters: Big Ideas from the Computer Age》,非常的有趣。
-
-错误:
-
-> 乔布斯那句话是怎么说的?「Stay hungry,stay foolish。」
-
-> 推荐你阅读《Hackers&Painters:Big Ideas from the Computer Age》,非常的有趣。
-
-## 名词
-
-### 专有名词使用正确的大小写
-
-大小写相关用法原属于英文书写范畴,不属于本 wiki 讨论內容,在这里只对部分易错用法进行简述。
-
-正确:
-
-> 使用 GitHub 登录
-
-> 我们的客户有 GitHub、Foursquare、Microsoft Corporation、Google、Facebook, Inc.。
-
-错误:
-
-> 使用 github 登录
-
-> 使用 GITHUB 登录
-
-> 使用 Github 登录
-
-> 使用 gitHub 登录
-
-> 使用 gイんĤЦ8 登录
-
-> 我们的客户有 github、foursquare、microsoft corporation、google、facebook, inc.。
-
-> 我们的客户有 GITHUB、FOURSQUARE、MICROSOFT CORPORATION、GOOGLE、FACEBOOK, INC.。
-
-> 我们的客户有 Github、FourSquare、MicroSoft Corporation、Google、FaceBook, Inc.。
-
-> 我们的客户有 gitHub、fourSquare、microSoft Corporation、google、faceBook, Inc.。
-
-> 我们的客户有 gイんĤЦ8、キouЯƧquムгє、๓เςг๏ร๏Ŧt ς๏гק๏гคtเ๏ภn、900913、ƒ4ᄃëв๏๏к, IПᄃ.。
-
-注意:当网页中需要配合整体视觉风格而出现全部大写/小写的情形,HTML 中请使用标准的大小写规范进行书写;并通过 `text-transform: uppercase;`/`text-transform: lowercase;` 对表现形式进行定义。
-
-### 不要使用不地道的缩写
-
-正确:
-
-> 我们需要一位熟悉 JavaScript、HTML5,至少理解一种框架(如 Backbone.js、AngularJS、React 等)的前端开发者。
-
-错误:
-
-> 我们需要一位熟悉 Js、h5,至少理解一种框架(如 backbone、angular、RJS 等)的 FED。
-
-## 争议
-
-以下用法略带有个人色彩,既:无论是否遵循下述规则,从语法的角度来讲都是**正确**的。
-
-### 链接之间增加空格
-
-用法:
-
-> 请 [提交一个 issue](#) 并分配给相关同事。
-
-> 访问我们网站的最新动态,请 [点击这里](#) 进行订阅!
-
-对比用法:
-
-> 请[提交一个 issue](#) 并分配给相关同事。
-
-> 访问我们网站的最新动态,请[点击这里](#)进行订阅!
-
-### 简体中文不要使用直角引号
-
-不管中英文,如果没有特殊要求,**不要用直角引号**。
-
-## 工具
-
-仓库 | 语言
---- | ---
-[vinta/paranoid-auto-spacing](https://github.com/vinta/paranoid-auto-spacing) | JavaScript
-[huei90/pangu.node](https://github.com/huei90/pangu.node) | Node.js
-[huacnlee/auto-correct](https://github.com/huacnlee/auto-correct) | Ruby
-[sparanoid/space-lover](https://github.com/sparanoid/space-lover) | PHP (WordPress)
-[nauxliu/auto-correct](https://github.com/NauxLiu/auto-correct) | PHP
-[hotoo/pangu.vim](https://github.com/hotoo/pangu.vim) | Vim
-[sparanoid/grunt-auto-spacing](https://github.com/sparanoid/grunt-auto-spacing) | Node.js (Grunt)
-[hjiang/scripts/add-space-between-latin-and-cjk](https://github.com/hjiang/scripts/blob/master/add-space-between-latin-and-cjk) | Python
-
-## 谁在这样做?
-
-网站 | 文案 | UGC
---- | --- | ---
-[Apple 中国](http://www.apple.com/cn/) | Yes | N/A
-[Apple 香港](http://www.apple.com/hk/) | Yes | N/A
-[Apple 台湾](http://www.apple.com/tw/) | Yes | N/A
-[Microsoft 中国](http://www.microsoft.com/zh-cn/) | Yes | N/A
-[Microsoft 香港](http://www.microsoft.com/zh-hk/) | Yes | N/A
-[Microsoft 台湾](http://www.microsoft.com/zh-tw/) | Yes | N/A
-[LeanCloud](https://leancloud.cn/) | Yes | N/A
-[知乎](https://www.zhihu.com/) | Yes | 部分用户达成
-[V2EX](https://www.v2ex.com/) | Yes | Yes
-[SegmentFault](https://segmentfault.com/) | Yes | 部分用户达成
-[Apple4us](http://apple4us.com/) | Yes | N/A
-[豌豆荚](https://www.wandoujia.com/) | Yes | N/A
-[Ruby China](https://ruby-china.org/) | Yes | 标题达成
-[PHPHub](https://phphub.org/) | Yes | 标题达成
-
-## 参考文献
-
-- [Guidelines for Using Capital Letters](http://grammar.about.com/od/punctuationandmechanics/a/Guidelines-For-Using-Capital-Letters.htm)
-- [Letter case - Wikipedia](http://en.wikipedia.org/wiki/Letter_case)
-- [Punctuation - Oxford Dictionaries](http://www.oxforddictionaries.com/words/punctuation)
-- [Punctuation - The Purdue OWL](https://owl.english.purdue.edu/owl/section/1/6/)
-- [How to Use English Punctuation Corrently - wikiHow](http://www.wikihow.com/Use-English-Punctuation-Correctly)
-- [格式 - openSUSE](https://zh.opensuse.org/index.php?title=Help:%E6%A0%BC%E5%BC%8F)
-- [全角和半角 - 维基百科](http://zh.wikipedia.org/wiki/%E5%85%A8%E5%BD%A2%E5%92%8C%E5%8D%8A%E5%BD%A2)
-- [引号 - 维基百科](http://zh.wikipedia.org/wiki/%E5%BC%95%E8%99%9F)
-- [疑问惊叹号 - 维基百科](http://zh.wikipedia.org/wiki/%E7%96%91%E5%95%8F%E9%A9%9A%E5%98%86%E8%99%9F)
-
-## CopyRight
-
-[中文文案排版指北](https://github.com/sparanoid/chinese-copywriting-guidelines)
diff --git a/选题模板.txt b/选题模板.txt
deleted file mode 100644
index 4515fe78ab..0000000000
--- a/选题模板.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-选题标题格式:
-
-```
-原文日期 标题.md
-```
-
-其中:
-
-- 原文日期为该文章发表时的日期,采用 8 位数字表示
-- 标题需去除特殊字符,使用 `_` 替换。
-
-正文内容:
-
-```
-[#]: collector: (选题人 GitHub ID)
-[#]: translator: ( )
-[#]: reviewer: ( )
-[#]: publisher: ( )
-[#]: subject: (文章标题)
-[#]: via: (原文 URL)
-[#]: author: (作者名 作者链接 URL)
-[#]: url: ( )
-
-标题
-=======
-
-### 子一级标题
-
-正文
-
-#### 子二级标题
-
-正文内容
-
-![][1]
-
-### 子一级标题
-
-正文内容 : I have a [dream][2]。
-
---------------------------------------------------------------------------------
-
-via: 原文 链接 URL
-
-作者:[作者名][a]
-译者:[选题 ID][b]
-译者:[译者 ID](https://github.com/译者 ID)
-校对:[校对 ID](https://github.com/校对 ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]: 作者链接 URL
-[b]: 选题链接 URL
-[1]: 图片链接地址
-[2]: 文内链接地址
-```
-
-说明:
-
-1. 标题层级很多时从 `##` 开始
-2. 图片链接和引文链接地址在下方集中写
-3. 因为 Windows 系统文件名有限制,所以文章名不要有特殊符号,如 `\/:*"<>|`,同时也不推荐全大写,或者其它不利阅读的格式
-4. 正文格式参照中文排版指北(https://github.com/LCTT/TranslateProject/blob/master/%E4%B8%AD%E6%96%87%E6%8E%92%E7%89%88%E6%8C%87%E5%8C%97.md)
-5. 我们使用的 markdown 语法和 GitHub 一致。而实际中使用的都是基本语法,比如链接、包含图片、标题、列表、字体控制和代码高亮。
-6. 选题的内容分为两类: 干货和湿货。干货就是技术文章,比如针对某种技术、工具的介绍、讲解和讨论。湿货则是和技术、开发、计算机文化有关的文章。选题时主要就是根据这两条来选择文章,文章需要对大家有益处,篇幅不宜太短,可以是系列文章,也可以是长篇大论,但是文章要有内容,不能有严重的错误,最好不要选择已经有翻译的原文。