From 812d2b6d138263beb91683983bd1b1fe82bb40d5 Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Tue, 27 Nov 2018 23:05:53 +0800
Subject: [PATCH 0001/4278] 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
+======
+扔掉你的打字机,然后使用这些开源工具在命令行上编辑吧。
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE)
+
+对于大多数人(尤其是非技术人员),写作意味着在 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 0002/4278] 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 0003/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20The=20Top=20Com?=
=?UTF-8?q?mand=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
+======
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/11/top-command-720x340.png)
+
+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:
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/11/top-command-1.png)
+
+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
+```
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/11/top-command-3.png)
+
+**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 0004/4278] 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 0005/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20brin?=
=?UTF-8?q?g=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-fortune.png?itok=5PVVZVer)
+
+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 0006/4278] =?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 0007/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Fix?=
=?UTF-8?q?=20Broken=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
+======
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg)
+
+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 0008/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20F-Words=20in=20?=
=?UTF-8?q?Linux=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 0009/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20reasons=20t?=
=?UTF-8?q?o=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tux_linux_penguin_code_binary.jpg?itok=TxGxW0KY)
+
+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 0010/4278] 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 0011/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Bring=20some=20?=
=?UTF-8?q?color=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph)
+
+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:
+![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png)
+
+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
+```
+![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif)
+**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 0012/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Bash=20Variable?=
=?UTF-8?q?s:=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
+======
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/wynand-van-poortvliet-40467-unsplash.jpg?itok=tr6Eb4N0)
+
+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 0013/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Take=20a=20brea?=
=?UTF-8?q?k=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?
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-nyancat.png?itok=eg1aEmBw)
+
+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.
+
+![](https://opensource.com/sites/default/files/uploads/linux-toy-nyancat-animated.gif)
+
+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 98f5dcc5c6a8b55a570496f271869f8d4c3b8104 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Mon, 10 Dec 2018 09:43:03 +0800
Subject: [PATCH 0014/4278] translating
---
...1102 Create a containerized machine learning model.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/sources/tech/20181102 Create a containerized machine learning model.md b/sources/tech/20181102 Create a containerized machine learning model.md
index 3914bd4bee..d0a57d0b72 100644
--- a/sources/tech/20181102 Create a containerized machine learning model.md
+++ b/sources/tech/20181102 Create a containerized machine learning model.md
@@ -1,3 +1,12 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Create a containerized machine learning model)
+[#]: via: (https://fedoramagazine.org/create-containerized-machine-learning-model/)
+[#]: author: (Sven Bösiger)
+[#]: url: ( )
+
Create a containerized machine learning model
======
From ece861b0cb14814483bbb4be41793b281bb533e7 Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Mon, 10 Dec 2018 10:06:43 +0800
Subject: [PATCH 0015/4278] 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 c7dddb2d3b92656b0403158e76da4db7a5945460 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com>
Date: Mon, 10 Dec 2018 11:00:04 +0800
Subject: [PATCH 0016/4278] Update 20180419 Migrating to Linux- Network and
System Settings.md
---
.../20180419 Migrating to Linux- Network and System Settings.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/tech/20180419 Migrating to Linux- Network and System Settings.md b/sources/tech/20180419 Migrating to Linux- Network and System Settings.md
index f3930f1777..50141aedca 100644
--- a/sources/tech/20180419 Migrating to Linux- Network and System Settings.md
+++ b/sources/tech/20180419 Migrating to Linux- Network and System Settings.md
@@ -1,3 +1,5 @@
+ScarboroughCoral translating!
+
Migrating to Linux: Network and System Settings
======
From aa2ef6cc5606694e108c499ecf309229739b74c3 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 10 Dec 2018 18:56:27 +0800
Subject: [PATCH 0017/4278] 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 0018/4278] 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 0019/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Powers=20of=20t?=
=?UTF-8?q?wo,=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-2048.png?itok=3M6S-n1a)
+
+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!
+
+![](https://opensource.com/sites/default/files/uploads/linux-toy-2048-animated_0.gif)
+
+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 0020/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Upda?=
=?UTF-8?q?te=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 0021/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Play=20Tetris?=
=?UTF-8?q?=20at=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.
+
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-tetris.png?itok=_UXtpgzN)
+
+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]!
+
+![](https://opensource.com/sites/default/files/uploads/linux-toy-tetris-animated.gif)
+
+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 0022/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=206=20steps=20to?=
=?UTF-8?q?=20optimize=20software=20delivery=20with=20value=20stream=20map?=
=?UTF-8?q?ping?=
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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk)
+
+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 0023/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Introduction=20?=
=?UTF-8?q?to=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)
+======
+
+![](https://www.creativeapplications.net/wp-content/uploads/2013/12/learnclojure10.jpg)
+
+### 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 0024/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20My=20Google-fre?=
=?UTF-8?q?e=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 0025/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Plan=20your=20o?=
=?UTF-8?q?wn=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cal.png?itok=S0F8RY9k)
+
+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.
+
+![](https://opensource.com/sites/default/files/uploads/linux-toy-cal-animated.gif)
+
+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 0026/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20YAML:=20probabl?=
=?UTF-8?q?y=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 0027/4278] 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 0028/4278] 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
-======
-
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/robot_arm_artificial_ai.png?itok=8CUU3U_7)
-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 0029/4278] 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来管理你的工作站:配置自动化
+======
+
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/robot_arm_artificial_ai.png?itok=8CUU3U_7)
+
+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 0030/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Manage=20NTP=20?=
=?UTF-8?q?with=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk)
+
+> "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 0031/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Screen=20Re?=
=?UTF-8?q?corders=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
+======
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen-record.png?itok=tKWx29k8)
+
+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 0032/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Automatic=20con?=
=?UTF-8?q?tinuous=20development=20and=20delivery=20of=20a=20hybrid=20mobi?=
=?UTF-8?q?le=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd)
+
+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.
+
+![](https://opensource.com/sites/default/files/uploads/3-travis-ci-process.png)
+
+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 0033/4278] =?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
+======
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Boot-Into-Rescue-Mode-Or-Emergency-Mode-720x340.png)
+
+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.
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Grub-menu.png)
+
+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
+```
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Edit-grub-menu.png)
+
+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:
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Ubuntu-rescue-mode.png)
+
+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.
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/emergency-mode-1.png)
+
+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 0034/4278] =?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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/web_browser_desktop_devlopment_design_system_computer.jpg?itok=pfqRrJgh)
+
+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:
+![](https://opensource.com/sites/default/files/uploads/xml_menu.png)
+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:
+
+![](https://opensource.com/sites/default/files/uploads/xml_modified-menu.png)
+
+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:
+
+![](https://opensource.com/sites/default/files/uploads/xml_scribusmenuinbrowser.png)
+
+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:
+
+![](https://opensource.com/sites/default/files/uploads/xml_tabular_begin.png)
+
+One of the features I created was the color coding used in the listing shown here:
+
+![](https://opensource.com/sites/default/files/uploads/xml_tabular_body.png)
+
+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 0035/4278] =?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 0036/4278] 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 或在终端中使用上述命令启动应用程序。
### 添加存档
第一次启动时,会看到下面的欢迎界面:
+
![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-1.png)
-我们还没有添加任何存档,所以让我们添加一个吧。单击“New Archive File”按钮,输入存档文件的名称,并选择它的保存位置。
+我们还没有添加任何存档,所以让我们添加一个吧。单击 “New Archive File” 按钮,输入存档文件的名称,并选择它的保存位置。
+
![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-2.png)
-你可以随意命名。我把它命名为“mypass”,存档将以 **.bcup** 为扩展名保存在你选择的位置。
+你可以随意命名。我把它命名为 “mypass”,存档将以 .bcup 为扩展名保存在你选择的位置。
-如果你已经创建了一个,只需单击“Open Archive File”来选择它。
+如果你已经创建了一个,只需单击 “Open Archive File” 来选择它。
-接下来,buttercup 将提示你为新创建的存档输入主密码,建议提供一个强级别的密码,以保护存档不受未经授权的访问。
+接下来,Buttercup 将提示你为新创建的存档输入主密码,建议提供一个强级别的密码,以保护存档不会被未经授权访问。
![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-3.png)
@@ -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” 按钮来添加新的条目,输入你想要保存的账户的信息。
![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-5-1.png)
-在每个条目下面都有一个“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”。
![](https://www.ostechnix.com/wp-content/uploads/2018/11/buttercup-8.png)
@@ -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 0037/4278] 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 0038/4278] [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 0039/4278] 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 0040/4278] 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 0041/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Snake=20your=20?=
=?UTF-8?q?way=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-snake.png?itok=oNhqUTDu)
+
+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].
+![](https://opensource.com/sites/default/files/uploads/linux-toy-snake-animated.gif)
+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 0042/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20get?=
=?UTF-8?q?=20started=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_)
+
+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 0043/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20McFly=20?=
=?UTF-8?q?=E2=80=93=20A=20Replacement=20To=20=E2=80=98Ctrl+R=E2=80=99=20B?=
=?UTF-8?q?ash=20History=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
+======
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/mcfly-720x340.png)
+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
+```
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/install-mcfly.png)
+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:
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/mcfly-command-1.png)
+
+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:
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/mcfly-demo.gif)
+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 0044/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Four=20Easy=20W?=
=?UTF-8?q?ays=20to=20Search=20Or=20Find=20Files=20And=20Folders=20in=20Li?=
=?UTF-8?q?nux?=
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 0045/4278] 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 种方法
-======
-如何表达你的感激之情。
-![](https://opensource.com/users/moshez)
+=======
-每天,我都使用高质量的软件,这些软件由没有要求付款的人开发和维护,他们尊重我的自由,并且慷慨地付出时间和精力。
+> 如何表达你的感激之情。
+
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/world_hands_diversity.png?itok=zm4EDxgE)
+
+每天,我使用的那些高质量的软件 —— 开发和维护这些软件的人不需要我为之付款,他们尊重我的自由,并且慷慨地付出时间和精力。
在这个感恩的季节,我鼓励那些也使用和欣赏开源和自由软件维护者工作的人表达你的感激之情。以下是十种方法:
### 容易做到的
- 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 0046/4278] 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 0047/4278] 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 0048/4278] 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 0049/4278] 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 0050/4278] 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 0051/4278] 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 实用程序将牛的声音带到你的终端输出。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cowsay.png?itok=RA4NDbrY)
-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 0052/4278] 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 0053/4278] 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 命令行下进行时间管理
======
+> 学习如何在命令行下用这些方法自己组织待办事项。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_terminals.png?itok=CfBqYBah)
-很多文章讨论关于命令行下如何做事情。有多少文章要么用晦涩的方式介绍 `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 0054/4278] 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 0055/4278] 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
-======
-
-![](https://i.imgur.com/0mzQMcB.png)
-
-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 @@
+数据科学家的命令行技巧
+======
+
+![](https://i.imgur.com/0mzQMcB.png)
+
+对于许多数据科学家来说,数据操作始于和结束于 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 0056/4278] 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 @@
无服务器架构的三个意义
======
-对于无服务器架构,什么时候该用,什么时候不该用呢?
+
+> 以及,对于无服务器架构,什么时候该用,什么时候不该用呢?
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR)
如果将如今互联网体验中最方便实用的那一部分去掉,那么留下来的基本就是客户端-服务端模式了。这一个模式在互联网建立初期就已经在使用了,直到目前都没有太大的变化,也就是说,这个模式仍然在为我们服务。
-那么,当人们谈论无服务器架构的时候,到底是指什么呢?其实,无服务器架构并不是说不使用服务器了。恰恰相反,客户端-服务端模式仍然在其中发挥着重要的作用。
+那么,当人们谈论无服务器架构的时候,到底是指什么呢?其实,无服务器架构并不是说不使用服务器了。恰恰相反,客户端-服务端模式仍然在其中发挥着重要的作用。
无服务器架构实际上指的是能够让开发者在不需要关心服务器上架、为操作系统打补丁、创建容器镜像这些工作的情况下,就能够完成编码、部署和创建应用这一整套流程的架构。
### 无服务器架构的三个重要意义
- 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 0057/4278] 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 0058/4278] 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 0059/4278] 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 0060/4278] 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 0061/4278] 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 0062/4278] 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 0063/4278] 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 0064/4278] 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 0065/4278] 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 0066/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Open=20source?=
=?UTF-8?q?=20DIY=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 0067/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Winterize=20you?=
=?UTF-8?q?r=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?
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-bash-prompt.png?itok=HK_kVn37)
+
+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 0068/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Inst?=
=?UTF-8?q?all=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 0069/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20To=20Benc?=
=?UTF-8?q?hmark=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
+======
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/benchmark-720x340.png)
+
+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:**
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-1.png)
+
+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
+```
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-2-1.png)
+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:
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Benchmark-commands-3.png)
+
+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'
+```
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/hyperfine-1.png)
+
+Benchmark multiple commands/programs:
+
+```
+$ hyperfine htop ptop
+```
+
+Sample output:
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/hyperfine-2.png)
+
+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 0070/4278] 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 0071/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Ways=20To?=
=?UTF-8?q?=20Check=20Laptop=20Battery=20Status=20And=20Level=20From=20Lin?=
=?UTF-8?q?ux=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 0072/4278] =?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 0073/4278] 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.
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K)
-
-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.
-![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png)
-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 0074/4278] 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 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K)
+
+对于许多使用计算机很多年的用户来说,自从第一批 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 键,如下所示。![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png)
+
+具体步骤如下:
+
+ 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 0075/4278] 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 0076/4278] 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 0077/4278] 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 0078/4278] 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 0079/4278] 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
+创建一个容器化的机器学习模型
======
![](https://fedoramagazine.org/wp-content/uploads/2018/10/machinelearning-816x345.jpg)
-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 0080/4278] 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 0081/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Top=205=20confi?=
=?UTF-8?q?guration=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M)
+
+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 0082/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Patch=20into=20?=
=?UTF-8?q?The=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.
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr)
+
+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.
+![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif)
+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 0083/4278] =?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 0084/4278] 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 0085/4278] 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 0086/4278] 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
======
-扔掉你的打字机,然后使用这些开源工具在命令行上编辑吧。
+扔掉你的打字机,然后使用这些开源工具在命令行上写作吧。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE)
-对于大多数人(尤其是非技术人员),写作意味着在 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 0087/4278] 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 @@
-使用开放决策框架收集项目需求
+降低项目失败率的三个原则
======
+> 透明和包容性的项目要求可以降低您的失败率。 以下是如何协作收集它们。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/suitcase_container_bag.png?itok=q40lKCBY)
-众所周知,明确、简洁和可衡量的需求会带来更多成功的项目。一项关于[麦肯锡与牛津大学][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 0088/4278] 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 0089/4278] 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.
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE)
-
-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 0090/4278] 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
-======
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT)
-
-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 @@
+认识存储:块、文件和对象
+======
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT)
+
+现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。
+
+ 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 0091/4278] 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 @@
![](https://i.imgur.com/0mzQMcB.png)
-对于许多数据科学家来说,数据操作始于和结束于 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 0092/4278] 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 0093/4278] 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 个命令行工具
======
-扔掉你的打字机,然后使用这些开源工具在命令行上写作吧。
+
+> 扔掉你的文字编辑器,然后使用这些开源工具在命令行上写作吧。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE)
-对于大多数人(尤其是非技术人员),写作意味着在 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 0094/4278] 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 0095/4278] 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 中使用控制运算符连接命令
======
-在命令行中,使用控制运算符为复合命令添加逻辑。
+
+> 在命令行中,使用控制运算符为复合命令添加逻辑。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-yearbook-best-couple.png?itok=a_99oCdE)
-一些简单的复合指令——比如说在一个命令行中连接几个命令——是经常使用的。这些命令使用分号分隔,表示一个命令结束。为了在一个命令行中创建一系列简单的 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 0096/4278] 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 0097/4278] 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.
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph)
-
-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:
-![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png)
-
-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
-```
-![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif)
-**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 终端带来一些颜色
+======
+使用这个简单的程序,你可以为所需的任何程序的输出添加彩色。
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph)
+
+今天是 Linux 命令行玩具日历的第五天。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏,或任何简单的可以帮助你在终端玩得开心的东西。
+
+很可能你们中的一些人之前已经看过我们日历中的各种选择,但我们希望每个人至少见到一件新事物。
+
+今日的选择,**lolcat**,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。
+
+```
+$ gem install lolcat
+```
+
+之后,只需将一些文本传送给它,就可以看到彩色的输出。例如,尝试几个之前在我们的日历中出现的程序,使用以下命令:
+
+```
+$ fortune | boxes -a c -d parchment | lolcat
+```
+
+根据你的运气,你可能会看到这样:
+![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png)
+
+你可以传递给 **lolcat** 一些参数而不必重复它们,我建议你访问 **lolcat** 的 [GitHub 页面][1] 或者在终端输入 **lolcat --help** 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画打印?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的句子列表中的适合猫的句子。
+
+```
+fortune -m "nine tails" | boxes -a c -d cat | lolcat -a
+```
+![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif)
+**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 0098/4278] 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 0099/4278] 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 @@
-一种新的用于安全检测的方法
+一种新的安全检测的方法
======
+> 不要只测试已有系统,强安全要求更积极主动的策略。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_privacy_lock.png?itok=ZWjrpFzx)
我们当中有多少人曾说出过下面这句话:“我希望这能起到作用!”?
-毫无疑问,我们中的大多数人可能都不止一次地说过这句话。这句话不是用来激发信心的,相反它揭示了我们对自身能力和当前正在测试功能的怀疑。不幸的是,这句话非常好地描述了我们传统的安全模型。我们的运营基于这样的假设,并希望我们实施的控制措施——从 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 0100/4278] 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 0101/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20How=20to=20Buil?=
=?UTF-8?q?d=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
+======
+
+![](https://fedoramagazine.org/wp-content/uploads/2018/12/netboot2-816x345.jpg)
+
+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 0102/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Aliases:=20DIY?=
=?UTF-8?q?=20Shell=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
+======
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV)
+
+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 0103/4278] 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 实用程序将牛的话语带到你的终端输出。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cowsay.png?itok=RA4NDbrY)
欢迎来到 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 0104/4278] 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 0105/4278] 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 0106/4278] 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 0107/4278] =?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 0108/4278] 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 0109/4278] 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 0110/4278] 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 0111/4278] 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 请求路由、验证和其它服务。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr)
-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 0112/4278] 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)
======
+
+> 知识共享为艺术家提供访问权限和原始素材。大公司也从中受益。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/CreativeCommons_ideas_520x292_1112JS.png?itok=otei0vKb)
-我毕业于电影学院,毕业后在一所电影学校教书,之后进入一家主流电影工作室,我一直在从事电影相关的工作。创造业的方方面面面临着同一个问题:创造者需要原材料。有趣的是,自由文化运动提出了解决方案,具体来说是在自由文化运动中出现的知识共享组织。
+我毕业于电影学院,毕业后在一所电影学校教书,之后进入一家主流电影工作室,我一直在从事电影相关的工作。创意产业的方方面面面临着同一个问题:创作者需要原材料。有趣的是,自由文化运动提出了解决方案,具体来说是在自由文化运动中出现的知识共享组织。
-###知识共享能够为我们提供展示片段和小样
+### 知识共享能够为我们提供展示片段和小样
-和其他事情一样,创造力也需要反复练习。幸运的是,在我刚开始接触电脑时,就在一本渲染工场的专业杂志中接触到了开源这个存在。当时我并不理解所谓的“开源”是什么,但我知道只有开源工具能帮助我在领域内稳定发展。对我来说,知识共享也是如此。知识共享可以为艺术家们提供充满丰富艺术资源的工作室。
+和其他事情一样,创造力也需要反复练习。幸运的是,在我刚开始接触电脑时,就在一本关于渲染工场的专业杂志中接触到了开源这个存在。当时我并不理解所谓的“开源”是什么,但我知道只有开源工具能帮助我在领域内稳定发展。对我来说,知识共享也是如此。知识共享可以为艺术家们提供充满丰富艺术资源的工作室。
-我在电影学院任教时,经常需要给学生们准备练习编辑、录音、拟音、分级、评分的脚本。在 Jim Munroe 的独立作品 [Infest Wisely][1] 中和 [Vimeo][2] 上的知识共享里我总能找到我想要的。这些写实的脚本覆盖内容十分广泛,从独立影院出品到昂贵的高质的升降镜头(一般都会用无人机代替)都有。
+我在电影学院任教时,经常需要给学生们准备练习编辑、录音、拟音、分级、评分的示例录像。在 Jim Munroe 的独立作品 [Infest Wisely][1] 中和 [Vimeo][2] 上的知识共享内容里我总能找到我想要的。这些逼真的镜头覆盖内容十分广泛,从独立制作到昂贵的高品质的升降镜头(一般都会用无人机代替)都有。
-对实验艺术来说,确有无尽可能。知识共享提供了丰富的底片材料,这些材料可以用来整合,混剪等等,可以满足一位视觉先锋能够想到的任何用途。
+![](https://opensource.com/sites/default/files/u128651/bunny.png)
-在接触知识共享之前,如果我想要使用写实脚本,我只能用之前的学生和老师拍摄的或者直接使用版权库里的脚本,但这些都有很多局限性。
+对实验主义艺术来说,确有无尽可能。知识共享提供了丰富的素材,这些材料可以用来整合、混剪等等,可以满足一位视觉先锋能够想到的任何用途。
-###坚守版权的底线很重要
+在接触知识共享之前,如果我想要使用写实镜头,如果在大学,只能用之前的学生和老师拍摄的或者直接使用版权库里的镜头,或者使用有受限的版权保护的镜头。
-知识共享同样能够创造经济效益。在某大型计算机公司的渲染工场工作时,我负责在某些硬件设施上测试渲染的运行情况,而这个测试时刻面临着被搁置的风险。做这些测试时,我用的都是[大雄兔][3]的资源,因为这个电影和它的组件都是可以免费使用和分享的。如果没有这个小短片,在接触写实资源之前我都没法完成我的实验,因为对于一个计算机公司来说,雇佣一只3D艺术家来应召布景是不太现实的。
+### 坚守版权的底线很重要
-令我震惊的是,与开源类似,知识共享已经用我们难以想象的方式支撑起了大公司。知识共享的使用或有或无地影响着公司的日常程序,但它填补了不足,让工作流程顺利进行。我没见到谁在他们的书中将流畅工作归功于知识共享的应用,但它确实无处不在。
+知识共享同样能够创造经济效益。在某大型计算机公司的渲染工场工作时,我负责在某些硬件设施上测试渲染的运行情况,而这个测试时刻面临着被搁置的风险。做这些测试时,我用的都是[大雄兔][3]的资源,因为这个电影和它的组件都是可以免费使用和分享的。如果没有这个小短片,在接触写实资源之前我都没法完成我的实验,因为对于一个计算机公司来说,雇佣一只 3D 艺术家来按需布景是不太现实的。
-我也见过一些开放版权的电影,比如[辛特尔][4],在最近的电视节目中播放了它的短片,那时的电视比现在的网络媒体要火得多。
+令我震惊的是,与开源类似,知识共享已经用我们难以想象的方式支撑起了大公司。知识共享的使用可能会也可能不会影响公司的日常流程,但它填补了不足,让工作流程顺利进行。我没见到谁在他们的书中将流畅工作归功于知识共享的应用,但它确实无处不在。
-###知识共享可以提供大量原材料
+![](https://opensource.com/sites/default/files/u128651/sintel.png)
-艺术家需要原材料。画家需要颜料,画笔和画布。雕塑家需要陶土和工具。数字内容编辑师需要数字内容,无论它是剪贴画还是音效或者是电子游戏里的成品精灵。
+我也见过一些开放版权的电影,比如[辛特尔][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 0113/4278] 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 0114/4278] 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 0115/4278] 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 0116/4278] 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
-======
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/wynand-van-poortvliet-40467-unsplash.jpg?itok=tr6Eb4N0)
-
-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 环境变量的那些事
+======
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/wynand-van-poortvliet-40467-unsplash.jpg?itok=tr6Eb4N0)
+
+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 0117/4278] 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 0118/4278] 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 0119/4278] 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 0120/4278] =?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 @@
-# 中文文案排版指北
-[![devDependency Status](https://david-dm.org/mzlogin/chinese-copywriting-guidelines/dev-status.svg)](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. 选题的内容分为两类: 干货和湿货。干货就是技术文章,比如针对某种技术、工具的介绍、讲解和讨论。湿货则是和技术、开发、计算机文化有关的文章。选题时主要就是根据这两条来选择文章,文章需要对大家有益处,篇幅不宜太短,可以是系列文章,也可以是长篇大论,但是文章要有内容,不能有严重的错误,最好不要选择已经有翻译的原文。
From 69e0f0ad82fa51c88e7e19726683cd938b18e841 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com>
Date: Sat, 15 Dec 2018 19:52:34 +0800
Subject: [PATCH 0121/4278] Create 20180419 Migrating to Linux- Network and
System Settings.md
---
...g to Linux- Network and System Settings.md | 128 ++++++++++++++++++
1 file changed, 128 insertions(+)
create mode 100644 translated/tech/20180419 Migrating to Linux- Network and System Settings.md
diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md
new file mode 100644
index 0000000000..480aa05239
--- /dev/null
+++ b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md
@@ -0,0 +1,128 @@
+# 迁移到 Linux 工作环境: 网络和系统设置
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO)
+
+在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问:
+
+[Part 1 - 基本介绍][1]
+
+[Part 2 - 磁盘、文件和文件系统][2]
+
+[Part 3 - 图形界面环境][3]
+
+[Part 4 - 命令行][4]
+
+[Part 5 - 使用 sudo 命令][5]
+
+[Part 6 - 软件安装][6]
+
+Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。
+
+
+
+大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。
+
+
+
+### 连接因特网
+
+在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。
+
+如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。
+
+在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。
+
+![Network Settings][8]
+
+图1: Gnome 桌面网络设置指示器图标.
+
+[经许可使用][9]
+
+### 网络接口名称
+
+在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。
+
+### 通过命令行进行网络管理
+
+如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。
+
+请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。
+
+更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ)
+
+图 2:nmtui 界面
+
+[经许可使用][9]
+
+在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。
+
+以下是一些允许您显示和更改网络设置的命令:
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ)
+
+[经许可使用][9]
+
+### 进程和系统信息
+
+在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。
+
+在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA)
+
+图 3:NetHogs 截图
+
+[经许可使用][9]
+
+在这些工具中,你也可以查看系统全局网络流量(图 4)。
+
+![System Monitor][11]
+
+图4: Gnome System Monitor 的截图
+
+[经许可使用][9]
+
+### 管理进程和系统使用
+
+您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。
+
+大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl)
+
+top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。
+
+使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。
+
+使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。
+
+本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。
+
+想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx.
+
+------
+
+via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings
+
+作者:[John Bonesio][a]
+选题:[lujun9972](https://github.com/lujun9972)
+译者:[ScarboroughCoral](https://github.com/ScarboroughCoral)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://www.linux.com/users/johnbonesio
+[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
+[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
+[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
+[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
+[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
+[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
+[7]: https://www.linux.com/files/images/figure-1png-2
+[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings"
+[9]: https://www.linux.com/licenses/category/used-permission
+[10]: https://www.linux.com/files/images/figure-4png-1
+[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor"
+[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
From dadff90637d2d7bf81e1f449a8583fa9fc49d9bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com>
Date: Sat, 15 Dec 2018 19:53:59 +0800
Subject: [PATCH 0122/4278] Delete 20180419 Migrating to Linux- Network and
System Settings.md
---
...g to Linux- Network and System Settings.md | 118 ------------------
1 file changed, 118 deletions(-)
delete mode 100644 sources/tech/20180419 Migrating to Linux- Network and System Settings.md
diff --git a/sources/tech/20180419 Migrating to Linux- Network and System Settings.md b/sources/tech/20180419 Migrating to Linux- Network and System Settings.md
deleted file mode 100644
index 50141aedca..0000000000
--- a/sources/tech/20180419 Migrating to Linux- Network and System Settings.md
+++ /dev/null
@@ -1,118 +0,0 @@
-ScarboroughCoral translating!
-
-Migrating to Linux: Network and System Settings
-======
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO)
-In this series, we provide an overview of fundamentals to help you successfully make the transition to Linux from another operating system. If you missed the earlier articles in the series, you can find them here:
-
-[Part 1 - An Introduction][1]
-
-[Part 2 - Disks, Files, and Filesystems][2]
-
-[Part 3 - Graphical Environments][3]
-
-[Part 4 - The Command Line][4]
-
-[Part 5 - Using sudo][5]
-
-[Part 6 - Installing Software][6]
-
-Linux gives you a lot of control over network and system settings. On your desktop, Linux lets you tweak just about anything on the system. Most of these settings are exposed in plain text files under the /etc directory. Here I describe some of the most common settings you’ll use on your desktop Linux system.
-
-A lot of settings can be found in the Settings program, and the available options will vary by Linux distribution. Usually, you can change the background, tweak sound volume, connect to printers, set up displays, and more. While I won't talk about all of the settings here, you can certainly explore what's in there.
-
-### Connect to the Internet
-
-Connecting to the Internet in Linux is often fairly straightforward. If you are wired through an Ethernet cable, Linux will usually get an IP address and connect automatically when the cable is plugged in or at startup if the cable is already connected.
-
-If you are using wireless, in most distributions there is a menu, either in the indicator panel or in settings (depending on your distribution), where you can select the SSID for your wireless network. If the network is password protected, it will usually prompt you for the password. Afterward, it connects, and the process is fairly smooth.
-
-You can adjust network settings in the graphical environment by going into settings. Sometimes this is called System Settings or just Settings. Often you can easily spot the settings program because its icon is a gear or a picture of tools (Figure 1).
-
-
-![Network Settings][8]
-
-Figure 1: Gnome Desktop Network Settings Indicator Icon.
-
-[Used with permission][9]
-
-### Network Interface Names
-
-Under Linux, network devices have names. Historically, these are given names like eth0 and wlan0 -- or Ethernet and wireless, respectively. Newer Linux systems have been using different names that appear more esoteric, like enp4s0 and wlp5s0. If the name starts with en, it's a wired Ethernet interface. If it starts with wl, it's a wireless interface. The rest of the letters and numbers reflect how the device is connected to hardware.
-
-### Network Management from the Command Line
-
-If you want more control over your network settings, or if you are managing network connections without a graphical desktop, you can also manage the network from the command line.
-
-Note that the most common service used to manage networks in a graphical desktop is the Network Manager, and Network Manager will often override setting changes made on the command line. If you are using the Network Manager, it's best to change your settings in its interface so it doesn't undo the changes you make from the command line or someplace else.
-
-Changing settings in the graphical environment is very likely to be interacting with the Network Manager, and you can also change Network Manager settings from the command line using the tool called nmtui. The nmtui tool provides all the settings that you find in the graphical environment but gives it in a text-based semi-graphical interface that works on the command line (Figure 2).
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ)
-
-On the command line, there is an older tool called ifconfig to manage networks and a newer one called ip. On some distributions, ifconfig is considered to be deprecated and is not even installed by default. On other distributions, ifconfig is still in use.
-
-Here are some commands that will allow you to display and change network settings:
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ)
-
-### Process and System Information
-
-In Windows, you can go into the Task Manager to see a list of the all the programs and services that are running. You can also stop programs from running. And you can view system performance in some of the tabs displayed there.
-
-You can do similar things in Linux both from the command line and from graphical tools. In Linux, there are a few graphical tools available depending on your distribution. The most common ones are System Monitor or KSysGuard. In these tools, you can see system performance, see a list of processes, and even kill processes (Figure 3).
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA)
-
-In these tools, you can also view global network traffic on your system (Figure 4).
-
-
-![System Monitor][11]
-
-Figure 4: Screenshot of Gnome System Monitor.
-
-[Used with permission][9]
-
-### Managing Process and System Usage
-
-There are also quite a few tools you can use from the command line. The command ps can be used to list processes on your system. By default, it will list processes running in your current terminal session. But you can list other processes by giving it various command line options. You can get more help on ps with the commands info ps, or man ps.
-
-Most folks though want to get a list of processes because they would like to stop the one that is using up too much memory or CPU time. In this case, there are two commands that make this task much easier. These are top and htop (Figure 5).
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl)
-
-The top and htop tools work very similarly to each other. These commands update their list every second or two and re-sort the list so that the task using the most CPU is at the top. You can also change the sorting to sort by other resources as well such as memory usage.
-
-In either of these programs (top and htop), you can type '?' to get help, and 'q' to quit. With top, you can press 'k' to kill a process and then type in the unique PID number for the process to kill it.
-
-With htop, you can highlight a task by pressing down arrow or up arrow to move the highlight bar, and then press F9 to kill the task followed by Enter to confirm.
-
-The information and tools provided in this series will help you get started with Linux. With a little time and patience, you'll feel right at home.
-
-Learn more about Linux through the free ["Introduction to Linux" ][12]course from The Linux Foundation and edX.
-
---------------------------------------------------------------------------------
-
-via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-settings
-
-作者:[John Bonesio][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/johnbonesio
-[1]:https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
-[2]:https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
-[3]:https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
-[4]:https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
-[5]:https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
-[6]:https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
-[7]:https://www.linux.com/files/images/figure-1png-2
-[8]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 (Network Settings)
-[9]:https://www.linux.com/licenses/category/used-permission
-[10]:https://www.linux.com/files/images/figure-4png-1
-[11]:https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF (System Monitor)
-[12]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
From 712d4fdc9836cbeae33772b3fef5c663d6f0ca7a Mon Sep 17 00:00:00 2001
From: dianbanjiu
Date: Sat, 15 Dec 2018 21:21:54 +0800
Subject: [PATCH 0123/4278] translating
---
...Check Laptop Battery Status And Level From Linux Terminal.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
index 631efa91f9..1f94cd1045 100644
--- 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
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (dianbanjiu )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From 64cebbbd73ec258d74b9afc20211684aa5fe7a38 Mon Sep 17 00:00:00 2001
From: HankChow <280630620@qq.com>
Date: Sun, 16 Dec 2018 03:26:05 +0800
Subject: [PATCH 0124/4278] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=84?=
=?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=94=99=E8=AF=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../20181205 Bash Variables- Environmental and Otherwise.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md
index d77cfd22aa..c6786eef15 100644
--- a/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md
+++ b/translated/tech/20181205 Bash Variables- Environmental and Otherwise.md
@@ -189,7 +189,7 @@ export -n robots
### 接下来
-了解过环境变量的知识之后,你已经到达了可能对自己和他人造成危险的水平,接下来就需要了解如何通过使用 `_aliases` 来让环境变得更安全、更友好以保护自己了。
+了解过环境变量的知识之后,你已经到达了可能对自己和他人造成危险的水平,接下来就需要了解如何通过使用别名来让环境变得更安全、更友好以保护自己了。
--------------------------------------------------------------------------------
From b77746f0d6282e5584490eab2e0e5bb6df6eb3a2 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 11:03:15 +0800
Subject: [PATCH 0125/4278] PRF:20181204 Have a cow at the Linux command
line.md
@heguangzhi
---
published/20181204 Have a cow at the Linux command line.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/published/20181204 Have a cow at the Linux command line.md b/published/20181204 Have a cow at the Linux command line.md
index ad7b054d9a..0d0f260bb8 100644
--- a/published/20181204 Have a cow at the Linux command line.md
+++ b/published/20181204 Have a cow at the Linux command line.md
@@ -23,13 +23,13 @@
`cowsay` 是一个神奇的实用程序,它将文本作为 ASCII 艺术牛的讲话文本输出。
-你可能会发现 `cowsey` 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装:
+你可能会发现 `cowsay` 打包在你的默认存储库中,甚至可能已经安装了。对我来说,在 Fedora,像这样安装:
```
$ sudo dnf install -y cowsay
```
-然后,用 `cowsey` 调用它,然后是你的消息。也许你想到昨天我们谈到的 [fortune 应用][1] 连接起来。
+然后,用 `cowsay` 调用它,然后是你的消息。也许你想到昨天我们谈到的 [fortune 应用][1] 连接起来。
```
$ fortune | cowsay
@@ -72,7 +72,7 @@ $ cowsay -f dragon "Run for cover, I feel a sneeze coming on."
我对 `cowsay` 的真正不满是,我今天没有足够的时间来为牛的挤奶 —— 一语双关。牛排价格太高了,我只是开个玩笑。
-更严重的是,我已经完全忘记了 `cowsay` 直到我在学习 Ansible 的剧本时再次遇到它。如果你碰巧安装了 `cowyay`,当你运行Ansible 的剧本时,你会从一队奶牛那里获得输出。例如,运行这个剧本:
+更严重的是,我已经完全忘记了 `cowsay` 直到我在学习 Ansible 的剧本时再次遇到它。如果你碰巧安装了 `cowsay`,当你运行 Ansible 的剧本时,你会从一队奶牛那里获得输出。例如,运行这个剧本:
```
- hosts:
From 6c2e1a5d7fc7764a818a5616d9a42c8199593615 Mon Sep 17 00:00:00 2001
From: dianbanjiu
Date: Sun, 16 Dec 2018 12:45:22 +0800
Subject: [PATCH 0126/4278] translated
---
...ry Status And Level From Linux Terminal.md | 74 +++++++++----------
1 file changed, 37 insertions(+), 37 deletions(-)
rename {sources => translated}/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md (53%)
diff --git a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
similarity index 53%
rename from sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
rename to translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
index 1f94cd1045..7e4bff270a 100644
--- a/sources/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
+++ b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: (dianbanjiu )
+[#]: translator: ( dianbanjiu )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
@@ -7,38 +7,38 @@
[#]: 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
+从 Linux 终端查看笔记本电池状态等级的 5 个方法
======
-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.
+在 Linux 上有很多实用工具可以用命令行进行使用。
-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.
+### 几种在 Linux 下检查电池状态的实用工具
- * `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.
+ * `upower`: upower 是一个提供了接口来罗列系统中电源的命令行工具。
+ * `acpi`: acpi显示来自 /proc 或者 /sys 文件中的一些信息,例如电池状态或者热量信息
+ * `batstat`: batstat 是一个为 Linux 打印电池状态的命令行工具。
+ * `tlp`: TLP 可以为你带来更高级的电源管理,而无需修改任何配置。
+ * `class file`: 这个文件系统是一个提供了内核数据结构接口的伪文件系统。
-### How to Check Laptop Battery Status Using upower Command?
+### 如何使用 upower 命令检查笔记本电池状态
-[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.
+[upower][1] 是一个提供了接口来罗列系统中电源的命令行工具。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。
-Just run the following command to get the battery and it’s related information on Linux.
+只需要在 Linux 中运行以下命令获取电池以及它所依赖的其他信息。
```
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
@@ -72,7 +72,7 @@ $ upower -i /org/freedesktop/UPower/devices/battery_BAT0
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"
@@ -81,7 +81,7 @@ $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|perce
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"
@@ -89,15 +89,15 @@ $ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|perce
percentage: 41%
```
-### How to Check Laptop Battery Status Using TLP Command?
+### 如何使用 TLP 命令检查笔记本电池状态
-TLP is a free opensource feature-rich command line tool which optimize laptop battery without making any configuration change.
+TLP 是一个自由开源多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。
-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 可以为你的 Linux 带来更高级的电源管理,而无需理解任何技术细节。TLP 默认附带了一个已经为你的电池优化好的配置,所以你可以安装好后就不再管它了。尽管 TLP 是一个可以根据你的需求高度可定制的工具。
-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.
+TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。
-Just run the following command to get the battery and it’s related information on Linux.
+只需要在 Linux 中运行以下命令获取电池以及其他所依赖的信息。
```
$ sudo tlp-stat -b
@@ -117,7 +117,7 @@ Charge = 42.0 [%]
Capacity = 87.1 [%]
```
-To see other information as well.
+也可以查看其他的信息。
```
$ sudo tlp-stat -s
@@ -139,16 +139,16 @@ Mode = battery
Power source = battery
```
-### How to Check Laptop Battery Status Using ACPI Command?
+### 如何使用 ACPI 命令检查电池状态
-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 代表高级配置和电源接口模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 /proc 或者 /sys 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。
```
$ acpi
Battery 0: Charging, 43%, 01:05:11 until charged
```
-To see battery capacity.
+查看电池容量。
```
$ acpi -i
@@ -156,7 +156,7 @@ 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
@@ -177,9 +177,9 @@ 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 命令查看笔记本电池状态
-batstat is a command line tool to print battery status in linux terminal.
+batstat 是一个在 Linux 终端打印电池信息的命令行工具。
```
Status: Charging
@@ -193,13 +193,13 @@ Time elapsed: 0: 0:12 since 49.00%
0: 0: 0 49.00%
```
-### How to Check Laptop Battery Status Using sysfs filesystem?
+### 如何使用 sysfs 文件系统查看笔记本电池状态
-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.
+sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。sysfs 下的文件提供有关设备、内核模块、文件系统和其他内核组件的信息。
-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`
+sysfs 文件系统通常挂载在 /sys。通常来说,它会被系统自动挂载,但是也可以使用例如 `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.
+在 sysfs 文件系统中的很多文件都是只读的,但也有一些是可写的,允许更改内核变量。为了避免冗余,符号链接被大量用于连接文件系统数中的条目。
```
$ cat /sys/class/power_supply/BAT0/*
@@ -247,7 +247,7 @@ via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
-译者:[译者ID](https://github.com/译者ID)
+译者:[dianbanjiu](https://github.com/dianbanjiu)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 8a9e2985aa5ecfed2ece687677feeb1a1464f0d8 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 12:58:38 +0800
Subject: [PATCH 0127/4278] PRF:20181016 Lab 4- Preemptive Multitasking.md
@qhwdw
---
...20181016 Lab 4- Preemptive Multitasking.md | 381 ++++++++----------
1 file changed, 173 insertions(+), 208 deletions(-)
diff --git a/translated/tech/20181016 Lab 4- Preemptive Multitasking.md b/translated/tech/20181016 Lab 4- Preemptive Multitasking.md
index 9302b7288a..4023b0b2e9 100644
--- a/translated/tech/20181016 Lab 4- Preemptive Multitasking.md
+++ b/translated/tech/20181016 Lab 4- Preemptive Multitasking.md
@@ -1,10 +1,9 @@
-实验 4:抢占式多任务处理
+Caffeinated 6.828:实验 4:抢占式多任务处理
======
-### 实验 4:抢占式多任务处理
-#### 简介
+### 简介
-在本实验中,你将在多个同时活动的用户模式中的环境之间实现抢占式多任务处理。
+在本实验中,你将在多个同时活动的用户模式环境之间实现抢占式多任务处理。
在 Part A 中,你将在 JOS 中添加对多处理器的支持,以实现循环调度。并且添加基本的环境管理方面的系统调用(创建和销毁环境的系统调用、以及分配/映射内存)。
@@ -12,7 +11,7 @@
最后,在 Part C 中,你将在 JOS 中添加对进程间通讯(IPC)的支持,以允许不同用户模式环境之间进行显式通讯和同步。你也将要去添加对硬件时钟中断和优先权的支持。
-##### 预备知识
+#### 预备知识
使用 git 去提交你的实验 3 的源代码,并获取课程仓库的最新版本,然后创建一个名为 `lab4` 的本地分支,它跟踪我们的名为 `origin/lab4` 的远程 `lab4` 分支:
@@ -31,6 +30,7 @@
```
实验 4 包含了一些新的源文件,在开始之前你应该去浏览一遍:
+
```markdown
kern/cpu.h Kernel-private definitions for multiprocessor support
kern/mpconfig.c Code to read the multiprocessor configuration
@@ -41,19 +41,19 @@ kern/spinlock.c Kernel code implementing spin locks
kern/sched.c Code skeleton of the scheduler that you are about to implement
```
-##### 实验要求
+#### 实验要求
-本实验分为三部分:Part A、Part B、和 Part C。我们计划为每个部分分配一周的时间。
+本实验分为三部分:Part A、Part B 和 Part C。我们计划为每个部分分配一周的时间。
和以前一样,你需要完成实验中出现的、所有常规练习和至少一个挑战问题。(不是每个部分做一个挑战问题,是整个实验做一个挑战问题即可。)另外,你还要写出你实现的挑战问题的详细描述。如果你实现了多个挑战问题,你只需写出其中一个即可,虽然我们的课程欢迎你完成越多的挑战越好。在动手实验之前,请将你的挑战问题的答案写在一个名为 `answers-lab4.txt` 的文件中,并把它放在你的 `lab` 目录的根下。
-#### Part A:多处理器支持和协调多任务处理
+### Part A:多处理器支持和协调多任务处理
在本实验的第一部分,将去扩展你的 JOS 内核,以便于它能够在一个多处理器的系统上运行,并且要在 JOS 内核中实现一些新的系统调用,以便于它允许用户级环境创建附加的新环境。你也要去实现协调的循环调度,在当前的环境自愿放弃 CPU(或退出)时,允许内核将一个环境切换到另一个环境。稍后在 Part C 中,你将要实现抢占调度,它允许内核在环境占有 CPU 一段时间后,从这个环境上重新取回对 CPU 的控制,那怕是在那个环境不配合的情况下。
-##### 多处理器支持
+#### 多处理器支持
-我们继续去让 JOS 支持 “对称多处理器”(SMP),在一个多处理器的模型中,所有 CPU 们都有平等访问系统资源(如内存和 I/O 总线)的权利。虽然在 SMP 中所有 CPU 们都有相同的功能,但是在引导进程的过程中,它们被分成两种类型:引导程序处理器(BSP)负责初始化系统和引导操作系统;而在操作系统启动并正常运行后,应用程序处理器(AP)将被 BSP 激活。哪个处理器做 BSP 是由硬件和 BIOS 来决定的。到目前为止,你所有的已存在的 JOS 代码都是运行在 BSP 上的。
+我们继续去让 JOS 支持 “对称多处理器”(SMP),在一个多处理器的模型中,所有 CPU 们都有平等访问系统资源(如内存和 I/O 总线)的权力。虽然在 SMP 中所有 CPU 们都有相同的功能,但是在引导进程的过程中,它们被分成两种类型:引导程序处理器(BSP)负责初始化系统和引导操作系统;而在操作系统启动并正常运行后,应用程序处理器(AP)将被 BSP 激活。哪个处理器做 BSP 是由硬件和 BIOS 来决定的。到目前为止,你所有的已存在的 JOS 代码都是运行在 BSP 上的。
在一个 SMP 系统上,每个 CPU 都伴有一个本地 APIC(LAPIC)单元。这个 LAPIC 单元负责传递系统中的中断。LAPIC 还为它所连接的 CPU 提供一个唯一的标识符。在本实验中,我们将使用 LAPIC 单元(它在 `kern/lapic.c` 中)中的下列基本功能:
@@ -61,15 +61,11 @@ kern/sched.c Code skeleton of the scheduler that you are about to implement
* 从 BSP 到 AP 之间发送处理器间中断(IPI) `STARTUP`,以启动其它 CPU(查看 `lapic_startap()`)。
* 在 Part C 中,我们设置 LAPIC 的内置定时器去触发时钟中断,以便于支持抢占式多任务处理(查看 `apic_init()`)。
+一个处理器使用内存映射的 I/O(MMIO)来访问它的 LAPIC。在 MMIO 中,一部分物理内存是硬编码到一些 I/O 设备的寄存器中,因此,访问内存时一般可以使用相同的 `load/store` 指令去访问设备的寄存器。正如你所看到的,在物理地址 `0xA0000` 处就是一个 IO 入口(就是我们写入 VGA 缓冲区的入口)。LAPIC 就在那里,它从物理地址 `0xFE000000` 处(4GB 减去 32MB 处)开始,这个地址对于我们在 KERNBASE 处使用直接映射访问来说太高了。JOS 虚拟内存映射在 `MMIOBASE` 处,留下一个 4MB 的空隙,以便于我们有一个地方,能像这样去映射设备。由于在后面的实验中,我们将介绍更多的 MMIO 区域,你将要写一个简单的函数,从这个区域中去分配空间,并将设备的内存映射到那里。
+> **练习 1**、实现 `kern/pmap.c` 中的 `mmio_map_region`。去看一下它是如何使用的,从 `kern/lapic.c` 中的 `lapic_init` 开始看起。在 `mmio_map_region` 的测试运行之前,你还要做下一个练习。
-一个处理器使用内存映射的 I/O(MMIO)来访问它的 LAPIC。在 MMIO 中,一部分物理内存是硬编码到一些 I/O 设备的寄存器中,因此,访问内存时一般可以使用相同的 `load/store` 指令去访问设备的寄存器。正如你所看到的,在物理地址 `0xA0000` 处就是一个 IO 入口(就是我们写入 VGA 缓冲区的入口)。LAPIC 就在那里,它从物理地址 `0xFE000000` 处(4GB 减去 32MB 处)开始,这个地址对于我们在 KERNBASE 处使用直接映射访问来说太高了。JOS 虚拟内存映射在 `MMIOBASE` 处,留下一个 4MB 的空隙,以便于我们有一个地方,能像这样去映射设备。由于在后面的实验中,我们将介绍更多的 MMIO 区域,你将要写一个简单的函数,从这个区域中去分配空间,并将设备的内存映射到那里。
-
-```markdown
-练习 1、实现 `kern/pmap.c` 中的 `mmio_map_region`。去看一下它是如何使用的,从 `kern/lapic.c` 中的 `lapic_init` 开始看起。在 `mmio_map_region` 的测试运行之前,你还要做下一个练习。
-```
-
-###### 引导应用程序处理器
+##### 引导应用程序处理器
在引导应用程序处理器之前,引导程序处理器应该会首先去收集关于多处理器系统的信息,比如总的 CPU 数、它们的 APIC ID 以及 LAPIC 单元的 MMIO 地址。在 `kern/mpconfig.c` 中的 `mp_init()` 函数,通过读取内存中位于 BIOS 区域里的 MP 配置表来获得这些信息。
@@ -77,46 +73,42 @@ kern/sched.c Code skeleton of the scheduler that you are about to implement
在那之后,通过发送 IPI `STARTUP` 到相关 AP 的 LAPIC 单元,以及一个初始的 `CS:IP` 地址(AP 将从那儿开始运行它的入口代码,在我们的案例中是 `MPENTRY_PADDR` ),`boot_aps()` 将一个接一个地激活 AP。在 `kern/mpentry.S` 中的入口代码非常类似于 `boot/boot.S`。在一些简短的设置之后,它启用分页,使 AP 进入保护模式,然后调用 C 设置程序 `mp_main()`(它也在 `kern/init.c` 中)。在继续唤醒下一个 AP 之前, `boot_aps()` 将等待这个 AP 去传递一个 `CPU_STARTED` 标志到它的 `struct CpuInfo` 中的 `cpu_status` 字段中。
-```markdown
-练习 2、阅读 `kern/init.c` 中的 `boot_aps()` 和 `mp_main()`,以及在 `kern/mpentry.S` 中的汇编代码。确保你理解了在 AP 引导过程中的控制流转移。然后修改在 `kern/pmap.c` 中的、你自己的 `page_init()`,实现避免在 `MPENTRY_PADDR` 处添加页到空闲列表上,以便于我们能够在物理地址上安全地复制和运行 AP 引导程序代码。你的代码应该会通过更新后的 `check_page_free_list()` 的测试(但可能会在更新后的 `check_kern_pgdir()` 上测试失败,我们在后面会修复它)。
-```
+> **练习 2**、阅读 `kern/init.c` 中的 `boot_aps()` 和 `mp_main()`,以及在 `kern/mpentry.S` 中的汇编代码。确保你理解了在 AP 引导过程中的控制流转移。然后修改在 `kern/pmap.c` 中的、你自己的 `page_init()`,实现避免在 `MPENTRY_PADDR` 处添加页到空闲列表上,以便于我们能够在物理地址上安全地复制和运行 AP 引导程序代码。你的代码应该会通过更新后的 `check_page_free_list()` 的测试(但可能会在更新后的 `check_kern_pgdir()` 上测试失败,我们在后面会修复它)。
-```markdown
-问题
- 1、比较 `kern/mpentry.S` 和 `boot/boot.S`。记住,那个 `kern/mpentry.S` 是编译和链接后的,运行在 `KERNBASE` 上面的,就像内核中的其它程序一样,宏 `MPBOOTPHYS` 的作用是什么?为什么它需要在 `kern/mpentry.S` 中,而不是在 `boot/boot.S` 中?换句话说,如果在 `kern/mpentry.S` 中删掉它,会发生什么错误?
+.
+
+> **问题 1**、比较 `kern/mpentry.S` 和 `boot/boot.S`。记住,那个 `kern/mpentry.S` 是编译和链接后的,运行在 `KERNBASE` 上面的,就像内核中的其它程序一样,宏 `MPBOOTPHYS` 的作用是什么?为什么它需要在 `kern/mpentry.S` 中,而不是在 `boot/boot.S` 中?换句话说,如果在 `kern/mpentry.S` 中删掉它,会发生什么错误?
提示:回顾链接地址和加载地址的区别,我们在实验 1 中讨论过它们。
-```
-
-###### 每个 CPU 的状态和初始化
+##### 每个 CPU 的状态和初始化
当写一个多处理器操作系统时,区分每个 CPU 的状态是非常重要的,而每个 CPU 的状态对其它处理器是不公开的,而全局状态是整个系统共享的。`kern/cpu.h` 定义了大部分每个 CPU 的状态,包括 `struct CpuInfo`,它保存了每个 CPU 的变量。`cpunum()` 总是返回调用它的那个 CPU 的 ID,它可以被用作是数组的索引,比如 `cpus`。或者,宏 `thiscpu` 是当前 CPU 的 `struct CpuInfo` 缩略表示。
下面是你应该知道的每个 CPU 的状态:
- * **每个 CPU 的内核栈**
-因为内核能够同时捕获多个 CPU,因此,我们需要为每个 CPU 准备一个单独的内核栈,以防止它们运行的程序之间产生相互干扰。数组 `percpu_kstacks[NCPU][KSTKSIZE]` 为 NCPU 的内核栈资产保留了空间。
+* **每个 CPU 的内核栈**
-在实验 2 中,你映射的 `bootstack` 所引用的物理内存,就作为 `KSTACKTOP` 以下的 BSP 的内核栈。同样,在本实验中,你将每个 CPU 的内核栈映射到这个区域,而使用保护页做为它们之间的缓冲区。CPU 0 的栈将从 `KSTACKTOP` 处向下增长;CPU 1 的栈将从 CPU 0 的栈底部的 `KSTKGAP` 字节处开始,依次类推。在 `inc/memlayout.h` 中展示了这个映射布局。
+ 因为内核能够同时捕获多个 CPU,因此,我们需要为每个 CPU 准备一个单独的内核栈,以防止它们运行的程序之间产生相互干扰。数组 `percpu_kstacks[NCPU][KSTKSIZE]` 为 NCPU 的内核栈资产保留了空间。
- * **每个 CPU 的 TSS 和 TSS 描述符**
-为了指定每个 CPU 的内核栈在哪里,也需要有一个每个 CPU 的任务状态描述符(TSS)。CPU _i_ 的任务状态描述符是保存在 `cpus[i].cpu_ts` 中,而对应的 TSS 描述符是定义在 GDT 条目 `gdt[(GD_TSS0 >> 3) + i]` 中。在 `kern/trap.c` 中定义的全局变量 `ts` 将不再被使用。
+ 在实验 2 中,你映射的 `bootstack` 所引用的物理内存,就作为 `KSTACKTOP` 以下的 BSP 的内核栈。同样,在本实验中,你将每个 CPU 的内核栈映射到这个区域,而使用保护页做为它们之间的缓冲区。CPU 0 的栈将从 `KSTACKTOP` 处向下增长;CPU 1 的栈将从 CPU 0 的栈底部的 `KSTKGAP` 字节处开始,依次类推。在 `inc/memlayout.h` 中展示了这个映射布局。
- * **每个 CPU 当前的环境指针**
-由于每个 CPU 都能同时运行不同的用户进程,所以我们重新定义了符号 `curenv`,让它指向到 `cpus[cpunum()].cpu_env`(或 `thiscpu->cpu_env`),它指向到当前 CPU(代码正在运行的那个 CPU)上当前正在运行的环境上。
+* **每个 CPU 的 TSS 和 TSS 描述符**
- * **每个 CPU 的系统寄存器**
-所有的寄存器,包括系统寄存器,都是一个 CPU 私有的。所以,初始化这些寄存器的指令,比如 `lcr3()`、`ltr()`、`lgdt()`、`lidt()`、等待,必须在每个 CPU 上运行一次。函数 `env_init_percpu()` 和 `trap_init_percpu()` 就是为此目的而定义的。
+ 为了指定每个 CPU 的内核栈在哪里,也需要有一个每个 CPU 的任务状态描述符(TSS)。CPU _i_ 的任务状态描述符是保存在 `cpus[i].cpu_ts` 中,而对应的 TSS 描述符是定义在 GDT 条目 `gdt[(GD_TSS0 >> 3) + i]` 中。在 `kern/trap.c` 中定义的全局变量 `ts` 将不再被使用。
+* **每个 CPU 当前的环境指针**
+ 由于每个 CPU 都能同时运行不同的用户进程,所以我们重新定义了符号 `curenv`,让它指向到 `cpus[cpunum()].cpu_env`(或 `thiscpu->cpu_env`),它指向到当前 CPU(代码正在运行的那个 CPU)上当前正在运行的环境上。
-```markdown
-练习 3、修改 `mem_init_mp()`(在 `kern/pmap.c` 中)去映射每个 CPU 的栈从 `KSTACKTOP` 处开始,就像在 `inc/memlayout.h` 中展示的那样。每个栈的大小是 `KSTKSIZE` 字节加上未映射的保护页 `KSTKGAP` 的字节。你的代码应该会通过在 `check_kern_pgdir()` 中的新的检查。
-```
+* **每个 CPU 的系统寄存器**
-```markdown
-练习 4、在 `trap_init_percpu()`(在 `kern/trap.c` 文件中)的代码为 BSP 初始化 TSS 和 TSS 描述符。在实验 3 中它就运行过,但是当它运行在其它的 CPU 上就会出错。修改这些代码以便它能在所有 CPU 上都正常运行。(注意:你的新代码应该还不能使用全局变量 `ts`)
-```
+ 所有的寄存器,包括系统寄存器,都是一个 CPU 私有的。所以,初始化这些寄存器的指令,比如 `lcr3()`、`ltr()`、`lgdt()`、`lidt()`、等待,必须在每个 CPU 上运行一次。函数 `env_init_percpu()` 和 `trap_init_percpu()` 就是为此目的而定义的。
+
+> **练习 3**、修改 `mem_init_mp()`(在 `kern/pmap.c` 中)去映射每个 CPU 的栈从 `KSTACKTOP` 处开始,就像在 `inc/memlayout.h` 中展示的那样。每个栈的大小是 `KSTKSIZE` 字节加上未映射的保护页 `KSTKGAP` 的字节。你的代码应该会通过在 `check_kern_pgdir()` 中的新的检查。
+
+.
+
+> **练习 4**、在 `trap_init_percpu()`(在 `kern/trap.c` 文件中)的代码为 BSP 初始化 TSS 和 TSS 描述符。在实验 3 中它就运行过,但是当它运行在其它的 CPU 上就会出错。修改这些代码以便它能在所有 CPU 上都正常运行。(注意:你的新代码应该还不能使用全局变量 `ts`)
在你完成上述练习后,在 QEMU 中使用 4 个 CPU(使用 `make qemu CPUS=4` 或 `make qemu-nox CPUS=4`)来运行 JOS,你应该看到类似下面的输出:
@@ -134,94 +126,87 @@ kern/sched.c Code skeleton of the scheduler that you are about to implement
SMP: CPU 3 starting
```
-###### 锁定
+##### 锁定
在 `mp_main()` 中初始化 AP 后我们的代码快速运行起来。在你更进一步增强 AP 之前,我们需要首先去处理多个 CPU 同时运行内核代码的争用状况。达到这一目标的最简单的方法是使用大内核锁。大内核锁是一个单个的全局锁,当一个环境进入内核模式时,它将被加锁,而这个环境返回到用户模式时它将释放锁。在这种模型中,在用户模式中运行的环境可以同时运行在任何可用的 CPU 上,但是只有一个环境能够运行在内核模式中;而任何尝试进入内核模式的其它环境都被强制等待。
`kern/spinlock.h` 中声明大内核锁,即 `kernel_lock`。它也提供 `lock_kernel()` 和 `unlock_kernel()`,快捷地去获取/释放锁。你应该在以下的四个位置应用大内核锁:
- * 在 `i386_init()` 时,在 BSP 唤醒其它 CPU 之前获取锁。
- * 在 `mp_main()` 时,在初始化 AP 之后获取锁,然后调用 `sched_yield()` 在这个 AP 上开始运行环境。
- * 在 `trap()` 时,当从用户模式中捕获一个陷阱时获取锁。在检查 `tf_cs` 的低位比特,以确定一个陷阱是发生在用户模式还是内核模式时。
- * 在 `env_run()` 中,在切换到用户模式之前释放锁。不能太早也不能太晚,否则你将可能会产生争用或死锁。
+* 在 `i386_init()` 时,在 BSP 唤醒其它 CPU 之前获取锁。
+* 在 `mp_main()` 时,在初始化 AP 之后获取锁,然后调用 `sched_yield()` 在这个 AP 上开始运行环境。
+* 在 `trap()` 时,当从用户模式中捕获一个陷阱时获取锁。在检查 `tf_cs` 的低位比特,以确定一个陷阱是发生在用户模式还是内核模式时。
+* 在 `env_run()` 中,在切换到用户模式之前释放锁。不能太早也不能太晚,否则你将可能会产生争用或死锁。
+> **练习 5**、在上面所描述的情况中,通过在合适的位置调用 `lock_kernel()` 和 `unlock_kernel()` 应用大内核锁。
-```markdown
-练习 5、在上面所描述的情况中,通过在合适的位置调用 `lock_kernel()` 和 `unlock_kernel()` 应用大内核锁。
-```
+> 如果你的锁定是正确的,如何去测试它?实际上,到目前为止,还无法测试!但是在下一个练习中,你实现了调度之后,就可以测试了。
-如果你的锁定是正确的,如何去测试它?实际上,到目前为止,还无法测试!但是在下一个练习中,你实现了调度之后,就可以测试了。
+.
-```
-问题
- 2、看上去使用一个大内核锁,可以保证在一个时间中只有一个 CPU 能够运行内核代码。为什么每个 CPU 仍然需要单独的内核栈?描述一下使用一个共享内核栈出现错误的场景,即便是在它使用了大内核锁保护的情况下。
-```
+> **问题 2**、看上去使用一个大内核锁,可以保证在一个时间中只有一个 CPU 能够运行内核代码。为什么每个 CPU 仍然需要单独的内核栈?描述一下使用一个共享内核栈出现错误的场景,即便是在它使用了大内核锁保护的情况下。
-```
-小挑战!大内核锁很简单,也易于使用。尽管如此,它消除了内核模式的所有并发。大多数现代操作系统使用不同的锁,一种称之为细粒度锁定的方法,去保护它们的共享的栈的不同部分。细粒度锁能够大幅提升性能,但是实现起来更困难并且易出错。如果你有足够的勇气,在 JOS 中删除大内核锁,去拥抱并发吧!
+> **小挑战!**大内核锁很简单,也易于使用。尽管如此,它消除了内核模式的所有并发。大多数现代操作系统使用不同的锁,一种称之为细粒度锁定的方法,去保护它们的共享的栈的不同部分。细粒度锁能够大幅提升性能,但是实现起来更困难并且易出错。如果你有足够的勇气,在 JOS 中删除大内核锁,去拥抱并发吧!
-由你来决定锁的粒度(一个锁保护的数据量)。给你一个提示,你可以考虑在 JOS 内核中使用一个自旋锁去确保你独占访问这些共享的组件:
+> 由你来决定锁的粒度(一个锁保护的数据量)。给你一个提示,你可以考虑在 JOS 内核中使用一个自旋锁去确保你独占访问这些共享的组件:
- * 页分配器
- * 控制台驱动
- * 调度器
- * 你将在 Part C 中实现的进程间通讯(IPC)的状态
-```
+> * 页分配器
+* 控制台驱动
+* 调度器
+* 你将在 Part C 中实现的进程间通讯(IPC)的状态
-
-##### 循环调度
+#### 循环调度
本实验中,你的下一个任务是去修改 JOS 内核,以使它能够在多个环境之间以“循环”的方式去交替。JOS 中的循环调度工作方式如下:
- * 在新的 `kern/sched.c` 中的 `sched_yield()` 函数负责去选择一个新环境来运行。它按顺序以循环的方式在数组 `envs[]` 中进行搜索,在前一个运行的环境之后开始(或如果之前没有运行的环境,就从数组起点开始),选择状态为 `ENV_RUNNABLE` 的第一个环境(查看 `inc/env.h`),并调用 `env_run()` 去跳转到那个环境。
- * `sched_yield()` 必须做到,同一个时间在两个 CPU 上绝对不能运行相同的环境。它可以判断出一个环境正运行在一些 CPU(可能是当前 CPU)上,因为,那个正在运行的环境的状态将是 `ENV_RUNNING`。
- * 我们已经为你实现了一个新的系统调用 `sys_yield()`,用户环境调用它去调用内核的 `sched_yield()` 函数,并因此将自愿把对 CPU 的控制禅让给另外的一个环境。
+* 在新的 `kern/sched.c` 中的 `sched_yield()` 函数负责去选择一个新环境来运行。它按顺序以循环的方式在数组 `envs[]` 中进行搜索,在前一个运行的环境之后开始(或如果之前没有运行的环境,就从数组起点开始),选择状态为 `ENV_RUNNABLE` 的第一个环境(查看 `inc/env.h`),并调用 `env_run()` 去跳转到那个环境。
+* `sched_yield()` 必须做到,同一个时间在两个 CPU 上绝对不能运行相同的环境。它可以判断出一个环境正运行在一些 CPU(可能是当前 CPU)上,因为,那个正在运行的环境的状态将是 `ENV_RUNNING`。
+* 我们已经为你实现了一个新的系统调用 `sys_yield()`,用户环境调用它去调用内核的 `sched_yield()` 函数,并因此将自愿把对 CPU 的控制禅让给另外的一个环境。
+> **练习 6**、像上面描述的那样,在 `sched_yield()` 中实现循环调度。不要忘了去修改 `syscall()` 以派发 `sys_yield()`。
-```c
-练习 6、像上面描述的那样,在 `sched_yield()` 中实现循环调度。不要忘了去修改 `syscall()` 以派发 `sys_yield()`。
+> 确保在 `mp_main` 中调用了 `sched_yield()`。
-确保在 `mp_main` 中调用了 `sched_yield()`。
+> 修改 `kern/init.c` 去创建三个(或更多个!)运行程序 `user/yield.c`的环境。
-修改 `kern/init.c` 去创建三个(或更多个!)运行程序 `user/yield.c`的环境。
+> 运行 `make qemu`。在它终止之前,你应该会看到像下面这样,在环境之间来回切换了五次。
-运行 `make qemu`。在它终止之前,你应该会看到像下面这样,在环境之间来回切换了五次。
+> 也可以使用几个 CPU 来测试:`make qemu CPUS=2`。
-也可以使用几个 CPU 来测试:make qemu CPUS=2。
-
- ...
- Hello, I am environment 00001000.
- Hello, I am environment 00001001.
- Hello, I am environment 00001002.
- Back in environment 00001000, iteration 0.
- Back in environment 00001001, iteration 0.
- Back in environment 00001002, iteration 0.
- Back in environment 00001000, iteration 1.
- Back in environment 00001001, iteration 1.
- Back in environment 00001002, iteration 1.
- ...
-
-在程序 `yield` 退出之后,系统中将没有可运行的环境,调度器应该会调用 JOS 内核监视器。如果它什么也没有发生,那么你应该在继续之前修复你的代码。
+>```
+...
+Hello, I am environment 00001000.
+Hello, I am environment 00001001.
+Hello, I am environment 00001002.
+Back in environment 00001000, iteration 0.
+Back in environment 00001001, iteration 0.
+Back in environment 00001002, iteration 0.
+Back in environment 00001000, iteration 1.
+Back in environment 00001001, iteration 1.
+Back in environment 00001002, iteration 1.
+...
```
-```c
-问题
- 3、在你实现的 `env_run()` 中,你应该会调用 `lcr3()`。在调用 `lcr3()` 的之前和之后,你的代码引用(至少它应该会)变量 `e`,它是 `env_run` 的参数。在加载 `%cr3` 寄存器时,MMU 使用的地址上下文将马上被改变。但一个虚拟地址(即 `e`)相对一个给定的地址上下文是有意义的 —— 地址上下文指定了物理地址到那个虚拟地址的映射。为什么指针 `e` 在地址切换之前和之后被解除引用?
- 4、无论何时,内核从一个环境切换到另一个环境,它必须要确保旧环境的寄存器内容已经被保存,以便于它们稍后能够正确地还原。为什么?这种事件发生在什么地方?
-```
+> 在程序 `yield` 退出之后,系统中将没有可运行的环境,调度器应该会调用 JOS 内核监视器。如果它什么也没有发生,那么你应该在继续之前修复你的代码。
-```c
-小挑战!给内核添加一个小小的调度策略,比如一个固定优先级的调度器,它将会给每个环境分配一个优先级,并且在执行中,较高优先级的环境总是比低优先级的环境优先被选定。如果你想去冒险一下,尝试实现一个类 Unix 的、优先级可调整的调度器,或者甚至是一个彩票调度器或跨步调度器。(可以在 Google 中查找“彩票调度”和“跨步调度”的相关资料)
-写一个或两个测试程序,去测试你的调度算法是否工作正常(即,正确的算法能够按正确的次序运行)。如果你实现了本实验的 Part B 和 Part C 部分的 `fork()` 和 IPC,写这些测试程序可能会更容易。
-```
+> **问题 3**、在你实现的 `env_run()` 中,你应该会调用 `lcr3()`。在调用 `lcr3()` 的之前和之后,你的代码引用(至少它应该会)变量 `e`,它是 `env_run` 的参数。在加载 `%cr3` 寄存器时,MMU 使用的地址上下文将马上被改变。但一个虚拟地址(即 `e`)相对一个给定的地址上下文是有意义的 —— 地址上下文指定了物理地址到那个虚拟地址的映射。为什么指针 `e` 在地址切换之前和之后被解除引用?
-```markdown
-小挑战!目前的 JOS 内核还不能应用到使用了 x87 协处理器、MMX 指令集、或流式 SIMD 扩展(SSE)的 x86 处理器上。扩展数据结构 `Env` 去提供一个能够保存处理器的浮点状态的地方,并且扩展上下文切换代码,当从一个环境切换到另一个环境时,能够保存和还原正确的状态。`FXSAVE` 和 `FXRSTOR` 指令或许对你有帮助,但是需要注意的是,这些指令在旧的 x86 用户手册上没有,因为它是在较新的处理器上引入的。写一个用户级的测试程序,让它使用浮点做一些很酷的事情。
-```
+.
-##### 创建环境的系统调用
+> **问题 4**、无论何时,内核从一个环境切换到另一个环境,它必须要确保旧环境的寄存器内容已经被保存,以便于它们稍后能够正确地还原。为什么?这种事件发生在什么地方?
+
+.
+
+> 小挑战!给内核添加一个小小的调度策略,比如一个固定优先级的调度器,它将会给每个环境分配一个优先级,并且在执行中,较高优先级的环境总是比低优先级的环境优先被选定。如果你想去冒险一下,尝试实现一个类 Unix 的、优先级可调整的调度器,或者甚至是一个彩票调度器或跨步调度器。(可以在 Google 中查找“彩票调度”和“跨步调度”的相关资料)
+
+> 写一个或两个测试程序,去测试你的调度算法是否工作正常(即,正确的算法能够按正确的次序运行)。如果你实现了本实验的 Part B 和 Part C 部分的 `fork()` 和 IPC,写这些测试程序可能会更容易。
+
+.
+
+> 小挑战!目前的 JOS 内核还不能应用到使用了 x87 协处理器、MMX 指令集、或流式 SIMD 扩展(SSE)的 x86 处理器上。扩展数据结构 `Env` 去提供一个能够保存处理器的浮点状态的地方,并且扩展上下文切换代码,当从一个环境切换到另一个环境时,能够保存和还原正确的状态。`FXSAVE` 和 `FXRSTOR` 指令或许对你有帮助,但是需要注意的是,这些指令在旧的 x86 用户手册上没有,因为它是在较新的处理器上引入的。写一个用户级的测试程序,让它使用浮点做一些很酷的事情。
+
+#### 创建环境的系统调用
虽然你的内核现在已经有了在多个用户级环境之间切换的功能,但是由于内核初始化设置的原因,它在运行环境时仍然是受限的。现在,你需要去实现必需的 JOS 系统调用,以允许用户环境去创建和启动其它的新用户环境。
@@ -229,34 +214,35 @@ Unix 提供了 `fork()` 系统调用作为它的进程创建原语。Unix 的 `f
为创建一个用户模式下的新的环境,你将要提供一个不同的、更原始的 JOS 系统调用集。使用这些系统调用,除了其它类型的环境创建之外,你可以在用户空间中实现一个完整的类 Unix 的 `fork()`。你将要为 JOS 编写的新的系统调用如下:
- * `sys_exofork`:
-这个系统调用创建一个新的空白的环境:在它的地址空间的用户部分什么都没有映射,并且它也不能运行。这个新的环境与 `sys_exofork` 调用时创建它的父环境的寄存器状态完全相同。在父进程中,`sys_exofork` 将返回新创建进程的 `envid_t`(如果环境分配失败的话,返回的是一个负的错误代码)。在子进程中,它将返回 0。(因为子进程从一开始就被标记为不可运行,在子进程中,`sys_exofork` 将并不真的返回,直到它的父进程使用 .... 显式地将子进程标记为可运行之前。)
- * `sys_env_set_status`:
-设置指定的环境状态为 `ENV_RUNNABLE` 或 `ENV_NOT_RUNNABLE`。这个系统调用一般是在,一个新环境的地址空间和寄存器状态已经完全初始化完成之后,用于去标记一个准备去运行的新环境。
- * `sys_page_alloc`:
-分配一个物理内存页,并映射它到一个给定的环境地址空间中、给定的一个虚拟地址上。
- * `sys_page_map`:
-从一个环境的地址空间中复制一个页映射(不是页内容!)到另一个环境的地址空间中,保持一个内存共享,以便于新的和旧的映射共同指向到同一个物理内存页。
- * `sys_page_unmap`:
-在一个给定的环境中,取消映射一个给定的已映射的虚拟地址。
+* `sys_exofork`:
+ 这个系统调用创建一个新的空白的环境:在它的地址空间的用户部分什么都没有映射,并且它也不能运行。这个新的环境与 `sys_exofork` 调用时创建它的父环境的寄存器状态完全相同。在父进程中,`sys_exofork` 将返回新创建进程的 `envid_t`(如果环境分配失败的话,返回的是一个负的错误代码)。在子进程中,它将返回 0。(因为子进程从一开始就被标记为不可运行,在子进程中,`sys_exofork` 将并不真的返回,直到它的父进程使用 .... 显式地将子进程标记为可运行之前。)
+* `sys_env_set_status`:
+ 设置指定的环境状态为 `ENV_RUNNABLE` 或 `ENV_NOT_RUNNABLE`。这个系统调用一般是在,一个新环境的地址空间和寄存器状态已经完全初始化完成之后,用于去标记一个准备去运行的新环境。
+* `sys_page_alloc`:
+
+ 分配一个物理内存页,并映射它到一个给定的环境地址空间中、给定的一个虚拟地址上。
+* `sys_page_map`:
+
+ 从一个环境的地址空间中复制一个页映射(不是页内容!)到另一个环境的地址空间中,保持一个内存共享,以便于新的和旧的映射共同指向到同一个物理内存页。
+* `sys_page_unmap`:
+
+ 在一个给定的环境中,取消映射一个给定的已映射的虚拟地址。
上面所有的系统调用都接受环境 ID 作为参数,JOS 内核支持一个约定,那就是用值 “0” 来表示“当前环境”。这个约定在 `kern/env.c` 中的 `envid2env()` 中实现的。
在我们的 `user/dumbfork.c` 中的测试程序里,提供了一个类 Unix 的 `fork()` 的非常原始的实现。这个测试程序使用了上面的系统调用,去创建和运行一个复制了它自己地址空间的子环境。然后,这两个环境像前面的练习那样使用 `sys_yield` 来回切换,父进程在迭代 10 次后退出,而子进程在迭代 20 次后退出。
-```c
-练习 7、在 `kern/syscall.c` 中实现上面描述的系统调用,并确保 `syscall()` 能调用它们。你将需要使用 `kern/pmap.c` 和 `kern/env.c` 中的多个函数,尤其是要用到 `envid2env()`。目前,每当你调用 `envid2env()` 时,在 `checkperm` 中传递参数 1。你务必要做检查任何无效的系统调用参数,在那个案例中,就返回了 `-E_INVAL`。使用 `user/dumbfork` 测试你的 JOS 内核,并在继续之前确保它运行正常。
-```
+> **练习 7**、在 `kern/syscall.c` 中实现上面描述的系统调用,并确保 `syscall()` 能调用它们。你将需要使用 `kern/pmap.c` 和 `kern/env.c` 中的多个函数,尤其是要用到 `envid2env()`。目前,每当你调用 `envid2env()` 时,在 `checkperm` 中传递参数 1。你务必要做检查任何无效的系统调用参数,在那个案例中,就返回了 `-E_INVAL`。使用 `user/dumbfork` 测试你的 JOS 内核,并在继续之前确保它运行正常。
-```c
-小挑战!添加另外的系统调用,必须能够读取已存在的、所有的、环境的重要状态,以及设置它们。然后实现一个能够 fork 出子环境的用户模式程序,运行它一小会(即,迭代几次 `sys_yield()`),然后取得几张屏幕截图或子环境的检查点,然后运行子环境一段时间,然后还原子环境到检查点时的状态,然后从这里继续开始。这样,你就可以有效地从一个中间状态“回放”了子环境的运行。确保子环境与用户使用 `sys_cgetc()` 或 `readline()` 执行了一些交互,这样,那个用户就能够查看和突变它的内部状态,并且你可以通过给子环境给定一个选择性遗忘的状况,来验证你的检查点/重启动的有效性,使它“遗忘”了在某些点之前发生的事情。
-```
+.
+
+> **小挑战!**添加另外的系统调用,必须能够读取已存在的、所有的、环境的重要状态,以及设置它们。然后实现一个能够 fork 出子环境的用户模式程序,运行它一小会(即,迭代几次 `sys_yield()`),然后取得几张屏幕截图或子环境的检查点,然后运行子环境一段时间,然后还原子环境到检查点时的状态,然后从这里继续开始。这样,你就可以有效地从一个中间状态“回放”了子环境的运行。确保子环境与用户使用 `sys_cgetc()` 或 `readline()` 执行了一些交互,这样,那个用户就能够查看和突变它的内部状态,并且你可以通过给子环境给定一个选择性遗忘的状况,来验证你的检查点/重启动的有效性,使它“遗忘”了在某些点之前发生的事情。
到此为止,已经完成了本实验的 Part A 部分;在你运行 `make grade` 之前确保它通过了所有的 Part A 的测试,并且和以往一样,使用 `make handin` 去提交它。如果你想尝试找出为什么一些特定的测试是失败的,可以运行 `run ./grade-lab4 -v`,它将向你展示内核构建的输出,和测试失败时的 QEMU 运行情况。当测试失败时,这个脚本将停止运行,然后你可以去检查 `jos.out` 的内容,去查看内核真实的输出内容。
-#### Part B:写时复制 Fork
+### Part B:写时复制 Fork
正如在前面提到过的,Unix 提供 `fork()` 系统调用作为它主要的进程创建原语。`fork()` 系统调用通过复制调用进程(父进程)的地址空间来创建一个新进程(子进程)。
@@ -264,11 +250,11 @@ xv6 Unix 的 `fork()` 从父进程的页上复制所有数据,然后将它分
但是,一个对 `fork()` 的调用后,经常是紧接着几乎立即在子进程中有一个到 `exec()` 的调用,它使用一个新程序来替换子进程的内存。这是 shell 默认去做的事,在这种情况下,在复制父进程地址空间上花费的时间是非常浪费的,因为在调用 `exec()` 之前,子进程使用的内存非常少。
-基于这个原因,Unix 的最新版本利用了虚拟内存硬件的优势,允许父进程和子进程去共享映射到它们各自地址空间上的内存,直到其中一个进程真实地修改了它们为止。这个技术就是众所周知的“写时复制”。为实现这一点,在 `fork()` 时,内核将复制从父进程到子进程的地址空间的映射,而不是所映射的页的内容,并且同时设置正在共享中的页为只读。当两个进程中的其中一个尝试去写入到它们共享的页上时,进程将产生一个页故障。在这时,Unix 内核才意识到那个页实际上是“虚拟的”或“写时复制”的副本,然后它生成一个新的、私有的、那个发生页故障的进程可写的、页的副本。在这种方式中,个人的页的内容并不进行真实地复制,直到它们真正进行写入时才进行复制。这种优化使得一个`fork()` 后在子进程中跟随一个 `exec()` 变得代价很低了:子进程在调用 `exec()` 时或许仅需要复制一个页(它的栈的当前页)。
+基于这个原因,Unix 的最新版本利用了虚拟内存硬件的优势,允许父进程和子进程去共享映射到它们各自地址空间上的内存,直到其中一个进程真实地修改了它们为止。这个技术就是众所周知的“写时复制”。为实现这一点,在 `fork()` 时,内核将复制从父进程到子进程的地址空间的映射,而不是所映射的页的内容,并且同时设置正在共享中的页为只读。当两个进程中的其中一个尝试去写入到它们共享的页上时,进程将产生一个页故障。在这时,Unix 内核才意识到那个页实际上是“虚拟的”或“写时复制”的副本,然后它生成一个新的、私有的、那个发生页故障的进程可写的、页的副本。在这种方式中,个人的页的内容并不进行真实地复制,直到它们真正进行写入时才进行复制。这种优化使得一个`fork()` 后在子进程中跟随一个 `exec()` 变得代价很低了:子进程在调用 `exec()` 时或许仅需要复制一个页(它的栈的当前页)。
在本实验的下一段中,你将实现一个带有“写时复制”的“真正的”类 Unix 的 `fork()`,来作为一个常规的用户空间库。在用户空间中实现 `fork()` 和写时复制有一个好处就是,让内核始终保持简单,并且因此更不易出错。它也让个别的用户模式程序在 `fork()` 上定义了它们自己的语义。一个有略微不同实现的程序(例如,代价昂贵的、总是复制的 `dumbfork()` 版本,或父子进程真实共享内存的后面的那一个),它自己可以很容易提供。
-##### 用户级页故障处理
+#### 用户级页故障处理
一个用户级写时复制 `fork()` 需要知道关于在写保护页上的页故障相关的信息,因此,这是你首先需要去实现的东西。对用户级页故障处理来说,写时复制仅是众多可能的用途之一。
@@ -276,15 +262,14 @@ xv6 Unix 的 `fork()` 从父进程的页上复制所有数据,然后将它分
内核跟踪有大量的信息,与传统的 Unix 方法不同,你将决定在每个用户空间中关于每个页故障应该做的事。用户空间中的 bug 危害都较小。这种设计带来了额外的好处,那就是允许程序员在定义它们的内存区域时,会有很好的灵活性;对于映射和访问基于磁盘文件系统上的文件时,你应该使用后面的用户级页故障处理。
-###### 设置页故障服务程序
+##### 设置页故障服务程序
为了处理它自己的页故障,一个用户环境将需要在 JOS 内核上注册一个页故障服务程序入口。用户环境通过新的 `sys_env_set_pgfault_upcall` 系统调用来注册它的页故障入口。我们给结构 `Env` 增加了一个新的成员 `env_pgfault_upcall`,让它去记录这个信息。
-```markdown
-练习 8、实现 `sys_env_set_pgfault_upcall` 系统调用。当查找目标环境的环境 ID 时,一定要确认启用了权限检查,因为这是一个“危险的”系统调用。
+> **练习 8**、实现 `sys_env_set_pgfault_upcall` 系统调用。当查找目标环境的环境 ID 时,一定要确认启用了权限检查,因为这是一个“危险的”系统调用。
```
-###### 在用户环境中的正常和异常栈
+##### 在用户环境中的正常和异常栈
在正常运行期间,JOS 中的一个用户环境运行在正常的用户栈上:它的 `ESP` 寄存器开始指向到 `USTACKTOP`,而它所推送的栈数据将驻留在 `USTACKTOP-PGSIZE` 和 `USTACKTOP-1`(含)之间的页上。但是,当在用户模式中发生页故障时,内核将在一个不同的栈上重新启动用户环境,运行一个用户级页故障指定的服务程序,即用户异常栈。其它,我们将让 JOS 内核为用户环境实现自动的“栈切换”,当从用户模式转换到内核模式时,x86 处理器就以大致相同的方式为 JOS 实现了栈切换。
@@ -292,7 +277,7 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
每个想去支持用户级页故障处理的用户环境,都需要为它自己的异常栈使用在 Part A 中介绍的 `sys_page_alloc()` 系统调用去分配内存。
-###### 调用用户页故障服务程序
+##### 调用用户页故障服务程序
现在,你需要去修改 `kern/trap.c` 中的页故障处理代码,以能够处理接下来在用户模式中发生的页故障。我们将故障发生时用户环境的状态称之为捕获时状态。
@@ -322,25 +307,20 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
去测试 `tf->tf_esp` 是否已经在用户异常栈上准备好,可以去检查它是否在 `UXSTACKTOP-PGSIZE` 和 `UXSTACKTOP-1`(含)的范围内。
-```markdown
-练习 9、实现在 `kern/trap.c` 中的 `page_fault_handler` 的代码,要求派发页故障到用户模式故障服务程序上。在写入到异常栈时,一定要采取适当的预防措施。(如果用户环境运行时溢出了异常栈,会发生什么事情?)
-```
+> **练习 9**、实现在 `kern/trap.c` 中的 `page_fault_handler` 的代码,要求派发页故障到用户模式故障服务程序上。在写入到异常栈时,一定要采取适当的预防措施。(如果用户环境运行时溢出了异常栈,会发生什么事情?)
-###### 用户模式页故障入口点
+##### 用户模式页故障入口点
接下来,你需要去实现汇编程序,它将调用 C 页故障服务程序,并在原始的故障指令处恢复程序运行。这个汇编程序是一个故障服务程序,它由内核使用 `sys_env_set_pgfault_upcall()` 来注册。
-```markdown
-练习 10、实现在 `lib/pfentry.S` 中的 `_pgfault_upcall` 程序。最有趣的部分是返回到用户代码中产生页故障的原始位置。你将要直接返回到那里,不能通过内核返回。最难的部分是同时切换栈和重新加载 EIP。
-```
+> **练习 10**、实现在 `lib/pfentry.S` 中的 `_pgfault_upcall` 程序。最有趣的部分是返回到用户代码中产生页故障的原始位置。你将要直接返回到那里,不能通过内核返回。最难的部分是同时切换栈和重新加载 EIP。
最后,你需要去实现用户级页故障处理机制的 C 用户库。
-```c
-练习 11、完成 `lib/pgfault.c` 中的 `set_pgfault_handler()`。
+> **练习 11**、完成 `lib/pgfault.c` 中的 `set_pgfault_handler()`。
```
-###### 测试
+##### 测试
运行 `user/faultread`(make run-faultread)你应该会看到:
@@ -376,7 +356,7 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
[00001000] free env 00001000
```
-如果你只看到第一个 "this string” 行,意味着你没有正确地处理递归页故障。
+如果你只看到第一个 “this string” 行,意味着你没有正确地处理递归页故障。
运行 `user/faultallocbad` 你应该会看到:
@@ -389,11 +369,9 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
确保你理解了为什么 `user/faultalloc` 和 `user/faultallocbad` 的行为是不一样的。
-```markdown
-小挑战!扩展你的内核,让它不仅是页故障,而是在用户空间中运行的代码能够产生的所有类型的处理器异常,都能够被重定向到一个用户模式中的异常服务程序上。写出用户模式测试程序,去测试各种各样的用户模式异常处理,比如除零错误、一般保护故障、以及非法操作码。
-```
+> **小挑战!**扩展你的内核,让它不仅是页故障,而是在用户空间中运行的代码能够产生的所有类型的处理器异常,都能够被重定向到一个用户模式中的异常服务程序上。写出用户模式测试程序,去测试各种各样的用户模式异常处理,比如除零错误、一般保护故障、以及非法操作码。
-##### 实现写时复制 Fork
+#### 实现写时复制 Fork
现在,你有个内核功能要去实现,那就是在用户空间中完整地实现写时复制 `fork()`。
@@ -401,38 +379,29 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
`fork()` 的基本控制流如下:
- 1. 父环境使用你在上面实现的 `set_pgfault_handler()` 函数,安装 `pgfault()` 作为 C 级页故障服务程序。
-
- 2. 父环境调用 `sys_exofork()` 去创建一个子环境。
-
- 3. 在它的地址空间中,低于 UTOP 位置的、每个可写入页、或写时复制页上,父环境调用 `duppage` 后,它应该会映射页写时复制到子环境的地址空间中,然后在它自己的地址空间中重新映射页写时复制。[ 注意:这里的顺序很重要(即,在父环境中标记之前,先在子环境中标记该页为 COW)!你能明白是为什么吗?尝试去想一个具体的案例,将顺序颠倒一下会发生什么样的问题。] `duppage` 把两个 PTE 都设置了,致使那个页不可写入,并且在 "avail” 字段中通过包含 `PTE_COW` 来从真正的只读页中区分写时复制页。
-
-然而异常栈是不能通过这种方式重映射的。对于异常栈,你需要在子环境中分配一个新页。因为页故障服务程序不能做真实的复制,并且页故障服务程序是运行在异常栈上的,异常栈不能进行写时复制:那么谁来复制它呢?
-
-`fork()` 也需要去处理存在的页,但不能写入或写时复制。
-
- 4. 父环境为子环境设置了用户页故障入口点,让它看起来像它自己的一样。
-
- 5. 现在,子环境准备去运行,所以父环境标记它为可运行。
-
+1. 父环境使用你在上面实现的 `set_pgfault_handler()` 函数,安装 `pgfault()` 作为 C 级页故障服务程序。
+2. 父环境调用 `sys_exofork()` 去创建一个子环境。
+3. 在它的地址空间中,低于 UTOP 位置的、每个可写入页、或写时复制页上,父环境调用 `duppage` 后,它应该会映射页写时复制到子环境的地址空间中,然后在它自己的地址空间中重新映射页写时复制。[ 注意:这里的顺序很重要(即,在父环境中标记之前,先在子环境中标记该页为 COW)!你能明白是为什么吗?尝试去想一个具体的案例,将顺序颠倒一下会发生什么样的问题。] `duppage` 把两个 PTE 都设置了,致使那个页不可写入,并且在 "avail” 字段中通过包含 `PTE_COW` 来从真正的只读页中区分写时复制页。
+ 然而异常栈是不能通过这种方式重映射的。对于异常栈,你需要在子环境中分配一个新页。因为页故障服务程序不能做真实的复制,并且页故障服务程序是运行在异常栈上的,异常栈不能进行写时复制:那么谁来复制它呢?
+ `fork()` 也需要去处理存在的页,但不能写入或写时复制。
+4. 父环境为子环境设置了用户页故障入口点,让它看起来像它自己的一样。
+5. 现在,子环境准备去运行,所以父环境标记它为可运行。
每次其中一个环境写一个还没有写入的写时复制页时,它将产生一个页故障。下面是用户页故障服务程序的控制流:
- 1. 内核传递页故障到 `_pgfault_upcall`,它调用 `fork()` 的 `pgfault()` 服务程序。
- 2. `pgfault()` 检测到那个故障是一个写入(在错误代码中检查 `FEC_WR`),然后将那个页的 PTE 标记为 `PTE_COW`。如果不是一个写入,则崩溃。
- 3. `pgfault()` 在一个临时位置分配一个映射的新页,并将故障页的内容复制进去。然后,故障服务程序以读取/写入权限映射新页到合适的地址,替换旧的只读映射。
-
-
+1. 内核传递页故障到 `_pgfault_upcall`,它调用 `fork()` 的 `pgfault()` 服务程序。
+2. `pgfault()` 检测到那个故障是一个写入(在错误代码中检查 `FEC_WR`),然后将那个页的 PTE 标记为 `PTE_COW`。如果不是一个写入,则崩溃。
+3. `pgfault()` 在一个临时位置分配一个映射的新页,并将故障页的内容复制进去。然后,故障服务程序以读取/写入权限映射新页到合适的地址,替换旧的只读映射。
对于上面的几个操作,用户级 `lib/fork.c` 代码必须查询环境的页表(即,那个页的 PTE 是否标记为 `PET_COW`)。为此,内核在 `UVPT` 位置精确地映射环境的页表。它使用一个 [聪明的映射技巧][1] 去标记它,以使用户代码查找 PTE 时更容易。`lib/entry.S` 设置 `uvpt` 和 `uvpd`,以便于你能够在 `lib/fork.c` 中轻松查找页表信息。
-```c
-练习 12、在 `lib/fork.c` 中实现 `fork`、`duppage` 和 `pgfault`。
+> **练习 12**、在 `lib/fork.c` 中实现 `fork`、`duppage` 和 `pgfault`。
-使用 `forktree` 程序测试你的代码。它应该会产生下列的信息,在信息中会有 'new env'、'free env'、和 'exiting gracefully' 这样的字眼。信息可能不是按如下的顺序出现的,并且环境 ID 也可能不一样。
+> 使用 `forktree` 程序测试你的代码。它应该会产生下列的信息,在信息中会有 'new env'、'free env'、和 'exiting gracefully' 这样的字眼。信息可能不是按如下的顺序出现的,并且环境 ID 也可能不一样。
+>```
1000: I am ''
1001: I am '0'
2000: I am '00'
@@ -450,31 +419,32 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
1006: I am '101'
```
-```c
-小挑战!实现一个名为 `sfork()` 的共享内存的 `fork()`。这个版本的 `sfork()` 中,父子环境共享所有的内存页(因此,一个环境中对内存写入,就会改变另一个环境数据),除了在栈区域中的页以外,它应该使用写时复制来处理这些页。修改 `user/forktree.c` 去使用 `sfork()` 而是不常见的 `fork()`。另外,你在 Part C 中实现了 IPC 之后,使用你的 `sfork()` 去运行 `user/pingpongs`。你将找到提供全局指针 `thisenv` 功能的一个新方式。
-```
+.
-```markdown
-小挑战!你实现的 `fork` 将产生大量的系统调用。在 x86 上,使用中断切换到内核模式将产生较高的代价。增加系统调用接口,以便于它能够一次发送批量的系统调用。然后修改 `fork` 去使用这个接口。
-你的新的 `fork` 有多快?
+> **小挑战!**实现一个名为 `sfork()` 的共享内存的 `fork()`。这个版本的 `sfork()` 中,父子环境共享所有的内存页(因此,一个环境中对内存写入,就会改变另一个环境数据),除了在栈区域中的页以外,它应该使用写时复制来处理这些页。修改 `user/forktree.c` 去使用 `sfork()` 而是不常见的 `fork()`。另外,你在 Part C 中实现了 IPC 之后,使用你的 `sfork()` 去运行 `user/pingpongs`。你将找到提供全局指针 `thisenv` 功能的一个新方式。
-你可以用一个分析来论证,批量提交对你的 `fork` 的性能改变,以它来(粗略地)回答这个问题:使用一个 `int 0x30` 指令的代价有多高?在你的 `fork` 中运行了多少次 `int 0x30` 指令?访问 `TSS` 栈切换的代价高吗?等待 ...
+.
-或者,你可以在真实的硬件上引导你的内核,并且真实地对你的代码做基准测试。查看 `RDTSC`(读取时间戳计数器)指令,它的定义在 IA32 手册中,它计数自上一次处理器重置以来流逝的时钟周期数。QEMU 并不能真实地模拟这个指令(它能够计数运行的虚拟指令数量,或使用主机的 TSC,但是这两种方式都不能反映真实的 CPU 周期数)。
-```
+> **小挑战!**你实现的 `fork` 将产生大量的系统调用。在 x86 上,使用中断切换到内核模式将产生较高的代价。增加系统调用接口,以便于它能够一次发送批量的系统调用。然后修改 `fork` 去使用这个接口。
+
+> 你的新的 `fork` 有多快?
+
+> 你可以用一个分析来论证,批量提交对你的 `fork` 的性能改变,以它来(粗略地)回答这个问题:使用一个 `int 0x30` 指令的代价有多高?在你的 `fork` 中运行了多少次 `int 0x30` 指令?访问 `TSS` 栈切换的代价高吗?等待 ...
+
+> 或者,你可以在真实的硬件上引导你的内核,并且真实地对你的代码做基准测试。查看 `RDTSC`(读取时间戳计数器)指令,它的定义在 IA32 手册中,它计数自上一次处理器重置以来流逝的时钟周期数。QEMU 并不能真实地模拟这个指令(它能够计数运行的虚拟指令数量,或使用主机的 TSC,但是这两种方式都不能反映真实的 CPU 周期数)。
到此为止,Part B 部分结束了。在你运行 `make grade` 之前,确保你通过了所有的 Part B 部分的测试。和以前一样,你可以使用 `make handin` 去提交你的实验。
-#### Part C:抢占式多任务处理和进程间通讯(IPC)
+### Part C:抢占式多任务处理和进程间通讯(IPC)
在实验 4 的最后部分,你将修改内核去抢占不配合的环境,并允许环境之间显式地传递消息。
-##### 时钟中断和抢占
+#### 时钟中断和抢占
运行测试程序 `user/spin`。这个测试程序 fork 出一个子环境,它控制了 CPU 之后,就永不停歇地运转起来。无论是父环境还是内核都不能回收对 CPU 的控制。从用户模式环境中保护系统免受 bug 或恶意代码攻击的角度来看,这显然不是个理想的状态,因为任何用户模式环境都能够通过简单的无限循环,并永不归还 CPU 控制权的方式,让整个系统处于暂停状态。为了允许内核去抢占一个运行中的环境,从其中夺回对 CPU 的控制权,我们必须去扩展 JOS 内核,以支持来自硬件时钟的外部硬件中断。
-###### 中断规则
+##### 中断规则
外部中断(即:设备中断)被称为 IRQ。现在有 16 个可能出现的 IRQ,编号 0 到 15。从 IRQ 号到 IDT 条目的映射是不固定的。在 `picirq.c` 中的 `pic_init` 映射 IRQ 0 - 15 到 IDT 条目 `IRQ_OFFSET` 到 `IRQ_OFFSET+15`。
@@ -484,31 +454,27 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
处于用户环境中时,你将要确保 `FL_IF` 标志被设置,以便于出现一个中断时,它能够通过处理器来传递,让你的中断代码来处理。否则,中断将被屏蔽或忽略,直到中断被重新打开后。我们使用引导加载程序的第一个指令去屏蔽中断,并且到目前为止,还没有去重新打开它们。
-```markdown
-练习 13、修改 `kern/trapentry.S` 和 `kern/trap.c` 去初始化 IDT 中的相关条目,并为 IRQ 0 到 15 提供服务程序。然后修改 `kern/env.c` 中的 `env_alloc()` 的代码,以确保在用户环境中,中断总是打开的。
+> **练习 13**、修改 `kern/trapentry.S` 和 `kern/trap.c` 去初始化 IDT 中的相关条目,并为 IRQ 0 到 15 提供服务程序。然后修改 `kern/env.c` 中的 `env_alloc()` 的代码,以确保在用户环境中,中断总是打开的。
-另外,在 `sched_halt()` 中取消注释 `sti` 指令,以便于空闲的 CPU 取消屏蔽中断。
+> 另外,在 `sched_halt()` 中取消注释 `sti` 指令,以便于空闲的 CPU 取消屏蔽中断。
-当调用一个硬件中断服务程序时,处理器不会推送一个错误代码。在这个时候,你可能需要重新阅读 [80386 参考手册][2] 的 9.2 节,或 [IA-32 Intel 架构软件开发者手册 卷 3][3] 的 5.8 节。
+> 当调用一个硬件中断服务程序时,处理器不会推送一个错误代码。在这个时候,你可能需要重新阅读 [80386 参考手册][2] 的 9.2 节,或 [IA-32 Intel 架构软件开发者手册 卷 3][3] 的 5.8 节。
-在完成这个练习后,如果你在你的内核上使用任意的测试程序去持续运行(即:`spin`),你应该会看到内核输出中捕获的硬件中断的捕获帧。虽然在处理器上已经打开了中断,但是 JOS 并不能处理它们,因此,你应该会看到在当前运行的用户环境中每个中断的错误属性并被销毁,最终环境会被销毁并进入到监视器中。
-```
+> 在完成这个练习后,如果你在你的内核上使用任意的测试程序去持续运行(即:`spin`),你应该会看到内核输出中捕获的硬件中断的捕获帧。虽然在处理器上已经打开了中断,但是 JOS 并不能处理它们,因此,你应该会看到在当前运行的用户环境中每个中断的错误属性并被销毁,最终环境会被销毁并进入到监视器中。
-###### 处理时钟中断
+##### 处理时钟中断
在 `user/spin` 程序中,子环境首先运行之后,它只是进入一个高速循环中,并且内核再无法取得 CPU 控制权。我们需要对硬件编程,定期产生时钟中断,它将强制将 CPU 控制权返还给内核,在内核中,我们就能够将控制权切换到另外的用户环境中。
我们已经为你写好了对 `lapic_init` 和 `pic_init`(来自 `init.c` 中的 `i386_init`)的调用,它将设置时钟和中断控制器去产生中断。现在,你需要去写代码来处理这些中断。
-```markdown
-练习 14、修改内核的 `trap_dispatch()` 函数,以便于在时钟中断发生时,它能够调用 `sched_yield()` 去查找和运行一个另外的环境。
+> **练习 14**、修改内核的 `trap_dispatch()` 函数,以便于在时钟中断发生时,它能够调用 `sched_yield()` 去查找和运行一个另外的环境。
-现在,你应该能够用 `user/spin` 去做测试了:父环境应该会 fork 出子环境,`sys_yield()` 到它许多次,但每次切换之后,将重新获得对 CPU 的控制权,最后杀死子环境后优雅地终止。
-```
+> 现在,你应该能够用 `user/spin` 去做测试了:父环境应该会 fork 出子环境,`sys_yield()` 到它许多次,但每次切换之后,将重新获得对 CPU 的控制权,最后杀死子环境后优雅地终止。
这是做回归测试的好机会。确保你没有弄坏本实验的前面部分,确保打开中断能够正常工作(即: `forktree`)。另外,尝试使用 ` make CPUS=2 target` 在多个 CPU 上运行它。现在,你应该能够通过 `stresssched` 测试。可以运行 `make grade` 去确认。现在,你的得分应该是 65 分了(总分为 80)。
-##### 进程间通讯(IPC)
+#### 进程间通讯(IPC)
(严格来说,在 JOS 中这是“环境间通讯” 或 “IEC”,但所有人都称它为 IPC,因此我们使用标准的术语。)
@@ -516,13 +482,13 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
进程间通讯有许多模型。关于哪个模型最好的争论从来没有停止过。我们不去参与这种争论。相反,我们将要实现一个简单的 IPC 机制,然后尝试使用它。
-###### JOS 中的 IPC
+##### JOS 中的 IPC
你将要去实现另外几个 JOS 内核的系统调用,由它们共同来提供一个简单的进程间通讯机制。你将要实现两个系统调用,`sys_ipc_recv` 和 `sys_ipc_try_send`。然后你将要实现两个库去封装 `ipc_recv` 和 `ipc_send`。
用户环境可以使用 JOS 的 IPC 机制相互之间发送 “消息” 到每个其它环境,这些消息有两部分组成:一个单个的 32 位值,和可选的一个单个页映射。允许环境在消息中传递页映射,提供了一个高效的方式,传输比一个仅适合单个的 32 位整数更多的数据,并且也允许环境去轻松地设置安排共享内存。
-###### 发送和接收消息
+##### 发送和接收消息
一个环境通过调用 `sys_ipc_recv` 去接收消息。这个系统调用将取消对当前环境的调度,并且不会再次去运行它,直到消息被接收为止。当一个环境正在等待接收一个消息时,任何其它环境都能够给它发送一个消息 — 而不仅是一个特定的环境,而且不仅是与接收环境有父子关系的环境。换句话说,你在 Part A 中实现的权限检查将不会应用到 IPC 上,因为 IPC 系统调用是经过慎重设计的,因此可以认为它是“安全的”:一个环境并不能通过给它发送消息导致另一个环境发生故障(除非目标环境也存在 Bug)。
@@ -532,7 +498,7 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
同样,一个库函数 `ipc_send` 将去不停地调用 `sys_ipc_try_send` 来发送消息,直到发送成功为止。
-###### 转移页
+##### 转移页
当一个环境使用一个有效的 `dstva` 参数(低于 `UTOP`)去调用 `sys_ipc_recv` 时,环境将声明愿意去接收一个页映射。如果发送方发送一个页,那么那个页应该会被映射到接收者地址空间的 `dstva` 处。如果接收者在 `dstva` 已经有了一个页映射,那么已存在的那个页映射将被取消映射。
@@ -540,31 +506,30 @@ JOS 用户异常栈也是一个页的大小,并且它的顶部被定义在虚
如果发送方和接收方都没有表示要转移这个页,那么就不会有页被转移。在任何 IPC 之后,内核将在接收方的 `Env` 结构上设置新的 `env_ipc_perm` 字段,以允许接收页,或者将它设置为 0,表示不再接收。
-###### 实现 IPC
+##### 实现 IPC
-```markdown
-练习 15、实现 `kern/syscall.c` 中的 `sys_ipc_recv` 和 `sys_ipc_try_send`。在实现它们之前一起阅读它们的注释信息,因为它们要一起工作。当你在这些程序中调用 `envid2env` 时,你应该去设置 `checkperm` 的标志为 0,这意味着允许任何环境去发送 IPC 消息到另外的环境,并且内核除了验证目标 envid 是否有效外,不做特别的权限检查。
+> **练习 15**、实现 `kern/syscall.c` 中的 `sys_ipc_recv` 和 `sys_ipc_try_send`。在实现它们之前一起阅读它们的注释信息,因为它们要一起工作。当你在这些程序中调用 `envid2env` 时,你应该去设置 `checkperm` 的标志为 0,这意味着允许任何环境去发送 IPC 消息到另外的环境,并且内核除了验证目标 envid 是否有效外,不做特别的权限检查。
-接着实现 `lib/ipc.c` 中的 `ipc_recv` 和 `ipc_send` 函数。
+> 接着实现 `lib/ipc.c` 中的 `ipc_recv` 和 `ipc_send` 函数。
-使用 `user/pingpong` 和 `user/primes` 函数去测试你的 IPC 机制。`user/primes` 将为每个质数生成一个新环境,直到 JOS 耗尽环境为止。你可能会发现,阅读 `user/primes.c` 非常有趣,你将看到所有的 fork 和 IPC 都是在幕后进行。
-```
+> 使用 `user/pingpong` 和 `user/primes` 函数去测试你的 IPC 机制。`user/primes` 将为每个质数生成一个新环境,直到 JOS 耗尽环境为止。你可能会发现,阅读 `user/primes.c` 非常有趣,你将看到所有的 fork 和 IPC 都是在幕后进行。
-```
-小挑战!为什么 `ipc_send` 要循环调用?修改系统调用接口,让它不去循环。确保你能处理多个环境尝试同时发送消息到一个环境上的情况。
-```
+.
-```markdown
-小挑战!质数筛选是在大规模并发程序中传递消息的一个很巧妙的用法。阅读 C. A. R. Hoare 写的 《Communicating Sequential Processes》,Communications of the ACM_ 21(8) (August 1978), 666-667,并去实现矩阵乘法示例。
-```
-```markdown
-小挑战!控制消息传递的最令人印象深刻的一个例子是,Doug McIlroy 的幂序列计算器,它在 [M. Douglas McIlroy,《Squinting at Power Series》,Software--Practice and Experience, 20(7) (July 1990),661-683][4] 中做了详细描述。实现了它的幂序列计算器,并且计算了 _sin_ ( _x_ + _x_ ^3) 的幂序列。
-```
+> **小挑战!**为什么 `ipc_send` 要循环调用?修改系统调用接口,让它不去循环。确保你能处理多个环境尝试同时发送消息到一个环境上的情况。
-```markdown
-小挑战!通过应用 Liedtke 的论文([通过内核设计改善 IPC 性能][5])中的一些技术、或你可以想到的其它技巧,来让 JOS 的 IPC 机制更高效。为此,你可以随意修改内核的系统调用 API,只要你的代码向后兼容我们的评级脚本就行。
-```
+.
+
+> **小挑战!**质数筛选是在大规模并发程序中传递消息的一个很巧妙的用法。阅读 C. A. R. Hoare 写的 《Communicating Sequential Processes》,Communications of the ACM_ 21(8) (August 1978), 666-667,并去实现矩阵乘法示例。
+
+.
+
+> **小挑战!**控制消息传递的最令人印象深刻的一个例子是,Doug McIlroy 的幂序列计算器,它在 [M. Douglas McIlroy,《Squinting at Power Series》,Software--Practice and Experience, 20(7) (July 1990),661-683][4] 中做了详细描述。实现了它的幂序列计算器,并且计算了 _sin_ ( _x_ + _x_ ^3) 的幂序列。
+
+.
+
+> **小挑战!**通过应用 Liedtke 的论文([通过内核设计改善 IPC 性能][5])中的一些技术、或你可以想到的其它技巧,来让 JOS 的 IPC 机制更高效。为此,你可以随意修改内核的系统调用 API,只要你的代码向后兼容我们的评级脚本就行。
**Part C 到此结束了。**确保你通过了所有的评级测试,并且不要忘了将你的小挑战的答案写入到 `answers-lab4.txt` 中。
@@ -577,7 +542,7 @@ via: https://pdos.csail.mit.edu/6.828/2018/labs/lab4/
作者:[csail.mit][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/) 荣誉推出
@@ -587,4 +552,4 @@ via: https://pdos.csail.mit.edu/6.828/2018/labs/lab4/
[2]: https://pdos.csail.mit.edu/6.828/2018/labs/readings/i386/toc.htm
[3]: https://pdos.csail.mit.edu/6.828/2018/labs/readings/ia32/IA32-3A.pdf
[4]: https://swtch.com/~rsc/thread/squint.pdf
-[5]: http://dl.acm.org/citation.cfm?id=168633
\ No newline at end of file
+[5]: http://dl.acm.org/citation.cfm?id=168633
From 78a05676f08c4405280bb437333d5ec3e4fbd4ab Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 13:00:50 +0800
Subject: [PATCH 0128/4278] PUB:20181016 Lab 4- Preemptive Multitasking.md
@qhwdw https://linux.cn/article-10351-1.html
---
.../tech => published}/20181016 Lab 4- Preemptive Multitasking.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20181016 Lab 4- Preemptive Multitasking.md (100%)
diff --git a/translated/tech/20181016 Lab 4- Preemptive Multitasking.md b/published/20181016 Lab 4- Preemptive Multitasking.md
similarity index 100%
rename from translated/tech/20181016 Lab 4- Preemptive Multitasking.md
rename to published/20181016 Lab 4- Preemptive Multitasking.md
From 8bee3af9f203bf3c0b6d2a09b0a8132b1d4774f9 Mon Sep 17 00:00:00 2001
From: HankChow <280630620@qq.com>
Date: Sun, 16 Dec 2018 13:31:33 +0800
Subject: [PATCH 0129/4278] hankchow translating
---
sources/tech/20181212 Aliases- DIY Shell Commands.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181212 Aliases- DIY Shell Commands.md b/sources/tech/20181212 Aliases- DIY Shell Commands.md
index d81fb03bb0..81dce2efe7 100644
--- a/sources/tech/20181212 Aliases- DIY Shell Commands.md
+++ b/sources/tech/20181212 Aliases- DIY Shell Commands.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (HankChow)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From 6231a212de89cab2144103573af4dbbcff25dfb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com>
Date: Sun, 16 Dec 2018 14:47:50 +0800
Subject: [PATCH 0130/4278] Update 20180912 How to turn on an LED with Fedora
IoT.md
---
sources/tech/20180912 How to turn on an LED with Fedora IoT.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md
index 007cfc27ab..5f1843fc83 100644
--- a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md
+++ b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md
@@ -1,3 +1,4 @@
+Translating by ScarboroughCoral
How to turn on an LED with Fedora IoT
======
From 608359fff4f1b0a49091e3a4259d3e4ef6975de2 Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Sun, 16 Dec 2018 17:12:33 +0800
Subject: [PATCH 0131/4278] Translated by qhwdw
---
.../tech/20181210 How to get started in AI.md | 113 ------------------
.../tech/20181210 How to get started in AI.md | 113 ++++++++++++++++++
2 files changed, 113 insertions(+), 113 deletions(-)
delete mode 100644 sources/tech/20181210 How to get started in AI.md
create mode 100644 translated/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
deleted file mode 100644
index 0dfb5761aa..0000000000
--- a/sources/tech/20181210 How to get started in AI.md
+++ /dev/null
@@ -1,113 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (qhwdw)
-[#]: 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.
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_)
-
-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/
diff --git a/translated/tech/20181210 How to get started in AI.md b/translated/tech/20181210 How to get started in AI.md
new file mode 100644
index 0000000000..ee88bb6961
--- /dev/null
+++ b/translated/tech/20181210 How to get started in AI.md
@@ -0,0 +1,113 @@
+[#]: collector: (lujun9972)
+[#]: translator: (qhwdw)
+[#]: 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)
+
+学习人工智能如何起步
+======
+在你开始从事人工智能之前,你需要先了解人类的智能。
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_)
+
+我曾经问过别人也被别人问过关于学习人工智能最好的方式是什么?我应该去阅读什么?我应该去关注什么?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。
+
+学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O’Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的区别。
+
+研究人工智能在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的?
+
+另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能入门比其它的要简单的多。
+
+在这个问题上我想补充一点,那就是人工智能的从业者不应该为了故弄玄虚而将它们的工具搞成只输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。但不需要去深入研究他们工具链中每个部分的理论。
+
+虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间切换还有它自己的缺陷。
+
+有了这些背景知识,下面是的一些研究领域和资源,你可能发现会很有用。
+
+### 研究人工智能
+
+在很多方面,用于人工智能研究的一个资源清单,可以反映出本科(甚至是研究生)的计算机科学项目都是专注于人工智能。最主要的区别是,你起草的教学大纲比起传统的大纲更关注于跨学科。
+
+你的计算机科学和数学背景知识决定了你的起点。
+
+如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOCs 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。
+
+典型的基础课程包括:
+
++ [MIT 的微积分课程][22],从微分开始学习
++ [线性代数][23] (德克萨斯大学)
++ 概率与统计,比如 MIT 的 [概率 — 不确定性与数据科学][24]
+
+
+从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。在深入研究机器学习和人工智能之前,上述的内容应该会让你得到一些常见研究分支的大致概念。
+
+除了 MOOCs 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。
+
+有了这些基础,你就可以学习更专业的人工智能课程了。Andrew Ng 在斯坦福大学教的 “AI MOOC” 就是整个在线课程中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。
+
+除了课程之外,也可以在网上找到各种范例和其它学习材料。这些包括:
+
+ * [神经网络和深度学习][7]
+ * MIT 的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 出版的 [深度学习][8]
+
+### 应用人工智能
+
+人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 — 甚至可以说是必需的 — 但对这些知识的了解程度不像研究人工智能的要求那么高。
+
+在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 — 比如 Python 的 [PyTorch][9],在这方面有很好的专长。尤其是,如果你有一些编程方面的背景知识,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。
+
+[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。比如,许多使用原始和数据清洗相关的应用任务,此外还有你最终要使用的诸如此类的分析技术,都将使用到它。一个 MOOC 系列,像 Harvard 的 [数据科学认证][13] 就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。
+
+如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 智慧团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。
+
+通常,大的公有云提供商都提供在线数据集和易于使用的机器学习服务。但是,在你开始去 “玩” 数据集和应用之前,你需要考虑清楚,一旦开始选定一个提供商,你将被它们 “锁定” 的程度。
+
+你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 的数据集。州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。
+
+### 研究和应用人工智能兼而有之
+
+最后我想说明的一点是,人工智能不仅是与数学、编程、和数据有关的一个宽泛的主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。
+
+我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人类与机器工作所面临的全部挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得对飞机的控制。一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。
+
+关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,而是它们只有这么多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/how-get-started-ai
+
+作者:[Gordon Haff][a]
+选题:[lujun9972][b]
+译者:[qhwdw](https://github.com/qhwdw)
+校对:[校对者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 b2f28aadec871b2a3ff46672e27e005d57cc92d2 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 19:36:53 +0800
Subject: [PATCH 0132/4278] PRF:20181201 Boxing yourself in on the Linux
command line.md
@jrglinux
---
...g yourself in on the Linux command line.md | 28 ++++++++++---------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/translated/tech/20181201 Boxing yourself in on the Linux command line.md b/translated/tech/20181201 Boxing yourself in on the Linux command line.md
index 56575b1f5b..1680a7ded8 100644
--- a/translated/tech/20181201 Boxing yourself in on the Linux command line.md
+++ b/translated/tech/20181201 Boxing yourself in on the Linux command line.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
-[#]: translator: (jrglinux )
-[#]: reviewer: ( )
+[#]: translator: (jrglinux)
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (Boxing yourself in on the Linux command line)
[#]: via: (https://opensource.com/article/18/12/linux-toy-boxes)
@@ -9,24 +9,26 @@
神奇的 Linux 命令行字符形状工具 boxes
======
-本文将教你如何在 Linux 命令行终端中使用 boxes 工具绘制字符形状图形来包装你的文字让其更突出。
+
+> 本文将教你如何在 Linux 命令行终端中使用 boxes 工具绘制字符形状图形来包装你的文字让其更突出。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-boxes.png?itok=Rii6nT5P)
现在正值假期,每个 Linux 终端用户都该得到一点礼物。无论你是庆祝圣诞节还是庆祝其他节日,或者什么节日也没有,都没有关系。我将在接下来的几周内介绍 24 个 Linux 命令行小玩具,供你把玩或者与朋友分享。让我们享受乐趣,让这个月过得快乐一点,因为对于北半球来说,这个月有点冷并且沉闷。
对于我要讲述的内容,可能你之前就有些了解。但是,我还是希望我们都有机会学到一些新的东西(我做了一点研究,确保可以分享 24 个小玩具)。
-24 个 Linux 终端小玩具中的第一个是叫做 boxes 的小程序。为何从 boxes 说起呢?因为在没有它的情况下很难将所有其他命令礼物包装起来!
+24 个 Linux 终端小玩具中的第一个是叫做 `boxes` 的小程序。为何从 `boxes` 说起呢?因为在没有它的情况下很难将所有其他命令礼物包装起来!
-在我的 Fedora 机器上,默认没有安装 boxes 程序,但它在我的普通仓库中可以获取到,所以用如下命令就可安装:
+在我的 Fedora 机器上,默认没有安装 `boxes` 程序,但它在我的普通仓库中可以获取到,所以用如下命令就可安装:
```
$ sudo dnf install boxes -y
```
-如果你在使用其他 Linux 发行版,一般也都可以在默认仓库中找到 boxes。
+如果你在使用其他 Linux 发行版,一般也都可以在默认仓库中找到 `boxes`。
-Boxes 是我真正希望在高中和大学计算机课程中就使用的实用程序,因为善意的老师要求我在每个源文件、函数、代码块等开头添加一些具体的评论信息。
+`boxes` 是我真正希望在高中和大学计算机课程中就使用的实用程序,因为善意的老师要求我在每个源文件、函数、代码块等开头添加一些特定外观的备注信息。
```
/***************/
@@ -34,7 +36,7 @@ Boxes 是我真正希望在高中和大学计算机课程中就使用的实用
/***************/
```
-事实证明,一旦你需要在框内添加几行文字,并且格式化的将它们统一风格就会变得很乏味。而 boxes 是一个简单实用程序,它使用 ASCII 艺术风格的字符形状框来包围文本。其字符形状默认风格是源代码注释风格,但也提供了一些其他选项。
+事实证明,一旦你需要在框内添加几行文字,并且格式化的将它们统一风格就会变得很乏味。而 `boxes` 是一个简单实用程序,它使用 ASCII 艺术风格的字符形状框来包围文本。其字符形状默认风格是源代码注释风格,但也提供了一些其他选项。
它真的很容易使用。使用管道,便可以将一个简短问候语塞进字符形状盒子里。
@@ -86,7 +88,7 @@ echo "I am a dog" | boxes -d dog -a c
'---------------------------------------'
```
-Boxes 程序提供了[很多选项][1] 用于填充、定位甚至处理正则表达式。你可以在其 [项目主页][2] 上了解更多有关 boxes 的信息,或者转到 [GitHub][3] 去下载源代码或者贡献你自己的盒子形状。说到此,如果你正在寻找贡献的好点子,我已经有了一个想法:为什么不贡献一个节日礼物盒子?
+`boxes` 程序提供了[很多选项][1] 用于填充、定位甚至处理正则表达式。你可以在其 [项目主页][2] 上了解更多有关 `boxes` 的信息,或者转到 [GitHub][3] 去下载源代码或者贡献你自己的盒子形状。说到此,如果你想给你的提交找个好点子,我已经有了一个想法:为什么不能是一个节日礼物盒子?
```
_ _
@@ -100,11 +102,11 @@ Boxes 程序提供了[很多选项][1] 用于填充、定位甚至处理正则
|____________________|
```
-Boxes 是基于 GPLv2 许可证的开源项目。
+`boxes` 是基于 GPLv2 许可证的开源项目。
-你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。即使要介绍的小玩具已经有 24 个了,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
+你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。即使要介绍的小玩具已经有 24 个了,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
-你可以通过[ Drive a locomotive through your Linux terminal][4] 来查看明天会介绍的命令行小玩具。
+你可以通过 [Drive a locomotive through your Linux terminal][4] 来查看明天会介绍的命令行小玩具。
--------------------------------------------------------------------------------
@@ -113,7 +115,7 @@ via: https://opensource.com/article/18/12/linux-toy-boxes
作者:[Jason Baker][a]
选题:[lujun9972][b]
译者:[jrg](https://github.com/jrglinux)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 069ed6a2ae9b85f090b2d083320a815b23b955a0 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 19:37:50 +0800
Subject: [PATCH 0133/4278] PUB:20181201 Boxing yourself in on the Linux
command line.md
@jrglinux https://linux.cn/article-10352-1.html
---
.../20181201 Boxing yourself in on the Linux command line.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181201 Boxing yourself in on the Linux command line.md (98%)
diff --git a/translated/tech/20181201 Boxing yourself in on the Linux command line.md b/published/20181201 Boxing yourself in on the Linux command line.md
similarity index 98%
rename from translated/tech/20181201 Boxing yourself in on the Linux command line.md
rename to published/20181201 Boxing yourself in on the Linux command line.md
index 1680a7ded8..657d7b8a31 100644
--- a/translated/tech/20181201 Boxing yourself in on the Linux command line.md
+++ b/published/20181201 Boxing yourself in on the Linux command line.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (jrglinux)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (Boxing yourself in on the Linux command line)
[#]: via: (https://opensource.com/article/18/12/linux-toy-boxes)
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10352-1.html)
神奇的 Linux 命令行字符形状工具 boxes
======
From 5165e663676f019cb539c3756264fc0b0679b7b2 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 20:13:11 +0800
Subject: [PATCH 0134/4278] PRF:20181210 5 Ways To Check Laptop Battery Status
And Level From Linux Terminal.md
@dianbanjiu
---
...ry Status And Level From Linux Terminal.md | 171 +++++++++---------
1 file changed, 84 insertions(+), 87 deletions(-)
diff --git a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
index 7e4bff270a..52767b97d4 100644
--- a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
+++ b/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
@@ -1,101 +1,99 @@
[#]: collector: (lujun9972)
-[#]: translator: ( dianbanjiu )
-[#]: reviewer: ( )
+[#]: translator: (dianbanjiu)
+[#]: reviewer: (wxy)
[#]: 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/)
-从 Linux 终端查看笔记本电池状态等级的 5 个方法
+从 Linux 终端查看笔记本电池状态和等级的 5 个方法
======
我们可以轻松地通过图形化界面查看当前电量百分比、是否在充电以及当前电量还可以使用多长时间等电池状态,但是却无法查看电池健康度等相关信息。
在这篇文章就是为了解决这些问题。
-在 Linux 上有很多实用工具可以用命令行进行使用。
+在 Linux 上有很多这样的实用工具,而且可以在命令行使用。
这篇文章今天就要探讨这个主题,我会尽我所能的覆盖尽可能多的信息。
每月检查一次你的电池健康度是一个很好的想法。它可以帮你检查你当前遇到的问题是否与电池或者充电相关。
-同时,我们也可以查看电池模组名称、电源、出售商以及电池规格等。
+同时,我们也可以查看电池模组名称、电源、厂商以及电池规格等。
-电源管理是在非活跃状态时关闭电源或者切换系统的组件到低耗模式的一种功能。
+电源管理是在不使用时关闭电源或者切换系统的组件到低耗模式的一种功能。
### 几种在 Linux 下检查电池状态的实用工具
- * `upower`: upower 是一个提供了接口来罗列系统中电源的命令行工具。
- * `acpi`: acpi显示来自 /proc 或者 /sys 文件中的一些信息,例如电池状态或者热量信息
- * `batstat`: batstat 是一个为 Linux 打印电池状态的命令行工具。
- * `tlp`: TLP 可以为你带来更高级的电源管理,而无需修改任何配置。
- * `class file`: 这个文件系统是一个提供了内核数据结构接口的伪文件系统。
-
-
+* `upower`:是一个命令行工具,其提供了罗列系统中电源的接口。
+* `acpi`:显示来自 `/proc` 或者 `/sys` 文件系统中的一些信息,例如电池状态或者热量信息。
+* `batstat`:是一个为 Linux 打印电池状态的命令行工具。
+* `tlp`:可以为你带来更高级的电源管理,而无需修改任何配置。
+* `class file`:这个 sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。
### 如何使用 upower 命令检查笔记本电池状态
-[upower][1] 是一个提供了接口来罗列系统中电源的命令行工具。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。
+[upower][1] 是一个命令行工具,其提供了罗列系统中电源的接口。它在你的电脑上可以控制不同操作的延迟,这可以为你节省很大一部分电量。
只需要在 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
+ 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
```
使用下面的格式检查电池的特定信息。
```
$ 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%
+ state: discharging
+ time to empty: 2.1 hours
+ percentage: 43%
```
-这个类似于上面的那个,但是充电线缆的插入就相当于一个令牌,这也就是为什么下面会显示正在充电状态的原因。
+这个类似于上面的那个,但是是在充电线缆的插入后运行,这也就是为什么下面会显示正在充电状态的原因。
```
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -i "state\|percentage\|time to empty"
- state: charging
- percentage: 41%
+ state: charging
+ percentage: 41%
```
### 如何使用 TLP 命令检查笔记本电池状态
-TLP 是一个自由开源多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。
+TLP 是一个自由开源的多功能的命令行工具,它可以优化笔记本电池而无需修改任何配置。
TLP 可以为你的 Linux 带来更高级的电源管理,而无需理解任何技术细节。TLP 默认附带了一个已经为你的电池优化好的配置,所以你可以安装好后就不再管它了。尽管 TLP 是一个可以根据你的需求高度可定制的工具。
-TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。
+TLP 在绝大多数 Linux 发行版,例如 Arch、Debian、Fedora、Gentoo、openSUSE 等的官方库中都可用。使用你的 Linux 发行版的包管理安装 TLP 即可。
只需要在 Linux 中运行以下命令获取电池以及其他所依赖的信息。
@@ -104,17 +102,17 @@ $ 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
+/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 [%]
+Charge = 42.0 [%]
+Capacity = 87.1 [%]
```
也可以查看其他的信息。
@@ -124,24 +122,23 @@ $ 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)
+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
-```
+State = enabled
+Last run = 07:16:12 IST, 4362 sec(s) ago
+Mode = battery
+Power source = battery```
### 如何使用 ACPI 命令检查电池状态
-ACPI 代表高级配置和电源接口模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 /proc 或者 /sys 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。
+ACPI 代表高级配置和电源接口模块,它们是不同 ACPI 部件的内核模块。它们启用特殊的 ACPI 函数向 `/proc` 或者 `/sys` 中添加信息。这些信息可以通过事件或者其他监控程序的 acpid 进行解析。
```
$ acpi
@@ -179,25 +176,25 @@ Cooling 11: Processor 0 of 10
### 如何使用 Batstat 命令查看笔记本电池状态
-batstat 是一个在 Linux 终端打印电池信息的命令行工具。
+`batstat` 是一个在 Linux 终端打印电池信息的命令行工具。
```
-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%
+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%
```
### 如何使用 sysfs 文件系统查看笔记本电池状态
sysfs 文件系统是一个提供了内核数据结构接口的伪文件系统。sysfs 下的文件提供有关设备、内核模块、文件系统和其他内核组件的信息。
-sysfs 文件系统通常挂载在 /sys。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。
+sysfs 文件系统通常挂载在 `/sys`。通常来说,它会被系统自动挂载,但是也可以使用例如 `mount -t sysfs sysfs /sys` 命令进行手动挂载。
在 sysfs 文件系统中的很多文件都是只读的,但也有一些是可写的,允许更改内核变量。为了避免冗余,符号链接被大量用于连接文件系统数中的条目。
@@ -216,7 +213,7 @@ L14M4P23
cat: /sys/class/power_supply/BAT0/power: Is a directory
27656000
1
- 756
+ 756
Charging
cat: /sys/class/power_supply/BAT0/subsystem: Is a directory
Li-ion
@@ -236,7 +233,7 @@ POWER_SUPPLY_CAPACITY=51
POWER_SUPPLY_CAPACITY_LEVEL=Normal
POWER_SUPPLY_MODEL_NAME=L14M4P23
POWER_SUPPLY_MANUFACTURER=SMP
-POWER_SUPPLY_SERIAL_NUMBER= 756
+POWER_SUPPLY_SERIAL_NUMBER= 756
14800000
15840000
```
@@ -248,7 +245,7 @@ via: https://www.2daygeek.com/check-laptop-battery-status-and-charging-state-in-
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[dianbanjiu](https://github.com/dianbanjiu)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From f8a8ed65781dcd4faf53247e767d27e9f55a6381 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 20:13:53 +0800
Subject: [PATCH 0135/4278] PUB:20181210 5 Ways To Check Laptop Battery Status
And Level From Linux Terminal.md
@dianbanjiu https://linux.cn/article-10353-1.html
---
...eck Laptop Battery Status And Level From Linux Terminal.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md (99%)
diff --git a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md b/published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
similarity index 99%
rename from translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
rename to published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
index 52767b97d4..dc7866eb07 100644
--- a/translated/tech/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
+++ b/published/20181210 5 Ways To Check Laptop Battery Status And Level From Linux Terminal.md
@@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (dianbanjiu)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
-[#]: url: ( )
+[#]: publisher: (wxy)
+[#]: url: (https://linux.cn/article-10353-1.html)
[#]: 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/)
From e497d34784159ce9fd1eb8046f80724c2adce535 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 20:38:22 +0800
Subject: [PATCH 0136/4278] PRF:20181112 A Free Guide for Setting Your Open
Source Strategy.md
@geekpi
---
...e for Setting Your Open Source Strategy.md | 26 +++++++++----------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md b/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md
index 16216c8a46..8647eea005 100644
--- a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md
+++ b/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (A Free Guide for Setting Your Open Source Strategy)
[#]: via: (https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-strategy)
@@ -10,13 +10,15 @@
制定开源战略的免费指南
======
+> 了解如何使用 TODO Group 的成熟实践,使您的组织的开源软件目标与您的业务目标保持一致。
+
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/os-strategy.jpg?itok=hSmtdJdK)
-大多数使用开源的公司都了解其商业价值,但他们可能缺乏战略性地实施开源计划和获得全部回报的工具。根据 [The New Stack][1] 最近的一项调查,“开源计划的三大好处是1)提高了对开源的认识,2)提高了开发周期的速度和灵活性,以及 3)更好的许可证合规性“。
+大多数使用开源的公司都了解其商业价值,但他们可能缺乏战略性地实施开源计划和获得全部回报的工具。根据 [The New Stack][1] 最近的一项调查,“开源计划的三大好处是 1)提高了对开源的认识,2)提高了开发周期的速度和灵活性,以及 3)更好的许可证合规性。”
-运营开源计划办公点涉及创建策略来帮助你定义和实施你的方法,并衡量你的进度。由 Linux 基金会与 TODO 集团合作开发的[企业开源指南][2]基于多年的经验和实践提供了专业开源知识。
+运作一个开源计划办公室涉及到创建策略来帮助你定义和实施你的方法,并衡量你的进度。由 Linux 基金会与 TODO Group 合作开发的[企业开源指南][2]基于多年的经验和实践提供了专业开源知识。
-最新的指南中,[设置开源战略][3]详细介绍了制定战略和确保成功之路的基本步骤。根据该指南,“你的开源战略将管理、参与和创建开源软件的计划与计划所服务的业务目标联系起来。这可以开辟许多机会并促进创新。“该指南涵盖以下主题:
+最新的指南中,[设置开源战略][3]详细介绍了制定战略和确保成功之路的基本步骤。根据该指南,“你的开源战略将管理、参与和创建开源软件的计划与计划所服务的业务目标联系起来。这可以开辟许多机会并促进创新。”该指南涵盖以下主题:
1. 为什么制定战略?
2. 你的战略文件
@@ -26,9 +28,7 @@
6. 确定投资回报率
7. 投资目标
-
-
-这里关键的第一步是创建和记录你的开源策略,该策略将“帮助你最大限度地提高组织从开源中获得的利益。”同时,你详细的策略可以帮助你避免因错误而导致的困难,例如:选择错误的许可证或不正确地维护代码。根据指南,该文件还可以:
+这里关键的第一步是创建和将你的开源策略形成文字,该策略将“帮助你最大限度地提高组织从开源中获得的利益。”同时,你详细的策略可以帮助你避免因错误而导致的困难,例如:选择错误的许可证或不正确地维护代码。根据指南,该文件还可以:
* 让领导者感到兴奋并参与
* 帮助在公司内获得支持
@@ -37,15 +37,13 @@
* 解释贵公司的开源方式和对其使用的支持
* 明确贵公司在社区驱动的外部研发中投资的地方,以及贵公司将重点放在增值差异化的地方
+Salesforce 的软件架构师兼本指南的撰稿人 Ian Varley 说:“在 Salesforce 内,我们有内部文件,我们将这些围绕开源战略指导和鼓励的文件分发给我们的工程团队。其中鼓励创建和使用开源,这让他们毫不含糊地知道公司的战略领导者完全支持它。此外,如果有某些我们不希望工程师使用的许可证或有其他开源指南,我们的内部文档需要明确。”
-
-Salesforce 的软件架构师兼指南的撰稿人 Ian Varley 说:“在 Salesforce 内,我们有内部文件,我们将这些围绕开源战略指导和鼓励的文件分发给我们的工程团队。其中鼓励创建和使用开源,这让他们毫不含糊地知道公司的战略领导者完全支持它。此外,如果有某些我们不希望工程师使用的许可证或有其他开源指南,我们的内部文档需要明确。“
-
-开源计划有助于促进企业文化,使企业更高效,并且根据指南,强有力的战略文档可以“帮助你的团队了解开源计划背后的业务目标,确保更好的决策,并最大限度地降低风险“。
+开源计划有助于促进企业文化,使企业更高效,并且根据指南,强有力的战略文档可以“帮助你的团队了解开源计划背后的业务目标,确保更好的决策,并最大限度地降低风险。”
了解如何使用[设置开源策略][3]新指南中的提示和经过验证的实践,将管理和创建开源软件的目标与组织的业务目标保持一致。然后,查看所有 12 个[企业开源指南][2],了解有关使用开源获得成功的更多信息。
-本文最初发表在 [Linux基金会][4]
+本文最初发表在 [Linux基金会][4]。
--------------------------------------------------------------------------------
@@ -54,7 +52,7 @@ via: https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-stra
作者:[Amber Ankerholz][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/) 荣誉推出
@@ -63,4 +61,4 @@ via: https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-stra
[1]: https://thenewstack.io/open-source-culture-starts-with-programs-and-policies/
[2]: https://www.linuxfoundation.org/resources/open-source-guides/
[3]: https://www.linuxfoundation.org/resources/open-source-guides/setting-an-open-source-strategy/
-[4]: https://www.linuxfoundation.org/blog/2018/11/a-free-guide-for-setting-your-open-source-strategy/
\ No newline at end of file
+[4]: https://www.linuxfoundation.org/blog/2018/11/a-free-guide-for-setting-your-open-source-strategy/
From 387752f580cd3f2c74756306dc2e67ca65a02364 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Sun, 16 Dec 2018 20:39:09 +0800
Subject: [PATCH 0137/4278] PUB:20181112 A Free Guide for Setting Your Open
Source Strategy.md
@geekpi https://linux.cn/article-10354-1.html
---
...1112 A Free Guide for Setting Your Open Source Strategy.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/talk => published}/20181112 A Free Guide for Setting Your Open Source Strategy.md (98%)
diff --git a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md b/published/20181112 A Free Guide for Setting Your Open Source Strategy.md
similarity index 98%
rename from translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md
rename to published/20181112 A Free Guide for Setting Your Open Source Strategy.md
index 8647eea005..6e203f72a1 100644
--- a/translated/talk/20181112 A Free Guide for Setting Your Open Source Strategy.md
+++ b/published/20181112 A Free Guide for Setting Your Open Source Strategy.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (A Free Guide for Setting Your Open Source Strategy)
[#]: via: (https://www.linux.com/blog/2018/11/free-guide-setting-your-open-source-strategy)
[#]: author: ([Amber Ankerholz](https://www.linux.com/users/aankerholz)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10354-1.html)
制定开源战略的免费指南
======
From 5e3f99e481760a3087feb930074e0b2ac65c9227 Mon Sep 17 00:00:00 2001
From: MjSeven
Date: Sun, 16 Dec 2018 20:46:12 +0800
Subject: [PATCH 0138/4278] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=902?=
=?UTF-8?q?0180710=20Users,=20Groups,=20and=20Other=20Linux=20Beasts.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...0 Users, Groups, and Other Linux Beasts.md | 155 ------------------
...0 Users, Groups, and Other Linux Beasts.md | 139 ++++++++++++++++
2 files changed, 139 insertions(+), 155 deletions(-)
delete mode 100644 sources/tech/20180710 Users, Groups, and Other Linux Beasts.md
create mode 100644 translated/tech/20180710 Users, Groups, and Other Linux Beasts.md
diff --git a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md b/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md
deleted file mode 100644
index ad5be702d8..0000000000
--- a/sources/tech/20180710 Users, Groups, and Other Linux Beasts.md
+++ /dev/null
@@ -1,155 +0,0 @@
-Translating by MjSeven
-
-Users, Groups, and Other Linux Beasts
-======
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/flamingo-2458782_1920.jpg?itok=_gkzGGx5)
-
-Having reached this stage, [after seeing how to manipulate folders/directories][1], but before flinging ourselves headlong into fiddling with files, we have to brush up on the matter of _permissions_ , _users_ and _groups_. Luckily, [there is already an excellent and comprehensive tutorial on this site that covers permissions][2], so you should go and read that right now. In a nutshell: you use permissions to establish who can do stuff to files and directories and what they can do with each file and directory -- read from it, write to it, move it, erase it, etc.
-
-To try everything this tutorial covers, you'll need to create a new user on your system. Let's be practical and make a user for anybody who needs to borrow your computer, that is, what we call a _guest account_.
-
-**WARNING:** _Creating and especially deleting users, along with home directories, can seriously damage your system if, for example, you remove your own user and files by mistake. You may want to practice on another machine which is not your main work machine or on a virtual machine. Regardless of whether you want to play it safe, or not, it is always a good idea to back up your stuff frequently, check the backups have worked correctly, and save yourself a lot of gnashing of teeth later on._
-
-### A New User
-
-You can create a new user with the `useradd` command. Run `useradd` with superuser/root privileges, that is using `sudo` or `su`, depending on your system, you can do:
-```
-sudo useradd -m guest
-
-```
-
-... and input your password. Or do:
-```
-su -c "useradd -m guest"
-
-```
-
-... and input the password of root/the superuser.
-
-( _For the sake of brevity, we'll assume from now on that you get superuser/root privileges by using`sudo`_ ).
-
-By including the `-m` argument, `useradd` will create a home directory for the new user. You can see its contents by listing _/home/guest_.
-
-Next you can set up a password for the new user with
-```
-sudo passwd guest
-
-```
-
-Or you could also use `adduser`, which is interactive and asks you a bunch of questions, including what shell you want to assign the user (yes, there are more than one), where you want their home directory to be, what groups you want them to belong to (more about that in a second) and so on. At the end of running `adduser`, you get to set the password. Note that `adduser` is not installed by default on many distributions, while `useradd` is.
-
-Incidentally, you can get rid of a user with `userdel`:
-```
-sudo userdel -r guest
-
-```
-
-With the `-r` option, `userdel` not only removes the _guest_ user, but also deletes their home directory and removes their entry in the mailing spool, if they had one.
-
-### Skeletons at Home
-
-Talking of users' home directories, depending on what distro you're on, you may have noticed that when you use the `-m` option, `useradd` populates a user's directory with subdirectories for music, documents, and whatnot as well as an assortment of hidden files. To see everything in you guest's home directory run `sudo ls -la /home/guest`.
-
-What goes into a new user's directory is determined by a skeleton directory which is usually _/etc/skel_. Sometimes it may be a different directory, though. To check which directory is being used, run:
-```
-useradd -D
-GROUP=100
-HOME=/home
-INACTIVE=-1
-EXPIRE=
-SHELL=/bin/bash
-SKEL=/etc/skel
-CREATE_MAIL_SPOOL=no
-
-```
-
-This gives you some extra interesting information, but what you're interested in right now is the `SKEL=/etc/skel` line. In this case, and as is customary, it is pointing to _/etc/skel/_.
-
-As everything is customizable in Linux, you can, of course, change what gets put into a newly created user directory. Try this: Create a new directory in _/etc/skel/_ :
-```
-sudo mkdir /etc/skel/Documents
-
-```
-
-And create a file containing a welcome text and copy it over:
-```
-sudo cp welcome.txt /etc/skel/Documents
-
-```
-
-Now delete the guest account:
-```
-sudo userdel -r guest
-
-```
-
-And create it again:
-```
-sudo useradd -m guest
-
-```
-
-Hey presto! Your _Documents/_ directory and _welcome.txt_ file magically appear in the guest's home directory.
-
-You can also modify other things when you create a user by editing _/etc/default/useradd_. Mine looks like this:
-```
-GROUP=users
-HOME=/home
-INACTIVE=-1
-EXPIRE=
-SHELL=/bin/bash
-SKEL=/etc/skel
-CREATE_MAIL_SPOOL=no
-
-```
-
-Most of these options are self-explanatory, but let's take a closer look at the `GROUP` option.
-
-### Herd Mentality
-
-Instead of assigning permissions and privileges to users one by one, Linux and other Unix-like operating systems rely on _groups_. A group is a what you imagine it to be: a bunch of users that are related in some way. On your system you may have a group of users that are allowed to use the printer. They would belong to the _lp_ (for " _line printer_ ") group. The members of the _wheel_ group were traditionally the only ones who could become superuser/root by using _su_. The _network_ group of users can bring up and power down the network. And so on and so forth.
-
-Different distributions have different groups and groups with the same or similar names have different privileges also depending on the distribution you are using. So don't be surprised if what you read in the prior paragraph doesn't match what is going on in your system.
-
-Either way, to see which groups are on your system you can use:
-```
-getent group
-
-```
-
-The `getent` command lists the contents of some of the system's databases.
-
-To find out which groups your current user belongs to, try:
-```
-groups
-
-```
-
-When you create a new user with `useradd`, unless you specify otherwise, the user will only belong to one group: their own. A _guest_ user will belong to a _guest_ group and the group gives the user the power to administer their own stuff and that is about it.
-
-You can create new groups and then add users to them at will with the `groupadd` command:
-```
-sudo groupadd photos
-
-```
-
-will create the _photos_ group, for example. Next time, we’ll use this to build a shared directory all members of the group can read from and write to, and we'll learn even more about permissions and privileges. Stay tuned!
-
-Learn more about Linux through the free ["Introduction to Linux" ][3]course from The Linux Foundation and edX.
-
---------------------------------------------------------------------------------
-
-via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
-
-作者:[Paul Brown][a]
-选题:[lujun9972](https://github.com/lujun9972)
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:https://www.linux.com/users/bro66
-[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux
-[2]:https://www.linux.com/learn/understanding-linux-file-permissions
-[3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
diff --git a/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md
new file mode 100644
index 0000000000..477d317d9f
--- /dev/null
+++ b/translated/tech/20180710 Users, Groups, and Other Linux Beasts.md
@@ -0,0 +1,139 @@
+用户,组和其他 Linux 用户
+======
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/flamingo-2458782_1920.jpg?itok=_gkzGGx5)
+
+到这个阶段,[在看到如何操作目录或文件夹之后][1],但在让自己一头扎进文件之前,我们必须重新审视 _权限_, _users_ 和 _group_。幸运的是,[有一个网站上已经有了一个优秀而全面的教程,包括了权限][2],所以你应该去立刻阅读它。简而言之,你使用权限来确定谁可以对文件和目录执行操作,以及他们可以对每个文件和目录执行什么操作 -- 从中读取,写入,擦除等等。
+
+要尝试本教程涵盖的所有内容,你需要在系统上创建新用户。让我们实践起来,为每一个需要借用你电脑的人创建一个用户,我们称之为 _guest 账户_。
+
+**警告:** _例如,如果你错误地删除了自己的用户和目录,那么创建,特别是删除用户以及主目录会严重损坏系统。你可能不想在你日常的工作机中练习,那么请在另一台机器或者虚拟机上练习。无论你是否想要安全地练习,经常备份你的东西总是一个好主意。检查备份是否正常工作,为你自己以后避免很多咬牙切齿的事情。_
+
+### 一个新用户
+
+你可以使用 `useradd` 命令来创建一个新用户。使用超级用户或 root 权限运行 `useradd`,即使用 `sudo` 或 `su`,这具体取决于你的系统,你可以:
+```
+sudo useradd -m guest
+```
+
+然后输入你的密码。或者也可以这样:
+```
+su -c "useradd -m guest"
+```
+
+然后输入 root 或超级用户的密码。
+
+(_为了简洁起见,我们将从现在开始假设你使用 `sudo` 获得超级用户或 root 权限。_)
+
+通过使用 `-m` 参数,`useradd` 将为新用户创建一个主目录。你可以通过列出 _/home/guest_ 来查看其内容。
+
+然后你可以使用以下命令来为新用户设置密码:
+```
+sudo passwd guest
+```
+
+或者你也可以使用 `adduser`,这是一个交互式的命令,它会询问你一些问题,包括你要为用户分配的 shell(是的,不止一个),你希望其主目录在哪里,你希望他们属于哪些组(有关这点稍后会讲到)等等。在运行 `adduser` 结束时,你可以设置密码。注意,默认情况下,在许多发行版中都没有安装 `adduser`,但安装了 `useradd`。
+
+顺便说一下,你可以使用 `userdel` 来移除一个用户:
+```
+sudo userdel -r guest
+```
+
+使用 `-r` 选项,`userdel` 不仅删除了 _guest_ 用户,还删除了他们的主目录和邮件中的条目(如果有的话)。
+
+### home 中的内容
+
+谈到用户的主目录,它依赖于你所使用的发行版。你可能已经注意到,当你使用 `-m` 选项时,`useradd` 使用子目录填充用户的目录,包括音乐,文档和诸如此类的内容以及各种各样的隐藏文件。要查看 guest 主目录中的所有内容,运行 `sudo ls -la /home/guest`。
+
+进入新用户目录的内容通常是由 _/etc/skel_ 架构目录确定的。有时它可能是一个不同的目录。要检查正在使用的目录,运行:
+```
+useradd -D
+GROUP=100
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/bash
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=no
+```
+
+这给你一些额外的有趣信息,但你现在感兴趣的是 `SKEL=/etc/skel` 这一行,在这种情况下,按照惯例,它指向 _/etc/skel/_。
+
+由于 Linux 中的所有东西都是可定制的,因此你可以更改那些放入新创建的用户目录的内容。试试这样做:在 _/etc/skel/_ 中创建一个新目录:
+```
+sudo mkdir /etc/skel/Documents
+```
+
+然后创建一个包含欢迎消息的文件,并将其复制过来:
+```
+sudo cp welcome.txt /etc/skel/Documents
+```
+
+现在删除 guest 账户:
+```
+sudo userdel -r guest
+```
+
+再次创建:
+```
+sudo useradd -m guest
+```
+
+嘿 presto!(to 校正:这个 presto 是什么?)你的 _Documents/_ 目录和 _welcome.txt_ 文件神奇地出现在了 guest 的主目录中。
+
+你还可以在创建用户时通过编辑 _/etc/default/useradd_ 来修改其他内容。我的看起来像这样:
+```
+GROUP=users
+HOME=/home
+INACTIVE=-1
+EXPIRE=
+SHELL=/bin/bash
+SKEL=/etc/skel
+CREATE_MAIL_SPOOL=no
+```
+
+这些选项大多数都是不言自明的,但让我们仔细看看 `GROUP` 选项。
+
+### 群组心态
+
+Linux 和其他类 Unix 操作系统依赖于 _groups_,而不是逐个为用户分配权限和特权。一个组就是你想象的那样:一群在某种程度上相关的用户。在你的系统上可能有一组允许使用打印机的用户,他们属于 _lp_(即 "_line printer_")组。传统上 _wheel_ 组的成员是唯一可以通过使用 _su_ 成为超级用户或 root 的成员。_network_ 用户组可以启动或关闭网络。还有许多诸如此类的。
+
+不同的发行版有不同的组,具有相同或相似名称的组具有不同的权限,这也取决于你使用的发行版。因此,如果你在前一段中读到的内容与你系统中的内容不匹配,不要感到惊讶。
+
+不管怎样g,要查看系统中有哪些组,你可以使用:
+```
+getent group
+```
+
+`getent` 命令列出了某些系统数据库的内容。
+
+要查找当前用户所属的组,尝试:
+```
+groups
+```
+
+当你使用 `useradd` 创建新用户时,除非你另行指定,否则用户讲只属于一个组:他们自己。一个 _guest_ 用户属于 _guest_ 组。组使用户有权管理自己的东西,仅此而已。
+
+你可以使用 `groupadd` 命令创建新组,然后添加用户:
+```
+sudo groupadd photos
+```
+
+例如,这将创建 _photos_ 组。下一次,我们将使用它来构建一个共享目录,该组的所有成员都可以读取和写入,我们将更多地了解权限和特权。敬请关注!
+
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/learn/intro-to-linux/2018/7/users-groups-and-other-linux-beasts
+
+作者:[Paul Brown][a]
+选题:[lujun9972](https://github.com/lujun9972)
+译者:[MjSeven](https://github.com/MjSeven)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://www.linux.com/users/bro66
+[1]:https://www.linux.com/blog/learn/2018/5/manipulating-directories-linux
+[2]:https://www.linux.com/learn/understanding-linux-file-permissions
+[3]:https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
From 65332a0e14804a34eacaea874afc64506ce0ec3b Mon Sep 17 00:00:00 2001
From: geekpi
Date: Mon, 17 Dec 2018 08:59:20 +0800
Subject: [PATCH 0139/4278] translated
---
...arch Or Find Files And Folders in Linux.md | 153 ------------------
...arch Or Find Files And Folders in Linux.md | 153 ++++++++++++++++++
2 files changed, 153 insertions(+), 153 deletions(-)
delete mode 100644 sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
create mode 100644 translated/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
deleted file mode 100644
index f28649013b..0000000000
--- a/sources/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
+++ /dev/null
@@ -1,153 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: 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
diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
new file mode 100644
index 0000000000..a95aef6e7d
--- /dev/null
+++ b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
@@ -0,0 +1,153 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: 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/)
+
+四种简单的方法来搜索或查找 Linux 中的文件和文件夹
+======
+
+Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。
+
+了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。
+
+这些命令记忆起来不复杂,因为它们使用的是标准语法。
+
+这里执行四个 Linux 命令,每个命令都有自己独特的功能。
+
+### 方法 1:使用 find 命令在 Linux 中搜索文件和文件夹
+
+find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件和文件夹的命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。
+
+它允许用户根据大小、名称、所有者、组、类型、权限、日期和其他条件执行所有类型的文件搜索。
+
+运行以下命令以在系统中查找给定文件。
+
+```
+# find / -iname "sshd_config"
+/etc/ssh/sshd_config
+```
+
+运行以下命令以查找系统中的给定文件夹。要在 Linux 中搜索文件夹,我们需要使用 `-type` 参数。
+
+```
+# 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
+```
+
+使用通配符搜索系统上的所有文件。我们将搜索系统中所有以 `.config` 为扩展名的文件。
+
+```
+# 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
+```
+
+使用以下命令格式在系统中查找空文件和文件夹。
+
+```
+# find / -empty
+```
+
+使用以下命令组合查找 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' {} \;
+```
+
+### 方法 2:使用 locate 命令在 Linux 中搜索文件和文件夹
+
+locate 命令比 find 命令运行得更快,因为它使用 updatedb 数据库,而 find 命令在真实系统中搜索。
+
+它使用数据库而不是搜索单个目录路径来获取给定文件。
+
+locate 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。
+
+数据库通过 cron 定期更新,但我们可以通过运行以下命令手动更新它。
+
+```
+$ sudo updatedb
+```
+
+只需运行以下命令即可列出给定的文件或文件夹。在 locate 命令中不需要指定特定选项来打印文件或文件夹。
+
+在系统中搜索 `ssh` 文件夹。
+
+```
+# 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
+```
+
+在系统中搜索 `ssh_config` 文件。
+
+```
+# locate --basename '\sshd_config'
+/etc/ssh/sshd_config
+```
+
+### 方法 3:在 Linux 中搜索文件使用 which 命令
+
+which 返回在终端输入命令时执行的可执行文件的完整路径。
+
+当你想要为可执行文件创建桌面快捷方式或符号链接时,它非常有用。
+
+which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。
+
+运行以下命令以打印 vim 可执行文件的完整路径。
+
+```
+# which vi
+/usr/bin/vi
+```
+
+或者,它允许用户一次执行多个文件搜索。
+
+```
+# which -a vi sudo
+/usr/bin/vi
+/bin/vi
+/usr/bin/sudo
+/bin/sudo
+```
+
+### 方法 4:使用 whereis 命令在 Linux 中搜索文件
+
+whereis 命令用于搜索给定命令的二进制、源码和手册页文件。
+
+```
+# 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]
+译者:[geekpi](https://github.com/geekpi)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://www.2daygeek.com/author/prakash/
+[b]: https://github.com/lujun9972
\ No newline at end of file
From 2e26f45a24fd7fb8f1bd689660bcf1f7d2197e7e Mon Sep 17 00:00:00 2001
From: geekpi
Date: Mon, 17 Dec 2018 09:09:27 +0800
Subject: [PATCH 0140/4278] translating
---
.../20181212 Patch into The Matrix at the Linux command line.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
index c07e71fc28..108fb7c97d 100644
--- 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
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From 909d8ba98d018e2b1ae0b33d07037af119ba6d30 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 10:22:00 +0800
Subject: [PATCH 0141/4278] Update README.md
---
README.md | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index f1e0cec6c1..6590da83cb 100644
--- a/README.md
+++ b/README.md
@@ -15,30 +15,26 @@
LCTT 已经拥有几百名活跃成员,并欢迎更多的 Linux 志愿者加入我们的团队。
-![logo](https://linux.cn/static/image/common/lctt_logo.png)
+![LCTT](https://lctt.github.io/wiki/images/lctt_logo.png)
-LCTT 的组成
--------------------------------
-
-**选题**,负责选择合适的内容,并将原文转换为 markdown 格式,提交到 LCTT 的 [TranslateProject](https://github.com/LCTT/TranslateProject) 库中。
-
-**译者**,负责从选题中选择内容进行翻译。
-
-**校对**,负责将初译的文章进行文字润色、技术校对等工作。
-
-**发布**,负责将校对后的文章,排版进行发布。
+- LCTT 官网: [https://linux.cn/lctt/](https://linux.cn/lctt/)
+- LCTT 状态: [https://lctt.github.io/](https://lctt.github.io/)
加入我们
-------------------------------
-请首先加入翻译组的 QQ 群,群号是:**198889102**,加群时请说明是“*志愿者*”。加入后记得修改您的群名片为您的 GitHub 的 ID。
+请首先加入翻译组的 QQ 群,群号是:**198889102**,加群时请说明是“*志愿者*”。
-加入的成员,请先阅读 [WIKI 如何开始](https://github.com/LCTT/TranslateProject/wiki/01-如何开始)。
+加入的成员,请:
+
+1. 修改你的 QQ 群名片为“译者-您的_GitHub_ID”。
+2. 阅读 [WIKI](http://lctt.github.io/wiki) 了解如何开始。
+3. 遇到不解之处,请在群内发问。
如何开始
-------------------------------
-请阅读 [WIKI](https://github.com/LCTT/TranslateProject/wiki)。如需要协助,请在群内发问。
+请阅读 [WIKI](http://lctt.github.io/wiki)。如需要协助,请在群内发问。
历史
-------------------------------
From 6e2fd557f6c412e021bc476ec8326faaeeb4a2cc Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Mon, 17 Dec 2018 13:37:28 +0800
Subject: [PATCH 0142/4278] Translating How to Update Ubuntu.
---
...untu -Terminal - GUI Methods- It-s FOSS.md | 174 ++++++++++++++++++
1 file changed, 174 insertions(+)
create mode 100644 translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
new file mode 100644
index 0000000000..3a4332c365
--- /dev/null
+++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
@@ -0,0 +1,174 @@
+[#]: collector: (lujun9972)
+[#]: 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/)
+
+如何更新Ubuntu [终端及GUI方式] It's FOSS
+======
+
+**这篇教程将向你展示如何更新服务器版本或者桌面版本的Ubuntu。它还解释了更新和升级之间的区别以及你应该了解的有关于Ubuntu Linux中的更新的一些其他内容。**
+
+如果你是一个新手并已经体验Ubuntu数天或几周,你可能想知道如何更新你的[Ubuntu][1]系统以获取安全补丁,错误修复和应用升级。
+
+更新 Ubuntu 非常简单。我并不夸张的说。它简单得只要运行两个命令。让我来告诉你更多更新细节。
+
+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 133c99a824e911cad0a304b298687ad76d72b28a Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 13:44:18 +0800
Subject: [PATCH 0143/4278] Update 20171129 TLDR pages Simplified Alternative
To Linux Man Pages.md
---
...71129 TLDR pages Simplified Alternative To Linux Man Pages.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
index afa981df46..749f2647dc 100644
--- a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
+++ b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
@@ -1,3 +1,4 @@
+wxy is translating
TLDR pages: Simplified Alternative To Linux Man Pages
============================================================
From da9c6f228a5347e1257997bd07548d2b99df18b8 Mon Sep 17 00:00:00 2001
From: WangYue <815420852@qq.com>
Date: Mon, 17 Dec 2018 14:20:48 +0800
Subject: [PATCH 0144/4278] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?=
=?UTF-8?q?=20=2020180826=20How=20to=20Install=20and=20Use=20FreeDOS=20on?=
=?UTF-8?q?=20VirtualBox.md?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
申请翻译 20180826 How to Install and Use FreeDOS on VirtualBox.md
---
.../20180826 How to Install and Use FreeDOS on VirtualBox.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md b/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md
index 8ba7db5139..f6d36e718b 100644
--- a/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md
+++ b/sources/talk/20180826 How to Install and Use FreeDOS on VirtualBox.md
@@ -1,3 +1,5 @@
+WangYueScream Tanslating
+---------------
How to Install and Use FreeDOS on VirtualBox
======
This step-by-step guide shows you how to install FreeDOS on VirtualBox in Linux.
From 30c0fdd0aded2040b298a06839573fdaec6f03c0 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 15:05:10 +0800
Subject: [PATCH 0145/4278] Update 20171129 TLDR pages Simplified Alternative
To Linux Man Pages.md
---
...mplified Alternative To Linux Man Pages.md | 74 ++++++++-----------
1 file changed, 31 insertions(+), 43 deletions(-)
diff --git a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
index 749f2647dc..fe9d2cdd6a 100644
--- a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
+++ b/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
@@ -1,93 +1,81 @@
-wxy is translating
-TLDR pages: Simplified Alternative To Linux Man Pages
-============================================================
+TLDR 页:Linux 手册页的简化替代品
+==============
- [![](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu-640x360.jpg "tldr page ubuntu")][22]
-
- Working on the terminal and using various commands to carry out important tasks is an indispensable part of a Linux desktop experience. This open-source operating system possesses an [abundance of commands][23] that **makes** it impossible for any user to remember all of them. To make things more complex, each command has its own set of options to bring a wider set of functionality.
+[![](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu-640x360.jpg "tldr page ubuntu")][22]
-To solve this problem, [Man Pages][12], short for manual pages, were created. First written in English, it contains tons of in-depth information about different commands. Sometimes, when you’re looking for just basic information on a command, it can also become overwhelming. To solve this issue,[ TLDR pages][13] was created.
+在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],使得任何用户都无法记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。
- _Before going ahead and knowing more about it, don’t forget to check a few more terminal tricks:_
+为了解决这个问题,人们创建了[手册页][12],(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。 为了解决这个问题,人们创建了[TLDR 页][13]。
-* _**[Watch Star Wars in terminal ][1]**_
+### 什么是 TLDR 页?
-* _**[Use StackOverflow in terminal][2]**_
+用于 Linux / Unix 的 TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页的集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:太长没读。
-* _**[Get Weather report in terminal][3]**_
+如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页会超过 1000 行。它是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页:
-* _**[Access Google through terminal][4]**_
+[![tar man page](https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg)][14]
-* [**_Use Wikipedia from command line_**][7]
+而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子——你可以使用此实用程序完成的最常见任务:
-* _**[Check Cryptocurrency Prices From Terminal][5]**_
+[![tar tldr page](https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg)][15]
-* _**[Search and download torrent in terminal][6]**_
+让我们再举一个例子,向你展示 TLDR 页面为 `apt` 提供的内容:
-### What are TLDR pages?
+[![tldr-page-of-apt](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg)][16]
-The GitHub page of TLDR pages for Linux/Unix describes it as a collection of simplified and community-driven man pages. It’s an effort to make the experience of using man pages simpler with the help of practical examples. For those who don’t know, TLDR is taken from common internet slang _ Too Long Didn’t Read_ .
+如上向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。
-In case you wish to compare, let’s take the example of tar command. The usual man page extends over 1,000 lines. It’s an archiving utility that’s often combined with a compression method like bzip or gzip. Take a look at its man page:
+### 如何在 Linux 上安装和使用 TLDR 页?
- [![tar man page](https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg)][14] On the other hand, TLDR pages lets you simply take a glance at the command and see how it works. Tar’s TLDR page simply looks like this and comes with some handy examples of the most common tasks you can complete with this utility:
-
- [![tar tldr page](https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg)][15] Let’s take another example and show you what TLDR pages has to offer when it comes to apt:
-
- [![tldr-page-of-apt](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg)][16] Having shown you how TLDR works and makes your life easier, let’s tell you how to install it on your Linux-based operating system.
-
-### How to install and use TLDR pages on Linux?
-
-The most mature TLDR client is based on Node.js and you can install it easily using NPM package manager. In case Node and NPM are not available on your system, run the following command:
+最成熟的 TLDR 客户端基于 Node.js,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令:
```
sudo apt-get install nodejs
-
sudo apt-get install npm
```
-In case you’re using an OS other than Debian, Ubuntu, or Ubuntu’s derivatives, you can use yum, dnf, or pacman package manager as per your convenience.
+如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生产品以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。
-Now, by running the following command in terminal, install TLDR client on your Linux machine:
+现在,通过在终端中运行以下命令,在 Linux 机器上安装 TLDR 客户端:
```
-sudo npm install -g tldr
+sudo npm install -g tldr
```
-Once you’ve installed this terminal utility, it would be a good idea to update its cache before trying it out. To do so, run the following command:
+一旦安装了此终端实用程序,最好在尝试之前更新其缓存。 为此,请运行以下命令:
```
tldr --update
```
-After doing this, feel free to read the TLDR page of any Linux command. To do so, simply type:
+执行此操作后,就可以阅读任何 Linux 命令的 TLDR 页面了。 为此,只需键入:
```
tldr
```
- [![tldr kill command](https://fossbytes.com/wp-content/uploads/2017/11/tldr-kill-command.jpg)][17]
+[![tldr kill command](https://fossbytes.com/wp-content/uploads/2017/11/tldr-kill-command.jpg)][17]
-You can also run the following help command to see all different parameters that can be used with TLDR to get the desired output. As usual, this help page is also accompanied with examples.
+你还可以运行其[帮助命令](https://github.com/tldr-pages/tldr-node-client),以查看可与 TLDR 一起使用的各种参数,以获取所需输出。 像往常一样,这个帮助页面也附有例子。
-### TLDR web, Android, and iOS versions
+### TLDR 的 web、Android 和 iOS 版本
-You would be pleasantly surprised to know that TLDR pages isn’t limited to your Linux desktop. Instead, it can also be used in your web browser, which can be accessed from any machine.
+你会惊喜地发现 TLDR 页不仅限于你的 Linux 桌面。 相反,它也可以在你的 Web 浏览器中使用,可以从任何计算机访问。
-To use TLDR web version, visit [tldr.ostera.io][18] and perform the required search operation.
+要使用 TLDR Web 版本,请访问 [tldr.ostera.io][18] 并执行所需的搜索操作。
-Alternatively, you can also download the [iOS][19] and [Android][20] apps and keep learning new commands on the go.
+或者,你也可以下载 [iOS][19] 和 [Android][20] 应用程序,并随时随地学习新命令。
- [![tldr app ios](https://fossbytes.com/wp-content/uploads/2017/11/tldr-app-ios.jpg)][21]
+[![tldr app ios](https://fossbytes.com/wp-content/uploads/2017/11/tldr-app-ios.jpg)][21]
-Did you find this cool Linux terminal trick interesting? Do give it a try and let us know your feedback.
+你觉得这个很酷的 Linux 终端技巧很有意思吗? 请尝试一下,让我们知道您的反馈。
--------------------------------------------------------------------------------
via: https://fossbytes.com/tldr-pages-linux-man-pages-alternative/
-作者:[Adarsh Verma ][a]
-译者:[译者ID](https://github.com/译者ID)
+作者:[Adarsh Verma][a]
+译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 788010ea5e8aa93456e137f3ff9e01ce9ff0f9b3 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 15:09:17 +0800
Subject: [PATCH 0146/4278] Rename sources/tech/20171129 TLDR pages Simplified
Alternative To Linux Man Pages.md to translated/tech/20171129 TLDR pages
Simplified Alternative To Linux Man Pages.md
---
...171129 TLDR pages Simplified Alternative To Linux Man Pages.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {sources => translated}/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md (100%)
diff --git a/sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
similarity index 100%
rename from sources/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
rename to translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
From 25bc7ad4d7142da74c2645f1cd4adfa6387a20de Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 15:25:14 +0800
Subject: [PATCH 0147/4278] Rename translated/tech/20171129 TLDR pages
Simplified Alternative To Linux Man Pages.md to translated/tech20171129 TLDR
pages Simplified Alternative To Linux Man Pages.md
---
...71129 TLDR pages Simplified Alternative To Linux Man Pages.md} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename translated/{tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md => tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md} (100%)
diff --git a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
similarity index 100%
rename from translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
rename to translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
From f4effae7c02eb56b6f80d5954c227255c8a08ead Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 15:32:40 +0800
Subject: [PATCH 0148/4278] Rename translated/tech20171129 TLDR pages
Simplified Alternative To Linux Man Pages.md to translated/tech/20171129 TLDR
pages Simplified Alternative To Linux Man Pages.md
---
...71129 TLDR pages Simplified Alternative To Linux Man Pages.md} | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename translated/{tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md => tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md} (100%)
diff --git a/translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
similarity index 100%
rename from translated/tech20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
rename to translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
From 2c150fd3a75a2dcc560698dff7c82b276211a573 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 17 Dec 2018 16:13:19 +0800
Subject: [PATCH 0149/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Linux=20on=20th?=
=?UTF-8?q?e=20Desktop:=20Are=20We=20Nearly=20There=20Yet=3F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...on the Desktop- Are We Nearly There Yet.md | 344 ++++++++++++++++++
1 file changed, 344 insertions(+)
create mode 100644 sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md
diff --git a/sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md b/sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md
new file mode 100644
index 0000000000..2f3b046362
--- /dev/null
+++ b/sources/talk/20181209 Linux on the Desktop- Are We Nearly There Yet.md
@@ -0,0 +1,344 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Linux on the Desktop: Are We Nearly There Yet?)
+[#]: via: (https://blog.dxmtechsupport.com.au/linux-on-the-desktop-are-we-nearly-there-yet/)
+[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
+
+Linux on the Desktop: Are We Nearly There Yet?
+======
+
+![][1]
+
+The numbers are pretty stark: Linux might be the backbone of everything from embedded devices to mainframes and super computers. But it has just a 2% share of desktops and laptops.
+
+It seems the only way to get most people to even touch it is to rip away everything you recognise as Linux to rebuild it as Android.
+
+Until recently, I was in the 98%. I honestly wasn’t even conflicted. I used Linux most days both for work and for hobbies – but always in the cloud or on one of those handy little project boards that are everywhere now. For my daily driver, it was Windows all the way.
+
+I guess what’s kept me with Windows so long is really that it’s just been good enough as a default option that I haven’t been prompted to even think about it. Which, to be fair, is a great quality in an operating system.
+
+The last time I tried a dual boot Linux/Windows setup was about 15 years ago. I was using Unix at university, and was quite attracted to the idea of free and open source software, so I decided to give it a go.
+
+This was back when, if you wanted to install Linux, you went to the newsagent and bought a magazine that had a CD-ROM on the front cover. I don’t exactly remember what distro it was – probably something like Slackware or Red Hat.
+
+I got it running, poked around a bit and played some of the included games, which were relatively primitive but still quite a lot of fun. After that, I wasn’t sure what I was supposed to do with it. I never managed to connect it to the internet.
+
+For a number of years, I had no say in my operating system: work was buying my computer for me. I was a junior developer at a small software company that wrote for Windows machines, so it made sense that it would be a Windows laptop. That was easy to arrange because that’s how they came anyway.
+
+When I left this role to work for myself, I kept doing the laptop thing; they’re so convenient when you’re renting and it’s great to work outside on a lovely day. Whenever I bought a new one, it would come with Windows on it, which was great because that’s what I used.
+
+I’ve managed to avoid most of the security headaches in Windows. I got a nasty rootkit about 7 years ago and it’s all been smooth sailing since.
+
+### I Only Want the Command Line When I Want it
+
+A big misgiving about Linux as a main OS is that it never really seemed like it was a total GUI operating system. Whatever desktop environment you used, it was just a nice little place to run your web browser, media player, and maybe an IDE or something. As soon as it’s time to install or configure anything, you opened a terminal window.
+
+I’m okay with the command line – up to a point. You definitely want it for “nerd stuff” like server configuration or deploying a website.
+
+But when I’m doing “normie stuff”, I’m like most people: I’d really rather just point and click. I want my mind to be on the actual task, not on what command I need to make it happen.
+
+Using a Windows laptop felt like I could have the best of both worlds. Whenever I needed a bash shell, I’d just ssh into a Linux machine and do it from there.
+
+Even when I started doing web tasks that required a bash shell on my local machine, that was no problem. Microsoft [had sorted one out for me][2] and it just worked.
+
+In the end, what made me install [Ubuntu Studio][3] was not any intent of replacing Windows. I had just started messing around with Linux synthesizers on my home theatre rig and was curious to see what I could do with these on an x86 machine.
+
+### Linux Very Quickly Became My Daily Driver
+
+The first thing to really hit me was just how fast this is. It boots quick and programs just open. This makes it so much nicer as a place to get things done.
+
+So it made sense to do my web browsing and word processing here as well. Booting back into the Windows partition for that would just be a drag.
+
+I guess, up until this point, I’ve just taken it for granted as an immutable fact of life that laptops gradually slow down as they age and every few years it will be time for a new one. Every time Microsoft pushes out an update, it gets a little slower.
+
+So it was that my cheap 4GB machine from 2015 felt like it was nearing the end. In my head, I was already pondering firewood and a longboat.
+
+I suppose when you have a monopoly operating system, nudging your customers toward buying that new machine a little bit earlier might even help move a few more licenses.
+
+I accepted that for a long time. I now thoroughly resent it.
+
+I mean, given what I’m doing – web browsing, word processing, editing text files, opening ssh terminals, some very light image editing – I honestly reckon a 3 year old machine should be able to keep up. These are all tasks you could do in the 90s. It’s not like I’m playing the latest Battlefield while rendering the next Star Wars.
+
+With Windows 10, my laptop was struggling with simple tasks. There seemed to be no way of avoiding the expense and hassle of getting a new one. After switching to Linux, I instead spent a pittance on another 4GB memory module for the spare slot.
+
+I reckon I can at least get another year of use out of this machine now. This in itself has made changing worthwhile.
+
+#### A Seamless Desktop Experience
+
+Ubuntu studio comes with the [xfce][4] desktop. The default design is intuitive and beautifully styled with kind of a cyberpunk motif. I haven’t felt any desire to mess with the default theme, except to change the background image.
+
+I love how simple the interface is. All your programs and settings are there in the menu where you might look for them. By comparison, the Windows 10 desktop seems to always grow more elaborate and crammed with obscurities.
+
+I can’t really say how much of my enthusiasm for this desktop is the ease of use and how much is simply down to how much more snappy and responsive it is – you experience these things together.
+
+#### A GUI You Can Set Your Watch to (Literally)
+
+So far, it seems like you could actually do a lot with this without ever going near the command line. They’ve actually gotten it to a point where you don’t need to edit text files to connect to wi-fi or set your timezone.
+
+I’d be lying if I said I wasn’t using the command line a bit more. But that’s only because an Ubuntu terminal window is also a great ssh client. For a couple of weeks I was using nano as my main text editor, but I decided that a mouse is actually pretty handy for navigating and selecting text.
+
+For the great mass of people who aren’t that into nerd stuff, I don’t think you would need the terminal at all.
+
+#### The Same Software, Only Better
+
+One thing that I think will help open Linux up to a much larger audience is the graphical front end for the package manager. It’s honestly not much different to browsing apps on my Android phone.
+
+I’ve found myself using both the graphical interface and the command line to install software. The graphical interface is great for browsing, while the command line makes it super simple when you already know what you want to install.
+
+That’s just me though. Most people don’t know how to run a package manager from the command line because they’ve never had to learn. The good news for them is that they’re not obliged to – you can get by fine with just the graphical interface.
+
+I guess it helps that I was already using so much open source software on Windows: [Firefox][5] for web browsing, [GIMP][6] to format images for web use, [OpenOffice][7] for word processing and the occasional spreadsheet. Moving to Linux has meant still using much the same software. I’ve switched from OpenOffice to [LibreOffice][8] and have barely noticed the difference.
+
+Installing software from the repositories means that it’s actually easier than on Windows, because I’m not having to look up a bunch of websites. Closed source applications like [Dropbox][9] and [Slack][10] were no hassle to install and work the same as always.
+
+Thanks to the package manager, updates and patches are now automated too. On Windows, Firefox knew to update itself, but other software expected you to download and install new versions manually, and I inevitably couldn’t be bothered
+
+#### Smooth Operating System Updates
+
+Every so often, when you boot Ubuntu Studio, there’s a little window that politely tells you that you have some updates to install. If you decide you want to install them right now, it will take a matter of minutes. You totally get on with other things in the meantime. Of course, if you absolutely need all your system resources, you’re not forced to run it at all until you’re ready.
+
+It’s a nice change. Windows updates, by contrast, show up out of nowhere like a bank robber, yelling, waving an Uzi and marching you to a big blue update screen for as long as it has to take.
+
+Having not booted into my Windows partition for about a month now, I’m dreading how much of it would have piled up and how long they will take to get through. And the longer I leave it, the worse it’s going to get. So maybe I’ll just never go back.
+
+All in all, I’m very happy to now use Linux as my main OS. I could almost become a Linux evangelist.
+
+Except for one thing:
+
+### This Was an Absolute Pig to Install
+
+I’m used to an easy install with Linux. You flash an SD card or buy a VPS, you’re up and running in minutes. Running a virtual machine on your own metal can take a little longer. But not a lot.
+
+Installing Linux on a partition of my laptop was a Biblical effort. It took 6 days to get it to boot.
+
+How could it take so long? Well, it starts with super slow download links: 7 to 13 hours for an image. Then there was the hardware support. Most time consuming of all were the mystery problems and all the time sunk trying to diagnose and fix them.
+
+What had got me interested was playing around with a bit of audio. [KXStudio][11] and [AVLinux][12] seemed to be the popular choices. Both belong to the Ubuntu/Debian family, which is the style of Linux I know.
+
+KXStudio booted fine from the USB stick. But it didn’t like my wireless adapter. The fix for this seemed to involve compiling something from github. This was a bother; I needed a working wireless adapter to connect to the internet.
+
+I figured it might be possible to download either a binary or the source to my Windows partition so I could install it without an internet connection. But after much searching and no clear instructions, I was stuck.
+
+So I downloaded AVLinux and flashed it to a USB stick. The installer connected to the internet fine, so I installed the damn thing, only to find that the partition wouldn’t boot and then neither would the USB stick. Also, I was locked out of the UEFI.
+
+I did the only logical thing you can do when you brick your work machine: panic. Then I remembered that I had a live boot restoration utility on a USB stick stashed away somewhere for precisely this occasion.
+
+I then tried Ubuntu Studio 18.10. The Live Boot worked fine and even connected to the internet. So I installed it. This seemed to go off without a hitch.
+
+When I tried to boot into it though, I just got a blank screen. I spent a while trying various kernel parameters like “nomodeset”, but with no luck.
+
+A helpful chap on Reddit recommended I try just bog standard Ubuntu, explaining to me that it’s easy enough to swap in a low-latency kernel once it’s installed.
+
+So it was that I tried Ubuntu 18.04 and 18.10, then Ubuntu Studio 18.04.. then again and again, trying slightly different settings on the installer, all in vain.
+
+Having made so many attempts and spent so much time trying to get these things to work, I was – reluctantly – having to face the possibility that perhaps a distribution based on Debian just wasn’t going to work on my machine.
+
+#### Fedora Jam Worked First Time
+
+I had no trouble installing this distribution. The installer was super simple and it just worked on my first try.
+
+It didn’t boot much faster than Windows 10, but once you were in the desktop it was quite snappy and responsive.
+
+Like Ubuntu Studio, this also has a graphical front end for the package manager. It doesn’t quite have the same smooth “app store” experience though. If you’re already familiar with command line package managers, it’s pretty easy, but I’m not sure how intuitive it would be for everyone else.
+
+I quickly came to discover that Fedora doesn’t have anything like the kind of software library that Ubuntu and Debian has. Or at least, that’s how it was for the software I was interested. I know that it’s often still possible to install things that aren’t in the repositories – but we’re talking ease of use here. Having to compile it yourself is not an ease of use.
+
+For web browsing and word processing, this was a great operating system. But when it came to tinkering with audio, I couldn’t even get [JACK][13] to start.
+
+So, after a few days, it was time to move on.
+
+All in all, even though I decided Fedora wasn’t really from me, I still rate it somewhat. There’s a very good workstation there for ordinary office work. And I can well believe the claims that it’s a great development environment – especially having the entire Red Hat ecosystem downstream of your OS.
+
+Still, the hunt was back on. A friend told me how much he liked using [Linux Mint][14]. I’d heard of it before, but knew little about it. I was intrigued when my friend explained it was based on Ubuntu because I’d really missed those repositories. I decided to give it a go.
+
+#### Linux Mint Was Excellent
+
+As near as I can tell, Linux Mint is basically just Ubuntu with a few tweaks to make it really user friendly right out of the box.
+
+The big one is the desktop environment Cinnamon. This is clearly very influenced by Windows XP – a fine OS to pay tribute to in my opinion. It’s probably even more beginner-friendly than the default desktop on Ubuntu Studio.
+
+I liked Linux Mint and decided to install it. The fly in the ointment though was that the dreaded wireless adapter problem had reemerged. This was a showstopper for me earlier. But by this point I was willing to consider building a temporary wireless bridge from bits and pieces I had lying around so that I could have an internet connection to try to get the right driver.
+
+I never got that far though. When I tried to, the installer kept aborting when it couldn’t install the boot loader. I tried it again and again and the same thing kept happening.
+
+#### Back to Ubuntu Studio
+
+I decided to go back to Ubuntu Studio 18.10. I’d at least gotten this to install before, even if it booted to a blank screen. I figured that there’d be some answer to this problem somewhere, if I only looked hard enough.
+
+I went and installed it again, expecting to be faced with the same problem. But this time it just worked.
+
+I’m pretty glad that it worked in the end. But I still have absolutely no idea what was going wrong or what I did differently to get it to work that one last time.
+
+### Should it Really Be This Difficult Even for Nerds?
+
+I admit it’s the other dudes in [DXM Tech Support team][15] who really know drivers and hardware. My own skills are mostly with web stuff.
+
+But still, I’d like to think I can hold my own a bit. I wrote my first code at the age of 7, I’ve worked as a software developer before, I can use a bash shell a bit, and installing weird operating systems to play 30 year old video games is my idea of a fun Sunday afternoon.
+
+And I reckon the things I was juggling a few things here that might be a bit beyond any kind of mass audience: things like kernel parameters, endlessly using Gparted and efibootmgr to clean up failed installs, or building my own wireless bridge.
+
+Which is all just a longer way of saying that, while I’m not exactly Linus Torvalds, I can do a thing or two here and there with a computer.
+
+But what if you actually are Linus Torvalds?
+
+It turns out you also think the install is disgusting:
+
+
+
+My favourite bit here is in the middle where the Debian fan approaches the microphone for what’s meant to be a question. It was totally within her power to just ask him what the difficulty was. Instead she completely dismisses his experience and tells him he should use her favourite Linux instead.
+
+I doubt that she actually meant to be that much of a dick. It’d be more that she’s such a fan of the software that it’s difficult for her to see any complaint as a genuine area for improvement. For her, it has to be a user education problem.
+
+You can literally have the whole damn thing named after you and still have to put up with that crap. No wonder he can be a bit cranky.
+
+### It’s the Little Things Too
+
+To install Linux, you have to first run all sorts of errands to prepare your machine.
+
+You need the Windows 10 Disk Management tool to resize your C partition, delve into the UEFI to change some settings, install an image writer to burn the installer image to a USB stick, that sort of thing. Often you’re presented with multiple alternatives for each of these steps.
+
+My suspicion is that each of these things feels so trivial to most Linux users that it just doesn’t occur to them that it’s a real point of friction for most people.
+
+Using a different tool for each task is very much in keeping with the [UNIX Philosophy][16]: any one thing should do just one thing and do it well.
+
+That’s actually excellent for anyone who uses a computer to build things. You have all these lego bricks that you can arrange however makes sense. You can totally just run a Python script, grep the most relevant bits, then make the output presentable by piping it to [cowsay][17].
+
+But not everyone’s ready for cowsay. Joe Average has never even heard of UEFI or partitioning and he honestly shouldn’t have to.
+
+So this might be the wrong place for a rigid application of the UNIX philosophy. It greatly adds to the number of steps and that’s always going to cut down on the number of people who make it to the end.
+
+Even if you’ve always been amazing at computers, I think you can probably think of something else that once seemed too difficult. For me, that was cooking Indian recipes.
+
+That’s been my favourite thing to eat ever since I was a kid. But every time I looked at a recipe, it was just line after line of ingredients I didn’t really understand. So I made do with the jars and recipe kits.
+
+When I finally decided to actually give it a go, I realised the ingredients list was so long because of all the spices I’d never cooked with before. It turned out that the most difficult part of using them was bringing them home from the Indian grocers. Putting them in the pan added mere seconds to the actual cooking.
+
+Pretty easy, right? And yet, until I knew that, it was enough to stop me even trying, literally for years.
+
+That’s how this stuff works. Every unfamiliar step you add to a process brings people closer to thinking “hmm, that’s actually a bit too involved for me” – even if those extra steps are, individually, trivial.
+
+Linux does this to potential new users every day.
+
+The worst thing about adding this to the installation is that it’s all front loaded right at the start of someone’s decision to try Linux. If they don’t make it through the install, then none of the rest of it comes into play.
+
+### What the Install Should Look Like
+
+A big part of what sucks about an unsuccessful Linux install is the amount of time you spend and the number steps you take to reach a point of failure.
+
+So what would be cool is a lightweight installation tool that began with a hardware scan to give you meaningful feedback on what’s supported, what’s unsupported, and what needs further attention.
+
+Then, if it’s all good to go, it could download the live boot image, burn it to a USB stick, take care of the UEFI settings and so on. Then, when you decide you want to install it, it could also take care of defragmenting and resizing the C partition.
+
+It’s a thought anyway.
+
+### It’s Part of a Bigger Picture
+
+Addressing the install nightmare won’t make anyone who wasn’t. It’s more about boosting the [conversion rate][18] of those already interested to actual users.
+
+Off the top of my head, here are some of the other big things that stop people switching:
+
+ * **Gaming:** A lot of the people who are most comfortable tinkering with drivers and the UEFI became that way because they’re really into playing the latest games.
+
+Linux is more than ok for casual gamers. For console gamers, like me, it’s an irrelevance. But if playing the best and latest games on PC is hugely important to you, there’s no contest which platform has the best library.
+
+There is an interesting push by the guys behind Steam to turn this around. There’s really no reason why Linux couldn’t be a major platform for gaming – not everyone realises that [the world’s best-selling console runs FreeBSD][19], a close cousin of Linux.
+
+But even if this starts to take off, it will be a while before hardcore gamers start moving away from Windows.
+
+ * **Business Realities:** The difficult installation matters much less in a professionally managed IT environment. But these are also the places where a need to preserve existing systems, configurations and procedures can complicate any change. Even just migrating from one version of Windows to another has pain points.
+
+On top of this, the business owners and senior managers with the final say tend to be very busy and preoccupied with a dozen other challenges, and fairly reluctant to consider anything that seems weird and unfamiliar. This makes inertia hard to shift.
+
+The IT staff who might lobby for such a move would be understandably wary of blame for any difficulties that arise with Linux, in a way they won’t be for difficulties with Windows.
+
+ * **Home Networking:** This is one spot where Windows still is much more user friendly. Your Windows machines are generally pretty good at detecting each other on the LAN and then appearing in Windows Explorer. From there it’s pretty easy to decide what to make public using a GUI interface.
+
+To do the same thing on Linux, you’re installing servers for various protocols and configuring them from the command line or in a text editor. Which is actually a lot less difficult than it first looks if you’re willing to roll your sleeves up. But, if we’re talking about going mainstream, then realistically most people will be repelled by this at a glance.
+
+Compared to the difficulty of the install, I think this is a relatively minor pain point. For the average home user, so long as they can run their software and connect to the internet, they’re pretty happy. And from what I’ve both seen and heard of DIY Windows networking jobs in the workplace, part of me thinks it’s a bad idea to democratise this too far.
+
+But it’s fairly normal for home users to want to copy things across a network to, say, a home theatre machine and they should be able to.
+
+ * **Social Proof and Branding:** Properly covering all the social proof and branding problems Linux has with ordinary people would be a lengthy article in its own right.
+
+The basic idea of [social proof][20] is that humans, as social animals, are highly influenced by what everyone. That’s a highly rational instinct in a paleolithic environment, where there is an obvious drawback to A/B testing all the things that might kill you. It also suits us in our modern world that throws vastly more decisions at us than anyone has the time or mental resources.
+
+But being on the wrong side of it means you’re significantly penalised simply for not already being popular.
+
+On top of this, to the extent that people are aware of Linux, it’s mostly as an operating system for a technical elite.
+
+
+
+
+If you think about it, the difficulty of the install feeds back into most of these. Definitely, a larger user base would make games developers care more about the platform. Hypothetically, big titles that are properly optimised for a lighter weight operating system might run better. This is a huge drawcard for hardcore gamers.
+
+Because of the legacy system issues of even fairly small businesses, one easier path into the workplace would be to get the business owner while it’s still a one person show.
+
+A large number of new businesses are started by parents of young children, who are often struggling to afford everything. And a great many freelancers and solo entrepreneurs go through feast and famine periods often enough that they’ve learned to be protective of their cash buffers.
+
+These are all people who’d rather get a couple more years out of a machine than be made to buy a new one. It’s a good use case for Linux. So long as they can actually install it.
+
+And creating social proof means building a visibly larger use base. That will happen easier if more interested new users can install successfully.
+
+### Is it Time for a Branded Linux Machine?
+
+The easiest installation is one that’s already done. So perhaps it’s time for off-the-shelf Linux desktops and laptops.
+
+These exist already of course. Big PC makers like Dell have a Linux lineup, while some boutique outfits are exclusively Linux in their product offering.
+
+I’m picturing something kinda different though: an officially branded consumer product by one of the more user friendly distributions, pitched not tech professionals but to a mass market audience. Something that could be reviewed next to Apple and Samsung products.
+
+The desktop environment is ready for a broader audience. The software library is quite excellent for anyone with ordinary computing needs – and with a good graphical front end, it’s pretty easy to find and install software. And because Linux is so much gentler on hardware requirements, there’s some real scope to offer some solid bang for back here.
+
+I expect most open source developers have had no experience of and even less interest in. So what they could do is license the brand and a subdomain on their website for a given time period to someone already in the business of making and selling computers.
+
+For the sake of the brand, it’d be important to license this to someone you could trust to do a good job of building a decent machine. That would take care and attention, but I don’t think it’s impossible.
+
+As well as providing a small income stream to developers, and growing the user base through direct sales, the ordinary publicity effort to promote these products would help make Linux visible as a thing that the mass market could use.
+
+I’m just spitballin’ really. But if anyone likes this idea, they’re welcome to it.
+
+### It’s More a Matter of When than If
+
+Maybe it seems like I spent a lot of this article talking down Linux on the desktop. The wider truth though is that I’ve voted with my feet. If I don’t stick with Ubuntu Studio forever, it will be because I went to a different flavour of Linux.
+
+I really don’t want to go back to Windows if I can avoid it.
+
+There are certainly still big obstacles to bringing Linux to a wider audience. But I can’t see why they wouldn’t be overcome.
+
+--------------------------------------------------------------------------------
+
+via: https://blog.dxmtechsupport.com.au/linux-on-the-desktop-are-we-nearly-there-yet/
+
+作者:[James Mawson][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/
+[b]: https://github.com/lujun9972
+[1]: https://blog.dxmtechsupport.com.au/wp-content/uploads/2018/11/Ubuntu-Desktop-1024x576.png
+[2]: https://docs.microsoft.com/en-us/windows/wsl/about
+[3]: https://ubuntustudio.org/
+[4]: https://www.xfce.org/
+[5]: https://www.mozilla.org/en-US/firefox/
+[6]: https://www.gimp.org/
+[7]: https://www.openoffice.org/
+[8]: https://www.libreoffice.org/
+[9]: https://www.dropbox.com/
+[10]: https://slack.com/
+[11]: https://kxstudio.linuxaudio.org/
+[12]: http://www.bandshed.net/avlinux/
+[13]: http://jackaudio.org/
+[14]: https://linuxmint.com/
+[15]: https://dxmtechsupport.com.au/about
+[16]: https://homepage.cs.uri.edu/~thenry/resources/unix_art/ch01s06.html
+[17]: https://medium.com/@jasonrigden/cowsay-is-the-most-important-unix-like-command-ever-35abdbc22b7f
+[18]: https://www.wordstream.com/conversion-rate
+[19]: http://www.extremetech.com/gaming/159476-ps4-runs-orbis-os-a-modified-version-of-freebsd-thats-similar-to-linux
+[20]: https://conversionxl.com/blog/is-social-proof-really-that-important/
From 27ff4e67e416504fa819f1fad53016e8fedc937f Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 17 Dec 2018 16:23:28 +0800
Subject: [PATCH 0150/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=205=20Things=20In?=
=?UTF-8?q?fluenza=20Taught=20Me=20About=20the=20Evolution=20of=20the=20De?=
=?UTF-8?q?sktop=20Computer?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...t the Evolution of the Desktop Computer.md | 130 ++++++++++++++++++
1 file changed, 130 insertions(+)
create mode 100644 sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md
diff --git a/sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md b/sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md
new file mode 100644
index 0000000000..c1e7f98200
--- /dev/null
+++ b/sources/talk/20180817 5 Things Influenza Taught Me About the Evolution of the Desktop Computer.md
@@ -0,0 +1,130 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (5 Things Influenza Taught Me About the Evolution of the Desktop Computer)
+[#]: via: (https://blog.dxmtechsupport.com.au/5-things-influenza-taught-me-about-the-evolution-of-the-desktop-computer/)
+[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
+
+5 Things Influenza Taught Me About the Evolution of the Desktop Computer
+======
+
+The flu took me completely out of action recently. It hit me pretty hard.
+
+And, as tends to happen with these things, I ended up binge watching more TV and movies in two weeks hidden under a blanket than in 2 years as a member of wider society.
+
+In the most delirious moments, the vicious conspiracy of fever and painkillers gave me no choice but to stick to bad 80s action movies.
+
+When I was a little more lucid, though, I got really stuck into some documentaries around the early days of desktop computing: Computerphile episodes, Silicon Cowboys, Micro Men, Youtube interviews, all sorts of stuff.
+
+Here are the big things that have stuck with me from it:
+
+### The Modern Computing Industry was Almost Entirely Built by Young Hobbyists
+
+There was an established computing industry in the 1970s – but these companies played very little direct role in what was to come.
+
+Xerox’s Palo Alto Research Centre had an important role to play in developing desktop technologies – with absolutely zero intention of ever commercialising anything. The entire thing was funded entirely from Xerox’s publicity budget.
+
+But for the most part, computers were sold to universities and enterprises. These were large, expensive machines guarded by a priesthood.
+
+The smallest and most affordable machines in use here were minicomputers like the DEC PDP-11. “Mini” is, of course, a relative term. These were the size of several fridges and cost several years worth of the average wage.
+
+So what if you wanted a computer of your own? Were you totally stranded? Not quite. You could always buy a bunch of chips and build and program the whole damn thing yourself.
+
+This had become increasingly accessible, thanks to the development of the microprocessor, which condensed the separate components of a CPU into a single chip. As the homebrew computer scene grew, hobby electronics companies started offering kits.
+
+It was out of this scene that desktop computing industry actually grew – both Apple and Acorn computers were founded by hobbyists. Their first commercial products evolved from what they’d built at home.
+
+Businesses that catered to the electronics hobbyist market, like Tandy and Radio Shack, were also some of the earliest to enter the market.
+
+### Things Changed More Radically from ’77 – ’87 than the Next 3 Decades Combined
+
+The first desktop computers were a massive leap forward in terms of bringing computing to ordinary people, they were still fairly primitive. We’re talking beeps, monochrome graphics, and a 30 minute wait to load your software from cassette tape.
+
+And the only way to steer it was from the command line. It’s definitely much more accessible than building and programming your own computer from scratch, but it’s still very much in nerd territory.
+
+By 1987, you’ve got most of what we’re familiar with: point and click interfaces, full colour graphics, word processors, spreadsheets, desktop publishing, music production, 3D gaming. The floppy drives had made loading times insignificant – and some machines even had hard drives.
+
+Your mum could use it.
+
+Things still got invented after that. The internet has obviously been a game changer. Screens are completely different. And there are any number of new languages.
+
+For the most part, though, desktop computers came together in a decade. Since then, we’ve just been making better and better versions of the same thing.
+
+### Bill Gates Really Was Kind of a James Bond Villain
+
+Back in the ’90s, it seemed a fairly ubiquitous part of computer geek culture that Bill Gates was kind of a dick. In magazines, on bulletin boards and the early internet, it was just taken for granted that Microsoft dominated the market not with a superior product but with sharp business practices.
+
+I was too young to really know if that was true, but I was happy to go along with it. It turns out that there was actually plenty of truth in that. An MS-DOS PC was hardly the best computer of the 1980s.
+
+The [Acorn Archimedes][1], for instance, had the world’s fastest processor in a desktop computer, many times faster than the 386, and an operating system so far ahead of its time that Microsoft shamelessly plagiarised it 8 years for Windows 95.
+
+And the Motorola 68000 series of CPUs used in many machines such as the Apple Macintosh and Commodore Amiga was also faster, and were vastly better for input/output intensive work such as graphics and sound.
+
+So how did Microsoft win?
+
+Well they had a head start piggybacking with IBM, who very successfully marketed the PC as a general purpose business computer. At this point, the PC was already one of the first platforms that many software developers would write for.
+
+Then, as what was then known as the “IBM clone” market began and grew, Bill Gates was very aggressive about getting MS-DOS onto as many machines as possible by licensing it on very generous terms to companies like Compaq and Amstrad. This was a short term sacrifice of profits in pursuit of market share. It also helped the PC to become the affordable choice for families.
+
+As this market share grew, the PC became the more obvious platform to first release your software on. This created a snowball effect, where more software support made the PC the more obvious computer to buy, increasing market share and attracting more software development.
+
+In the end, it didn’t matter how much better your computer was when all the programs ran on MS-DOS.
+
+### That’s Actually Totally Awesome Though
+
+On first glance, Gates looks like the consummate monopolist. Actually, he did a lot more open up access to new players and foster innovation and competition.
+
+In the early days of desktop computing, every manufacturer more or less maintained its own proprietary platform, with its own hardware, operating system and software support. That meant if you wanted a certain kind of computer, there was one company who built it so you bought it from them.
+
+By opening the PC market to new entrants, selling the operating systems to anyone who wanted them, and setting industry standards that anyone could build to, PC makers had to compete directly on price and performance.
+
+Apple still have the old model of a closed, proprietary platform, and you’ll pay vastly more for an equivalent machine – or perhaps one whose specs haven’t improved in 3 years.
+
+It was also great for software developers not to have to port their software across so many platforms. I had first hand experience of this growing up – when I was really young, there were more than a dozen computers scattered around the house, because Dad was running his software business from home, and when he needed to port a program to a new machine, he needed the machine. But by the time I was finishing primary school, it was just the mac and the PC.
+
+Handling the compatibility problem, throwing Windows on top of it, and offering it on machines at all price points did so much to bring computing to ordinary people.
+
+At this point, I’m pretty sure someone in the audience is saying “yeah, but we could have done that open source”. Look, I like Linux for what it’s good for, but let’s be real here. Linux doesn’t really have a GUI environment – it has dozens of them, each with different quirks to learn.
+
+One thing that they all have in common though is that they’re not really proper operating system environments, more just nice little boxes to stick your web browser and word processor. The moment you need to install or configure anything, guess what? It’s terminal time. Which is rather excellent if you’re that way inclined, but realistically, that’s a small fraction of humanity.
+
+If Bill Gates never came up with an everyman operating system that you could run on an affordable machine, would someone else have? Probably. But he’s the guy that actually did it.
+
+### Sheer Conceit Will Make Fools of Even the Most Brilliant and Powerful
+
+The deal that really made Microsoft is also the deal that eventually cost IBM their entire market share of the PC platform they created and of the desktop computer market as a whole.
+
+IBM were in a hurry to bring their PC to market, they built almost all of it from off-the-shelf components. Bill Gates got the meeting to talk operating systems because his mother sat on a board with. IBM offered to buy the rights to the operating system, but Gates offered instead to license it.
+
+There was really no reason that IBM had to take that deal. There was nothing all that special about MS-DOS. They could have bought a similar operating system from someone else. I mean, that’s exactly what Gates did: he went to another guy in Seattle, bought the rights to a rip off of CP/M that worked on the Intel 8086, and tweaked it a bit.
+
+To be fair to IBM, in 1980, it wasn’t obvious yet how crucial it would be to hold a dominant operating system. That came later. At that point, the OS was kind of just a bit of code to run the hardware – a component. It was normal for every computer manufacturer to have its own . It was normal for developers to port their products across them.
+
+But it’s also just weren’t inclined to take a skinny twenty-something seriously.
+
+Compaq famously reverse engineered the BIOS, and other manufacturers followed them into the market. IBM now had competition, but were still considered the market leaders and standard setters – it was their platform and everyone else was a “clone”.
+
+They were still cocky.
+
+So when the 386, IBM decided they weren’t in any hurry to do anything with it. The logic was that they already held the manufacturing rights to the 286, so they might as well get as much value out of that as they could. This was crazy: the 386 was more than twice as fast at the same clock speed, and it could go to much higher clock speeds.
+
+Compaq jumped on it. Suddenly IBM were the slowpokes in their own market.
+
+Having totally lost all control and leadership in the PC market, they fought back with a new, totally proprietary platform: the PS/2. But it was way too late. The genie was out of the bottle. This was up against the same third party support issues working against everyone other company with a closed, proprietary platform. It didn’t last.
+
+--------------------------------------------------------------------------------
+
+via: https://blog.dxmtechsupport.com.au/5-things-influenza-taught-me-about-the-evolution-of-the-desktop-computer/
+
+作者:[James Mawson][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/
+[b]: https://github.com/lujun9972
+[1]: https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/
From e41fbbc9bec2709d8f7ea1f008ccf4b9f458eb9b Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 17 Dec 2018 16:25:44 +0800
Subject: [PATCH 0151/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=2011=20Uses=20for?=
=?UTF-8?q?=20a=20Raspberry=20Pi=20Around=20the=20Office?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...es for a Raspberry Pi Around the Office.md | 142 ++++++++++++++++++
1 file changed, 142 insertions(+)
create mode 100644 sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md
diff --git a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md
new file mode 100644
index 0000000000..c1a9e1a165
--- /dev/null
+++ b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md
@@ -0,0 +1,142 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (11 Uses for a Raspberry Pi Around the Office)
+[#]: via: (https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/)
+[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
+
+11 Uses for a Raspberry Pi Around the Office
+======
+
+Look, I know what you’re thinking: a Raspberry Pi is really just for tinkering, prototyping and hobby use. It’s not actually meant for running a business on.
+
+And it’s definitely true that this computer’s relatively low processing power, corruptible SD card, lack of battery backup and the DIY nature of the support means it’s not going to be a viable replacement for a [professionally installed and configured business server][1] for your most mission-critical operations any time soon.
+
+But the board is affordable, incredibly frugal with power, small enough to fit just about anywhere and endlessly flexible – it’s actually a pretty great way to handle some basic tasks around the office.
+
+And, even better, there’s a whole world of people out there who have done these projects before and are happy to share how they did it.
+
+### DNS Server
+
+Every time you type a website address or click a link in your browser, it needs to convert the domain name into a numeric IP address before it can show you anything.
+
+Normally this means a request to a DNS server somewhere on the internet – but you can speed up your browsing by handling this locally.
+
+You can also assign your own subdomains for local access to machines around the office.
+
+[Here’s how to get this working.][2]
+
+### Toilet Occupied Sign
+
+Ever get queues at the loos?
+
+That’s annoying for those left waiting and the time spent dealing with it is a drain on your whole office’s productivity.
+
+I guess you could always hang those signs they have on airplanes all through your office.
+
+[Occu-pi][3] is a much simpler solution, using a magnetic switch and a Raspberry Pi to tell when the bolt is closed and update a Slack channel as to when it’s in use – meaning that the whole office can tell at a glance of their computer or mobile device whether there’s a cubicle free.
+
+### Honeypot Trap for Hackers
+
+It should scare most business owners just a little bit that their first clue that a hacker’s breached the network is when something goes badly wrong.
+
+That’s where it can help to have a honeypot: a computer that serves no purpose except to sit on your network with certain ports open to masquerade as a juicy target to hackers.
+
+Security researchers often deploy honeypots on the exterior of a network, to collect data on what attackers are doing.
+
+But for the average small business, these are more usefully deployed in the interior, to serve as kind of a tripwire. Because no ordinary user has any real reason to want to connect to the honeypot, any login attempts that occur are a very good indicator that mischief is afoot.
+
+This can provide early warning of outsider intrusion, and of trusted insiders up to no good.
+
+In larger, client/server networks, it might be more practical to run something like this as a virtual machine. But in small-office/home-office situations with a peer-to-peer network running on a wireless router, something like [HoneyPi][4] is a great little burglar alarm.
+
+### Print Server
+
+Network-attached printers are so much more convenient.
+
+But it can be expensive to replace all your printers- especially if you’re otherwise happy with them.
+
+It might make a lot more sense to [set up a Raspberry Pi as a print server][5].
+
+### Network Attached Storage
+
+Turning simple hard drives into network attached storage was one of the earliest practical uses for a Raspberry Pi, and it’s still one of the best.
+
+[Here’s how to create a NAS with your Raspberry Pi.][6]
+
+### Ticketing Server
+
+Looking for a way to manage the support tickets for your help desk on a shoestring budget?
+
+There’s a totally open source ticketing program called osTicket that you can install on your Pi, and it’s even available as [a ready-to-go SD card image][7].
+
+### Digital Signage
+
+Whether it’s for events, advertising, a menu, or something else entirely, a lot of businesses need a way to display digital signage – and the Pi’s affordability and frugal electricity needs make it a very attractive choice.
+
+[There are a wealth of options to choose from here.][8]
+
+### Directories and Kiosks
+
+[FullPageOS][9] is a Linux distribution based on Raspbian that boots straight into a full screen version of Chromium – ideal for shopping directoriers, library catalogues and so on.
+
+### Basic Intranet Web Server
+
+For hosting a public-facing website, you’re really much better off just getting a hosting account. A Raspberry Pi is not really built to serve any real volume of web traffic.
+
+But for small offices, it can host an internal business wiki or basic company intranet. It can also work as a sandbox environment for experimenting with code and server configurations.
+
+[Here’s how to get Apache, MySQL and PHP running on a Pi.][10]
+
+### Penetration Tester
+
+Kali Linux is an operating system built specifically to probe networks for security vulnerabilities. By installing it on a Pi, you’ve got a super portable penetration tester with more than 600 tools included.
+
+[You can find a torrent link for the Raspberry Pi image here.][11]
+
+Be absolutely scrupulous to only use this on your own network or networks you’ve got permission to perform a security audit on – using this to hack other networks is a serious crime.
+
+### VPN Server
+
+When you’re out on the road, relying on public wireless internet, you’ve not really any say in who else might be on the network, snooping on all your traffic. That’s why it can be reassuring to encrypt everything with a VPN connection.
+
+There are any number of commercial VPN services you can subscribe to – and you can install your own in the cloud – but by running one from your office, you can also access the local network from anywhere.
+
+For light use – say, the occasional bit of business travel – a Raspberry Pi is a great, power-efficient way to set up a VPN server. (It’s also worth checking first that your router doesn’t offer this functionality already – very many do.)
+
+[Here’s how to install OpenVPN on a Raspberry Pi.][12]
+
+### Wireless Coffee Machine
+
+Ahh, ambrosia: sweet nectar of the gods and the backbone of all productive enterprise.
+
+So why not [hack the office coffee machine into a smart coffee machine][13] for precision temperature control and wireless network connectivity?
+
+--------------------------------------------------------------------------------
+
+via: https://blog.dxmtechsupport.com.au/11-uses-for-a-raspberry-pi-around-the-office/
+
+作者:[James Mawson][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/
+[b]: https://github.com/lujun9972
+[1]: https://dxmtechsupport.com.au/server-configuration
+[2]: https://www.1and1.com/digitalguide/server/configuration/how-to-make-your-raspberry-pi-into-a-dns-server/
+[3]: https://blog.usejournal.com/occu-pi-the-bathroom-of-the-future-ed69b84e21d5
+[4]: https://trustfoundry.net/honeypi-easy-honeypot-raspberry-pi/
+[5]: https://opensource.com/article/18/3/print-server-raspberry-pi
+[6]: https://howtoraspberrypi.com/create-a-nas-with-your-raspberry-pi-and-samba/
+[7]: https://everyday-tech.com/a-raspberry-pi-ticketing-system-image-with-osticket/
+[8]: https://blog.capterra.com/7-free-and-open-source-digital-signage-software-options-for-your-next-event/
+[9]: https://github.com/guysoft/FullPageOS
+[10]: https://maker.pro/raspberry-pi/projects/raspberry-pi-web-server
+[11]: https://www.offensive-security.com/kali-linux-arm-images/
+[12]: https://medium.freecodecamp.org/running-your-own-openvpn-server-on-a-raspberry-pi-8b78043ccdea
+[13]: https://www.techradar.com/au/how-to/how-to-build-your-own-smart-coffee-machine
From 22890f2a5d822b56f584d299dd67eff459dcd3da Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 18:23:19 +0800
Subject: [PATCH 0152/4278] PRF:20171129 TLDR pages Simplified Alternative To
Linux Man Pages.md
@wxy
---
...implified Alternative To Linux Man Pages.md | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
index fe9d2cdd6a..bca48001bf 100644
--- a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
+++ b/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
@@ -3,19 +3,19 @@ TLDR 页:Linux 手册页的简化替代品
[![](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-ubuntu-640x360.jpg "tldr page ubuntu")][22]
-在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],使得任何用户都无法记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。
+在终端上使用各种命令执行重要任务是 Linux 桌面体验中不可或缺的一部分。Linux 这个开源操作系统拥有[丰富的命令][23],任何用户都无法全部记住所有这些命令。而使事情变得更复杂的是,每个命令都有自己的一组带来丰富的功能的选项。
-为了解决这个问题,人们创建了[手册页][12],(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。 为了解决这个问题,人们创建了[TLDR 页][13]。
+为了解决这个问题,人们创建了[手册页][12],(手册 —— man 是 manual 的缩写)。首先,它是用英文写成的,包含了大量关于不同命令的深入信息。有时候,当你在寻找命令的基本信息时,它就会显得有点庞杂。为了解决这个问题,人们创建了[TLDR 页][13]。
### 什么是 TLDR 页?
-用于 Linux / Unix 的 TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页的集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:太长没读。
+TLDR 页的 GitHub 仓库将其描述为简化的、社区驱动的手册页集合。在实际示例的帮助下,努力让使用手册页的体验变得更简单。如果还不知道,TLDR 取自互联网的常见俚语:太长没读。
-如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页会超过 1000 行。它是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页:
+如果你想比较一下,让我们以 `tar` 命令为例。 通常,手册页的篇幅会超过 1000 行。`tar` 是一个归档实用程序,经常与 `bzip` 或 `gzip` 等压缩方法结合使用。看一下它的手册页:
[![tar man page](https://fossbytes.com/wp-content/uploads/2017/11/tar-man-page.jpg)][14]
-而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子——你可以使用此实用程序完成的最常见任务:
+而另一方面,TLDR 页面让你只是浏览一下命令,看看它是如何工作的。 `tar` 的 TLDR 页面看起来像这样,并带有一些方便的例子 —— 你可以使用此实用程序完成的最常见任务:
[![tar tldr page](https://fossbytes.com/wp-content/uploads/2017/11/tar-tldr-page.jpg)][15]
@@ -23,18 +23,18 @@ TLDR 页:Linux 手册页的简化替代品
[![tldr-page-of-apt](https://fossbytes.com/wp-content/uploads/2017/11/tldr-page-of-apt.jpg)][16]
-如上向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。
+如上,它向你展示了 TLDR 如何工作并使你的生活更轻松,下面让我们告诉你如何在基于 Linux 的操作系统上安装它。
### 如何在 Linux 上安装和使用 TLDR 页?
-最成熟的 TLDR 客户端基于 Node.js,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令:
+最成熟的 TLDR 客户端是基于 Node.js 的,你可以使用 NPM 包管理器轻松安装它。如果你的系统上没有 Node 和 NPM,请运行以下命令:
```
sudo apt-get install nodejs
sudo apt-get install npm
```
-如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生产品以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。
+如果你使用的是 Debian、Ubuntu 或 Ubuntu 衍生发行版以外的操作系统,你可以根据自己的情况使用`yum`、`dnf` 或 `pacman`包管理器。
现在,通过在终端中运行以下命令,在 Linux 机器上安装 TLDR 客户端:
@@ -76,7 +76,7 @@ via: https://fossbytes.com/tldr-pages-linux-man-pages-alternative/
作者:[Adarsh Verma][a]
译者:[wxy](https://github.com/wxy)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From cfa2c44454ae16a474a5dde715f647320cf2f8e8 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 18:24:45 +0800
Subject: [PATCH 0153/4278] PUB:20171129 TLDR pages Simplified Alternative To
Linux Man Pages.md
@wxy https://linux.cn/article-10355-1.html
---
...171129 TLDR pages Simplified Alternative To Linux Man Pages.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md (100%)
diff --git a/translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md b/published/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
similarity index 100%
rename from translated/tech/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
rename to published/20171129 TLDR pages Simplified Alternative To Linux Man Pages.md
From b1676eb2250b917922d780a75eabd7f8c7a20f49 Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 17 Dec 2018 19:18:53 +0800
Subject: [PATCH 0154/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Playing=20Badas?=
=?UTF-8?q?s=20Acorn=20Archimedes=20Games=20on=20a=20Raspberry=20Pi?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...corn Archimedes Games on a Raspberry Pi.md | 539 ++++++++++++++++++
1 file changed, 539 insertions(+)
create mode 100644 sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md
diff --git a/sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md b/sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md
new file mode 100644
index 0000000000..b1f8d97305
--- /dev/null
+++ b/sources/tech/20180626 Playing Badass Acorn Archimedes Games on a Raspberry Pi.md
@@ -0,0 +1,539 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Playing Badass Acorn Archimedes Games on a Raspberry Pi)
+[#]: via: (https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/)
+[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
+
+Playing Badass Acorn Archimedes Games on a Raspberry Pi
+======
+
+![Cannon Fodder on the Raspberry Pi][1]
+
+The Acorn Archimedes was an excellent machine and years ahead of its time.
+
+Debuting in 1987, it featured a point and click graphic interface not so different to Windows 95, 32 bit processing, and enough 3D graphics power to portal you to a new decade.
+
+These days, it’s best remembered for launching the Acorn RISC Machines processor. ARM processors went on to rule the world. You almost certainly keep one in your pocket.
+
+What’s less well appreciated is that the Archimedes was rad for games. For a few years, it was the most powerful desktop in the world and developers were eager to show what they could do with it.
+
+But with such power came a great price tag. The Archimedes was never going to be in as many homes to make as many memories as Sega or Nintendo.
+
+But now, the Raspberry Pi’s ARM chip makes it cheap and easy to play these games on the same operating system and CPU architecture they were written for.
+
+Even better, the rights holders to much of this machine’s gaming catalogue have been generous enough to allow hobbyists to legally download their work for free.
+
+This is a cheap and easy project. In fact, if you already run a Raspberry Pi home theatre or retro gaming rig, all you really need is a spare SD card.
+
+### Introduction
+
+None of this will be on the exam, so if you already know the story of the Acorn Archimedes – or just want to get straight into gaming – feel free to skip ahead to the next section.
+
+But if you’re wondering what we’re even talking about, here it is:
+
+#### What on Earth is an Acorn Archimedes?
+
+Me and Acorn computers go way back.
+
+For the earliest part of my life that I can remember, Dad ran his business from home, writing timetabling software for schools. This was the early 80s, before the desktop computer market had been whittled down to Mac and PC. There were Amstrad CPCs, Sinclairs, Commodores, Ataris, TRSs, the list goes on.
+
+They all had their operating systems and ran their own software. If you wanted to port your software over to a new platform, you had to buy it.
+
+So, at a time when it was somewhat novel for a family to have even one computer, we had about a dozen, many of them already quite antique. There was a Microbee, an Apple IIc, an IBM XT, all sorts of stuff.
+
+The ones Dad liked most though were the BBC machines by [Acorn Computers][2]. He had several. There was a Model B, a Master 128 and a Master Compact.
+
+They were named that way because the British Broadcasting Corporation were developing a course to teach children how to program and they needed. Because of this educational focus, they’d found their way into a lot of schools – exactly the market he was selling to.
+
+At some point, I figured out you could play games on these things. I was straight away hooked like it was crack. All I cared about was games games games. It must have taken me several years to figure out that computers had a different use, because I can vividly recall how annoyed I was to be starting school while Dad got to stay home and play games all day.
+
+On my 7th birthday I got a second hand BBC Master Compact all of my own. This was probably as much to keep me away from his work computers as it was to introduce me to computing. I started learning to program in BASIC and Logo. I also played epic amounts of space shooters, 2D platformers and adventure games.
+
+Being obsessed with these things, I tagged along to the local BBC Users Group. This was a monthly get-together where enthusiasts would discuss what was new, bring their machines to show off what they’re doing and engage in some casual software piracy. Back before internet forums and torrents, people did this in person.
+
+This was where I first saw an Archimedes. I can’t really remember the exact year or the exact model – I just remember my jaw dropping to the floor at the 3D graphics and the 8 channel stereo sound. It would be about a decade before I saw anything similar on a gaming console.
+
+
+
+#### The Birth of a Legend
+
+Looking back, this has very good claim to be the first modern desktop computer. It was a 32-bit machine, an interface that looks more like what we use today than anything built in the 1980s, a palette of 4096 colours, and more horsepower than a lot of people knew what to do with.
+
+Now, don’t get me wrong: the 8-bit BBC machines were loads of fun and great for what they were – but what they were was fairly primitive. It was basically just a big box you typed commands on to make it beep and stuff. In theory it had 8 colours, but when you saw one in the wild it was usually hooked up to a monochrome screen and you didn’t feel like you were missing out on too much because of it.
+
+In 1984, Apple launched their Macintosh, featuring the first Graphical User Interface available on the mass market. Acorn knew they’d need a point and click graphic interface to stay in the game. And they knew the aging MOS 6502 they’d used in all their machines so far was just not going to be the CPU of the future.
+
+So, what to replace it with?
+
+The Acorn engineers looked at the available processors and found that none of them could quite do what they want. They decided to build their own – and it would be radically different.
+
+Up until that point, chip makers took a bit of a Swiss Army Knife approach to processor design – to compete, you added more and more useful stuff to the instruction set.
+
+There was a certain logic to this – hardware could be mass produced, while good software engineers were expensive. It made sense to handle as much as possible in the hardware. For device manufacturers with bills to pay, it was a real selling point.
+
+But this came at a cost – more and more complex instructions required more and more clock cycles to complete. Often there was a whole extra layer of processing to convert the complex machine code instructions into smaller instructions. As RAM became bigger and faster, CPUs were struggling to keep pace with the available memory bandwidth.
+
+Acorn turned this idea on its head, with a stripped-back approach in the great British tradition of the [de Havilland Mosquito][3]: Every instruction could be completed in a single cycle.
+
+While testing the prototype CPU, the engineers noticed something weird: they’d disconnected the power and yet the chip was running. What they’d built was so power-efficient that it kept running on residual power from nearby components.
+
+It was also 25 times faster than the 6502 CPU they used in the old BBC machines. Even better, it was several times more powerful than the Motorola 68000 found in the Apple Macintosh, Atari ST and Commodore Amiga – and several time more powerful than the 386 in the new Compaq too.
+
+With such radically new hardware, they needed a new operating system. What they come up with was Risc OS, and it was operated entirely through a graphic point-and-click desktop interface with a pinboard and an icon bar. This was pretty much Windows 95, 8 years before it happened.
+
+In a single step, Acorn had gone from producing some perfectly serviceable 8-bit box that kids could learn to code one, to having the most powerful desktop computer in the world. I mean, it was technically possible to get something more powerful – but it would have been some kind of server or mainframe. As far as something that could sit on your desk, this was top of the pile.
+
+It sold well in Acorn’s traditional education market in the UK. The sheer grunt also made it popular for certain power-hungry business tasks, like desktop publishing.
+
+#### The Crucifixion
+
+It wasn’t too long before Dad got an Archimedes – I can’t remember exactly which model. By this time, he’d moved his business out of home to an office. When school holidays rolled around, I’d sometimes have to spend the day at his work, where I had all the time in the world to fiddle around on it.
+
+The software it came with was enough to keep a child entertained for a while. It came with a demo game called Lander – this was more about showing off the machine’s 3D graphics power than providing any lasting value. There was a card game, and also some drawing programs.
+
+
+
+I played with the demo disc until I got bored – which I think was the most use that this particular machine ever got. For all the power under the hood, all the applications Dad used to actually run his business ran on DOS and Windows.
+
+He’d spent more than $4000 in today’s money for the most sophisticated and advanced piece of computing technology for a mile in any direction and it just sat there.
+
+He might have at least salvaged some beneficial utility out of it if he’d followed my advice of getting some games for it and letting me take it home.
+
+He never got around to writing any software on it. The Archimedes was apparently a big hit with British schools, but never really got popular enough with his Australian customer base to be worth coding for.
+
+Which I guess is kind of sums up where it all ultimately went wrong for the Acorn desktop.
+
+As the 80s wore on to the ’90s, Compaq reverse engineered the BIOS on the IBM PC to release their own fully compatible PC, and big players like Amstrad left their proprietary platforms to produce their own compatible MS-DOS machines. It was also became increasingly easy for just about anyone with a slight technical bunt to build their own PC-compatible clone from off-the-shelf parts – and to upgrade old PCs with new hard drives, sound cards, and the latest 386 and 486 processors.
+
+Small, independent computer shops and other local businesses started building their owns PCs and hardware manufacturers competed to sell parts to them. This was a computing platform that could serve all price points.
+
+With so much of the user base now on MS-DOS, software developers followed. Which only reinforced the idea that this was the obvious system to buy, which in turn reinforced that it was the system to code for.
+
+The days when just any computer maker could make a go of it with their own proprietary hardware and operating system had passed. Third-party support was everything. It didn’t actually matter how good your technology was if nothing would run on it. Even Apple nearly went to the wall.
+
+Acorn hung on through the 90s, and there was even a successor to the Archimedes called the [RiscPC][4]. But while the technology itself was again very good, these things were relatively marginal affairs in the marketplace. The era of the Acorn desktop had passed.
+
+#### The Resurrection
+
+It was definitely good for our family business when the market consolidated to Mac and PC. We didn’t need to maintain so many versions of the same software.
+
+But the Acorn machines had so much sentimental value. We both liked them and were sad to see them go. I’ve never been that into sport, but watching them slowly disappear might have been a bit like watching your football team lose match after match before finally going broke.
+
+We totally had no idea that they were, very quietly, on a path to total domination.
+
+The ARM was originally only built to go in the Archimedes. But it turned out that having a massively powerful processor with a simple instruction set and very little heat emission was useful for all sorts of stuff: DVD players, set top boxes, photocopiers, televisions, vending machines, home and small business routers, you name it.
+
+The ARM’s low power consumption made it especially useful for portable devices like PDAs, digital cameras, GPS navigators and – eventually – tablets and smartphones. Intel tried to compete in the smartphone market, but was [eventually forced to admit that this technology was just better for phones][5].
+
+So in the end, Dad’s old BBC machines went on to conquer the world.
+
+### The Acorn Archimedes as a Gaming Platform
+
+While Microsoft operating systems were ultimately to become the only real choice for the serious desktop gamer, for a while the Archimedes was the most powerful desktop computer in the world. This attracted a lot of games developers, eager to show what they could do with it.
+
+This would have been about more than just selling to a well moneyed section of the desktop computer market that was clearly quite willing to throw cash at shiny things. It would have been a chance to make your reputation in the industry with a flagship product that just wasn’t possible on lesser hardware.
+
+So it is that you see Star Fighter 3000, Chocks Away and Zarch all charting new territory in what was possible on a desktop computer.
+
+But while the 3D graphics power was this system’s headline feature, the late 80s and early 90s were really the era of Sonic and Mario: the heyday of 2D platform games. Here, the Archimedes also excels, with offerings like Mad Professor Mariarti, Bug Hunter, F.R.E.D. and Hamsters, all of which are massively playable, have vibrant graphics and a boatload of personality.
+
+As you dig further into the library, you also find a few games that show that not every developer really knew what to do with this machine. Some games – like Repton 3 – are just old BBC micro games given the most meagre of facelifts.
+
+Many of the games in the Archimedes catalogue you’ll recognise from other platforms: Populous, Lemmings, James Pond, Battle Chess, the list goes on.
+
+Here, the massive hardware advantage of the Archimedes means that it usually had the best version of the game to play. You’re not getting a whole new game here: but it’s noticeably smoother graphics and gameplay, especially compared to the console releases.
+
+All in all, the Archimedes never had a catalogue as expansive as MS-DOS, the Commodore Amiga, or the Sega and Nintendo consoles. But there are enough truly excellent games to make it worth an SD card.
+
+### Configuring Your Raspberry Pi
+
+This is a bit different to other retro gaming options on the Raspberry Pi – we’re not running an emulator. The ARM chip in the Pi is a direct descendant of the one in the Archimedes, and there’s an [open source version of Risc OS][6] we can install on it.
+
+For the most hardcore retro gaming purist, nothing less than using the hardware will do. For everyone else, using the same operating system from back in the day to load up your games means that your retro gaming rig becomes just that little bit more of a time machine.
+
+But even with all these similarities, there’s still going to be a few things that change in 30 years of computing.
+
+The most visible difference is that our Raspberry Pi doesn’t come with an internal 3.5″ floppy disk drive. You might be able to hook up a USB one, but most of us don’t have this lying around and don’t really want one. So we’re going to need a different way to boot floppy images.
+
+The more major difference is how much RAM the operating system is written to handle. The earliest versions of Risc OS made efficient use of the ARM’s 32-bit register by using 26 bits for the memory address and the remaining 6 bits for status flags. A 26-bit scheme gives you enough addressing space for up to 64 megabytes of RAM.
+
+When this was first devised, the fact that an Archimedes came with a whole megabyte of RAM was considered incredibly luxurious by the standards of the day. By contrast, the first Commodore Amiga had 256kb of RAM. The Sega Mega Drive had 72kb.
+
+But as time wore on, and later versions of Risc OS moved to a 32-bit addressing scheme. This is what we have on our Raspberry Pi. A few games have been [recompiled to run on 32 bit addressing][7], but most have not.
+
+The Archimedes also used different display drivers for different screens. These days, our GPU can handle all of this for us. We just need to install a patch to get that working.
+
+There are free utilities you can download to handle all of these things.
+
+#### Hardware Requirements
+
+I’ve tested this to work with a Raspberry Pi Model 3 B, but I expect that any Pi from the Model A onwards should manage this. The ARM processor on the slowest Pi is a great many times more powerful than the on the fastest Archimedes.
+
+The lack of ports on a Raspberry Pi Zero means it’s probably not the most convenient choice, but if you can navigate around this, then it should be powerful enough.
+
+In addition to the board, you’ll need something to put it in, a micro SD card, a USB SD card adapter, a power supply, a screen with an HDMI input, a USB keyboard and a 3 button mouse – a clickable scroll wheel works fine for your middle button.
+
+If you already have a Raspberry Pi home theatre or retro gaming rig, then you’ve already got all this, so all you really need is a new micro SD card to swap in for Risc OS.
+
+#### Installing Risc OS Open
+
+When I first wrote this guide, Risc OS wasn’t an available option for the Raspberry Pi 3 on the NOOBS and PINN installers. That meant you had to download the image from the [Risc OS Open downloads page][8] and burn it to a new micro SD card.
+
+You can still do this if you like, and if you can’t connect your Raspberry Pi to the internet via Wi-Fi or Ethernet then that’s still your best option. If you’re not sure how to write an image to an SD card, here’s some good guides for [Windows][9] and for [Mac][10].
+
+For everyone else, now that Risc OS is available in the [NOOBS installer][11] again, I recommend using that. What’s really cool about NOOBS is that it makes it super simple to dual boot with something like [Retropie][12] or [Recalbox][13] for the ultimate all-in-one retro gaming device.
+
+Risc OS is as an extremely good option for a dual boot machine because it only uses a few gigabytes – a small fraction of even the smallest SD cards around these days. This leaves most of it available for other operating systems and saves you having to swap cards, which can be a right pain if you have to unscrew the case. The games themselves vary from about 300kb to about 5 megabytes at the very largest, so don’t worry about that.
+
+This image requires a card with at least 2 gigabytes, which for what we’re doing is plenty. Don’t worry about tracking down the largest SD card you can find. The operating system is extremely lightweight and the games themselves vary from about 300kb to about 5 megabytes at the very largest. Even a very small card offers enough space for hundreds of games – more than you will ever play.
+
+If you’re unsure how to use the NOOBS installer, please [click here for instructions][14].
+
+#### Navigating Risc OS
+
+Compared to your first Linux experience, using Risc OS for the first time is, in my opinion, far more gentle. This is in large part thanks to a graphical interface that’s both fairly intuitive and actually very useful for configuring things.
+
+The command line is there if you want it, but we won’t need it just to play some games. You can kind of tell that this was first built with a mass-market audience in mind.
+
+So let’s jump right in.
+
+Insert your card into your Pi, hook it up to your screen, keyboard, mouse and power supply. It shouldn’t take all that long before you’re at the desktop.
+
+###### The Risc OS Mouse
+
+Risc OS uses a three button mouse.
+
+You use the left button – or “Select” button – in much the same way as you’re already used to: one click to select icons and a double click to open folders and execute programs.
+
+The middle button – ie, your scroll wheel – is used to open menus in much the same way as the right mouse button is used in Windows. We’ll be using this a lot.
+
+The right button – or “Adjust” button – has behaviours that vary between applications.
+
+###### Browsing Directories
+
+Ok, so let’s start taking a look around. At the bottom of the screen you’ll see an icon bar. In the bottom left are icons for storage devices.
+
+Click once with the left mouse button on the SD card and a window will open to show you what’s on it. You can take a look inside the directories by double clicking.
+
+###### The Pling
+
+As you start to browse Risc OS, you’ll notice that a lot of what you see inside the directories has exclamation marks at the beginning. This is said out aloud as a “pling”, and it’s used to mark an application that you can execute.
+
+One of the quirks of Risc OS is that these executables aren’t really files – they’re directories. If you hold shift while double clicking, you can open them and start looking inside, same as any other directory – but be careful with this, it’s a good way to break stuff.
+
+Risc OS comes with some applications installed – including a web browser called !NetSurf. We’ll be using that soon to download our games and some small utilities we need to get them running.
+
+###### Creating Directories
+
+Risc OS comes with a basic directory structure, but you’ll probably want to create some new ones to put your floppy images and .zip files.
+
+To do this, click with the middle button inside the folder where you want to place your new directory. This will open up a menu. Move your mouse over the arrow next to “New Directory” and a prompt will open where you can name it and press OK.
+
+###### Copying Files and Directories
+
+To copy a file or directory somewhere else, just drag and drop it with the left mouse button to the new location.
+
+###### Forcing Applications to Quit
+
+Sometimes, if you haven’t configured something right, if you’ve downloaded something that just doesn’t work, or if you plain forgot to look up the controls in the manual, you might find yourself stuck inside an application that has a blank screen or isn’t responding.
+
+Here, you can press Ctrl-Shift-F12 to quit back to the desktop.
+
+###### Shutting Down and Rebooting
+
+If you want to power down or reboot your Pi, just click the middle button on the raspberry icon in the bottom right corner and select “Shutdown”. This will give you an option to reboot the Pi or you can just remove the power cable.
+
+#### Connecting to the Internet
+
+Okay, so I’ve got good news and bad news. I’ll get the bad news right out of the way first:
+
+Risc OS Open doesn’t yet support wireless networking through either the onboard wireless or a wireless dongle in the USB port. It’s on the [to-do list][15].
+
+In the meantime, if you can a way to connect to the internet through the Ethernet port, it makes the rest of this project a lot easier. If you were going to use an Ethernet cable anyway, this will be no big deal. And if you have a wireless bridge handy, you can just use that.
+
+If you don’t have a wireless bridge, but do have a second Raspberry Pi board lying around (hey, who doesn’t these days :p), you can [set it up as a wireless bridge][16]. This is what I did and it’s actually pretty easy if you just follow the steps.
+
+Another option might be to set up a temporary tinkering area next to your router so that you can plug straight in to get everything in configured.
+
+Ok, so what’s the good news?
+
+It’s this: once you’ve got the internet in your front hole, the rest is rather easy. In fact, the only bit that’s not done for your is configuring name servers.
+
+So let’s get to it.
+
+Double-click on !Configure, click once on Network, click on Internet and then on Host Names. Then enter the IPs of your name servers in the name server fields. If you’re not sure what IP to put in here, just use Google’s publicly available name servers – 8.8.8.8 and 8.8.4.4.
+
+When you click Set, it will ask you if you want to reboot. Click yes.
+
+Now double-click on !NetSurf. You’ll see the logo is now added to the bottom right corner. Click on this to open a new browser window.
+
+Compared to Chrome, Firefox, et al, !NetSurf is a primitive web browser. I do not recommend it as a daily driver. But to download Risc OS software directly to the Pi, it’s actually pretty damn convenient.
+
+###### Short Link to This Guide
+
+As you go through the rest of this guide, it’s going to get annoying copying by hand all the URLs you’ll want to visit.
+
+To save you this trouble, type bit.do/riscpi into the browser bar to load this page. With this loaded, you can follow the links.
+
+###### If You’re Still Getting Host Name Error Messages
+
+One little quirk of Risc OS is that it seems to check for name servers as part of the boot process. If it doesn’t find them then, it assumes they’re not there for the rest of the session.
+
+This means that if you connect your Pi to the internet when it’s already booted, you will get an error message when you try to browse the internet with !NetSurf.
+
+To fix this, just double check that your wireless bridge is switched on or that your Pi is plugged into the router, reboot, and the OS should find the name servers.
+
+###### If You Can’t Connect to the Internet
+
+If this is all too hard and you absolutely can’t connect to the internet, there’s always sneakernet – downloading files to another machine and then transferring by USB stick.
+
+This is what I tried at first; It does work, but I found it terribly annoying.
+
+One frustration is that using a Windows 10 machine to download Risc OS software seems to strip out the filetype information – even when you aren’t unzipping the archives. It’s not that difficult to repair this, it’s just tedious when you have to do it all the time.
+
+The other problem is that running USB sticks from computer to computer all the time just got a bit old.
+
+Still, if you have to do it, it’s an option.
+
+#### Unzipping Compressed Files
+
+Most of the files we’ll be downloading will come in .zip format – this is a good thing, because it preserves the file type information. But we’ll need a way to uncompress these files.
+
+For this we’ll use a program called !SparkFS. This is proprietary software, but you can download a read-only version for free. This will let us extract files from .zip archives.
+
+To download and install !SparkFS, click [this link][17] and follow the instructions. You want the version of this software for machines with more than 2MB of RAM.
+
+#### Installing ADFFS and Anymode
+
+Now we need to install ADFFS, a floppy disk imaging program written by Jon Abbot of the [Archimedes Software Preservation Project][18].
+
+This gives us a virtual floppy drive we can use to boot floppy images. It also takes care of the 26 bit memory addressing issues.
+
+To get your copy, browse to the [ADFFS subforum][19] and click the thread for the latest public release – at the time of writing that’s 2.64.
+
+Download the .zip file, open it and then drag and drop !ADFFS to somewhere on your SD card where it’s conveniently accessible – we’ll be using it a lot.
+
+###### Configuring Boot Scripts
+
+For ADFFS to work properly, we’re going to need to add a little boot script.
+
+Follow these instructions carefully – if you do the wrong thing here you can really mess up your OS, or even brick your Pi.
+
+###### Creating !Boot.Loader.CMDLINE/TXT
+
+Remember how I showed you that you could open up applications as directories by holding down shift when you double-click? We can also do this to get inside the Risc OS boot process. We’ll need to do this now to add our boot script.
+
+Start by left clicking once on the SD card icon on the icon bar, then hold down shift and double-click !Boot with your left mouse button. Then double click the folder labeled Loader to open it. This is where we’re going to put our script.
+
+To write our script, click Apps on the icon bar, then double-click !StrongEd. Now click on the fist icon that appeared on the bottom right of the icon bar to open a text editor window, and type:
+
+```
+disable_mode_changes
+```
+
+Computers are fussy so take a moment to double-check your spelling.
+
+To save this file, click the middle button on the text editor and hover your cursor over the arrow next to Save. Then delete the existing text in the Name field and replace it with:
+
+```
+CMDLINE/TXT
+```
+
+Now, see that button marked Save? It’s a trap! Instead, drag and drop the pen and paper icon to the Loader folder.
+
+We’re now finished with this folder, so you can close it and also close the text editor.
+
+###### Installing Anymode
+
+Now we need to install the Anymode module. This is to make the screen modes on our software play nice with our GPU and HDMI output.
+
+Download Anymode from [here,][20] copy the .zip file to somewhere temporary and open it.
+
+Now go back to the root directory on your SD card, double-click on !Boot again, then open the folders marked Choices, Boot and Predesk.
+
+Then use your left mouse button to drag and drop the Anymode module from your .zip file to the Predesk folder.
+
+#### Configuring USB Joysticks and Gamepads
+
+Over at the Archimedes Software Preservation Project, there’s a [USB joystick driver][21] in development.
+
+This module is still in alpha testing, and you’ll need to use the command line to configure it, but it’s there if you’d like to give it a try.
+
+If you can’t get this working, don’t worry too much. It was actually pretty normal back in the day for people either to not have a joystick, or not to be able to get it to work. So pretty much every game can be played with keyboard and mouse.
+
+I’ll be updating this section as this project develops.
+
+#### Setting File Types
+
+Risc OS uses an [ADFS][22] filesystem, different to anything used on Windows or Linux.
+
+Instead of using a filename extension, ADFS files have a “file type” associated with them to show what. When these files pass through a different operating system, this information can get stripped from the file.
+
+In theory, if we don’t open our .zip archives until it reaches our Risc OS machine, the file type should be preserved. Usually this works, but sometimes you unzip the archive and find files with no file type attached. You’ll be able to tell when this has happened because you’ll be faced with a green icon labeled “data”.
+
+Fortunately, this is pretty easy to fix.
+
+Just click on the file with your middle button. A menu will appear.
+
+The second item on this menu will include the name of the file and it will have an arrow next to it. Hover your cursor over the arrow and a second menu will appear.
+
+Near the bottom of this menu will be an option marked “Set Type”, and it will also have an arrow next to it. Hover your cursor over this arrow and a field will appear where you can enter the file type.
+
+To set the file type on a floppy image, type:
+
+```
+&FCE
+```
+
+[Click here for more file type codes.][23]
+
+### Finding, Loading and Playing Games
+
+The best start looking for floppy images is in the [Games subforum][24] at the Archimedes Software Preservation Project.
+
+There’s also a [Risc OS downloads section at Acorn Arcade][25].
+
+There are definitely other websites that host Archimedes games, but I have no idea how legal these copies are.
+
+###### Booting and Switching Floppy Disc Images
+
+Some games might have specific instructions for how to boot the floppy. If so, then follow them.
+
+Generally, though, you drag and drop the image file to, then click on it with the middle button and press “boot floppy”. Your game should start straight away.
+
+Many of the games use more than one floppy disc. To play these, boot disc 1. When you’re asked to switch floppy discs, press control and shift and the function key corresponding to the disc you want to change to.
+
+### Which Games Should You Play?
+
+This is a matter of opinion really and everyone’s taste differs.
+
+Still, if you’re wondering what to try, here are my recommendations.
+
+This is still a work in progress. I’ll be adding more games as I find what I like.
+
+#### Cannon Fodder
+
+
+
+This is a top-down action/strategy game that’s extremely playable and wickedly funny.
+
+You control a team of soldiers indirectly by clicking on areas of the screen to tell them where to move and who to kill. Everyone dies with a single shot.
+
+At the start your enemies are all very easy to beat but the game progresses in difficulty. As you go, you’ll need to start dividing your team up into squads to command separately.
+
+I used to play this on the Mega Drive back in the day, but it’s so much more playable with an actual mouse.
+
+[Click here to get Cannon Fodder.][26]
+
+#### Star Fighter 3000
+
+
+
+This is a 3D space shooter that really laid down the gauntlet for what the Archimedes could do.
+
+You fly around and blast stuff with lasers and missiles. It’s pretty awesome. It’s kind of a forerunner to Terminal Velocity, if you ever played that.
+
+It was later ported to the 3D0, Sega Saturn and Playstation, but they could never render the 3D graphics to the same distance.
+
+[Click here to get Star Fighter 3000.][27]
+
+You want the download marked “Star Fighter 3000 version 3.20”. This one doesn’t use a floppy image, so don’t use ADFFS to run this file. Just double click the program and go.
+
+#### Aggressor
+
+
+
+This is a side-scrolling run-and-gun where you have unlimited ammo and a whole lot of aliens and robots to kill. Badass.
+
+#### Bug Hunter
+
+
+
+This is a really unique puzzle/platform game – you’re a robot with sticky legs who can walk up and down walls and across the ceiling, and your job is to squash bugs by dropping objects lying around.
+
+Which is harder than it sounds, because you can easily get yourself into situations where you dropped something in the wrong place, making it impossible to complete your objective, so your only way out is to initiate your self destruct sequence in futility and shame. Which I guess is kinda rather dark, if you dwell on it.
+
+It’s fun though.
+
+[Click here to get Bug Hunter.][28]
+
+#### Mad Professor Mariarti
+
+
+
+This is a platformer where you’re a mad scientist who shoots spanners and other weapons at bad guys. It has good music and gameplay and an immersive puzzle element as well.
+
+[Click here to get Mad Professor Mariarti.][29]
+
+#### Chuckie Egg
+
+Ok, now we’re getting really retro.
+
+Strictly speaking, this doesn’t really belong in this list, because it’s not even an Archimedes game – it’s an old BBC Micro game that I played the hell out of back in the day that some nice chap has ported to Risc OS.
+
+But there’s a version that runs and it’s awesome so you should play it.
+
+Basically you’re just this guy who goes around stealing eggs. That’s it. That’s all you do.
+
+It’s absolutely amazing.
+
+If you’ve never played it, you really should check it out.
+
+You can [get Chuckie Egg here][30].
+
+This isn’t a floppy image, so you don’t need ADFFS to run it. Just double click on the program and go.
+
+### Over to You
+
+Got any favourite Acorn Archimedes games?
+
+Got any tips for getting them running on the Pi?
+
+Please let me know in the comments section 🙂
+
+--------------------------------------------------------------------------------
+
+via: https://blog.dxmtechsupport.com.au/playing-badass-acorn-archimedes-games-on-a-raspberry-pi/
+
+作者:[James Mawson][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/
+[b]: https://github.com/lujun9972
+[1]: https://blog.dxmtechsupport.com.au/wp-content/uploads/2018/06/cannonfodder-1024x768.jpg
+[2]: http://www.computinghistory.org.uk/det/897/Acorn-Computers/
+[3]: http://davetrott.co.uk/2017/03/strategy-is-sacrifice/
+[4]: http://www.old-computers.com/museum/computer.asp?c=1015
+[5]: https://www.theverge.com/2016/8/16/12507568/intel-arm-mobile-chips-licensing-deal-idf-2016
+[6]: https://www.riscosopen.org/content/
+[7]: https://www.riscosopen.org/wiki/documentation/show/ARMv6%2Fv7%20software%20compatibility%20list#games
+[8]: https://www.riscosopen.org/content/downloads/raspberry-pi
+[9]: http://www.raspberry-projects.com/pi/pi-operating-systems/win32diskimager
+[10]: http://osxdaily.com/2018/01/11/write-img-to-sd-card-mac-etcher/
+[11]: https://www.raspberrypi.org/downloads/noobs/
+[12]: https://retropie.org.uk/
+[13]: https://www.recalbox.com/
+[14]: https://www.raspberrypi.org/documentation/installation/noobs.md
+[15]: https://www.riscosopen.org/wiki/documentation/show/RISC%20OS%20Roadmap
+[16]: https://pimylifeup.com/raspberry-pi-wifi-bridge/
+[17]: http://www.riscos.com/ftp_space/generic/sparkfs/index.htm
+[18]: https://forums.jaspp.org.uk/forum/index.php
+[19]: https://forums.jaspp.org.uk/forum/viewforum.php?f=14&sid=d0f037e95c560144f3910503b776aef5
+[20]: http://www.pi-star.co.uk/anymode/
+[21]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=8&t=396
+[22]: https://en.wikipedia.org/wiki/Advanced_Disc_Filing_System
+[23]: https://www.riscosopen.org/wiki/documentation/show/File%20Types
+[24]: https://forums.jaspp.org.uk/forum/viewforum.php?f=25
+[25]: http://www.acornarcade.com/downloads/
+[26]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=188
+[27]: http://starfighter.acornarcade.com/
+[28]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=330
+[29]: https://forums.jaspp.org.uk/forum/viewtopic.php?f=25&t=148
+[30]: http://homepages.paradise.net.nz/mjfoot/riscos.htm
From 40d2dc885ebd13ed8fe0b07728d490678e4533bc Mon Sep 17 00:00:00 2001
From: darksun
Date: Mon, 17 Dec 2018 19:20:58 +0800
Subject: [PATCH 0155/4278] =?UTF-8?q?=E9=80=89=E9=A2=98:=20Streaming=20Aus?=
=?UTF-8?q?tralian=20TV=20Channels=20to=20a=20Raspberry=20Pi?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...ustralian TV Channels to a Raspberry Pi.md | 209 ++++++++++++++++++
1 file changed, 209 insertions(+)
create mode 100644 sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md
diff --git a/sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md b/sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md
new file mode 100644
index 0000000000..ac756223f1
--- /dev/null
+++ b/sources/tech/20180527 Streaming Australian TV Channels to a Raspberry Pi.md
@@ -0,0 +1,209 @@
+[#]: collector: (lujun9972)
+[#]: translator: ( )
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: url: ( )
+[#]: subject: (Streaming Australian TV Channels to a Raspberry Pi)
+[#]: via: (https://blog.dxmtechsupport.com.au/streaming-australian-tv-channels-to-a-raspberry-pi/)
+[#]: author: (James Mawson https://blog.dxmtechsupport.com.au/author/james-mawson/)
+
+Streaming Australian TV Channels to a Raspberry Pi
+======
+
+If you’re anything like me, it’s been years since you’ve even thought about hooking an antenna to your television. With so much of the good stuff available by streaming and download, it’s easy go a very long time without even thinking about free-to-air TV.
+
+But every now and again, something comes up – perhaps the cricket, news and current affairs shows, the FIFA World Cup – where the easiest thing would be to just chuck on the telly.
+
+When I first started tinkering with the Raspberry Pi as a gaming and media centre platform, the standard advice for watching broadcast TV always seemed to involve an antenna and a USB TV tuner.
+
+Which I guess is fine if you can be arsed.
+
+But what if you utterly can’t?
+
+What if you bitterly resent the idea of more clutter, more cords to add to the mess, more stuff to buy? What if every USB port is precious and jealously guarded for your keyboard, mouse, game controllers and removable storage? What if the wall port for your roof antenna is in a different room?
+
+That’s all a bit of a hassle for a thing you might use only a few times a year.
+
+In 2018, shouldn’t we just be able to stream free TV from the internet?
+
+It turns out that, yes, we can access legal and high quality TV streams from any Australian IP using [Freeview][1]. And thanks to a cool Kodi Add-on by [Matt Huisman][2], it’s now really easy to access this service from a Raspberry Pi.
+
+I’ve tested this to work on a Model 3 B+ running Retropie 4.4 and Kodi 17.6. But it should work similarly for other models and operating systems, so long as you’re using a reasonably up-to-date version of Kodi.
+
+Let’s jump right in.
+
+### If You Already Have Kodi Installed
+
+If you’re already using your Raspberry Pi to watch movies and TV shows, there’s a good chance you’ve already installed Kodi.
+
+Most Raspberry Pi operating systems intended for media centre use – such as OSMC or Xbian – come with Kodi installed by default.
+
+It’s fairly easy to get running on other Linux operating systems, and you might have already installed it there too.
+
+If your version of Kodi is more than a year or so old, it might be an idea to update it. The following instructions are written for the interface on Kodi 17 (Krypton).
+
+You can do that by typing the following commands at the command line:
+
+```
+sudo apt-get update
+sudo apt-get upgrade
+```
+
+And now you can skip ahead to the next section.
+
+### Installing Kodi
+
+Installing Kodi on Retropie and other versions of Raspbian is fairly simple. Other Linux operating systems should be able to run it, perhaps with a bit of coaxing.
+
+You will need to be connected to the internet to install it.
+
+If you’re using something, such as Risc OS – you probably can’t install kodi. You will need to either swap in another SD card, or use a boot loader to boot into a media centre OS for your TV viewing.
+
+#### Installing Kodi on Retropie
+
+It’s really easy to install Kodi using the Retropie menu system.
+
+Here’s how:
+
+ 1. Navigate to the Retropie main screen – that’s that horizontal menu where you can scroll left and right through all your different consoles
+ 2. Select “Retropie”
+ 3. Select “Retropie setup”
+ 4. Select “Manage Packages”
+ 5. Select “Manage Optional Packages”
+ 6. Scroll down and select “Kodi”
+ 7. Select “Install from Binary”
+
+
+
+This will take a minute or two to install. Once it’s installed, you can exit out of the Retropie Setup screen. When you next restart Retropie, you will see Kodi under the “Ports” section of the Retropie main screen.
+
+#### Installing Kodi on Raspbian
+
+If you’re running Raspbian without Retropie. But that’s okay, because it’s pretty easy to do it from the command line
+
+Just type:
+
+```
+sudo apt-get update
+sudo apt-get install kodi
+```
+
+At this point you have a vanilla installation of Kodi. You can run it by typing:
+
+```
+kodi
+```
+
+It’s possible to delve a lot further into setting up Kodi from the command line. Check out [this guide][3] if you’re interested.
+
+If not, what you’ve just installed will work just fine.
+
+#### Installing Kodi on Other Versions of Linux
+
+If you’re using a different flavour of Linux, such as Pidora or Arch Linux ARM, then the above might or might not work – I’m not really sure, because I don’t really use these operating systems.
+
+If you get stuck, it might be worth a look at the [how-to guide][4] on the Kodi wiki.
+
+#### Dual Booting a Media Centre OS
+
+If your operating system of choice isn’t suitable for Kodi – or is just too confusing and difficult to figure out – it might be easiest to use a boot loader for multiple operating systems on the one SD card.
+
+You can set this up using an OS installer like [PINN][5].
+
+Using PINN, you can install a media centre OS like [OSMC][6] to use Kodi – it will be installed with the operating system – and then your preferred OS for your other uses.
+
+It’s even possible to [move your existing OS over][7].
+
+### Adding Australian TV Channels to Kodi
+
+With Kodi installed and running, you’ve got a pretty good media player for the files on your network and hard drive.
+
+But we need to install an add-on if we want to use it to chuck on the telly. This only takes a minute or so.
+
+#### Installing Matt Huisman’s Kodi Repository
+
+Ready? Let’s get started.
+
+ 1. Open Kodi
+ 2. Click the cog icon at the top left to enter the settings
+ 3. Click “System Settings”
+ 4. Select “Add-ons”
+ 5. Make sure that “Unknown Sources” is enabled
+ 6. Right click anywhere on the screen to navigate back to the settings menu
+ 7. Click “File Manager”
+ 8. Click “Add Source”
+ 9. Double-click “Add Source”
+ 10. Select “”
+ 11. Type in exactly ****
+ 12. Select “OK”
+ 13. Click the text input underneath the label “Enter a name for this media source.”
+ 14. Type in exactly **MJH**
+ 15. Click “OK”
+ 16. Right click twice anywhere on the screen to navigate back to the main menu
+ 17. Select “Add-ons”
+ 18. Click “My Add-ons”
+ 19. Click “..”
+ 20. Click “Install from zip file”
+ 21. Click “MJH”
+ 22. Select “repository.matthuisman.zip”
+
+
+
+The repository is now installing.
+
+If you get stuck with any of this, here’s a video from Matt that starts by installing the repository.
+
+
+
+#### Installing the Freeview Australia Add-On
+
+We’re nearly there! Just a few more steps.
+
+ 1. Right click anywhere on the screen a couple of times to navigate back to the main menu
+ 2. Select “Add-ons”
+ 3. Click “My add-ons”
+ 4. Click “..”
+ 5. Click “Install from repository”
+ 6. Click “MattHuisman.nz Repository”
+ 7. Click “Video add-ons”
+ 8. Click “AU Freeview”
+ 9. Click “Install”
+
+
+
+You can now have every free-to-air TV channel in your Add-ons main menu item.
+
+### Watching TV
+
+When you want to chuck the telly on, all you need to do is click “AU Freeview” in the Add-ons main menu item. This will give you a list of channels to browse through and select.
+
+If you want, you can also add individual channels to your Favourites menu by right clicking them and selecting “Add to favourites”.
+
+By default you will be watching Melbourne television. You can change the region by right clicking on “AU Freeview” and clicking “settings”.
+
+When you first tune in, it sometimes jumps a bit for a few seconds, but after that it’s pretty smooth.
+
+After spending a few minutes with this, you’ll quickly realise that free-to-air TV hasn’t improved in the years since you last looked at. Unfortunately, I don’t think there’s a fix for that.
+
+But at least it’s there now for when you want it.
+
+--------------------------------------------------------------------------------
+
+via: https://blog.dxmtechsupport.com.au/streaming-australian-tv-channels-to-a-raspberry-pi/
+
+作者:[James Mawson][a]
+选题:[lujun9972][b]
+译者:[译者ID](https://github.com/译者ID)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://blog.dxmtechsupport.com.au/author/james-mawson/
+[b]: https://github.com/lujun9972
+[1]: http://www.freeview.com.au/
+[2]: https://www.matthuisman.nz/
+[3]: https://www.raspberrypi.org/forums/viewtopic.php?t=192499
+[4]: https://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux
+[5]: https://github.com/procount/pinn
+[6]: https://osmc.tv/
+[7]: https://github.com/procount/pinn/wiki/How-to-Create-a-Multi-Boot-SD-card-out-of-2-existing-OSes-using-PINN
From feda553caebe541995208fe397bf18f96a0d184c Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 19:33:14 +0800
Subject: [PATCH 0156/4278] PRF:20181210 How to get started in AI.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@qhwdw 好文章
---
.../tech/20181210 How to get started in AI.md | 59 ++++++++++---------
1 file changed, 30 insertions(+), 29 deletions(-)
diff --git a/translated/tech/20181210 How to get started in AI.md b/translated/tech/20181210 How to get started in AI.md
index ee88bb6961..a88e0588f7 100644
--- a/translated/tech/20181210 How to get started in AI.md
+++ b/translated/tech/20181210 How to get started in AI.md
@@ -1,28 +1,30 @@
[#]: collector: (lujun9972)
[#]: translator: (qhwdw)
-[#]: reviewer: ()
-[#]: publisher: ()
-[#]: url: ()
+[#]: reviewer: (wxy)
+[#]: 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)
-学习人工智能如何起步
+学习人工智能如何入门
======
-在你开始从事人工智能之前,你需要先了解人类的智能。
+
+> 在你开始从事人工智能之前,你需要先了解人类的智能。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain-think-ai-intelligence-ccby.png?itok=C-gK01E_)
-我曾经问过别人也被别人问过关于学习人工智能最好的方式是什么?我应该去阅读什么?我应该去关注什么?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。
+我曾经问过别人、也被别人问过关于学习人工智能(AI)最好的方式是什么?我应该去阅读什么书?我应该去看什么视频?后面我将讲到这些,但是,考虑到人工智能涉及很多领域,我把这个问题分开来讲可能更好理解。
-学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O’Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的区别。
+学习人工智能很重要的一点是区别开研究方面和应用方面。Google 的 Cassie Kozyrkov 在近日于伦敦举行的 O'Reilly 人工智能会议的一个演讲中 [描述了这个区别][1],并且这是一个很好的演讲。
-研究人工智能在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的?
+人工智能研究在本质上是学术性的,在你能够获得人工智能的某些细节之前,需要大量的跨各类学科的数学知识。这部分的人工智能关注于算法和驱动人工智能发展的工具。比如,什么样的神经网络结构能够改善视觉识别的结果?我们如何使无监督学习成为更有用的方法?我们能否找到一个更好的方法,去理解深度学习流水线是如何得出答案的?
-另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能入门比其它的要简单的多。
+另一方面,人工智能应用更多是关于使用现有工具去获取有用的结果。开源在这里发挥了一个重要的作用,那就是免费提供了易于使用的、各种语言的软件。公有云提供商也致力于提供大量的机器学习、模型、以及数据集,这使得人工智能的入门比其它的要简单的多。
-在这个问题上我想补充一点,那就是人工智能的从业者不应该为了故弄玄虚而将它们的工具搞成只输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。但不需要去深入研究他们工具链中每个部分的理论。
+在这个问题上我想补充一点,那就是人工智能的从业者不应该将他们的工具视为神秘地输出答案的黑匣子。至少,他们应该去了解不同技术、模型、和数据采集方法的限制和潜在偏差。只是不需要去深入研究他们工具链中每个部分的理论基础。
-虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间切换还有它自己的缺陷。
+虽然在日常工作中人工智能可能并不那么重要,但理解人工智能的大量的背景知识还是很有用的。人工智能已经超越了神经网络上深度学习的狭窄范围,目前神经网络上的强化学习和监督学习已经取得重要成就。例如,人工智能经常被视为是增强(而不是替代)人类判断和决策的一种方法。但是在机器和人类之间交换信息还有其自身的缺陷。
有了这些背景知识,下面是的一些研究领域和资源,你可能发现会很有用。
@@ -32,47 +34,46 @@
你的计算机科学和数学背景知识决定了你的起点。
-如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOCs 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。
+如果你的计算机科学和数据背景知识很差或已经荒芜了,但你还希望能够深入了解人工智能的基本原理,那么从一些数学课程开始将会让你受益。MOOC 上像非盈利的 [edX][2] 平台和 [Coursera][3] 上都有许多可供你选择的课程(这两个平台都对认证收费,但 edX 上所有的课程,对旁听者是全免费的)。
典型的基础课程包括:
-+ [MIT 的微积分课程][22],从微分开始学习
-+ [线性代数][23] (德克萨斯大学)
-+ 概率与统计,比如 MIT 的 [概率 — 不确定性与数据科学][24]
+- [MIT 的微积分课程][22],从微分开始学习
+- [线性代数][23] (德克萨斯大学)
+- 概率与统计,比如 MIT 的 [概率 —— 不确定性与数据科学][24]
+从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。但是上面的内容应该让您在深入研究机器学习和AI之前大致了解可能是最重要的研究分支。
-从一个研究的角度去深入人工智能,你可能需要深入所有的这些数据领域,甚至更多。在深入研究机器学习和人工智能之前,上述的内容应该会让你得到一些常见研究分支的大致概念。
+除了 MOOC 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。
-除了 MOOCs 之外,像 [MIT OpenCourseWare][4] 这样的资源也提供了大量的数学和计算机科学课程的大纲和各种支持材料。
-
-有了这些基础,你就可以学习更专业的人工智能课程了。Andrew Ng 在斯坦福大学教的 “AI MOOC” 就是整个在线课程中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。
+有了这些基础,你就可以学习更专业的人工智能课程了。吴恩达从他在斯坦福大学时教的 “AI MOOC” 就是整个在线课程领域中最早流行起来的课程之一。今天,他的 [神经网络和深度学习][5] 也是 Coursera 深度学习专业的一部分。在 edX 上也有相关的一些项目,比如,哥伦比亚大学提供的一个 [人工智能 MicroMasters][6]。
除了课程之外,也可以在网上找到各种范例和其它学习材料。这些包括:
* [神经网络和深度学习][7]
- * MIT 的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 出版的 [深度学习][8]
+ * MIT 出版的 Ian Goodfellow、Yoshua Bengio、Aaron Courville 的《[深度学习][8]》
### 应用人工智能
-人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 — 甚至可以说是必需的 — 但对这些知识的了解程度不像研究人工智能的要求那么高。
+人工智能应用更关注于使用可用的工具,而不是去构建新工具。对一些底层的数学,尤其是统计学的了解仍然是非常有用的 —— 甚至可以说是必需的 —— 但对这些知识的了解程度不像研究人工智能的要求那么高。
-在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 — 比如 Python 的 [PyTorch][9],在这方面有很好的专长。尤其是,如果你有一些编程方面的背景知识,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。
+在这里编程是核心技能。虽然可以使用不同的编程语言去做,但是一些库和工具集 —— 比如 Python 的 [PyTorch][9],依赖于 Python,所以这是一个应该掌握的好技能。尤其是,如果你有某种程度上的编程背景,MIT 的 [计算机科学入门和使用 Python 编程][10],它是基于 MIT 的 6.001 在校课程,是一个非常好的启蒙课程。如果你编程零基础,来自密歇根大学的 Charles Severance 的 [人人学编程(Python 使用入门)][11] 是个很好的开端,它不会像 MIT 的课程那样,把你一下子扔进代码的汪洋大海。
-[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。比如,许多使用原始和数据清洗相关的应用任务,此外还有你最终要使用的诸如此类的分析技术,都将使用到它。一个 MOOC 系列,像 Harvard 的 [数据科学认证][13] 就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。
+[R 编程语言][12] 也是一个应该增加到你的技能库中的很有用的技能。虽然它在机器学习(ML)中使用的很少,但它在其它数据科学任务中很常见,并且经常与人工智能/机器学习和数据科学的应用实践结合在一起。例如,与组织和清理数据相关的许多任务同样适用于您最终使用的任何分析技术。像哈佛的 [数据科学认证][13] 这样的一个 MOOC 系列就是一整套课程的一个例子,这些课程介绍了如何去很好地处理数据。
-如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 智慧团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。
+如果你从事人工智能方面的工作,那么你很可能会遇到的另一个开源软件库就是 [TensorFlow][14]。它最初是由 Google 人工智能团队中的 Google 大脑团队的研发工程师开发的。[Google 提供了许多教程][15] 让你通过高级 Keras API 去开始使用 TensorFlow。你既可以在 Google 云上也可以在本地运行 TensorFlow。
通常,大的公有云提供商都提供在线数据集和易于使用的机器学习服务。但是,在你开始去 “玩” 数据集和应用之前,你需要考虑清楚,一旦开始选定一个提供商,你将被它们 “锁定” 的程度。
-你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 的数据集。州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。
+你的探索学习项目所需的数据集可以从许多不同的源获得。除了公有云提供商之外,[Kaggle][16] 是另一个受欢迎的源,总体来看,它也是一个比较好的学习源。以数字形式提供的政府数据也越来越多了。美国联邦政府的 [Data.gov][17] 声称它提供超过 300,000 个数据集。各州和地方政府也发布从餐馆健康评级到狗的名字的所有数据。
### 研究和应用人工智能兼而有之
-最后我想说明的一点是,人工智能不仅是与数学、编程、和数据有关的一个宽泛的主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。
+最后我想说明的一点是,人工智能不仅是与数学、编程、数据有关的一个宽泛主题。人工智能作为一个综合体涉及到了许多其它的领域,包括心理学、语言学、博弈论、运筹学和控制系统。确实,现在有一些人工智能研究者担心,由于处理能力和大数据的结合,使得该领域过于关注最近才变得强大和有趣的少数几个技术。在了解人类如何学习和推理方面,许多长期存在的问题仍未解决。不管怎样,对这些广泛存在的问题有一个了解,将更好地让你在更广泛的背景中评估人工智能。
-我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人类与机器工作所面临的全部挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得对飞机的控制。一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。
+我比较喜欢的其中一个示例是杜克大学的 [人类和自治实验室][18]。这个实验室的工作涉及人机协同所面临的各种挑战,比如,如果自动化设备失效,自动驾驶仪如何设计才能让那些[“洋红色的孩子“][19] 快速取得控制。有一个基础的大脑科学课程,比如 MIT 的 [心理学导论][20],它提供了关于人类智能和机器智能之间关系的一些很有用的内容。另一个类似的课程是,MIT 电子工程与计算机科学系已故教授 Marvin Minsky 的 [心灵的社会][21]。
-关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,而是它们只有这么多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快!
+关于学习人工智能,假如说有一个最重要的挑战,那它不是原材料和工具不易获得,因为它们有如此之多。我的目标并不是给你一个全面的指导,相反,而是指出了你可以去学习的不同路径,以及为你提供一些可能的起点。祝你学习愉快!
--------------------------------------------------------------------------------
@@ -81,7 +82,7 @@ via: https://opensource.com/article/18/12/how-get-started-ai
作者:[Gordon Haff][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 b2fa053297477892690da95ad319e5706e1fe838 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 19:34:04 +0800
Subject: [PATCH 0157/4278] PUB:20181210 How to get started in AI.md
@qhwdw https://linux.cn/article-10356-1.html
---
.../tech => published}/20181210 How to get started in AI.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181210 How to get started in AI.md (99%)
diff --git a/translated/tech/20181210 How to get started in AI.md b/published/20181210 How to get started in AI.md
similarity index 99%
rename from translated/tech/20181210 How to get started in AI.md
rename to published/20181210 How to get started in AI.md
index a88e0588f7..07a21f9910 100644
--- a/translated/tech/20181210 How to get started in AI.md
+++ b/published/20181210 How to get started in AI.md
@@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (qhwdw)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
-[#]: url: ( )
+[#]: publisher: (wxy)
+[#]: url: (https://linux.cn/article-10356-1.html)
[#]: 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)
From d67cadc6cd6a9009eaa120deb87f928944a3dbb5 Mon Sep 17 00:00:00 2001
From: chizelin
Date: Mon, 17 Dec 2018 21:10:24 +0800
Subject: [PATCH 0158/4278] [translated] 3 best practices for continuous
integration and deployment
---
...r continuous integration and deployment.md | 138 ------------------
...r continuous integration and deployment.md | 137 +++++++++++++++++
2 files changed, 137 insertions(+), 138 deletions(-)
delete mode 100644 sources/tech/20181115 3 best practices for continuous integration and deployment.md
create mode 100644 translated/tech/20181115 3 best practices for continuous integration and deployment.md
diff --git a/sources/tech/20181115 3 best practices for continuous integration and deployment.md b/sources/tech/20181115 3 best practices for continuous integration and deployment.md
deleted file mode 100644
index 09e10f187b..0000000000
--- a/sources/tech/20181115 3 best practices for continuous integration and deployment.md
+++ /dev/null
@@ -1,138 +0,0 @@
-[Translating by ChiZelin]
-3 best practices for continuous integration and deployment
-======
-Learn about automating, using a Git repository, and parameterizing Jenkins pipelines.
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M)
-
-The article covers three key topics: automating CI/CD configuration, using a Git repository for common CI/CD artifacts, and parameterizing Jenkins pipelines.
-
-### Terminology
-
-First things first; let's define a few terms. **CI/CD** is a practice that allows teams to quickly and automatically test, package, and deploy their applications. It is often achieved by leveraging a server called **[Jenkins][1]** , which serves as the CI/CD orchestrator. Jenkins listens to specific inputs (often a Git hook following a code check-in) and, when triggered, kicks off a pipeline.
-
-A **pipeline** consists of code written by development and/or operations teams that instructs Jenkins which actions to take during the CI/CD process. This pipeline is often something like "build my code, then test my code, and if those tests pass, deploy my application to the next highest environment (usually a development, test, or production environment)." Organizations often have more complex pipelines, incorporating tools such as artifact repositories and code analyzers, but this provides a high-level example.
-
-Now that we understand the key terminology, let's dive into some best practices.
-
-### 1\. Automation is key
-
-To run CI/CD on a PaaS, you need the proper infrastructure to be configured on the cluster. In this example, I will use [OpenShift][2].
-
-"Hello, World" implementations of this are quite simple to achieve. Simply run **oc new-app jenkins- ** and voilà, you have a running Jenkins server ready to go. Uses in the enterprise, however, are much more complex. In addition to the Jenkins server, admins will often need to deploy a code analysis tool such as SonarQube and an artifact repository such as Nexus. They will then have to create pipelines to perform CI/CD and Jenkins slaves to reduce the load on the master. Most of these entities are backed by OpenShift resources that need to be created to deploy the desired CI/CD infrastructure.
-
-Eventually, the manual steps required to deploy your CI/CD components may need to be replicated, and you might not be the person to perform those steps. To ensure the outcome is produced quickly, error-free, and exactly as it was before, an automation method should be incorporated in the way your infrastructure is created. This can be an Ansible playbook, a Bash script, or any other way you would like to automate the deployment of CI/CD infrastructure. I have used [Ansible][3] and the [OpenShift-Applier][4] role to automate my implementations. You may find these tools valuable, or you may find something else that works better for you and your organization. Either way, you'll find that automation significantly reduces the workload required to recreate CI/CD components.
-
-#### Configuring the Jenkins master
-
-Outside of general "automation," I'd like to single out the Jenkins master and talk about a few ways admins can take advantage of OpenShift to automate Jenkins configuration. The Jenkins image from the [Red Hat Container Catalog][5] comes packaged with the [OpenShift-Sync plugin][6] installed. In the [video][7], we discuss how this plugin can be used to create Jenkins pipelines and slaves.
-
-To create a Jenkins pipeline, create an OpenShift BuildConfig similar to this:
-
-```
-apiVersion: v1
-kind: BuildConfig
-...
-spec:
- source:
- git:
- ref: master
- uri:
- ...
- strategy:
- jenkinsPipelineStrategy:
- jenkinsfilePath: Jenkinsfile
- type: JenkinsPipeline
-```
-
-The OpenShift-Sync plugin will notice that a BuildConfig with the strategy **jenkinsPipelineStrategy** has been created and will convert it into a Jenkins pipeline, pulling from the Jenkinsfile specified by the Git source. An inline Jenkinsfile can also be used instead of pulling from one from a Git repository. See the [documentation][8] for more information.
-
-To create a Jenkins slave, create an OpenShift ImageStream that starts with the following definition:
-
-```
-apiVersion: v1
-kind: ImageStream
-metadata:
- annotations:
- slave-label: jenkins-slave
- labels:
- role: jenkins-slave
-…
-```
-
-Notice the metadata defined in this ImageStream. The OpenShift-Sync plugin will convert any ImageStream with the label **role: jenkins-slave** into a Jenkins slave. The Jenkins slave will be named after the value from the **slave-label** annotation.
-
-ImageStreams work just fine for simple Jenkins slave configurations, but some teams will find it necessary to configure nitty-gritty details such as resource limits, readiness and liveness probes, and instance caps. This is where ConfigMaps come into play:
-
-```
-apiVersion: v1
-kind: ConfigMap
-metadata:
- labels:
- role: jenkins-slave
-...
-data:
- template1: |-
-
-```
-
-Notice that the **role: jenkins-slave** label is still required to convert the ConfigMap into a Jenkins slave. The **Kubernetes pod template** consists of a lengthy bit of XML that will configure every detail to your organization's liking. To view this XML, as well as more information on converting ImageStreams and ConfigMaps into Jenkins slaves, see the [documentation][9].
-
-Notice with the three examples shown above that none of the operations required an administrator to make manual changes to the Jenkins console. By using OpenShift resources, Jenkins can be configured in a way that is easily automated.
-
-### 2\. Sharing is caring
-
-The second best practice is maintaining a Git repository of common CI/CD artifacts. The main idea is to prevent teams from reinventing the wheel. Imagine your team needs to perform a blue/green deployment to an OpenShift environment as part of the pipeline's CD phase. The members of your team responsible for writing the pipeline may not be OpenShift experts, nor may they have the bandwidth to write this functionality from scratch. Luckily, somebody has already written a function that incorporates that functionality in a common CI/CD repository, so your team can use that function instead of spending time writing one.
-
-To take this a step further, your organization may decide to maintain entire pipelines. You may find that teams are writing pipelines with similar functionality. It would be more efficient for those teams to use a parameterized pipeline from a common repository as opposed to writing their own from scratch.
-
-### 3\. Less is more
-
-As I hinted in the previous section, the third and final best practice is to parameterize your CI/CD pipelines. Parameterization will prevent an over-abundance of pipelines, making your CI/CD system easier to maintain. Imagine I have multiple regions where I can deploy my application. Without parameterization, I would need a separate pipeline for each region.
-
-To parameterize a pipeline written as an OpenShift build config, add the **env** stanza to the configuration:
-
-```
-...
-spec:
- ...
- strategy:
- jenkinsPipelineStrategy:
- env:
- - name: REGION
- value: US-West
- jenkinsfilePath: Jenkinsfile
- type: JenkinsPipeline
-```
-
-With this configuration, I can pass the **REGION** parameter the pipeline to deploy my application to the specified region.
-
-The [video][7] provides a more substantial case where parameterization is a must. Some organizations decide to split up their CI/CD pipelines into separate CI and CD pipelines, usually, because there is some sort of approval process that happens before deployment. Imagine I have four images and three different environments to deploy to. Without parameterization, I would need 12 CD pipelines to allow all deployment possibilities. This can get out of hand very quickly. To make maintenance of the CD pipeline easier, organizations would find it better to parameterize the image and environment to allow one pipeline to perform the work of many.
-
-### Summary
-
-CI/CD at the enterprise level tends to become more complex than many organizations anticipate. Luckily, with Jenkins, there are many ways to seamlessly provide automation of your setup. Maintaining a Git repository of common CI/CD artifacts will also ease the effort, as teams can pull from maintained dependencies instead of writing their own from scratch. Finally, parameterization of your CI/CD pipelines will reduce the number of pipelines that will have to be maintained.
-
-If you've found other practices you can't do without, please share them in the comments.
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/11/best-practices-cicd
-
-作者:[Austin Dewey][a]
-选题:[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/adewey
-[b]: https://github.com/lujun9972
-[1]: https://jenkins.io/
-[2]: https://www.openshift.com/
-[3]: https://docs.ansible.com/
-[4]: https://github.com/redhat-cop/openshift-applier
-[5]: https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/openshift3/jenkins-2-rhel7
-[6]: https://github.com/openshift/jenkins-sync-plugin
-[7]: https://www.youtube.com/watch?v=zlL7AFWqzfw
-[8]: https://docs.openshift.com/container-platform/3.11/dev_guide/dev_tutorials/openshift_pipeline.html#the-pipeline-build-config
-[9]: https://docs.openshift.com/container-platform/3.11/using_images/other_images/jenkins.html#configuring-the-jenkins-kubernetes-plug-in
diff --git a/translated/tech/20181115 3 best practices for continuous integration and deployment.md b/translated/tech/20181115 3 best practices for continuous integration and deployment.md
new file mode 100644
index 0000000000..0706d70544
--- /dev/null
+++ b/translated/tech/20181115 3 best practices for continuous integration and deployment.md
@@ -0,0 +1,137 @@
+持续集成与部署的3个最佳实践
+======
+了解自动化,使用 Git 存储库以及参数化 Jenkins 管道。
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M)
+
+本文涵盖了三个关键主题:自动化 CI/CD 配置、使用 Git 存储库处理常见的 CI/CD 工件、参数化 Jenkins 管道。
+
+### 术语
+
+首先,我们定义一些术语。**CI/CD** 是允许团队快速自动化测试、打包、部署其应用程序的实践。它通常通过利用名为 **[Jenkins][1]** 的服务器来实现,该服务器充当 CI/CD 协调器。Jenkins 侦听特定输入(通常是代码签入后的 Git hook),并在触发时启动管道。
+
+**pipeline** 由开发和/或运营团队编写的代码组成,这些代码指导 Jenkins 在 CI/CD 过程中采取哪些操作。这个流水线通常类似于“构建我的代码,然后测试我的代码,如果这些测试通过,则把我的应用程序部署到下一个最高环境(通常是开发、测试或生产环境)”。组织通常具有更复杂的流水线,并入了诸如工件存储库和代码分析器之类的工具,但是这提供了一个高级示例。
+
+现在我们了解了关键术语,让我们深入研究一些最佳实践。
+
+### 1\. 自动化是关键
+
+要在 PaaS 上运行 CI/CD,需要在集群上配置适当的基础设施。在这个例子中,我将使用 [OpenShift][2]。
+
+"Hello, World" 的实现很容易实现。简单地运行 **oc new-app jenkins- ** 和 voilà, 你已经准备好运行 Jenkins 服务器了。然而,在企业中的使用要复杂得多。除了 Jenkins 服务器之外,管理员通常还需要部署代码分析工具(如 SonarQube)和构件库(如 Nexus)。然后,它们必须创建管道来执行 CI/CD 和 Jenkins 从服务器,以减少主服务器的负载。这些实体中的大多数都由 OpenShift 资源支持,需要创建这些资源来部署所需的 CI/CD 基础设施。
+
+最后,部署 CI/CD 组件所需要的手动步骤可能是需要被重复的,并且你可能不想成为执行那些重复步骤的人。为了确保结果能够像以前一样快速、无错误和准确地产生,应该在创建基础设施的方式中结合自动化方法。这可以是一个 Ansible 剧本、一个 Bash 脚本,或者任何您希望自动化 CI/CD 基础设施部署的其他方式。我已经使用 [Ansible][3] 和 [OpenShift-Applier][4] 角色来自动化我的实现。您可能会发现这些工具很有价值,或者您可能会发现其他一些对您和组织更有效的工具。无论哪种方式,您都将发现自动化显著地减少了重新创建 CI/CD 组件所需的工作量。
+
+#### 配置Jenkins主服务器
+
+除了一般的“自动化”之外,我想单独介绍一下 Jenkins 主服务器,并讨论管理员如何利用 OpenShift 来自动化配置 Jenkins。来自 [Red Hat Container Catalog][5] 的 Jenkins 映像已经安装了 [OpenShift-Sync plugin][6]。在 [视频][7] 中,我们将讨论如何使用这个插件来创建 Jenkins 管道和从设备。
+
+要创建 Jenkins 流水线,请创建一个类似于下面的 OpenShift BuildConfig:
+
+```
+apiVersion: v1
+kind: BuildConfig
+...
+spec:
+ source:
+ git:
+ ref: master
+ uri:
+ ...
+ strategy:
+ jenkinsPipelineStrategy:
+ jenkinsfilePath: Jenkinsfile
+ type: JenkinsPipeline
+```
+
+OpenShift-Sync 插件将注意到已经创建了带有 **jenkinsPipelineStrategy** 策略的 BuildConfig,并将其转换为 Jenkins 管道,从 Git 源指定的 Jenkins 文件中提取。也可以使用内联 Jenkinsfile,而不是从 Git 存储库中提取。有关更多信息,请参阅[文档][8]。
+
+要创建 Jenkins 从站,请创建一个 OpenShift ImageStream,它从以下定义开始:
+
+```
+apiVersion: v1
+kind: ImageStream
+metadata:
+ annotations:
+ slave-label: jenkins-slave
+ labels:
+ role: jenkins-slave
+…
+```
+
+注意在这个 ImageStream 中定义的元数据。OpenShift-Sync 插件将把带有标签 **role: jenkins-slave** 的任何ImageStream 转换为 Jenkins 从站。Jenkins 从站将以 **slave-label** 注释中的值命名。
+
+ImageStreams 对于简单的 Jenkins 从属配置工作得很好,但是一些团队会发现有必要配置一些细节详情,比如资源限制、准备就绪和活动性探测,以及实例帽。这就是 ConfigMap 发挥作用的地方:
+
+```
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ labels:
+ role: jenkins-slave
+...
+data:
+ template1: |-
+
+```
+
+注意,仍然需要角色:jenkins-slave 标签来将 ConfigMap 转换为 Jenkins slave。Kubernetes pod 模板由一长段 XML 组成,它将根据组织的喜好配置每个细节。要查看此 XML,以及有关将 ImageStreams 和 ConfigMaps 转换为 Jenkins 从属的更多信息,请参阅[文档][9]。
+
+请注意上面所示的三个示例,其中没有一个操作需要管理员对 Jenkins 控制台进行手动更改。通过使用 OpenShift 资源,可以简单的自动化方式配置 Jenkins。
+
+### 2\. 分享就是关心
+
+第二个最佳实践是维护一个公共 CI/CD 工件的 Git 存储库。主要思想是防止团队重新发明轮子。假设您的团队需要执行到 OpenShift 环境的蓝色/绿色部署,作为管道 CD 阶段的一部分。负责编写流水线的团队成员可能不是 OpenShift 专家,也不可能具有从头开始编写此功能的能力。幸运的是,有人已经编写了一个将此功能合并到一个公共 CI/CD 存储库中的函数,因此您的团队可以使用该函数而不是花时间编写一个函数。
+
+为了更进一步,您的组织可能决定维护整个管道。您可能会发现团队正在编写具有相似功能的流水线。对于那些团队来说,使用来自公共存储库的参数化管道要比从头开始编写自己的管道更有效。
+
+### 3\. 少即是多
+
+正如我在前一节中提到的,第三个也是最后一个最佳实践是参数化您的 CI/CD 管道。参数化将防止过多的管道,使您的 CI/CD 系统更容易维护。假设我有多个区域可以部署应用程序。如果没有参数化,我需要为每个区域设置单独的管道。
+
+要参数化作为 OpenShift 构建配置编写的管道,请将 **env** 节添加到配置:
+
+```
+...
+spec:
+ ...
+ strategy:
+ jenkinsPipelineStrategy:
+ env:
+ - name: REGION
+ value: US-West
+ jenkinsfilePath: Jenkinsfile
+ type: JenkinsPipeline
+```
+
+使用此配置,我可以传递 **REGION** 参数管道以将我的应用程序部署到指定区域。
+
+这有一个[视频][7]提供了一个更实质性的情况,其中参数化是必须的。一些组织决定把他们的 CI/CD 管道分割成单独的 CI 和 CD 管道,通常是因为在部署之前有一些审批过程。假设我有四个映像和三个不同的环境要部署。如果没有参数化,我需要12个 CD 管道来允许所有部署可能性。这会很快失去控制。为了使 CD 流水线的维护更容易,组织会发现将映像和环境参数化以便允许一个流水线执行多个流水线的工作会更好。
+
+### 总结
+
+企业级的 CI/CD 往往比许多组织预期的更加复杂。幸运的是,对于 Jenkins,有很多方法可以无缝地提供设置的自动化。维护一个公共 CI/CD 工件的 Git 存储库也会减轻工作量,因为团队可以从维护的依赖项中提取而不是从头开始编写自己的依赖项。最后,CI/CD 管道的参数化将减少必须维护的管道的数量。
+
+如果您找到了其他不可或缺的做法,请在评论中分享。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/11/best-practices-cicd
+
+作者:[Austin Dewey][a]
+选题:[lujun9972][b]
+译者:[ChiZelin](https://github.com/ChiZelin)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://opensource.com/users/adewey
+[b]: https://github.com/lujun9972
+[1]: https://jenkins.io/
+[2]: https://www.openshift.com/
+[3]: https://docs.ansible.com/
+[4]: https://github.com/redhat-cop/openshift-applier
+[5]: https://access.redhat.com/containers/?tab=overview#/registry.access.redhat.com/openshift3/jenkins-2-rhel7
+[6]: https://github.com/openshift/jenkins-sync-plugin
+[7]: https://www.youtube.com/watch?v=zlL7AFWqzfw
+[8]: https://docs.openshift.com/container-platform/3.11/dev_guide/dev_tutorials/openshift_pipeline.html#the-pipeline-build-config
+[9]: https://docs.openshift.com/container-platform/3.11/using_images/other_images/jenkins.html#configuring-the-jenkins-kubernetes-plug-in
From 8b453ba56c5996025518197a77f29fc0bc3a43ca Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 21:42:22 +0800
Subject: [PATCH 0159/4278] PRF:20181202 Drive a locomotive through your Linux
terminal.md
@geekpi
---
... locomotive through your Linux terminal.md | 38 +++++++++----------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md b/translated/tech/20181202 Drive a locomotive through your Linux terminal.md
index 540f3de7ec..e9bdd2c30f 100644
--- a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md
+++ b/translated/tech/20181202 Drive a locomotive through your Linux terminal.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (Drive a locomotive through your Linux terminal)
[#]: via: (https://opensource.com/article/18/12/linux-toy-sl)
@@ -9,42 +9,42 @@
在 Linux 终端中开火车
======
-使用 sl 命令,你可以让自己坐上火车,有一个有趣的命令行体验。
+
+> 使用 sl 命令,你可以让自己驾驶火车,带来一个有趣的命令行体验。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-sl.png?itok=WPTj0Ga9)
-现在是 12 月,每个 Linux 终端用户都值得这一年的奖励。因此, 我们将为你带来一个 Linux 命令行玩具的出现日历。什么是命令行玩具?它可能是一个游戏、一个小的无意义的打发时间的东西,或者为你在终端带来快乐的东西。
+现在是 12 月,每个 Linux 终端用户都值得这一年的奖励。因此,我们将为你带来一个 Linux 命令行玩具的日历。什么是命令行玩具?它可能是一个游戏、一个小的无意义的打发时间的东西,或者为你在终端带来快乐的东西。
-今天的 Linux 命令行玩具是来自 Opensource.com 社区版主 [Ben Cotton][1] 的建议。Ben 建议 `sl`,它是蒸汽机车的简称。
+今天的 Linux 命令行玩具来自 Opensource.com 社区版主 [Ben Cotton][1] 的建议。Ben 建议 `sl`,它是蒸汽机车的简称。
-对于 Linux **ls** 命令来说,它也是一个常见的错误,而不是巧合。想要不再打错吗?尝试安装 **sl**。它可能已经在默认仓库中打包。对我而言,在 Fedora 中,这意味着安装起来很简单:
+而对于 Linux `ls` 命令来说,`sl` 也是一个常见的拼写错误,这并不是巧合(LCTT 译注:意即 `sl` 是专门用来设计提醒 `ls` 打错的)。想要不再打错吗?尝试安装 `sl`。它可能已经在默认仓库中打包。对我而言,在 Fedora 中,这意味着安装起来很简单:
```
$ sudo dnf install sl -y
```
-现在,只需键入**sl** 即可测试。
+现在,只需键入 `sl` 即可测试。
![](https://opensource.com/sites/default/files/uploads/linux-toy-sl-animated.gif)
-你可能会像我一样注意到,**Ctrl+C** 不会让你的火车脱轨,所以你必须等待整列火车通过。这会让你知道打错了 **ls**!
+你可能会像我一样注意到,`Ctrl+C` 不会让你的火车脱轨,所以你必须等待整列火车通过。这会让你知道打错了 `ls`!
+想查看 `sl` 源码?它已经在[在 GitHub 上][2]。
-想查看 **sl** 源码?它已经在[在 GitHub 上][2]。
+`sl` 也是分享我个人关于开源许可证的见解的绝佳机会。虽然它的[许可证][3]“足够开源”能够打包到我的发行版,但技术上而言,它并不是 [OSI 批准][4]的许可证。在其版权行之后,许可证的内容很简单:
-**sl** 也是分享关于开源许可的个人 PSA 的绝佳机会。虽然它的[许可证][3]“足够开源”以便为我的发行版打包,但技术上而言,它并不是 [OSI 批准][4]的许可证。在版权行之后,许可证的内容很简单:
-
-```
-Everyone is permitted to do anything on this program including copying,
-modifying, and improving, unless you try to pretend that you wrote it.
-i.e., the above copyright notice has to appear in all copies.
-THE AUTHOR DISCLAIMS ANY RESPONSIBILITY WITH REGARD TO THIS SOFTWARE.
-```
+> 每个人都可以在这个程序上做任何事情,包括复制,修改和改进,除非你试图假装你写了它。
+>
+> 即,上述版权声明必须出现在所有副本中。
+>
+> 作者对本软件不承担任何责任。
遗憾的是,当你选择未经 OSI 批准的许可证时,你可能会意外地为你的用户带来额外的工作,因为他们必须要弄清楚你的许可证是否适用于他们的情况。他们的公司政策是否允许他们做贡献?甚至他们可以合法地使用该程序吗?许可证是否与他们希望与之集成的其他程序的许可证相匹配?
除非你是律师(也许,即使你是律师),否则在非标准许可证范围内选择可能会很棘手。因此,如果你仍在寻找新年的方案,为什么不把仅 OSI 批准的许可证作为你 2019 年新项目的选择呢。
-这并不是对作者的不尊重。**sl** 仍然是一个很棒的小命令行玩具。
+这并不是对作者的不尊重。`sl` 仍然是一个很棒的小命令行玩具。
你有一个你认为我应该介绍的最喜欢的命令行玩具吗?这个系列的日历大部分已经完成,但我还剩下几个空余。请在下面的评论中告诉我,我会了解一下。如果有空间,我会尝试包含它。如果没有,但我得到了一些好的投稿,我会在最后做一些荣誉介绍。
@@ -57,7 +57,7 @@ via: https://opensource.com/article/18/12/linux-toy-sl
作者:[Jason Baker][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/) 荣誉推出
@@ -67,4 +67,4 @@ via: https://opensource.com/article/18/12/linux-toy-sl
[2]: https://github.com/mtoyoda/sl
[3]: https://github.com/mtoyoda/sl/blob/master/LICENSE
[4]: https://opensource.org/licenses
-[5]: https://opensource.com/article/18/12/linux-toy-boxes
\ No newline at end of file
+[5]: https://opensource.com/article/18/12/linux-toy-boxes
From e18d163096098580b2b780edc8fa2af98c4f93e6 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 21:43:24 +0800
Subject: [PATCH 0160/4278] PUB:20181202 Drive a locomotive through your Linux
terminal.md
@geekpi https://linux.cn/article-10357-1.html
---
...20181202 Drive a locomotive through your Linux terminal.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181202 Drive a locomotive through your Linux terminal.md (98%)
diff --git a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md b/published/20181202 Drive a locomotive through your Linux terminal.md
similarity index 98%
rename from translated/tech/20181202 Drive a locomotive through your Linux terminal.md
rename to published/20181202 Drive a locomotive through your Linux terminal.md
index e9bdd2c30f..4f1f3b5f19 100644
--- a/translated/tech/20181202 Drive a locomotive through your Linux terminal.md
+++ b/published/20181202 Drive a locomotive through your Linux terminal.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (Drive a locomotive through your Linux terminal)
[#]: via: (https://opensource.com/article/18/12/linux-toy-sl)
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10357-1.html)
在 Linux 终端中开火车
======
From 8a6a8da15d4e5d44f0745a42e17d6b33051eb48c Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 22:39:25 +0800
Subject: [PATCH 0161/4278] PRF:20181121 How to swap Ctrl and Caps Lock keys in
Linux.md
@jlztan
---
...o swap Ctrl and Caps Lock keys in Linux.md | 35 +++++++++++--------
1 file changed, 20 insertions(+), 15 deletions(-)
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
index cf1c56e908..f1da291931 100644
--- 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
@@ -1,38 +1,43 @@
-在 Linux 下交换 Ctrl 与 Caps Lock 键
+在 Linux 下交换 Ctrl 与大写锁定键
======
-Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
+> Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示如何去做。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/keyboard_numbers_letters_type_game.jpg?itok=fLlWGw1K)
-对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和 Caps Lock 键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。)
+对于许多使用计算机很多年的用户来说,自从第一批 PC 键盘从生产线上下线后不久,Ctrl 和大写锁定键就已经在错误的位置上了。对我来说,这张 1995 年 Sun 工作站的老式键盘照片上的两个键的位置才是正确的。(原谅我放了一张模糊的图片,它是在昏暗的光线下使用 Minox 间谍相机拍摄的。)
-感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,不评论 Caps Lock 键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上也不可能这样做,因为有的键会位于腕托以下。
+![](https://opensource.com/sites/default/files/uploads/keyboard.jpg)
-相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和 Caps Lock 键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。
+感兴趣的话,可以读一下维基百科上对于 [Ctrl 键位置的历史][1] 的介绍。我不打算讨论将 Ctrl 键放在“a”旁边而不是 Shift 键下方的各种理由,也不评论大写锁定键的无用性,也没有打算与那些主张使用手掌根来触发 Ctrl 键的人争论,即使在一些笔记本电脑键盘上不可能这样做到,因为有的键会位于腕托以下。
+
+相反,我将假设我不是唯一喜欢把 Ctrl 键放在“a”旁边的人,并说明如何使用 Linux 自带的灵活性在各种桌面环境中交换 Ctrl 和大写锁定键的位置。请注意,下面的演示可能只有有限的有效期,因为调整桌面设置的方法经常发生变化,但我希望这为你开了一个好头。
### GNOME 3
-[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换 Caps Lock 和 Ctrl 键,如下所示。![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png)
+[GNOME 3][2] 桌面环境用户可以使用 [Tweaks][3] 工具交换大写锁定和 Ctrl 键,如下所示。
+
+![](https://opensource.com/sites/default/files/uploads/tweaks-tool.png)
具体步骤如下:
1. 从你的 Linux 发行版的软件仓库安装 Tweaks 工具。
2. 启动 Tweaks 程序。
- 3. 从左侧菜单中选择“Keyboard & Mouse”。
- 4. 单击“Additional Layout Options”。
- 5. 在打开的窗口中单击“Ctrl position”,然后选择“Swap Ctrl and Caps Lock”。
+ 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+~` 分别键入 ç、é、ô 和 ñ。
+完成!顺便说一句,你可以使用 Tweaks 工具做很多很酷的事情。例如,我将我的右 Ctrl 键设置为 Compose 键,这让我可以使用键盘快捷键打出各种字符,例如通过 `Compose+c+,`、`Compose+e+'`、`Compose+o+^` 以及 `Compose+n+~` 分别键入 ç、é、ô 和 ñ。(LCTT 译注:可参考 [Special characters listed by extended compose sequence](https://www.ibm.com/support/knowledgecenter/en/SSKTWP_9.0.0/com.ibm.notes900.help.doc/acc_spec_characters_r.html))
### KDE
-我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [KDE tweaks that will change your life][5] 这篇文章的第 5 项演示了如何重新映射按键。
+我不使用 [KDE][4],但我的同事 Seth Kenlon 写的 [将改变你的生命的 KDE tweaks][5] 这篇文章的第 5 项演示了如何重新映射按键。
### Xfce
据我所知,[Xfce][6] 桌面环境没有一个方便的工具来管理这些(指交换按键)设置。 但是,`setxkbmap` 命令的 `ctrl:swapcaps` 选项可以帮助你完成交换按键的修改。这个修改包含两部分:
- 1. 弄清楚命令的用法;
+ 1. 弄清楚命令的用法;
2. 找出调用命令的位置,以便在桌面启动时激活它。
第一部分非常简单,命令是:
@@ -43,7 +48,7 @@ Linux 桌面环境使你可以根据需要轻松设置键盘。下面来演示
在终端窗口中执行此命令,以确保结果符合你的预期。
-假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找“Session and Startup”)里。
+假设上述命令有效,应该在哪里调用此命令呢?这需要一些实验。一种可能是在用户主目录的 `.profile` 文件中;另一个可能是将命令添加到 Xfce 的自启动配置(在设置管理器中查找 “Session and Startup”)里。
还有一种可能性是在文件 `/etc/default/keyboard` 中使用相同的选项,最终可能看起来像这样:
@@ -76,7 +81,7 @@ BACKSPACE="guess"
### 其他环境
-最后,上面 StackExchange 的链接中提到的这一点值得强调--配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。
+最后,上面 StackExchange 的链接中提到的这一点值得强调 —— 配置控制台与配置终端窗口不同;如前所述,后者是通过桌面管理器进行配置的。
`setxkbmap`、`xkeyboard-config`、`keyboard`、`console-setup` 和 `setupcon` 命令的手册都是有用的参考资料。或者,如果你不喜欢阅读手册,可以看一下 [这篇极好的文章][13]。
@@ -87,7 +92,7 @@ via: https://opensource.com/article/18/11/how-swap-ctrl-and-caps-lock-your-keybo
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[jlztan](https://github.com/jlztan)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 35fbfdba5426bf989e8b76b687ff6e63f52978e4 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Mon, 17 Dec 2018 22:40:01 +0800
Subject: [PATCH 0162/4278] PUB:20181121 How to swap Ctrl and Caps Lock keys in
Linux.md
@jltzan https://linux.cn/article-10358-1.html
---
.../20181121 How to swap Ctrl and Caps Lock keys in Linux.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20181121 How to swap Ctrl and Caps Lock keys in Linux.md (100%)
diff --git a/translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md b/published/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
similarity index 100%
rename from translated/tech/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
rename to published/20181121 How to swap Ctrl and Caps Lock keys in Linux.md
From af60871a89dad8a6999cba05398c72f075151ca4 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Tue, 18 Dec 2018 09:03:50 +0800
Subject: [PATCH 0163/4278] translated
---
...on Ubuntu and Other Linux Distributions.md | 111 ------------------
...on Ubuntu and Other Linux Distributions.md | 111 ++++++++++++++++++
2 files changed, 111 insertions(+), 111 deletions(-)
delete mode 100644 sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
create mode 100644 translated/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
deleted file mode 100644
index 2c7805cbf2..0000000000
--- a/sources/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
+++ /dev/null
@@ -1,111 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: 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
diff --git a/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
new file mode 100644
index 0000000000..886d5ce5e8
--- /dev/null
+++ b/translated/tech/20181211 How to Install Putty on Ubuntu and Other Linux Distributions.md
@@ -0,0 +1,111 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: 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/)
+
+如何在 Ubuntu 和其他 Linux 发行版上安装 Putty
+======
+
+如果我没错,[Putty][1] 可能是 Windows 最受欢迎的 SSH 客户端。
+
+I在 IT 公司中,开发环境通常在远程 Linux 系统上,而开发人员则使用 Windows 作为本地系统。Putty 用于从 Windows 机器连接到远程 Linux 系统。
+
+Putty 不仅限于 Windows。你也可以在 Linux 和 macOS 上使用此开源软件。
+
+但是等等!当你已经拥有“真正的” Linux 终端时,为什么要在 Linux 上使用单独的 SSH 客户端?这有几个想在 Linux 上使用 Putty 的原因。
+
+ * 你在 Windows 上使用 Putty 已经很久了,你觉得它更舒服。
+ * 你发现很难手动编辑 SSH 配置文件以保存各种 SSH 会话。你更喜欢 Putty 图形化保存 SSH 连接的方式。
+ * 你想通过连接到原始套接字和串口进行调试。
+
+
+
+无论是什么原因,如果你想在 Ubuntu 或任何其他 Linux 上使用 Putty,你当然可以这样做。让我告诉你如何做到。
+
+### 在 Ubuntu Linux 上安装 Putty
+
+![Installing Putty on Linux][2]
+
+对于 Ubuntu 用户来说,好消息是 Putty 可以在 Ubuntu 的 universe 仓库中找到。
+
+要在 Ubuntu上安装 Putty,首先应确保已启用 universe 仓库。
+
+```
+sudo add-apt-repository universe
+```
+
+启用 universe 存储库后,应使用以下命令更新 Ubuntu:
+
+```
+sudo apt update
+```
+
+之后,你可以使用以下命令安装 Putty:
+
+```
+sudo apt install putty
+```
+
+安装后,你可以在菜单中找到它来启动 Putty。
+
+正如你在下面的截图中看到的,Putty 的 Linux 版本看起来与 Windows 版本相同。这让你松了一口气, 因为你不必再尝试新的设置。
+
+![Putty in Linux][3]
+
+当你输入远程系统的[主机名][4]或 IP 地址并连接到它时,Putty 将使用你主目录中已保存的 SSH 密钥。
+
+![Using Putty in Ubuntu Linux][5]
+
+### 在其他 Linux 发行版上安装 Putty
+
+[Putty 可用于 Debian][6],所以你只需要使用 apt-get 或 aptitude 来安装它。
+
+```
+sudo apt-get install putty
+```
+
+Putty 也适用于 Fedora/Red Hat,并可以使用默认的包管理器进行安装。
+
+```
+sudo dnf install putty
+```
+
+你还可以在基于 Arch Linux 的发行版中轻松安装 Putty。
+
+```
+sudo pacman -S putty
+```
+
+请记住,Putty 是一款开源软件。如果你真的想要,你也可以通过源代码安装它。你可以从下面的链接获取 Putty 的源代码。
+
+[下载 Putty 源代码][8]
+
+我一直喜欢原生 Linux 终端而不是像 Putty 这样的 SSH 客户端。我觉得 GNOME 终端或 [Terminator][7] 更有家的感觉。但是,在 Linux 中使用默认终端或 Putty 是个人选择。
+
+你在 Linux 上管理多个 SSH 连接时使用了什么?
+
+--------------------------------------------------------------------------------
+
+via: https://itsfoss.com/putty-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://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
\ No newline at end of file
From 9062abccaf10eba0d727e39829955f87b626dd65 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Tue, 18 Dec 2018 09:14:59 +0800
Subject: [PATCH 0164/4278] translating
---
.../20180717 11 Uses for a Raspberry Pi Around the Office.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md
index c1a9e1a165..4eb59ba1a0 100644
--- a/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md
+++ b/sources/tech/20180717 11 Uses for a Raspberry Pi Around the Office.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From 9dbc6d7dea1305a1cd95cda59434fa83e6b09840 Mon Sep 17 00:00:00 2001
From: HankChow <280630620@qq.com>
Date: Tue, 18 Dec 2018 10:08:06 +0800
Subject: [PATCH 0165/4278] hankchow translated
---
.../20181212 Aliases- DIY Shell Commands.md | 133 ------------------
.../20181212 Aliases- DIY Shell Commands.md | 123 ++++++++++++++++
2 files changed, 123 insertions(+), 133 deletions(-)
delete mode 100644 sources/tech/20181212 Aliases- DIY Shell Commands.md
create mode 100644 translated/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
deleted file mode 100644
index 81dce2efe7..0000000000
--- a/sources/tech/20181212 Aliases- DIY Shell Commands.md
+++ /dev/null
@@ -1,133 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (HankChow)
-[#]: 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
-======
-
-![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV)
-
-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
diff --git a/translated/tech/20181212 Aliases- DIY Shell Commands.md b/translated/tech/20181212 Aliases- DIY Shell Commands.md
new file mode 100644
index 0000000000..d7d0c9d096
--- /dev/null
+++ b/translated/tech/20181212 Aliases- DIY Shell Commands.md
@@ -0,0 +1,123 @@
+命令别名:定义自己的命令
+======
+
+![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/jodi-mucha-540841-unsplash.jpg?itok=n1d1VDUV)
+
+命令别名在 Linux shell 中指的是将一些太长或者太难记的多个命令组合起来,成为一个由用户自定义构建的命令。
+
+可以通过 `alias` 命令来创建命令别名。在 `alias` 后面跟上想要创建的别名名称、一个等号(`=`),以及希望使用这个别名来执行的命令,这样一个命令别名就创建好了。举个例子,`ls` 命令在默认情况下是不会对输出的内容进行着色的,这样就不能让用户一眼分辨出目录、文件和连接了。对此,可以创建这样一个命令别名,在输出目录内容的时候为输出内容着色:
+
+```
+alias lc='ls --color=auto'
+```
+
+其中 `lc` 是自定义的命令别名,代表“list with color”的意思。在创建命令别名的时候,需要先确认使用的别名是不是已经有对应的命令了,如果有的话,原本的命令就会被覆盖掉了。注意,定义命令别名的时候,`=` 两端是没有空格的。当运行 `lc` 的时候,就相当于执行了 `ls --color` 命令。
+
+此后,执行 `lc` 列出目录内容的时候,就会输出带有着色的内容了。
+
+你可能会发现你在执行 `ls` 的时候,本来就是输出带有着色的内容。那是因为大部分 Linux 发行版都已经将 `ls` 设定为带有着色的命令别名了。
+
+### 可以直接使用的命令别名
+
+实际上,执行不带任何内容的 `alias` 命令就可以看到当前已经设定的所有命令别名。对于不同的发行版,包含的命令别名不尽相同,但普遍都会有以下这些命令别名:
+
+ * `alias ls='ls --color=auto'`:这个命令别名在前面已经提到过了。`--color=auto` 参数会让 `ls` 命令在通过标准输出在终端中显示内容时进行着色,而其它情况(例如通过管道输出到文件)下则不进行着色。`--color` 这个参数还可以设置为 `always` 或`never`。
+ * `alias cp='cp -i'`:`-i` 参数代表“交互”。在使用 `cp` 命令复制文件的时候,可能会无意中覆盖现有的文件,在使用了 `-i` 参数之后,`cp` 命令会在一些关键操作前向用户发出询问。
+ * `alias free='free -m'`:在 `free` 命令后面加上 `-m` 参数,就可以将输出的内存信息以 MiB 这个更方面阅读和计算的单位输出,而不是默认的 Byte 单位。
+
+
+
+你使用的发行版自带的命令别名可能多多少少和上面有些差别。但你都可以在命令前面加上 `\` 修饰符来使用命令的最基本形式。例如:
+
+```
+\free
+```
+
+就是直接执行 `free`,而不是 `free -m`。还有:
+
+```
+\ls
+```
+
+执行的就是不带有`--color=auto` 参数的 `ls`。
+
+如果想要持久地保存命令别名,可以在 `.bashrc` 文件中进行修改。
+
+### 使用命令别名纠正错误
+
+各种发行版的设计者都会尽量设置用户可能需要用到的命令别名。但是不同的用户的习惯各不相同,一些用户可能刚从其它操作系统迁移到 Linux,而不同操作系统的基本命令又因 shell 而异。因此,对于刚从 Windows/MS-DOS 系统迁移到 Linux 系统的用户,不妨使用
+
+```
+alias dir='ls'
+```
+
+这个命令别名来列出目录内容。
+
+类似地,
+
+```
+alias copy='cp'
+alias move='mv'
+```
+
+也可以在尚未完全熟悉 Linux 的时候用得顺手。
+
+还有一种情况,就是在经常出现输入错误的场合中做出容错,例如 Administration 这个单词就很难快速正确地输入,因此很多用户都会设置
+
+```
+alias sl='ls'
+```
+
+以及
+
+```
+alias gerp='echo "You did it *again*!"; grep'
+```
+
+ `grep` 命令最基本的用途就是在文件中查找字符串,在熟悉这个命令之后,它一定是最常用的命令之一,因此输入错误导致不得不重输命令就很令人抓狂。
+
+在上面 `gerp` 的例子中,包含的不只是一条命令,而是两条。第一条命令 `echo "You did it *again*!"` 输出了一条提醒用户拼写错误的消息,然后使用分号(`;`)把两条命令隔开,再往后才是 `grep` 这一条正确的命令。
+
+在我的系统上使用 `gerp` 来搜索 `/etc/skel/.bashrc` 中包含“alias”这个单词的行,就会输出以下内容:
+
+```
+$ 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
+```
+
+在命令别名中以固定的顺序执行多个命令,甚至更进一步,把多个命令串连起来,让后面的命令可以使用到前面的命令的执行结果。这样的做法已经非常接近 bash 脚本了。这篇文章已经接近尾声,我们将在下一篇文章中详细介绍。
+
+如果想要删除在终端中临时设置的别名,可以使用 `unalias` 命令。
+
+```
+unalias gerp
+```
+
+如果想要持久保存命令别名,可以将命令别名放在用户主目录的 `.bashrc` 文件中,具体的方法在[上一篇文章][2]中已经介绍过。
+
+--------------------------------------------------------------------------------
+
+via: https://www.linux.com/blog/learn/2018/12/aliases-diy-shell-commands
+
+作者:[Paul Brown][a]
+选题:[lujun9972][b]
+译者:[HankChow](https://github.com/HankChow)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://www.linux.com/users/bro66
+[b]: https://github.com/lujun9972
+[1]: https://www.linux.com/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 49e075989b63503a01a547fe52e976862824c72b Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 11:08:53 +0800
Subject: [PATCH 0166/4278] PRF:20180504 How a university network assistant
used Linux in the 90s.md
@geekpi
---
...network assistant used Linux in the 90s.md | 24 ++++++++++---------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md b/translated/talk/20180504 How a university network assistant used Linux in the 90s.md
index 3c8b0e8a5d..f9e811986d 100644
--- a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md
+++ b/translated/talk/20180504 How a university network assistant used Linux in the 90s.md
@@ -1,34 +1,36 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: subject: (How a university network assistant used Linux in the 90s)
[#]: via: (https://opensource.com/article/18/5/my-linux-story-student)
[#]: author: ([Alan Formy-Duva](https://opensource.com/users/alanfdoss)
[#]: url: ( )
-大学网络助理如何在 90 年代使用 Linux
+90 年代的大学网管如何使用 Linux
======
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/moneyrecycle_520x292.png?itok=SAaIziNr)
-在 20 世纪 90 年代中期,我报名了计算机科学课。我大学的计算机科学系为学生提供了一台 SunOS 服务器,它是一个多用户、多任务的 Unix 系统。我们登录它并编写我们在学习的编程语言代码,例如 C、C++ 和 ADA。在那些日子里,在社交网络和 IM 出现之前,我们还使用该系统相互通信,发送电子邮件和使用诸如 `write` 和 `talk` 之类的程序。我们每个人被允许托管一个个人网站。我很高兴它能够完成我的作业并联系其他用户。
+
+在上世纪 90 年代中期,我报名了计算机科学课。我大学的计算机科学系为学生提供了一台 SunOS 服务器,它是一个多用户、多任务的 Unix 系统。我们登录它并编写我们学习的编程语言代码,例如 C、C++ 和 ADA。在那时,在社交网络和 IM 出现之前,我们还使用该系统发送电子邮件和使用诸如 `write` 和 `talk` 之类的程序来相互通信。我们每个人被允许托管一个个人网站。我很高兴能够使用它完成我的作业并联系其他用户。
这是我第一次体验这种类型的操作环境,但我很快就了解了另一个可以做同样事情的操作系统:Linux。
-当我还是一名学生的时候,我还在大学兼职工作。我的第一个职位是住房和住宅部 (H&R) 的网络安装人员。这包含将学生宿舍与校园网络连接起来。由于这是该大学的第一个宿舍网络服务,因此只有两幢楼和大约 75 名学生已经连接。
+那会我还是学生,我在大学找了份兼职工作。我的第一个职位是住房和住宅部(H&R)的网络安装人员。这工作涉及到将学生宿舍与校园网络连接起来。由于这是该大学的第一个宿舍网络服务,因此只有两幢楼和大约 75 名学生连上了网。
-在我工作的第二年,该网络扩展到另外两幢楼。H&R 决定让该大学的信息技术办公室 (OIT) 管理这不断增长的业务。我进入 OIT 并开始担任 OIT 网络经理的学生助理。这就是我发现 Linux 的方式。我的新职责之一是管理防火墙系统,它为宿舍提供网络和互联网访问。
+在第二年,该网络扩展到另外两幢楼。H&R 决定让该大学的信息技术办公室(OIT)管理这不断增长的业务。我进入 OIT 并开始担任 OIT 网络经理的学生助理。这就是我发现 Linux 的方式。我的新职责之一是管理防火墙系统,它为宿舍提供网络和互联网访问。
-每个学生都注册了他们硬件的 MAC 地址。注册学生可以连接到宿舍网络并获得 IP 地址及访问互联网。与大学使用的其他昂贵的 SunOS 和 VMS 服务器不同,这些防火墙使用运行着免费和开源 Linux 操作系统的低成本计算机。截至年底,该系统已注册近 500 名学生。
+每个学生都注册了他们硬件的 MAC 地址。注册的学生可以连接到宿舍网络并获得 IP 地址及访问互联网。与大学使用的其他昂贵的 SunOS 和 VMS 服务器不同,这些防火墙使用运行着自由开源的 Linux 操作系统的低成本计算机。截至年底,该系统已注册近 500 名学生。
![Red hat Linux install disks][1]
-OIT 网络工作人员使用 Linux 运行 HTTP、FTP 和其他服务。他们还在个人桌面上使用 Linux。就在那时,我意识到我手上的计算机看起来和运行起来就像 CS 系昂贵的 SunOS 机器一样但没有高昂的成本。Linux 可以在商用 x86 硬件上运行,例如有 8 MB RAM 和 133Mhz Intel Pentium CPU 的 Dell Latitude。那对我来说是个卖点!我在从一个剩余的仓库中清理出来的机器上安装了 Red Hat Linux 5.2,并给了我的朋友登录帐户。
+OIT 网络工作人员使用 Linux 运行 HTTP、FTP 和其他服务。他们还在个人桌面上使用 Linux。就在那时,我意识到我手上的计算机看起来和运行起来就像 CS 系昂贵的 SunOS 机器一样,但没有高昂的成本。Linux 可以在商用 x86 硬件上运行,例如有 8 MB RAM 和 133Mhz Intel Pentium CPU 的 Dell Latitude。那对我来说是个卖点!我在从一个存货仓库中清理出来的机器上安装了 Red Hat Linux 5.2,并给了我的朋友登录帐户。
我使用我的新 Linux 服务器来托管我的网站并向我的朋友提供帐户,同时它还提供 CS 系服务器没有的图形功能。它使用了 X Windows 系统,我可以使用 Netscape Navigator 浏览网页,使用 [XMMS][2] 播放音乐,并尝试不同的窗口管理器。我也可以下载并编译其他开源软件并编写自己的代码。
-我了解到 Linux 提供了一些非常先进的功能,其中许多功能比更主流的操作系统更方便或更优越。例如,许多操作系统尚未提供应用更新的简单方法。在 Linux 中,这很简单,感谢 [autoRPM][3],一个由 Kirk Bauer 编写的更新管理器,它向 root 用户每日发送邮件,其中包含可用的更新。它有一个直观的界面,用于审查和选择要安装的软件更新 - 这对于 90 年代中期来说非常了不起。
+我了解到 Linux 提供了一些非常先进的功能,其中许多功能比更主流的操作系统更方便或更优越。例如,许多操作系统尚未提供应用更新的简单方法。在 Linux 中,这很简单,感谢 [autoRPM][3],一个由 Kirk Bauer 编写的更新管理器,它向 root 用户每日发送邮件,其中包含可用的更新。它有一个直观的界面,用于审查和选择要安装的软件更新 —— 这对于 90 年代中期来说非常了不起。
-Linux may not have been well-known back then, and it was often received with skepticism, but I was convinced it would survive. And survive it did!
+当时 Linux 可能并不为人所知,而且它经常受到怀疑,但我确信它会存活下来。而它确实生存下来了!
--------------------------------------------------------------------------------
@@ -37,11 +39,11 @@ via: https://opensource.com/article/18/5/my-linux-story-student
作者:[Alan Formy-Duval][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/alanfdoss
[1]:https://opensource.com/sites/default/files/styles/panopoly_image_original/public/images/life-uploads/red_hat_linux_install_disks.png?itok=VSw6Cke9 (Red hat Linux install disks)
[2]:http://www.xmms.org/
-[3]:http://www.ccp14.ac.uk/solution/linux/autorpm_redhat7_3.html
\ No newline at end of file
+[3]:http://www.ccp14.ac.uk/solution/linux/autorpm_redhat7_3.html
From c60a0e756dcf64271001cf35a71091d63f0e0373 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 11:09:41 +0800
Subject: [PATCH 0167/4278] PUB:20180504 How a university network assistant
used Linux in the 90s.md
@geekpi https://linux.cn/article-10359-1.html
---
...ow a university network assistant used Linux in the 90s.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/talk => published}/20180504 How a university network assistant used Linux in the 90s.md (98%)
diff --git a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md b/published/20180504 How a university network assistant used Linux in the 90s.md
similarity index 98%
rename from translated/talk/20180504 How a university network assistant used Linux in the 90s.md
rename to published/20180504 How a university network assistant used Linux in the 90s.md
index f9e811986d..38a99e4310 100644
--- a/translated/talk/20180504 How a university network assistant used Linux in the 90s.md
+++ b/published/20180504 How a university network assistant used Linux in the 90s.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (How a university network assistant used Linux in the 90s)
[#]: via: (https://opensource.com/article/18/5/my-linux-story-student)
[#]: author: ([Alan Formy-Duva](https://opensource.com/users/alanfdoss)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10359-1.html)
90 年代的大学网管如何使用 Linux
======
From 73aa9a68a321fc81b3d1f6e7ca0aeb876a43a31a Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Tue, 18 Dec 2018 14:05:23 +0800
Subject: [PATCH 0168/4278] Translating How to Update Ubuntu.
---
...untu -Terminal - GUI Methods- It-s FOSS.md | 40 +++++++++----------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
index 3a4332c365..b0f0751d81 100644
--- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
+++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
@@ -7,7 +7,7 @@
[#]: via: (https://itsfoss.com/update-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
-如何更新Ubuntu [终端及GUI方式] It's FOSS
+如何更新 Ubuntu [终端及GUI方式] It's FOSS
======
**这篇教程将向你展示如何更新服务器版本或者桌面版本的Ubuntu。它还解释了更新和升级之间的区别以及你应该了解的有关于Ubuntu Linux中的更新的一些其他内容。**
@@ -16,38 +16,38 @@
更新 Ubuntu 非常简单。我并不夸张的说。它简单得只要运行两个命令。让我来告诉你更多更新细节。
-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.
+请注意,本教程适用于 Ubuntu 18.04,16.04 或任何其他版本。命令行方式也适用于基于 Ubuntu 的发行版如 Linux Mint,Linux Lite,elementary OS 等。
-### Update Ubuntu via Command Line
+### 通过命令行更新 Ubuntu
-![How to Update Ubuntu][2]
+![如何更新 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.
+在桌面上,打开终端。你可以在菜单里找到它或者使用 Ctrl+Alt+T [快捷键][3]。如果你登陆到一台 [Ubuntu 服务器][4],那你已经在访问一个终端了。
-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.
+当命令 `apt upgrade` 要求你在安装更新前确认时,末尾的参数 `-y` 会自动输入 yes。
-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
+#### 说明: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.
@@ -63,7 +63,7 @@ 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
+#### 说明: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).
@@ -75,7 +75,7 @@ So the bottom line is that the sudo apt update checks for the availability of ne
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]
+### 通过 GUI 更新 Ubuntu[适用于桌面用户]
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.
@@ -109,11 +109,11 @@ You can choose to restart later if you don’t want to reboot your system straig
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
+### 更新 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:
@@ -121,7 +121,7 @@ Your system will have some unnecessary packages that won’t be required after t
sudo apt autoremove
```
-#### Live patching kernel in Ubuntu Server to avoid rebooting
+#### 在 Ubuntu Server 中热修复内核以避免重启
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.
@@ -129,13 +129,13 @@ In case of a Linux kernel updates, you’ll have to restart the system after the
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.
From 4bbdcb279b3ff9982f636f351cfd140f9bf87f61 Mon Sep 17 00:00:00 2001
From: cycoe
Date: Tue, 18 Dec 2018 14:12:40 +0800
Subject: [PATCH 0169/4278] translating by cycoe
---
.../20180822 9 flowchart and diagramming tools for Linux.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md b/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md
index 853cd1b7c3..5729f765d1 100644
--- a/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md
+++ b/sources/tech/20180822 9 flowchart and diagramming tools for Linux.md
@@ -1,3 +1,5 @@
+translating by cycoe
+cycoe 翻译中
9 flowchart and diagramming tools for Linux
======
From a85fe7df351a1cbf06f0abf05172a56b158ebdfd Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 16:04:23 +0800
Subject: [PATCH 0170/4278] PRF:20181205 Bring some color to your Linux
terminal with lolcat.md
@geekpi
---
...olor to your Linux terminal with lolcat.md | 23 +++++++++++--------
1 file changed, 14 insertions(+), 9 deletions(-)
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
index eb23d85e36..2fc3c4cb0a 100644
--- 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
@@ -1,22 +1,24 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: 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 终端带来一些颜色
+使用 lolcat 为你的 Linux 终端带来彩虹
======
-使用这个简单的程序,你可以为所需的任何程序的输出添加彩色。
+
+> 使用这个简单的工具,你可以为所需的任何程序的输出变成七彩。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-lolcat.png?itok=Es6dYcph)
今天是 Linux 命令行玩具日历的第五天。如果这是你第一次访问该系列,你可能会问自己,什么是命令行玩具。即使我不太确定,但一般来说,它可能是一个游戏,或任何简单的可以帮助你在终端玩得开心的东西。
-很可能你们中的一些人之前已经看过我们日历中的各种选择,但我们希望每个人至少见到一件新事物。
+很可能你们中的一些人之前已经看过我们日历中的各种玩具,但我们希望每个人至少见到一件新事物。
-今日的选择,**lolcat**,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。
+今日的选择,`lolcat`,是我选择的第一个没有在我的 Linux 发行版中打包的程序,但它安装仍然很简单。它是一个 Ruby 程序,你应该可以使用下面的命令轻松地添加到系统中。
```
$ gem install lolcat
@@ -29,15 +31,18 @@ $ fortune | boxes -a c -d parchment | lolcat
```
根据你的运气,你可能会看到这样:
+
![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-parchment.png)
-你可以传递给 **lolcat** 一些参数而不必重复它们,我建议你访问 **lolcat** 的 [GitHub 页面][1] 或者在终端输入 **lolcat --help** 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画打印?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的句子列表中的适合猫的句子。
+你可以传递给 `lolcat` 一些参数。这里不再赘述,我建议你访问 `lolcat` 的 [GitHub 页面][1] 或者在终端输入 `lolcat --help` 了解。但一般来说,它们能设置彩虹的传递和频率,以及我个人最喜欢的动画。谁不喜欢终端的彩色动画输出呢?让我们再试一次,用一个不同的边框(当然是以猫为主题)和一句在我的格言列表中的适合猫的句子。
```
fortune -m "nine tails" | boxes -a c -d cat | lolcat -a
```
+
![](https://opensource.com/sites/default/files/uploads/linux-toy-lolcat-animated.gif)
-**lolcat** 是 BSD 许可下的开源软件。
+
+`lolcat` 是一个 BSD 许可下的开源软件。
你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。如果你有特别想了解的可以评论留言,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
@@ -50,11 +55,11 @@ 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)
+校对:[wxy](https://github.com/wxy)
本文由 [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
+[2]: https://opensource.com/article/18/12/linux-toy-cowsay
From 7fa885b3178e3a6bdd0ea0aeec75cf6b43ae34a6 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 16:05:00 +0800
Subject: [PATCH 0171/4278] PUB:20181205 Bring some color to your Linux
terminal with lolcat.md
@geekpi https://linux.cn/article-10361-1.html
---
...205 Bring some color to your Linux terminal with lolcat.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181205 Bring some color to your Linux terminal with lolcat.md (97%)
diff --git a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md b/published/20181205 Bring some color to your Linux terminal with lolcat.md
similarity index 97%
rename from translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md
rename to published/20181205 Bring some color to your Linux terminal with lolcat.md
index 2fc3c4cb0a..629f30a6e3 100644
--- a/translated/tech/20181205 Bring some color to your Linux terminal with lolcat.md
+++ b/published/20181205 Bring some color to your Linux terminal with lolcat.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: 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: ( )
+[#]: url: (https://linux.cn/article-10361-1.html)
使用 lolcat 为你的 Linux 终端带来彩虹
======
From f0c2d70ee9c8ef9d37103a27a1f05120615d1d25 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 19:37:13 +0800
Subject: [PATCH 0172/4278] PRF:20171111 A CEOs Guide to Emacs.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
部分
---
.../tech/20171111 A CEOs Guide to Emacs.md | 88 ++++++++-----------
1 file changed, 39 insertions(+), 49 deletions(-)
diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md
index 5b25f37313..6d14ad7a8e 100644
--- a/translated/tech/20171111 A CEOs Guide to Emacs.md
+++ b/translated/tech/20171111 A CEOs Guide to Emacs.md
@@ -1,57 +1,58 @@
一位 CEO 的 Emacs 指南
-============================================================
+===========
-几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器或者是说操作系统,而且我还乐此不疲。多年过去了,我也转向了其他更新,更好的工具。结果,我已经忘了如何在不用鼠标的情况下来浏览文件。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是就决定再试一次 Emacs。这是个很正确的决定,原因有以下几个。其中包括了 `.emacs` 和 Dropbox 的技巧,可以让你建立一个良好的,可移植的环境。
+几年前,不,是几十年前,我就在用 Emacs。不论是码代码、编写文档,还是管理邮件和日程,我都用这个编辑器或者是说操作系统,而且我还乐此不疲。许多年过去了,我也转向了其他更新、更好的工具。结果,我已经忘了如何在不用鼠标的情况下来浏览文件。大约三个月前,我意识到我在应用程序和计算机之间切换上耗费了大量的时间,于是就决定再试一次 Emacs。这是个很正确的决定,原因有以下几个。其中包括了 `.emacs` 和 Dropbox 的技巧,可以让你建立一个良好的、可移植的环境。
-对于那先还没用过 Emacs 的人来说,你可能会讨厌它,但也可能喜欢上它。它有点像一个房子大小的 Rube Goldberg 机器,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键短语是“乍一看”。一旦你了解了Emacs,你就会意识到它其实是一种可以作为发动机的热核烤面包机。好吧,你想对文字做什么都可以。当考虑到计算寿命在很大程度上与文本有关时,这是一个相当大胆的声明,真的很大胆。
+对于那些还没用过 Emacs 的人来说,你可能会讨厌它,但也可能喜欢上它。它有点像一个房子大小的鲁布·戈德堡机械,乍一看,它具备烤面包机的所有功能。这听起来不像是一种认可,但关键短语是“乍一看”。一旦你了解了 Emacs,你就会意识到它其实是一种可以作为发动机的热核烤面包机……好吧,你可以用来对文字做什么都可以。当考虑到你的计算生活在很大程度上与文本有关时,这是一个相当大胆的声明,真的很大胆。
-也许对我来说更重要的是,它是我曾经使用过的一个应用程序,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30] 或 Redmond 附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如文件或 `IDE`)就像碳纤维赛车,他们装备得很好,也很完整。而Emacs 就像一盒经典的 [Campagnolo][31] 零件和一个漂亮的拖钢框架,缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。第二点就是它会给你带来无尽的快乐或烦恼,这取决于你自己,而且会一直持续到你生命的最后一天。我是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时同样感到高兴的人,具体情况因人而异。
+也许对我来说更重要的是,它是我曾经使用过的一个应用程序,并让我觉得我真正的拥有它,而不是把我塑造成一个匿名的“用户”,就好像位于 [Soma][30](LCTT 译注:旧金山的一个街区)或雷蒙德(LCTT 译注:微软总部所在地)附近某个高档办公室的产品营销部门把钱作为明确的目标一样。现代生产力和创作应用程序(如 Pages 或 IDE)就像碳纤维赛车,它们装备得很好,也很齐全。而 Emacs 就像一盒经典的 [Campagnolo][31] (LCTT 译注:世界上最好的三个公路自行车套件系统品牌之一)零件和一个漂亮的自行车牵引式钢框架,但缺少曲柄臂和刹车杆,你必须在网上某个小众文化中找到它们。第一点是它是更快更完整的。第二点就是它会给你带来无尽的快乐或烦恼,这取决于你自己,而且会一直持续到你生命的最后一天。我是那种在找到一堆老古董或用 `Emacs Lisp` 配置编辑器时同样感到高兴的人,具体情况因人而异。
-![1933 steel bicycle](https://blog.fugue.co/assets/images/bicycle.jpg)
-一辆我还在骑的1933年产的钢制自行车。你可以从查看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6].
+![1933 steel bicycle](https://www.fugue.co/hubfs/Imported_Blog_Media/bicycle-1.jpg)
-这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。他的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这。
+*一辆我还在骑的1933年产的钢制自行车。你可以看看框架管差别: [https://www.youtube.com/watch?v=khJQgRLKMU0][6]*
-如果通过编辑 `Lisp` 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 `Ludwig` 和 `Emacs Lisp`),但是 `Fugue` 的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs, 40% 用 `IDE` 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32](PHB[1][7])的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。
+这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。它的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。
-### 最后的优点
+如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32](PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。
-使用 Emacs 带来的长期优势是让生活更轻松。与最后的收获相比,最开始的付出完全值得。想想这些:
+### 恒久优势
-### 无需上下文切换
+使用 Emacs 带来的长期优势是让生活更轻松。与最后的收获相比,最开始的付出完全值得。想想这些:
-`Org` 模式本身就值得花时间,但如果你像我一样,你通常要处理十几份左右的文件 —— 从博客帖子到会议需要做什么的清单,再到员工评论。在现代计算世界中,这通常意味着要使用多个应用程序,所有这些应用程序都有不同的用户界面,保存方式、排序和搜索方式。结果就是你需要不断转换思维环境,记住细节。我讨厌上下文切换,因为它是一种强加到我身上的方式,原因是破坏了接口模型[2][8],并且我讨厌记住计算机的命令,这本该是计算机要记住的东西。在单个环境下,Emacs 对 PHB 甚至比对于程序员更有用,因为程序员更多时候只需要专注于一个程序。转换思维环境的成本比通常看起来的要高。操作系统和应用程序供应商已经构建了各种接口,以分散我们对这一现实的注意力。如果你是技术人员,通过快捷键(`M-:`)来访问功能强大的[语言解释器][33]会方便的多[3][9]。
+#### 无需上下文切换
-许多应用程序可以全天全屏并用于编辑文本。Emacs 是惟一的,因为它既是编辑器也是 `Emacs Lisp` 解释器。从本质上说,你工作时只要用电脑上的一两个键就能完成。如果你对编程略知一二,就能发现这一位置你可以在 Emacs 中做 _任何事情_。一旦你在内存中有了这些命令,你的电脑就可以在你工作时几乎实时地为你提供高效的运转。你不会想用 `Emacs Lisp` 来重建 Excel,只要用简单的一两行代码就能实现 Excel 中大多数的功能。如果我需要处理数字,我更有可能转到 scratch 缓冲区,编写一些代码,而不是打开电子表格。即便是我有一封多行的邮件要写,我通常也会先在 Emacs 中写完,然后再复制粘贴到邮件客户端中。当你可以流畅的书写时,为什么要去切换呢?你可以先从一两个简单的计算开始,随着时间的推移,你可以很容易的在 Emacs 中添加你所需要处理的计算。这在应用程序中可能是独一无二的,同时还提供了让为其他的人创造的丰富特性。还记得 Isaac Asimov 书中那些神奇的终端吗[4][10]? Emacs 是我所遇到的最接近他们的东西。我决定不再用什么应用程序来做这个或那个。相反,我只是工作。拥有一个伟大的工具并致力于此,这才是真正的动力和效率。
+Org 模式本身就值得花时间,但如果你像我一样,你通常要处理十几份左右的文件 —— 从博客帖子到会议需要做什么的清单,再到员工评估。在现代计算世界中,这通常意味着要使用多个应用程序,所有这些应用程序都有不同的用户界面、保存方式、排序和搜索方式。结果就是你需要不断转换思维环境,记住细节。我讨厌上下文切换,因为它是一种强加到我身上的方式,原因是破坏了界面模型[^2] ,并且我讨厌记住本该是计算机要为我记住的东西。在单个环境下,Emacs 对 PHB 甚至比对于程序员更有用,因为程序员更多时候只需要专注于一个程序。转换思维环境的成本比通常看起来的要高。操作系统和应用程序厂商已经构建了各种界面,以分散我们对这一现实的注意力。如果你是技术人员,通过快捷键(`M-:`)来访问功能强大的[语言解释器][33]会方便的多[^3] 。
-### 在安静中创造事情
+许多应用程序可以全天全屏地用于编辑文本。Emacs 是惟一的,因为它既是编辑器也是 Emacs Lisp 解释器。从本质上说,你工作时只要用电脑上的一两个键就能完成。如果你对编程略知一二,就能发现这意味着你可以在 Emacs 中做 _任何事情_。一旦你在内存中有了这些命令,你的电脑就可以在你工作时几乎实时地为你提供高效的运转。你不会想用 Emacs Lisp 来重建 Excel,只要用简单的一两行代码就能实现 Excel 中大多数的功能。如果我需要处理数字,我更有可能转到 scratch 缓冲区,编写一些代码,而不是打开电子表格。即便是我有一封多行的邮件要写,我通常也会先在 Emacs 中写完,然后再复制粘贴到邮件客户端中。当你可以流畅的书写时,为什么要去切换呢?你可以先从一两个简单的算术开始,随着时间的推移,你可以很容易的在 Emacs 中添加你所需要处理的计算。这在应用程序中可能是独一无二的,同时还提供了让为其他的人创造的丰富特性。还记得艾萨克·阿西莫夫书中那些神奇的终端吗? Emacs 是我所遇到的最接近它们的东西[^4] 。我决定不再用什么应用程序来做这个或那个。相反,我只是工作。拥有一个伟大的工具并致力于此,这才是真正的动力和效率。
+
+#### 在安静中创造事情
拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?拥有 `Lisp` 键盘的全部功能?这就是我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。
-我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等保存在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序努力提供帮助并使其易于使用。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[5][11]。比其 office 应用程序,我更讨厌在线版的应用程序。
+我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等保存在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序努力提供帮助并使其易于使用。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比其 office 应用程序,我更讨厌在线版的应用程序。
![1933 steel bicycle](https://blog.fugue.co/assets/images/desktop.jpg)
我的桌面布局, Emacs 在左边
但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间时,我的效率会更高。在 `Fugue` 中使用了 `Slack`,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。仅仅是风投或董事会董事的一次懈怠,或一封电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。
-### 带上一切,并保留着
+#### 带上一切,并保留着
第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 `Dropbox` 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何地方,任何环境下工作了,因为你已经精心制作了适合目的套件了。我在 OS X,Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理页面、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。
-永久存储在计算机上的限制是文件格式。假设人类已经解决了存储[6][12]的问题,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最持久的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于办公应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。
+永久存储在计算机上的限制是文件格式。假设人类已经解决了存储[^6] 的问题,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最持久的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于办公应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。
如果你准备尝试 Emacs,请继续阅读!下面的部分不会取代完整的教程,但是在完成阅读时,就可以操作了。
### 学会驾驭 Emacs —— 一个专业的配置
-所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像现代世界已经过去了。这有点像你只开过车,却要你去学骑自行车[7][13]。
+所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像现代世界已经过去了。这有点像你只开过车,却要你去学骑自行车[^7] 。
-### 该选哪个 Emacs
+#### 该选哪个 Emacs
-我用的是 GNU 中 OS X 和 Windows 的通用版本的 Emacs。你可以在 [][34][http://emacsformacos.com/][35] 获取 OS X 版本,在[][36][http://www.gnu.org/software/emacs/][37]获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(包括 `Lisp` 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[8][14]!
+我用的是 GNU 中 OS X 和 Windows 的通用版本的 Emacs。你可以在 [][34][http://emacsformacos.com/][35] 获取 OS X 版本,在[][36][http://www.gnu.org/software/emacs/][37]获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(包括 `Lisp` 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] !
-### 首先,学会浏览
+#### 首先,学会浏览
在本文中,我将约定 Emacs 中的键和组合。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组快捷键会指向一个教程,这是你首先要做的一件事。
@@ -59,11 +60,11 @@
Emacs 附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。
-### 学会复制和粘贴
+#### 学会复制和粘贴
你可以叫 Emacs 设为 `CUA` 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 这样的浏览命令来标记区域(如选择)。所以 `C-F` 是选中管标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除和召回,但它非常类似于剪切和粘贴。在删除的环中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你在这开始摸索, `C-x u` 是撤销。
-### 下一步,学会用 `Ido` 模式
+#### 下一步,学会用 `Ido` 模式
相信我,`Ido` 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独分开的查找或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 `Ido` 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 `Ido` 是 Emacs 的 22 版时开发出来的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。
@@ -85,7 +86,7 @@ home
`Ido` 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它.
-### 符号链接是你的好伙伴
+#### 符号链接是你的好伙伴
等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把他们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并链接到 `.emacs` 和 `.emacs.d`,以及主目录 `~`。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的一部分了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件家的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。
@@ -113,7 +114,7 @@ home
其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开查找或文件资源管理器再用鼠标点要节省 _很_ 多时间。 `Ido` 模式很有用, 这真的是操作 Emacs 的一种实用的模式。下面让我们去探索一些其他对完成工作很有帮助的模式吧。
-### 字体及风格
+#### 字体及风格
我推荐在 Emacs 中使用很棒的字体系列。它们可以使用不同的括号、0和其他字符进行自定义。你可以在字体文件本身中构建额外的行间距。我推荐 1\.5 倍的行间距,并在代码和数据中使用它们适应比例的字体。写作中我用 `Serif` 字体,它有一种紧凑但时髦的感觉。你可以在 [http://input.fontbureau.com/][40] 上找到它们,在那里你可以根据自己的喜好进行定制。你可以使用 Emacs 中的菜单手动设置字体,但这会将代码保存到你的 `.emacs` 文件中,如果您使用多个设备,您可能需要一些不同的设置。我我将我的 `.emacs` 设置位根据使用的机器的名称,并配置适当的屏幕机字体。代码如下:
@@ -142,7 +143,7 @@ home
(if (fboundp 'menu-bar-mode) (menu-bar-mode 1))
```
-### Org 模式
+#### Org 模式
我基本上 `Org` 模式下处理工作的。它是我创作文档、记笔记、列任务清单以及 90% 其他工作的首选环境。`Org` 最初是由一个在会议中使用笔记本电脑的家伙构想出来的,它是笔记和待办事项列表的组合工具。我反对在会议中使用笔记本电脑,自己也不使用,所以我的用法与他的有些不同。对我来说,`Org` 主要是一种处理结构中内容的方式。在 `Org` 模式中有标题和副标题等,它们的作用就像一个大纲。`Org` 允许你展开或隐藏文本内容,还可以重新排列文本。这非常很符合我的想法,而且我发现用这种方式使用它是一种乐趣。
@@ -159,7 +160,7 @@ home
我有一个总是在缓冲区中打开的 `stuff.org` 文件。我把它当作记事本。`Org` 使得提取待办事项和有期限的事情变得很容易。当你在内联 `Lisp` 代码并在需要计算它时,它特别有用。拥有包含内容的代码非常方便。同样,你可以使用 Emacs 访问实际的计算机,这是一种解放。
-#### 用 `Org` 模式进行发布
+##### 用 `Org` 模式进行发布
我关心的是文档的外观和格式。我我刚开始工作时是个设计师,而且我认为信息可以,也应该表现得清晰和美丽。`Org` 对将 `LaTeX` 生成 PDF 支持的很好, `LaTeX` 有自己的学习曲线,但是做简单的事情非常简单。
@@ -187,9 +188,9 @@ home
这个文件是一个使用该配置输出为 PDF 的实例。这就是开箱即用的 `LaTeX` 一样。在我看来这还不错,但是字体很无聊,而且有点奇怪。此外,如果你使用标准格式,人们会认为他们正在阅读的东西是或假装是一篇学术论文。别怪我没提醒你。
-### `Ace Jump` 模式
+#### `Ace Jump` 模式
-如果你想使用的话,这是个辅助而不是主要功能。它的工作原理有点像 Jef Raskin 的 `Leap` 功能[9][15]。 按下 `C-c` `C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `Lisp` 目录下,并在 `.emacs` 文件添加如下代码:
+如果你想使用的话,这是个辅助而不是主要功能。它的工作原理有点像 Jef Raskin 的 `Leap` 功能[^9] 。 按下 `C-c` `C-SPC`,然后输入要跳转到单词的第一个字母。它会高亮显示所有以该字母开头的单词,并将其替换为字母表中的字母。您只需键入所需位置的字母,光标就会跳转到该位置。我自己经常用这个作为导航键或搜索。将 `.el` 文件下到你的 `Lisp` 目录下,并在 `.emacs` 文件添加如下代码:
```
;; set up ace-jump-mode
@@ -202,27 +203,16 @@ home
这篇文章已经够详细了,你能在其中的到你所想要的。我很想了解除编程(或编程)之外你对 Emacs 的使用,以及这是否有用。在我使用 Emacs 的过程中,可能存在一些自作聪明的想法,如果你能指出它们,我将感激不尽。之后,我可能会写一些更新来引入其他特性或模式。我很确定我将会向你展示如何在 Emacs 和 `Ludwig` 模式下使用 `Fugue`,因为我会将它发展成比代码突出显示更有用的东西。把你的想法发到 [@fugueHQ][41] 上。
-* * *
-#### 附注
-
-1. [^][16] If you are now a PHB of some sort, but were never technical, Emacs likely isn’t for you. There may be a handful of folks for whom Emacs will form a path into the more technical aspects of computing, but this is probably a small population. It’s helpful to know how to use a Unix or Windows terminal, to have edited a dotfile or two, and to have written some code at some point in your life for Emacs to make much sense.
-
-2. [^][17] [][18][http://archive.wired.com/wired/archive/2.08/tufte.html][19]
-
-3. [^][20] I mainly use this to perform calculations while writing. For example, I was writing an offer letter to a new employee and wanted to calculate how many options to include in the offer. Since I have a variable defined in my `.emacs` for outstanding-shares, I can simply type `M-: (* .001 outstanding-shares)`and get a tenth of a point without opening a calculator or spreadsheet. I keep _lots_ of numbers in variables like this so I can avoid context switching.
-
-4. [^][21] The missing piece of this is the web. There is an Emacs web browser called eww that will allow you to browse in Emacs. I actually use this, as it is both a great ad-blocker and removes most of the poor choices in readability from the web designer's hands. It's a bit like Reading Mode in Safari. Unfortunately, most websites have lots of annoying cruft and navigation that translates poorly into text.
-
-5. [^][22] Usability is often confused with learnability. Learnability is how difficult it is to learn a tool. Usability is how useful the tool is. Often, these are at odds, such as with the mouse and menus. Menus are highly learnable, but have poor usability, so there have been keyboard shortcuts from the earliest days. Raskin was right on many points where he was ignored about GUIs in general. Now, OSes are putting things like decent search onto a keyboard shortcut. On OS X and Windows, my default method of navigation is search. Ubuntu's search is badly broken, as is the rest of its GUI.
-
-6. [^][23] AWS S3 has effectively solved file storage for as long as we have the Internet. Trillions of objects are stored in S3 and they've never lost one of them. Most every service out there that offers cloud storage is built on S3 or imitates it. No one has the scale of S3, so I keep important stuff there, via Dropbox.
-
-7. [^][24] By now, you might be thinking "what is it with this guy and bicycles?" ... I love them on every level. They are the most mechanically efficient form of transportation ever invented. They can be objects of real beauty. And, with some care, they can last a lifetime. I had Rivendell Bicycle Works build a frame for me back in 2001 and it still makes me happy every time I look at it. Bicycles and UNIX are the two best inventions I've interacted with. Well, they and Emacs.
-
-8. [^][25] This is not a tutorial for Emacs. It comes with one and it's excellent. I do walk through some of the things that I find most important to getting a useful Emacs setup, but this is not a replacement in any way.
-
-9. [^][26] Jef Raskin designed the Canon Cat computer in the 1980s after falling out with Steve Jobs on the Macintosh project, which he originally led. The Cat had a document-centric interface (as all computers should) and used the keyboard in innovative ways that you can now imitate with Emacs. If I could have a modern, powerful Cat with a giant high-res screen and Unix underneath, I'd trade my Mac for it right away. [][27][https://youtu.be/o_TlE_U_X3c?t=19s][28]
+[^1]: If you are now a PHB of some sort, but were never technical, Emacs likely isn’t for you. There may be a handful of folks for whom Emacs will form a path into the more technical aspects of computing, but this is probably a small population. It’s helpful to know how to use a Unix or Windows terminal, to have edited a dotfile or two, and to have written some code at some point in your life for Emacs to make much sense.
+[^2]: http://archive.wired.com/wired/archive/2.08/tufte.html
+[^3]: I mainly use this to perform calculations while writing. For example, I was writing an offer letter to a new employee and wanted to calculate how many options to include in the offer. Since I have a variable defined in my `.emacs` for outstanding-shares, I can simply type `M-: (* .001 outstanding-shares)`and get a tenth of a point without opening a calculator or spreadsheet. I keep _lots_ of numbers in variables like this so I can avoid context switching.
+[^4]: The missing piece of this is the web. There is an Emacs web browser called eww that will allow you to browse in Emacs. I actually use this, as it is both a great ad-blocker and removes most of the poor choices in readability from the web designer's hands. It's a bit like Reading Mode in Safari. Unfortunately, most websites have lots of annoying cruft and navigation that translates poorly into text.
+[^5]: Usability is often confused with learnability. Learnability is how difficult it is to learn a tool. Usability is how useful the tool is. Often, these are at odds, such as with the mouse and menus. Menus are highly learnable, but have poor usability, so there have been keyboard shortcuts from the earliest days. Raskin was right on many points where he was ignored about GUIs in general. Now, OSes are putting things like decent search onto a keyboard shortcut. On OS X and Windows, my default method of navigation is search. Ubuntu's search is badly broken, as is the rest of its GUI.
+[^6]: AWS S3 has effectively solved file storage for as long as we have the Internet. Trillions of objects are stored in S3 and they've never lost one of them. Most every service out there that offers cloud storage is built on S3 or imitates it. No one has the scale of S3, so I keep important stuff there, via Dropbox.
+[^7]: By now, you might be thinking "what is it with this guy and bicycles?" ... I love them on every level. They are the most mechanically efficient form of transportation ever invented. They can be objects of real beauty. And, with some care, they can last a lifetime. I had Rivendell Bicycle Works build a frame for me back in 2001 and it still makes me happy every time I look at it. Bicycles and UNIX are the two best inventions I've interacted with. Well, they and Emacs.
+[^8]: This is not a tutorial for Emacs. It comes with one and it's excellent. I do walk through some of the things that I find most important to getting a useful Emacs setup, but this is not a replacement in any way.
+[^9]: Jef Raskin designed the Canon Cat computer in the 1980s after falling out with Steve Jobs on the Macintosh project, which he originally led. The Cat had a document-centric interface (as all computers should) and used the keyboard in innovative ways that you can now imitate with Emacs. If I could have a modern, powerful Cat with a giant high-res screen and Unix underneath, I'd trade my Mac for it right away. [][27][https://youtu.be/o_TlE_U_X3c?t=19s][28]
--------------------------------------------------------------------------------
From b9246f66148532703d7ce7c6439033a95b02d6d8 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 23:25:57 +0800
Subject: [PATCH 0173/4278] PRF:20181203 Four Easy Ways to Search Or Find Files
And Folders in Linux.md
@geekpi
---
...arch Or Find Files And Folders in Linux.md | 35 +++++++++----------
1 file changed, 16 insertions(+), 19 deletions(-)
diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
index a95aef6e7d..8358a9ebb0 100644
--- a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
+++ b/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
@@ -1,26 +1,22 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: 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/)
-四种简单的方法来搜索或查找 Linux 中的文件和文件夹
+搜索 Linux 中的文件和文件夹的四种简单方法
======
-Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。
+Linux 管理员一天都不能离开搜索文件,因为这是他们的日常活动。了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。这些命令记忆起来不复杂,因为它们使用的是标准语法。
-了解一些搜索的东西是不错的,因为这能帮助你在命令行服务器中工作。
-
-这些命令记忆起来不复杂,因为它们使用的是标准语法。
-
-这里执行四个 Linux 命令,每个命令都有自己独特的功能。
+可以通过四个 Linux 命令啦执行此操作,每个命令都有自己独特的功能。
### 方法 1:使用 find 命令在 Linux 中搜索文件和文件夹
-find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件和文件夹的命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。
+`find` 命令被广泛使用,并且是在 Linux 中搜索文件和文件夹的著名命令。它搜索当前目录中的给定文件,并根据搜索条件递归遍历其子目录。
它允许用户根据大小、名称、所有者、组、类型、权限、日期和其他条件执行所有类型的文件搜索。
@@ -72,19 +68,19 @@ find 命令被广泛使用,并且是非常著名的在 Linux 中搜索文件
### 方法 2:使用 locate 命令在 Linux 中搜索文件和文件夹
-locate 命令比 find 命令运行得更快,因为它使用 updatedb 数据库,而 find 命令在真实系统中搜索。
+`locate` 命令比 `find` 命令运行得更快,因为它使用 `updatedb` 数据库,而 `find` 命令在真实系统中搜索。
它使用数据库而不是搜索单个目录路径来获取给定文件。
-locate 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。
+`locate` 命令未在大多数发行版中预安装,因此,请使用你的包管理器进行安装。
-数据库通过 cron 定期更新,但我们可以通过运行以下命令手动更新它。
+数据库通过 cron 任务定期更新,但我们可以通过运行以下命令手动更新它。
```
$ sudo updatedb
```
-只需运行以下命令即可列出给定的文件或文件夹。在 locate 命令中不需要指定特定选项来打印文件或文件夹。
+只需运行以下命令即可列出给定的文件或文件夹。在 `locate` 命令中不需要指定特定选项来打印文件或文件夹。
在系统中搜索 `ssh` 文件夹。
@@ -107,13 +103,13 @@ $ sudo updatedb
### 方法 3:在 Linux 中搜索文件使用 which 命令
-which 返回在终端输入命令时执行的可执行文件的完整路径。
+`which` 返回在终端输入命令时执行的可执行文件的完整路径。
当你想要为可执行文件创建桌面快捷方式或符号链接时,它非常有用。
-which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。
+`which` 命令搜索当前用户而不是所有用户的 `$PATH` 环境变量中列出的目录。我的意思是,当你登录自己的帐户时,你无法搜索 root 用户文件或目录。
-运行以下命令以打印 vim 可执行文件的完整路径。
+运行以下命令以打印 `vim` 可执行文件的完整路径。
```
# which vi
@@ -132,12 +128,13 @@ which 命令搜索当前用户而不是所有用户的 PATH 环境变量中列
### 方法 4:使用 whereis 命令在 Linux 中搜索文件
-whereis 命令用于搜索给定命令的二进制、源码和手册页文件。
+`whereis` 命令用于搜索给定命令的二进制、源码和手册页文件。
```
# 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/
@@ -145,9 +142,9 @@ via: https://www.2daygeek.com/four-easy-ways-to-search-or-find-files-and-folders
作者:[Prakash Subramanian][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/prakash/
-[b]: https://github.com/lujun9972
\ No newline at end of file
+[b]: https://github.com/lujun9972
From f7b88e3744d9acbf35afab82437378d96b75aac8 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Tue, 18 Dec 2018 23:26:46 +0800
Subject: [PATCH 0174/4278] PUB:20181203 Four Easy Ways to Search Or Find Files
And Folders in Linux.md
@geekpi https://linux.cn/article-10362-1.html
---
... Easy Ways to Search Or Find Files And Folders in Linux.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md (98%)
diff --git a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md b/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
similarity index 98%
rename from translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
rename to published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
index 8358a9ebb0..d9326f0904 100644
--- a/translated/tech/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
+++ b/published/20181203 Four Easy Ways to Search Or Find Files And Folders in Linux.md
@@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
-[#]: url: ( )
+[#]: publisher: (wxy)
+[#]: url: (https://linux.cn/article-10362-1.html)
[#]: 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/)
From 13b7fc841a5a6fdb39245fe1d483c99bc14c7b08 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 00:44:58 +0800
Subject: [PATCH 0175/4278] PRF:20180419 Migrating to Linux- Network and System
Settings.md
@ScarboroughCoral
---
...g to Linux- Network and System Settings.md | 102 ++++++++----------
1 file changed, 44 insertions(+), 58 deletions(-)
diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md
index 480aa05239..b9fe12b66e 100644
--- a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md
+++ b/translated/tech/20180419 Migrating to Linux- Network and System Settings.md
@@ -1,106 +1,92 @@
-# 迁移到 Linux 工作环境: 网络和系统设置
+迁移到 Linux:网络和系统设置
+======
+
+> 这个系列我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux;这篇中我们涉及到 Linux 桌面系统上的一些常见设置。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/animals-birds-flock-55832.jpg?itok=NUGAyhDO)
-在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到Linux。如果你错过了以前的文章,可以从这访问:
+在这个系列中,我们提供了基础知识的概述,以帮助您成功地从另一个操作系统过渡到 Linux。如果你错过了以前的文章,可以从这访问:
-[Part 1 - 基本介绍][1]
+- [第1部分 - 入门介绍][1]
+- [第2部分 - 磁盘、文件和文件系统][2]
+- [第3部分 - 图形操作环境][3]
+- [第4部分 - 命令行][4]
+- [第5部分 - 使用 sudo][5]
+- [第5部分 - 安装软件][6]
-[Part 2 - 磁盘、文件和文件系统][2]
+Linux 提供了一系列网络和系统设置。在你的桌面计算机上,Linux 允许您调整系统上的任何内容。大多数这些设置都出现在 `/etc` 目录下的纯文本文件中。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。
-[Part 3 - 图形界面环境][3]
+大多数设置都能够在“设置”程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。
-[Part 4 - 命令行][4]
+### 连接互联网
-[Part 5 - 使用 sudo 命令][5]
+在 Linux 中连接到互联网通常非常简单。如果您通过以太网电缆连接,Linux 通常会在插入电缆时或启动时(如果电缆已连接)获得 IP 地址并自动连接。
-[Part 6 - 软件安装][6]
+如果您使用无线网络,则在大多数发行版中都有一个菜单,可以在指示器面板中或在“设置”中(取决于您的发行版),您可以在其中选择无线网络的 SSID。如果网络受密码保护,它通常会提示您输入密码。然后连接,这个过程相当顺利。
-Linux 提供了一系列网络和系统设置。在桌面上,Linux允许您调整系统上的任何内容。大多数这些设置都在/ etc目录下的纯文本文件中公开。这里我将介绍你使用桌面 Linux 操作系统的过程中最常用的设置。
-
-
-
-大多数设置都能够在设置程序里面找到,这些设置可能对于不同的 Linux 发行版有所不同。通常来说,你可以修改背景、调整音量、连接打印机、进行显示设置等。对于这些设置尽管我不会全部谈论,但你可以自己探索。
-
-
-
-### 连接因特网
-
-在Linux中连接到Internet通常非常简单。如果您通过以太网电缆连接,Linux通常会在插入电缆时或启动时获得IP地址并自动连接(如果电缆已连接)。
-
-如果您使用无线,则在大多数发行版中都有一个菜单,可以在指示器面板中或在设置中(取决于您的发行版),您可以在其中选择无线网络的SSID。如果网络受密码保护,它通常会提示您输入密码。 然后连接,这个过程相当顺利。
-
-在图形界面您可以通过进入设置来调整网络设置。通常称为系统设置或者是设置。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。
+在图形界面您可以通过进入设置来调整网络设置。通常称为“系统设置”或者是“设置”。通常可以轻松找到设置程序,因为它的图标是齿轮或工具图片(图1)。
![Network Settings][8]
-图1: Gnome 桌面网络设置指示器图标.
-
-[经许可使用][9]
+*图1: Gnome 桌面网络设置指示器图标。*
### 网络接口名称
-在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 - 或以太网和无线。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。
+在 Linux 下,网络设备有名称。 从历史上看,它们的名称分别为 eth0 和 wlan0 —— 或“以太网”和“无线网络”。 较新的 Linux 系统一直使用看起来更深奥的不同名称,如 enp4s0 和 wlp5s0 。 如果名称以 en 开头,则它是有线以太网接口。 如果它以 wl 开头,那么它就是一个无线接口。 其余的字母和数字反映了设备如何连接到硬件。
### 通过命令行进行网络管理
如果您希望更好地控制网络设置,或者如果您在没有图形桌面的情况下管理网络连接,则还可以从命令行管理网络。
-请注意,用于在图形桌面中管理网络的最常用服务是网络管理器,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。
+请注意,用于在图形桌面中管理网络的最常用服务是“网络管理器”,而网络管理器通常会覆盖在命令行上进行的设置更改。如果您正在使用网络管理器,最好在其界面中更改您的设置,以防止撤消您从命令行或其他位置所做的更改。
-更改图形环境中的设置很可能与网络管理器交互,您还可以使用名为nmtui的工具从命令行更改网络管理器设置。nmtui工具提供了您在图形环境中找到的所有设置,但是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图2)。
+在图形环境中的更改设置与在网络管理器中很类似,您还可以使用名为 `nmtui` 的工具从命令行更改网络管理器设置。`nmtui` 工具提供了您在图形环境中找到的所有设置,但是是在基于文本的半图形界面中提供了该设置,该界面可在命令行上运行(图 2)。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-2_0.png?itok=1QVjDdbJ)
-图 2:nmtui 界面
+*图 2:nmtui 界面*
-[经许可使用][9]
-
-在命令行上,有一个名为 ifconfig 的旧工具来管理网络,还有一个名为 ip 的新工具。在某些发行版中,ifconfig 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,ifconfig 仍可以使用。
+在命令行上,有一个名为 `ifconfig` 的旧工具来管理网络,还有一个名为 `ip` 的新工具。在某些发行版中,`ifconfig` 被认为是不推荐使用的,默认情况下甚至没有安装。在其他发行版上,`ifconfig` 仍可以使用。
以下是一些允许您显示和更改网络设置的命令:
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/screen_shot_2018-04-17_at_3.11.48_pm.png?itok=EZsjb-GQ)
-[经许可使用][9]
-
### 进程和系统信息
-在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能.。
+在 Windows 系统中,你可以使用任务管理器来查看所有正在运行的程序和服务的列表。你可以停止运行中的程序,并且可以在其中显示的某些选项卡中查看系统性能。
-在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可以使用的图形工具。大多数所共有的工具是 System Monitor 和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。
+在 Linux 系统下你可以使用命令行或者图形界面中做同样的事情。Linux 系统中根据你的发行版本会有不同的几个可用的图形工具。大多数所共有的工具是“系统监视器”和 KSysGuard。在这些工具中,你可以查看系统性能,查看进程列表甚至是杀死进程(图 3)。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-3_2.png?itok=ePeXj9PA)
-图 3:NetHogs 截图
-
-[经许可使用][9]
+*图 3:NetHogs 截图*
在这些工具中,你也可以查看系统全局网络流量(图 4)。
![System Monitor][11]
-图4: Gnome System Monitor 的截图
-
-[经许可使用][9]
+*图 4:Gnome System Monitor 的截图*
### 管理进程和系统使用
-您还可以从命令行使用相当多的工具。使用 ps 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 ps 命令不会使用可以使用命令 info ps 或者 man ps。
+您还可以从命令行使用相当多的工具。使用 `ps` 命令可以查看系统中的进程列表。默认情况下,这个命令的结果是显示当前终端会话下的所有进程列表。但是你也可以通过使用各种命令行参数显示其他进程。如果 `ps` 命令不会使用,可以使用命令 `info ps` 或者 `man ps` 获取帮助。
-大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或CPU时间的进程。这种情况下有两个非常简单的命令,分别是 top 和 htop 命令(图 5)。
+大多数人都希望得到一个进程列表,因为他们想要停止占用过多内存或 CPU 时间的进程。这种情况下有两个非常简单的命令,分别是 `top` 和 `htop` 命令(图 5)。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-5_0.png?itok=2nm5EmAl)
-top 和 htop 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。
+*图 5:top 截屏*
-使用两个命令时 (top and htop),你可以输入 ”?“ 来获取使用帮助,输入 ”q“ 来退出程序。使用 top 命令你可以按”k“键然后输入进程 ID 来杀死某个进程。
+`top` 和 `htop` 工具使用效果非常相似。两个命令每秒或者两秒会更新重新排序,这样会把占用 CPU 资源最多的放置在列表顶部。你也可以根据其他资源的使用情况比如内存使用情况来排序。
-使用 htop 命令时你可以使用 ↑↓ 键来将列表中的一条记录进行高亮显示,按下 F9 键会杀死进程(需要回车确认)。
+使用这两个命令时(`top` 和 `htop`),你可以输入 `?` 来获取使用帮助,输入 `q` 来退出程序。使用 `top` 命令你可以按 `k` 键然后输入进程 ID 来杀死某个进程。
+
+使用 `htop` 命令时你可以使用 `↑` `↓` 键来将列表中的一条记录进行高亮显示,按下 `F9` 键会杀死进程(需要回车确认)。
本系列中提供的信息和工具将帮助您开始使用 Linux。 只需一点时间和耐心,您就会感到这非常舒服。
-想学习更多 Linux 内容可访问免费的 ["Linux 简介" ][12]课程,此课程来自 Linux 基金会和 edx.
+想学习更多 Linux 内容可访问免费的 [Linux 简介][12]课程,此课程来自 Linux 基金会和 edx。
------
@@ -109,20 +95,20 @@ via: https://www.linux.com/blog/learn/2018/4/migrating-linux-network-and-system-
作者:[John Bonesio][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[ScarboroughCoral](https://github.com/ScarboroughCoral)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linux.com/users/johnbonesio
-[1]: https://www.linux.com/blog/learn/intro-to-linux/2017/10/migrating-linux-introduction
-[2]: https://www.linux.com/blog/learn/intro-to-linux/2017/11/migrating-linux-disks-files-and-filesystems
-[3]: https://www.linux.com/blog/learn/2017/12/migrating-linux-graphical-environments
-[4]: https://www.linux.com/blog/learn/2018/1/migrating-linux-command-line
-[5]: https://www.linux.com/blog/learn/2018/3/migrating-linux-using-sudo
-[6]: https://www.linux.com/blog/learn/2018/3/migrating-linux-installing-software
+[1]: https://linux.cn/article-9212-1.html
+[2]: https://linux.cn/article-9213-1.html
+[3]: https://linux.cn/article-9293-1.html
+[4]: https://linux.cn/article-9565-1.html
+[5]: https://linux.cn/article-9819-1.html
+[6]: https://linux.cn/article-9823-1.html
[7]: https://www.linux.com/files/images/figure-1png-2
-[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings"
+[8]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-1_2.png?itok=J-C6q-t5 "Network Settings"
[9]: https://www.linux.com/licenses/category/used-permission
[10]: https://www.linux.com/files/images/figure-4png-1
-[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor"
+[11]: https://www.linux.com/sites/lcom/files/styles/rendered_file/public/figure-4_1.png?itok=boI-L1mF "System Monitor"
[12]: https://training.linuxfoundation.org/linux-courses/system-administration-training/introduction-to-linux
From 5bae0d23ac4dfdf272d8cb162c8b1ddc0389daad Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 00:45:38 +0800
Subject: [PATCH 0176/4278] PUB:20180419 Migrating to Linux- Network and System
Settings.md
@ScarboroughCoral https://linux.cn/article-10363-1.html
---
.../20180419 Migrating to Linux- Network and System Settings.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180419 Migrating to Linux- Network and System Settings.md (100%)
diff --git a/translated/tech/20180419 Migrating to Linux- Network and System Settings.md b/published/20180419 Migrating to Linux- Network and System Settings.md
similarity index 100%
rename from translated/tech/20180419 Migrating to Linux- Network and System Settings.md
rename to published/20180419 Migrating to Linux- Network and System Settings.md
From 2b9a2b44cf96f43fa321c18b88f089658ff56f3f Mon Sep 17 00:00:00 2001
From: geekpi
Date: Wed, 19 Dec 2018 08:51:41 +0800
Subject: [PATCH 0177/4278] translated
---
...roken Ubuntu OS Without Reinstalling It.md | 78 -------------------
...roken Ubuntu OS Without Reinstalling It.md | 78 +++++++++++++++++++
2 files changed, 78 insertions(+), 78 deletions(-)
delete mode 100644 sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
create mode 100644 translated/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
deleted file mode 100644
index 0d24e0d7c6..0000000000
--- a/sources/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
+++ /dev/null
@@ -1,78 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: 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
-======
-
-![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg)
-
-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/
diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
new file mode 100644
index 0000000000..2fbdc6f07e
--- /dev/null
+++ b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
@@ -0,0 +1,78 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: 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: ( )
+
+如何不重装修复损坏的 Ubuntu 系统
+======
+
+![](https://www.ostechnix.com/wp-content/uploads/2018/12/Fix-Broken-Ubuntu-OS-720x340.jpg)
+
+今天,我在升级我的 Ubuntu 18.04 LTS 系统。不幸的是,在更新 Ubuntu 时中途断电,系统关机。电源恢复后,我再次启动系统。在登录页面输入密码后,它变成空白并且没有响应。键盘和鼠标也没有作用。我只看到一个空白的屏幕!值得庆幸的是,它只是一台测试机,并且没有重要的数据。我可以直接擦除整个系统然后重新安装。但是,我不想这样做。由于我没有什么可失去的,我只是想不重装修复我损坏的 Ubuntu 系统,并且我成功了!如果你发现自己处于像我这样的境地,不要惊慌。这个简短的教程描述了如何在不丢失数据的情况下轻松修复损坏的 Ubuntu 系统,而无需重新安装。
+
+### 修复损坏的 Ubuntu 系统
+
+首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统!
+
+在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。
+
+现在,逐个输入以下命令来修复损坏的 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
+```
+
+最后,使用命令重启系统:
+
+```
+$ sudo reboot
+```
+
+你现在可以像往常一样登录到你的 Ubuntu 系统。
+
+我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。
+
+这是这些了。希望这篇文章有用。
+
+还有更多好东西。敬请关注!
+
+干杯!
+
+
+
+--------------------------------------------------------------------------------
+
+via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-it/
+
+作者:[SK][a]
+选题:[lujun9972][b]
+译者:[geekpi](https://github.com/geekpi)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://www.ostechnix.com/author/sk/
+[b]: https://github.com/lujun9972
+[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
\ No newline at end of file
From 66b22351b1d9b10c097ad36d8989173e5bbe5166 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Wed, 19 Dec 2018 08:59:31 +0800
Subject: [PATCH 0178/4278] translating
---
...nt Dropbox Folder Locally As Virtual File System In Linux.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md
index 691600a4cc..ae559de4c6 100644
--- a/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md
+++ b/sources/tech/20181005 Dbxfs - Mount Dropbox Folder Locally As Virtual File System In Linux.md
@@ -1,3 +1,5 @@
+translating---geekpi
+
Dbxfs – Mount Dropbox Folder Locally As Virtual File System In Linux
======
From 31b5122870c1e31449d6db8a71b377806cb4e0d7 Mon Sep 17 00:00:00 2001
From: lxy <524187166@qq.com>
Date: Wed, 19 Dec 2018 09:35:33 +0800
Subject: [PATCH 0179/4278] update
---
... - Notmuch, mbsync, postfix and dovecot.md | 237 ------------------
... - Notmuch, mbsync, postfix and dovecot.md | 235 +++++++++++++++++
2 files changed, 235 insertions(+), 237 deletions(-)
delete mode 100644 sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
create mode 100644 translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
diff --git a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
deleted file mode 100644
index b239209c1b..0000000000
--- a/sources/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
+++ /dev/null
@@ -1,237 +0,0 @@
-translating by lixinyuxx
-
-My personal Email setup - Notmuch, mbsync, postfix and dovecot
-======
-I've been using personal email setup for quite long and have not documented it anywhere. Recently when I changed my laptop (a post is pending about it) I got lost trying to recreate my local mail setup. So this post is a self documentation so that I don't have to struggle again to get it right.
-
-### Server Side
-
-I run my own mail server and I use postfix as SMTP server and Dovecot for the IMAP purpose. I'm not going into detail of setting those up as my setup was mostly done by using scripts created by Jonas for Redpill infrastructure. What redpill is?. (In jonas's own words)
-
-> Redpill is a concept - a way to setup Debian hosts to collaborate across organisations I develop the concept, and use it for the first ever Redpill network-of-networks redpill.dk, involving my own network (jones.dk), my main client's network (homebase.dk), a network in Germany including Skolelinux Germany (free-owl.de), and Vasudev's network (copyninja.info)
-
-Along with that I have a dovecot sieve filtering to classify on high level mails into various folders depending on from where they originate. All the rules live in the ~/dovecot.sieve file under every account which has a mail address.
-
-Again I'm not going into detail of how to set these things up, as its not goal of my this post.
-
-### On my Laptop
-
-On my laptop I've following 4 parts setup
-
- 1. Mail syncing : Done using mbsync command
- 2. Classification: Done using notmuch
- 3. Reading: Done using notmuch-emacs
- 4. Mail sending: Done using postfix running as relay server and SMTP client.
-
-
-
-### Mail Syncing
-
-Mail syncing is done using mbsync tool, I was previously user of offlineimap and recently switched to mbsync as I felt it more lighter and simpler to configure than offlineimap. mbsync command is provided by package isync.
-
-Configuration file is ~/.mbsyncrc. Below is my sample content with some private things redacted.
-
-```
-IMAPAccount copyninja
-Host imap.copyninja.info
-User vasudev
-PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
-SSLType IMAPS
-SSLVersion TLSv1.2
-CertificateFile /etc/ssl/certs/ca-certificates.crt
-
-
-IMAPAccount gmail-kamathvasudev
-Host imap.gmail.com
-User kamathvasudev@gmail.com
-PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
-SSLType IMAPS
-SSLVersion TLSv1.2
-CertificateFile /etc/ssl/certs/ca-certificates.crt
-
-IMAPStore copyninja-remote
-Account copyninja
-
-IMAPStore gmail-kamathvasudev-remote
-Account gmail-kamathvasudev
-
-MaildirStore copyninja-local
-Path ~/Mail/vasudev-copyninja.info/
-Inbox ~/Mail/vasudev-copyninja.info/INBOX
-
-MaildirStore gmail-kamathvasudev-local
-Path ~/Mail/Gmail-1/
-Inbox ~/Mail/Gmail-1/INBOX
-
-Channel copyninja
-Master :copyninja-remote:
-Slave :copyninja-local:
-Patterns *
-Create Both
-SyncState *
-Sync All
-
-Channel gmail-kamathvasudev
-Master :gmail-kamathvasudev-remote:
-Slave :gmail-kamathvasudev-local:
-# Exclude everything under the internal [Gmail] folder, except the interesting folders
-Patterns * ![Gmail]*
-Create Both
-SyncState *
-Sync All
-```
-
-Explanation for some interesting part in above configuration. One is the PassCmd which allows you to provide shell command to obtain the password for the account. This avoids filling in the password in configuration file. I'm using symmetric encryption with gpg and storing password some where on my disk. Which is of course just safe guarded by Unix ACL.
-
-I actually wanted to use my public key to encrypt the file but unlocking the file when script is run in background or via systemd looks difficult (or looked nearly impossible). If you have better suggestion I'm all ears :-).
-
-Next instruction part is Patterns. This allows you to selectively sync mail from your mail server. This was really helpful for me to exclude all crappy [Gmail]/ folders.
-
-### Mail Classification
-
-Once mail is locally on your device, we need a way to read the mails easily in a mail reader. My original setup was serving synced Maildir using local dovecot instance and read it in Gnus. This setup was bit of a over kill with all server software setups but inability of Gnus to not cope well with Maildir format this was best way to do it. This setup also has a disadvantage, that is searching a mail quickly when you have huge pile of mail to go through. This is where notmuch comes into picture.
-
-notmuch allows me to easily index through Gigabytes of my mail archives and get what I need very easily. I've created a small script which combines executing of mbsync and notmuch execution. I tag mails based on the Maildirs which are actually created on server side using dovecot sieve. Below is my full shell script which is doing task of syncing classification and deleting of spams.
-
-```
-#!/bin/sh
-
-MBSYNC=$(pgrep mbsync)
-NOTMUCH=$(pgrep notmuch)
-
-if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
- echo "Already running one instance of mail-sync. Exiting..."
- exit 0
-fi
-
-echo "Deleting messages tagged as *deleted*"
-notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v
-
-echo "Moving spam to Spam folder"
-notmuch search --format=text0 --output=files tag:Spam and \
- to:vasudev@copyninja.info | \
- xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
-notmuch search --format=text0 --output=files tag:Spam and
- to:vasudev-debian@copyninja.info | \
- xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
-
-
-MDIR="vasudev-copyninja.info vasudev-debian Gmail-1"
-mbsync -Va
-notmuch new
-
-for mdir in $MDIR; do
- echo "Processing $mdir"
- for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do
- if [ $(basename $fdir) != "INBOX" ]; then
- echo "Tagging for $(basename $fdir)"
- notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir)
- fi
- done
-done
-```
-
-So before running mbsync I search for all mails tagged as deleted and delete them from system. Next I look for mails tagged as Spam on both my accounts and move it to Spam folder. Yeah you got it right these are mails escaping the spam filter and landing in my inbox and personally marked as Spam.
-
-After running mbsync I tag mails based on their folder (searching string folder:). This allows me easily get contents of lets say a mailing list without remembering the list address.
-
-### Reading Mails
-
-Now that we have synced and classified mail its time to setup the reading part. I use notmuch-emacs interface to read the mails. I use Spacemacs flavor of emacs so I took some time to write down the a private layer which brings together all my keybindings and classification in one place and does not clutter my entire .spacemacs file. You can find the code for my private layer in [notmuch-emacs-layer repository][1]
-
-### Sending Mails
-
-Well its not sufficient that if we can read mails, we need to be able to reply to mail. And this was the slightly tricky part where I recently got lost and had to write this post so that I don't forget it again. (And of course don't have to refer some outdated posts on web).
-
-My setup to send mails is using postfix as SMTP client with my own SMTP server as relayhost for it. The problem of relaying is it's not for the hosts with dynamic IP. There are couple of ways to allow hosts with dynamic IP to use relay servers, one is put the IP address from where mail will originate into my_network or second use SASL authentication.
-
-My preferred way is use of SASL authentication. For this I first had to create a separate account one for each machine which is going to relay the mails to my main server. Idea is to not use my primary account for SASL authentication. (Originally I was using primary account, but Jonas gave this idea of account per road runner).
-```
-adduser _relay
-
-```
-
-Here replace with name of your laptop/desktop or whatever you are using. Now we need to adjust postfix to act as relaying server. So add following lines to postfix configuration
-```
-# SASL authentication
-smtp_sasl_auth_enable = yes
-smtp_tls_security_level = encrypt
-smtp_sasl_tls_security_options = noanonymous
-relayhost = [smtp.copyninja.info]:submission
-smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
-```
-
-So here relayhost is the server name which your postfix instance will be using to relay mails forward into internet. :submission part tells postfix to forward mail on to port 587 (secure). smtp_sasl_tls_security_options is set to disallow anonymous connection. This is must so that relay server trusts your mobile host and agrees to forward the mail for you.
-
-/etc/postfix/sasl_passwd is the file where you need to store password for account to be used for SASL authentication with server. Put following content into it.
-```
-[smtp.example.com]:submission user:password
-
-```
-
-Replace smtp.example.com with your SMTP server name which you have put in relayhost configuration. Replace user with _relay user you created and its password.
-
-To secure the sasl_passwd file and create a hash of it for postfix use following command.
-```
-chown root:root /etc/postfix/sasl_passwd
-chmod 0600 /etc/postfix/sasl_passwd
-postmap /etc/postfix/sasl_passwd
-```
-
-The last command will create /etc/postfix/sasl_passwd.db file which is hash of your file /etc/postfix/sasl_passwd with same owner and permission. Now reload the postfix and check if mail makes out of your system using mail command.
-
-### Bonus Part
-
-Well since I've a script created above bringing together mail syncing and classification. I went ahead and created a systemd timer to periodically sync mails in the background. In my case every 10 minutes. Below is mailsync.timer file.
-```
-[Unit]
-Description=Check Mail Every 10 minutes
-RefuseManualStart=no
-RefuseManualStop=no
-
-[Timer]
-Persistent=false
-OnBootSec=5min
-OnUnitActiveSec=10min
-Unit=mailsync.service
-
-[Install]
-WantedBy=default.target
-```
-
-Below is mailsync.service which is needed by mailsync.timer to execute our scripts.
-
-```
-[Unit]
-Description=Check Mail
-RefuseManualStart=no
-RefuseManualStop=yes
-
-[Service]
-Type=oneshot
-ExecStart=/usr/local/bin/mail-sync
-StandardOutput=syslog
-StandardError=syslog
-```
-
-Put these files under /etc/systemd/user and run below command to enable them.
-```
-systemctl enable --user mailsync.timer
-systemctl enable --user mailsync.service
-systemctl start --user mailsync.timer
-```
-
-So that's how I've sync and send mail from my system. I came to know about afew from Jonas Smedegaard who also proof read this post. So next step I will try to improve my notmuch configuration using afew and of course a post will follow after that :-).
-
---------------------------------------------------------------------------------
-
-via: https://copyninja.info/blog/email_setup.html
-
-作者:[copyninja][a]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:https://copyninja.info
-[1]:https://source.copyninja.info/notmuch-emacs-layer.git/
diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
new file mode 100644
index 0000000000..ffbf6d11a7
--- /dev/null
+++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
@@ -0,0 +1,235 @@
+我的个人电子邮件系统 - Notmuch, mbsync, postfix and dovecot
+======
+我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷路了。所以这篇文章是一个自我文档, 这样我就不用再挣扎了就能改正过来。
+
+### 服务器端
+
+我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说)
+
+> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我发展了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info)
+
+除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。
+
+再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。
+
+### 在我的笔记本电脑上
+
+在我的笔记本电脑上, 我已经按照4个部分设置
+
+ 1. 邮件同步: 使用 mbsync 命令完成
+ 2. 分类: 使用 notmuch 完成
+ 3. 阅读: 使用 notmuch-emacs 完成
+ 4. 邮件发送: 使用作为转接服务器和 SMTP 客户端运行的 postfix 完成。
+
+
+
+### 邮件同步
+
+邮件同步是使用 mbsync 工具完成的, 我以前是离线的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。
+
+配置文件是 ~/.mbsyncrc. 下面是我的例子与一些私人设置。
+
+```
+IMAPAccount copyninja
+Host imap.copyninja.info
+User vasudev
+PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
+SSLType IMAPS
+SSLVersion TLSv1.2
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+
+IMAPAccount gmail-kamathvasudev
+Host imap.gmail.com
+User kamathvasudev@gmail.com
+PassCmd "gpg -q --for-your-eyes-only --no-tty --exit-on-status-write-error --batch --passphrase-file ~/path/to/passphrase.txt -d ~/path/to/mailpass.gpg"
+SSLType IMAPS
+SSLVersion TLSv1.2
+CertificateFile /etc/ssl/certs/ca-certificates.crt
+
+IMAPStore copyninja-remote
+Account copyninja
+
+IMAPStore gmail-kamathvasudev-remote
+Account gmail-kamathvasudev
+
+MaildirStore copyninja-local
+Path ~/Mail/vasudev-copyninja.info/
+Inbox ~/Mail/vasudev-copyninja.info/INBOX
+
+MaildirStore gmail-kamathvasudev-local
+Path ~/Mail/Gmail-1/
+Inbox ~/Mail/Gmail-1/INBOX
+
+Channel copyninja
+Master :copyninja-remote:
+Slave :copyninja-local:
+Patterns *
+Create Both
+SyncState *
+Sync All
+
+Channel gmail-kamathvasudev
+Master :gmail-kamathvasudev-remote:
+Slave :gmail-kamathvasudev-local:
+# Exclude everything under the internal [Gmail] folder, except the interesting folders
+Patterns * ![Gmail]*
+Create Both
+SyncState *
+Sync All
+```
+
+对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我使用对称加密与 gpg 和存储密码在我的磁盘上的一些地方。这当然是由 Unix ACL 保护安全。
+
+实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。
+
+下一个指令部分是模式。这使您可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders.
+
+### 邮件分类
+
+一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置是有点大题小作相比于设置所有服务器软件, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。
+
+不多让我很容易索引通过千兆字节的邮件档案, 并很容易得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。
+
+```
+#!/bin/sh
+
+MBSYNC=$(pgrep mbsync)
+NOTMUCH=$(pgrep notmuch)
+
+if [ -n "$MBSYNC" -o -n "$NOTMUCH" ]; then
+ echo "Already running one instance of mail-sync. Exiting..."
+ exit 0
+fi
+
+echo "Deleting messages tagged as *deleted*"
+notmuch search --format=text0 --output=files tag:deleted |xargs -0 --no-run-if-empty rm -v
+
+echo "Moving spam to Spam folder"
+notmuch search --format=text0 --output=files tag:Spam and \
+ to:vasudev@copyninja.info | \
+ xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
+notmuch search --format=text0 --output=files tag:Spam and
+ to:vasudev-debian@copyninja.info | \
+ xargs -0 -I {} --no-run-if-empty mv -v {} ~/Mail/vasudev-copyninja.info/Spam/cur
+
+
+MDIR="vasudev-copyninja.info vasudev-debian Gmail-1"
+mbsync -Va
+notmuch new
+
+for mdir in $MDIR; do
+ echo "Processing $mdir"
+ for fdir in $(ls -d /home/vasudev/Mail/$mdir/*); do
+ if [ $(basename $fdir) != "INBOX" ]; then
+ echo "Tagging for $(basename $fdir)"
+ notmuch tag +$(basename $fdir) -inbox -- folder:$mdir/$(basename $fdir)
+ fi
+ done
+done
+```
+
+因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对, 这些邮件逃脱垃圾邮件过滤器进到我的 inbox, 并被我亲自标记为垃圾邮件。
+
+运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。
+
+### 阅读邮件
+
+现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层, 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。
+
+### 发送邮件
+
+如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是我最近迷惑的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。
+
+我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。
+
+我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法
+```
+adduser _relay
+
+```
+
+这里替换 与您的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行
+```
+# SASL authentication
+smtp_sasl_auth_enable = yes
+smtp_tls_security_level = encrypt
+smtp_sasl_tls_security_options = noanonymous
+relayhost = [smtp.copyninja.info]:submission
+smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
+```
+
+因此, 这里的 relayhost 是您的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任您的移动主机, 并同意为您转发邮件。
+
+/etc/postfix/sasl__asswd 是您需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。
+```
+[smtp.example.com]:submission user:password
+
+```
+
+替换 smtp.example.com 用你的 SMTP 服务器名称, 您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。
+
+若要保护 sasl_passwd 文件, 并创建它的哈希值进行 postfix 使用以下命令。
+```
+chown root:root /etc/postfix/sasl_passwd
+chmod 0600 /etc/postfix/sasl_passwd
+postmap /etc/postfix/sasl_passwd
+```
+
+最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的哈希值 /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。
+
+### Bonus 的部分
+
+好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。
+```
+[Unit]
+Description=Check Mail Every 10 minutes
+RefuseManualStart=no
+RefuseManualStop=no
+
+[Timer]
+Persistent=false
+OnBootSec=5min
+OnUnitActiveSec=10min
+Unit=mailsync.service
+
+[Install]
+WantedBy=default.target
+```
+
+下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。
+
+```
+[Unit]
+Description=Check Mail
+RefuseManualStart=no
+RefuseManualStop=yes
+
+[Service]
+Type=oneshot
+ExecStart=/usr/local/bin/mail-sync
+StandardOutput=syslog
+StandardError=syslog
+```
+
+将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启他们
+```
+systemctl enable --user mailsync.timer
+systemctl enable --user mailsync.service
+systemctl start --user mailsync.timer
+```
+
+这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew 他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。
+
+--------------------------------------------------------------------------------
+
+via: https://copyninja.info/blog/email_setup.html
+
+作者:[copyninja][a]
+译者:[lixinyuxx](https://github.com/lixinyuxx)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://copyninja.info
+[1]:https://source.copyninja.info/notmuch-emacs-layer.git/
From 9b1bba79fda1b38b9df99d31607edf9c7d545de6 Mon Sep 17 00:00:00 2001
From: lxy <524187166@qq.com>
Date: Wed, 19 Dec 2018 09:40:41 +0800
Subject: [PATCH 0180/4278] 20180101
---
...en solutions to everything in education.md | 113 ------------------
...en solutions to everything in education.md | 110 +++++++++++++++++
2 files changed, 110 insertions(+), 113 deletions(-)
delete mode 100644 sources/tech/20180101 27 open solutions to everything in education.md
create mode 100644 translated/tech/20180101 27 open solutions to everything in education.md
diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md
deleted file mode 100644
index eeba3692e4..0000000000
--- a/sources/tech/20180101 27 open solutions to everything in education.md
+++ /dev/null
@@ -1,113 +0,0 @@
-translating by lixinyuxx
-
-27 open solutions to everything in education
-======
-![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo)
-
-Openness (from open source software, to open hardware, to open principles) is changing the paradigm of education. So, to celebrate all that's gone on this year, I collected 27 of the best articles published on Opensource.com in 2017 on the subject. I divided them into broad themes, rather than ordering them by popularity. And, if these 27 stories don't satisfy your appetite for information about open source in education, check out our companion article on how [education is leveraging Raspberry Pi and Linux][30].
-
-### Open is better for everyone
-
-1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt reviews David Price's book OPEN, which explores the idea that "open" isn't just a technological shift, rather it's "how we'll work, live, and learn in the future."
-
-2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur points out how to get ahead in the workforce by learning open source. This advice isn't just for programmers; designers, writers, marketers, and other creative professionals are also essential to the success of open source.
-
-3. [A graduate degree could springboard you into an open source job][3]: Citing research that shows that Linux skills lead to higher pay, Joshua Pearce makes the case that open source proficiency and a graduate degree are an unbeatable career combination.
-
-4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger shows us how open practices are creating a more inclusive, agile, and open culture in a Pennsylvania school district. Charlie says it's not just about saving money; the district also gains from "open leadership principles that foster innovation among teachers and students, help to better engage the community, and create a more vibrant and inclusive learning community."
-
-5. [15 ways to empower students with open source tools][5]: I write how open source gives students the freedom to explore, tinker, and learn, whether they're learning basic digital literacy or expanding on those skills with fun projects.
-
-6. [Developer opportunities to code for good][6]: Open source is often the backbone of socially beneficial projects. As Ahn Bui, vice president of Benetech Labs, states in this interview: "Establishing open data standards is an integral step in breaking down data silos. Those open standards will provide the foundation for interoperability and in turn, translate to more organizations building together, often more cost effectively. The ultimate goal is to serve more people at the same cost or even less."
-
-### Open education resources for remixing and reusing
-
-1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis, director of programs for Wiki Ed, discusses how open educational resources (OERs), such as Wiki Ed, are providing high-quality and affordable open source learning resources as classroom teaching tools.
-
-2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, director of open education for Creative Commons, shares how the face of education is changing in higher education and what Creative Commons is doing to facilitate it.
-
-3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites, community evangelist and chief marketing officer of Open Up Resources, talks about the nonprofit organization's efforts to provide open, standards-aligned curricula for K-12 schools.
-
-4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke, educational technologist at the University of Hawaii at Manoa, says that transitioning to OER in college courses will "empower faculty to take control of what content they teach with, which we expect will result in their saving students money."
-
-5. [How open courses are slashing the cost of higher education][11]: Saylor Academy's director of education Devon Ritter reports how Saylor is building its college credit-eligible courses on openly licensed content, with the goal of making higher education affordable and accessible to more people.
-
-6. [Open educational resources movement gains speed][12]: Alexis Clifton, executive director of the State University of New York OER Services, describes how New York's US$ 8 million investment is spurring growth in open education and making college more affordable.
-
-7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik from Duke University explores OSPRI (Open Source Pedagogy Research and Innovation), a collaboration between Duke and Red Hat that's building a 21st-century, preK-12 learning ecosystem that is open by design.
-
-8. [Perma.cc stops scholarly link rot][14]: Virginia Tech's Phillip Young writes about Perma.cc, a solution to "link rot," which is the high probability that hyperlinks in academic papers will disappear or change over time.
-
-9. [Open education: How students save money by creating open textbooks][15]: OER pioneer Robin DeRosa talks about "the freedom that the openly licensed textbook introduced, and the overarching idea that education and learning should be contextualized in inclusive ecosystems that enhance the public good."
-
-### Open source tools in the classroom
-
-1. [How an open source board game is saving the planet][16]: Joshua Pearce writes about Save the Planet, a board game that empowers students to solve environmental problems while having fun and contributing to the maker community.
-
-2. [A new Android app for teaching kids how to read][17]: Michael Hall talks about Phoenicia, a children's literacy app he developed after his son was diagnosed with autism, the value of coding for good, and why user testing matters more than you think.
-
-3. [8 open source Android apps for education][18]: Joshua Allen Holm challenges us to use our smartphones as learning tools by recommending eight open source apps from the F-Droid repository to try.
-
-4. [3 open source alternatives to MATLAB][19]: Jason Baker's update to his 2016 survey of open source mathematical computing software presents alternatives to MATLAB, the expensive, proprietary solution nearly ubiquitous in mathematics, physical sciences, engineering, and economics.
-
-5. [What does SVG have to do with teaching kids to code?][20] Retired engineer Jay Nick talks about how he uses art as a creative way to introduce students to coding. He volunteers in schools, using Scalable Vector Graphics (SVG) to teach an approach to coding that combines principles of mathematics and art.
-
-6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, who holds a PhD in fine arts from Texas Tech, shares his experience using open source tools in a world ruled by proprietary solutions. Kyle says there's a bias against using open source in disciplines outside of computer science: "Many people think non-technical students can't use Linux, and they make a lot of assumptions about people who use it in their advanced degree programs. … Well, it is possible, and I'm proof."
-
-7. [A list of open source tools for college][22]: Aaron Cocker outlines the open source tools (including presentation, backup, and programming software) he uses while working on his undergraduate degree in computer science.
-
-8. [5 great KDE apps to help you study][23]: Zsolt Szakács offers five KDE applications that help anyone who wants to learn new skills or cultivate existing ones.
-
-### Coding in the classroom
-
-1. [How to get the next generation coding early][24]: Bryson Payne says we need to teach kids to code before high school: By ninth grade 80% of girls and 60% of boys have already self-selected out of a STEM career. But it's not only about jobs and closing the IT skills gap, he suggests. "Teaching a young person to code could be the single most life-changing skill you can give them. And it's not just a career-enhancer. Coding is about problem-solving, it's about creativity, and more importantly, it's about empowerment."
-
-2. [Kids can't code without computers][25]: Patrick Masson introduces the FLOSS Desktops for Kids program, which teaches students at underserved schools to repurpose older computers with open source software, such as Linux, LibreOffice, and GIMP. Not only is the program breathing new life into broken or decommissioned hardware, it's also giving students important skills that may translate into future careers.
-
-3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva offers suggestions for using [Scratch][27] to spark kids' interest in programming, just as LOGO did when he started using it in the 1980s.
-
-4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger describes App Inventor, a programming framework for building Android applications using a visual blocks language (similar to Scratch or [Snap][29]).
-
-Throughout the year we learned that there is an open solution to everything in education, and I expect this theme to continue in 2018 and beyond. Are there open education topics you'd like Opensource.com to cover in the coming year? If so, please share your ideas in the comments.
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/1/best-open-education
-
-作者:[Don Watkins][a]
-译者:[译者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
-[1]:https://opensource.com/article/17/7/book-review-open
-[2]:https://opensource.com/article/17/8/jump-start-your-career
-[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab
-[4]:https://opensource.com/article/17/7/open-school-leadership
-[5]:https://opensource.com/article/17/7/empower-students-open-source-tools
-[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs
-[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation
-[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons
-[9]:https://opensource.com/article/17/1/open-up-resources
-[10]:https://opensource.com/article/17/2/interview-education-billy-meinke
-[11]:https://opensource.com/article/17/7/college-alternatives
-[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton
-[13]:https://opensource.com/article/17/3/education-should-be-open-design
-[14]:https://opensource.com/article/17/9/stop-link-rot-permacc
-[15]:https://opensource.com/article/17/11/creating-open-textbooks
-[16]:https://opensource.com/article/17/7/save-planet-board-game
-[17]:https://opensource.com/article/17/4/phoenicia-education-software
-[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education
-[19]:https://opensource.com/alternatives/matlab
-[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
-[21]:https://opensource.com/article/17/5/how-linux-higher-education
-[22]:https://opensource.com/article/17/6/open-source-tools-university-student
-[23]:https://opensource.com/article/17/6/kde-education-software
-[24]:https://opensource.com/article/17/8/teach-kid-code-change-life
-[25]:https://opensource.com/article/17/9/floss-desktops-kids
-[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids
-[27]:https://scratch.mit.edu/
-[28]:https://opensource.com/article/17/8/app-inventor-android-app-development
-[29]:http://snap.berkeley.edu/
-[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education
diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md
new file mode 100644
index 0000000000..898a4250ab
--- /dev/null
+++ b/translated/tech/20180101 27 open solutions to everything in education.md
@@ -0,0 +1,110 @@
+27个解决教学问题的开放式方法
+======
+![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo)
+
+开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的协同文章吧 " [education is leveraging Raspberry Pi and Linux][30].
+
+### 开放对每个人都有好处
+
+1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 "开放" 不仅仅是技术转变的观点, 而是 "我们未来将如何工作、生活和学习"。
+
+2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。
+
+3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。
+
+4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 "开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区"。
+
+5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。
+
+6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: "建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。
+
+### 用于再混合和再利用的开放教育资源
+
+1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。
+
+2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。
+
+3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,Open Up Resources 的社区福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。
+
+4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke夏威夷大学马诺阿分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 "使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用"。
+
+5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。
+
+6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。
+
+7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。
+
+8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, "link rot,"(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。
+
+9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 "公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念"。
+
+### 课堂上的开源工具
+
+1. [How an open source board game is saving the planet][16]: Joshua Pearce 写关于拯救地球, 一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。
+
+2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。
+
+3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。
+
+4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专有解决方案。
+
+5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。
+
+6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位 分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:"很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。
+
+7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。
+
+8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。
+
+### 在教室编码
+
+1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。"教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。
+
+2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破碎或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会转化为未来的职业。
+
+3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提供 [Scratch][27] 的使用建议激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。
+
+4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]).
+
+在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放的教育主题?如果是, 请在评论中分享你的想法。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/1/best-open-education
+
+作者:[Don Watkins][a]
+译者:[lixinyuxx](https://github.com/lixinyuxx)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://opensource.com/users/don-watkins
+[1]:https://opensource.com/article/17/7/book-review-open
+[2]:https://opensource.com/article/17/8/jump-start-your-career
+[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab
+[4]:https://opensource.com/article/17/7/open-school-leadership
+[5]:https://opensource.com/article/17/7/empower-students-open-source-tools
+[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs
+[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation
+[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons
+[9]:https://opensource.com/article/17/1/open-up-resources
+[10]:https://opensource.com/article/17/2/interview-education-billy-meinke
+[11]:https://opensource.com/article/17/7/college-alternatives
+[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton
+[13]:https://opensource.com/article/17/3/education-should-be-open-design
+[14]:https://opensource.com/article/17/9/stop-link-rot-permacc
+[15]:https://opensource.com/article/17/11/creating-open-textbooks
+[16]:https://opensource.com/article/17/7/save-planet-board-game
+[17]:https://opensource.com/article/17/4/phoenicia-education-software
+[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education
+[19]:https://opensource.com/alternatives/matlab
+[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
+[21]:https://opensource.com/article/17/5/how-linux-higher-education
+[22]:https://opensource.com/article/17/6/open-source-tools-university-student
+[23]:https://opensource.com/article/17/6/kde-education-software
+[24]:https://opensource.com/article/17/8/teach-kid-code-change-life
+[25]:https://opensource.com/article/17/9/floss-desktops-kids
+[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids
+[27]:https://scratch.mit.edu/
+[28]:https://opensource.com/article/17/8/app-inventor-android-app-development
+[29]:http://snap.berkeley.edu/
From 47c856dc6c4fd72c084a5c578626530adadc568e Mon Sep 17 00:00:00 2001
From: lxy <524187166@qq.com>
Date: Wed, 19 Dec 2018 09:41:57 +0800
Subject: [PATCH 0181/4278] Revert "20180101"
This reverts commit 9b1bba79fda1b38b9df99d31607edf9c7d545de6.
---
...en solutions to everything in education.md | 113 ++++++++++++++++++
...en solutions to everything in education.md | 110 -----------------
2 files changed, 113 insertions(+), 110 deletions(-)
create mode 100644 sources/tech/20180101 27 open solutions to everything in education.md
delete mode 100644 translated/tech/20180101 27 open solutions to everything in education.md
diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md
new file mode 100644
index 0000000000..eeba3692e4
--- /dev/null
+++ b/sources/tech/20180101 27 open solutions to everything in education.md
@@ -0,0 +1,113 @@
+translating by lixinyuxx
+
+27 open solutions to everything in education
+======
+![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo)
+
+Openness (from open source software, to open hardware, to open principles) is changing the paradigm of education. So, to celebrate all that's gone on this year, I collected 27 of the best articles published on Opensource.com in 2017 on the subject. I divided them into broad themes, rather than ordering them by popularity. And, if these 27 stories don't satisfy your appetite for information about open source in education, check out our companion article on how [education is leveraging Raspberry Pi and Linux][30].
+
+### Open is better for everyone
+
+1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt reviews David Price's book OPEN, which explores the idea that "open" isn't just a technological shift, rather it's "how we'll work, live, and learn in the future."
+
+2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur points out how to get ahead in the workforce by learning open source. This advice isn't just for programmers; designers, writers, marketers, and other creative professionals are also essential to the success of open source.
+
+3. [A graduate degree could springboard you into an open source job][3]: Citing research that shows that Linux skills lead to higher pay, Joshua Pearce makes the case that open source proficiency and a graduate degree are an unbeatable career combination.
+
+4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger shows us how open practices are creating a more inclusive, agile, and open culture in a Pennsylvania school district. Charlie says it's not just about saving money; the district also gains from "open leadership principles that foster innovation among teachers and students, help to better engage the community, and create a more vibrant and inclusive learning community."
+
+5. [15 ways to empower students with open source tools][5]: I write how open source gives students the freedom to explore, tinker, and learn, whether they're learning basic digital literacy or expanding on those skills with fun projects.
+
+6. [Developer opportunities to code for good][6]: Open source is often the backbone of socially beneficial projects. As Ahn Bui, vice president of Benetech Labs, states in this interview: "Establishing open data standards is an integral step in breaking down data silos. Those open standards will provide the foundation for interoperability and in turn, translate to more organizations building together, often more cost effectively. The ultimate goal is to serve more people at the same cost or even less."
+
+### Open education resources for remixing and reusing
+
+1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis, director of programs for Wiki Ed, discusses how open educational resources (OERs), such as Wiki Ed, are providing high-quality and affordable open source learning resources as classroom teaching tools.
+
+2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, director of open education for Creative Commons, shares how the face of education is changing in higher education and what Creative Commons is doing to facilitate it.
+
+3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites, community evangelist and chief marketing officer of Open Up Resources, talks about the nonprofit organization's efforts to provide open, standards-aligned curricula for K-12 schools.
+
+4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke, educational technologist at the University of Hawaii at Manoa, says that transitioning to OER in college courses will "empower faculty to take control of what content they teach with, which we expect will result in their saving students money."
+
+5. [How open courses are slashing the cost of higher education][11]: Saylor Academy's director of education Devon Ritter reports how Saylor is building its college credit-eligible courses on openly licensed content, with the goal of making higher education affordable and accessible to more people.
+
+6. [Open educational resources movement gains speed][12]: Alexis Clifton, executive director of the State University of New York OER Services, describes how New York's US$ 8 million investment is spurring growth in open education and making college more affordable.
+
+7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik from Duke University explores OSPRI (Open Source Pedagogy Research and Innovation), a collaboration between Duke and Red Hat that's building a 21st-century, preK-12 learning ecosystem that is open by design.
+
+8. [Perma.cc stops scholarly link rot][14]: Virginia Tech's Phillip Young writes about Perma.cc, a solution to "link rot," which is the high probability that hyperlinks in academic papers will disappear or change over time.
+
+9. [Open education: How students save money by creating open textbooks][15]: OER pioneer Robin DeRosa talks about "the freedom that the openly licensed textbook introduced, and the overarching idea that education and learning should be contextualized in inclusive ecosystems that enhance the public good."
+
+### Open source tools in the classroom
+
+1. [How an open source board game is saving the planet][16]: Joshua Pearce writes about Save the Planet, a board game that empowers students to solve environmental problems while having fun and contributing to the maker community.
+
+2. [A new Android app for teaching kids how to read][17]: Michael Hall talks about Phoenicia, a children's literacy app he developed after his son was diagnosed with autism, the value of coding for good, and why user testing matters more than you think.
+
+3. [8 open source Android apps for education][18]: Joshua Allen Holm challenges us to use our smartphones as learning tools by recommending eight open source apps from the F-Droid repository to try.
+
+4. [3 open source alternatives to MATLAB][19]: Jason Baker's update to his 2016 survey of open source mathematical computing software presents alternatives to MATLAB, the expensive, proprietary solution nearly ubiquitous in mathematics, physical sciences, engineering, and economics.
+
+5. [What does SVG have to do with teaching kids to code?][20] Retired engineer Jay Nick talks about how he uses art as a creative way to introduce students to coding. He volunteers in schools, using Scalable Vector Graphics (SVG) to teach an approach to coding that combines principles of mathematics and art.
+
+6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, who holds a PhD in fine arts from Texas Tech, shares his experience using open source tools in a world ruled by proprietary solutions. Kyle says there's a bias against using open source in disciplines outside of computer science: "Many people think non-technical students can't use Linux, and they make a lot of assumptions about people who use it in their advanced degree programs. … Well, it is possible, and I'm proof."
+
+7. [A list of open source tools for college][22]: Aaron Cocker outlines the open source tools (including presentation, backup, and programming software) he uses while working on his undergraduate degree in computer science.
+
+8. [5 great KDE apps to help you study][23]: Zsolt Szakács offers five KDE applications that help anyone who wants to learn new skills or cultivate existing ones.
+
+### Coding in the classroom
+
+1. [How to get the next generation coding early][24]: Bryson Payne says we need to teach kids to code before high school: By ninth grade 80% of girls and 60% of boys have already self-selected out of a STEM career. But it's not only about jobs and closing the IT skills gap, he suggests. "Teaching a young person to code could be the single most life-changing skill you can give them. And it's not just a career-enhancer. Coding is about problem-solving, it's about creativity, and more importantly, it's about empowerment."
+
+2. [Kids can't code without computers][25]: Patrick Masson introduces the FLOSS Desktops for Kids program, which teaches students at underserved schools to repurpose older computers with open source software, such as Linux, LibreOffice, and GIMP. Not only is the program breathing new life into broken or decommissioned hardware, it's also giving students important skills that may translate into future careers.
+
+3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva offers suggestions for using [Scratch][27] to spark kids' interest in programming, just as LOGO did when he started using it in the 1980s.
+
+4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger describes App Inventor, a programming framework for building Android applications using a visual blocks language (similar to Scratch or [Snap][29]).
+
+Throughout the year we learned that there is an open solution to everything in education, and I expect this theme to continue in 2018 and beyond. Are there open education topics you'd like Opensource.com to cover in the coming year? If so, please share your ideas in the comments.
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/1/best-open-education
+
+作者:[Don Watkins][a]
+译者:[译者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
+[1]:https://opensource.com/article/17/7/book-review-open
+[2]:https://opensource.com/article/17/8/jump-start-your-career
+[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab
+[4]:https://opensource.com/article/17/7/open-school-leadership
+[5]:https://opensource.com/article/17/7/empower-students-open-source-tools
+[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs
+[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation
+[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons
+[9]:https://opensource.com/article/17/1/open-up-resources
+[10]:https://opensource.com/article/17/2/interview-education-billy-meinke
+[11]:https://opensource.com/article/17/7/college-alternatives
+[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton
+[13]:https://opensource.com/article/17/3/education-should-be-open-design
+[14]:https://opensource.com/article/17/9/stop-link-rot-permacc
+[15]:https://opensource.com/article/17/11/creating-open-textbooks
+[16]:https://opensource.com/article/17/7/save-planet-board-game
+[17]:https://opensource.com/article/17/4/phoenicia-education-software
+[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education
+[19]:https://opensource.com/alternatives/matlab
+[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
+[21]:https://opensource.com/article/17/5/how-linux-higher-education
+[22]:https://opensource.com/article/17/6/open-source-tools-university-student
+[23]:https://opensource.com/article/17/6/kde-education-software
+[24]:https://opensource.com/article/17/8/teach-kid-code-change-life
+[25]:https://opensource.com/article/17/9/floss-desktops-kids
+[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids
+[27]:https://scratch.mit.edu/
+[28]:https://opensource.com/article/17/8/app-inventor-android-app-development
+[29]:http://snap.berkeley.edu/
+[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education
diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md
deleted file mode 100644
index 898a4250ab..0000000000
--- a/translated/tech/20180101 27 open solutions to everything in education.md
+++ /dev/null
@@ -1,110 +0,0 @@
-27个解决教学问题的开放式方法
-======
-![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo)
-
-开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的协同文章吧 " [education is leveraging Raspberry Pi and Linux][30].
-
-### 开放对每个人都有好处
-
-1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 "开放" 不仅仅是技术转变的观点, 而是 "我们未来将如何工作、生活和学习"。
-
-2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。
-
-3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。
-
-4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 "开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区"。
-
-5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。
-
-6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: "建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。
-
-### 用于再混合和再利用的开放教育资源
-
-1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。
-
-2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。
-
-3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,Open Up Resources 的社区福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。
-
-4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke夏威夷大学马诺阿分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 "使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用"。
-
-5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。
-
-6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。
-
-7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。
-
-8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, "link rot,"(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。
-
-9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 "公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念"。
-
-### 课堂上的开源工具
-
-1. [How an open source board game is saving the planet][16]: Joshua Pearce 写关于拯救地球, 一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。
-
-2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。
-
-3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。
-
-4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专有解决方案。
-
-5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。
-
-6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位 分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:"很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。
-
-7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。
-
-8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。
-
-### 在教室编码
-
-1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。"教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。
-
-2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破碎或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会转化为未来的职业。
-
-3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提供 [Scratch][27] 的使用建议激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。
-
-4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]).
-
-在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放的教育主题?如果是, 请在评论中分享你的想法。
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/1/best-open-education
-
-作者:[Don Watkins][a]
-译者:[lixinyuxx](https://github.com/lixinyuxx)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]:https://opensource.com/users/don-watkins
-[1]:https://opensource.com/article/17/7/book-review-open
-[2]:https://opensource.com/article/17/8/jump-start-your-career
-[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab
-[4]:https://opensource.com/article/17/7/open-school-leadership
-[5]:https://opensource.com/article/17/7/empower-students-open-source-tools
-[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs
-[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation
-[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons
-[9]:https://opensource.com/article/17/1/open-up-resources
-[10]:https://opensource.com/article/17/2/interview-education-billy-meinke
-[11]:https://opensource.com/article/17/7/college-alternatives
-[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton
-[13]:https://opensource.com/article/17/3/education-should-be-open-design
-[14]:https://opensource.com/article/17/9/stop-link-rot-permacc
-[15]:https://opensource.com/article/17/11/creating-open-textbooks
-[16]:https://opensource.com/article/17/7/save-planet-board-game
-[17]:https://opensource.com/article/17/4/phoenicia-education-software
-[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education
-[19]:https://opensource.com/alternatives/matlab
-[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
-[21]:https://opensource.com/article/17/5/how-linux-higher-education
-[22]:https://opensource.com/article/17/6/open-source-tools-university-student
-[23]:https://opensource.com/article/17/6/kde-education-software
-[24]:https://opensource.com/article/17/8/teach-kid-code-change-life
-[25]:https://opensource.com/article/17/9/floss-desktops-kids
-[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids
-[27]:https://scratch.mit.edu/
-[28]:https://opensource.com/article/17/8/app-inventor-android-app-development
-[29]:http://snap.berkeley.edu/
From 6602c304cc871ab4fe6dc569686f2a8f1afaccf6 Mon Sep 17 00:00:00 2001
From: lixinyuxx <524187166@qq.com>
Date: Wed, 19 Dec 2018 11:01:39 +0800
Subject: [PATCH 0182/4278] correct
---
... - Notmuch, mbsync, postfix and dovecot.md | 30 +++++++++----------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
index ffbf6d11a7..0edd75e2bd 100644
--- a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
+++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
@@ -1,12 +1,12 @@
我的个人电子邮件系统 - Notmuch, mbsync, postfix and dovecot
======
-我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷路了。所以这篇文章是一个自我文档, 这样我就不用再挣扎了就能改正过来。
+我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。
### 服务器端
我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说)
-> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我发展了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info)
+> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info)
除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。
@@ -25,9 +25,9 @@
### 邮件同步
-邮件同步是使用 mbsync 工具完成的, 我以前是离线的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。
+邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。
-配置文件是 ~/.mbsyncrc. 下面是我的例子与一些私人设置。
+配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。
```
IMAPAccount copyninja
@@ -79,7 +79,7 @@ SyncState *
Sync All
```
-对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我使用对称加密与 gpg 和存储密码在我的磁盘上的一些地方。这当然是由 Unix ACL 保护安全。
+对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。
实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。
@@ -87,9 +87,9 @@ Sync All
### 邮件分类
-一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置是有点大题小作相比于设置所有服务器软件, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。
+一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。
-不多让我很容易索引通过千兆字节的邮件档案, 并很容易得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。
+不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。
```
#!/bin/sh
@@ -135,15 +135,15 @@ done
### 阅读邮件
-现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层, 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。
+现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer), 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。
### 发送邮件
-如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是我最近迷惑的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。
+如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。
我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。
-我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法
+我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法)
```
adduser _relay
@@ -167,16 +167,16 @@ smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
```
-替换 smtp.example.com 用你的 SMTP 服务器名称, 您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。
+ 用你的 SMTP 服务器名称替换 smtp.example.com ,您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。
-若要保护 sasl_passwd 文件, 并创建它的哈希值进行 postfix 使用以下命令。
+若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。
```
chown root:root /etc/postfix/sasl_passwd
chmod 0600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
```
-最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的哈希值 /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。
+最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。
### Bonus 的部分
@@ -212,14 +212,14 @@ StandardOutput=syslog
StandardError=syslog
```
-将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启他们
+将这些文件置于 /etc/systemd/user 目录下并运行以下代码去开启它们
```
systemctl enable --user mailsync.timer
systemctl enable --user mailsync.service
systemctl start --user mailsync.timer
```
-这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew 他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。
+这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。
--------------------------------------------------------------------------------
From 2132fc3343ac37a09ecbbb1deaac05790124f4d8 Mon Sep 17 00:00:00 2001
From: jlztan
Date: Wed, 19 Dec 2018 11:16:42 +0800
Subject: [PATCH 0183/4278] =?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
---
...23 Celebrate Christmas In Linux Way With These Wallpapers.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
index e59286ddbc..94c08d72ae 100644
--- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
+++ b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (jlztan)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers)
From 5b9c7454137a8a6639bad8a9dad3f08eac8f530d Mon Sep 17 00:00:00 2001
From: LazyWolf Lin
Date: Wed, 19 Dec 2018 13:40:24 +0800
Subject: [PATCH 0184/4278] Translating How to Update Ubuntu.
---
...untu -Terminal - GUI Methods- It-s FOSS.md | 20 +++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
index b0f0751d81..00864bffa9 100644
--- a/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
+++ b/translated/tech/20181210 How to Update Ubuntu -Terminal - GUI Methods- It-s FOSS.md
@@ -49,31 +49,31 @@ sudo apt upgrade
#### 说明: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).
+这就是为什么当你运行 `sudo apt update`,你会在输出中看到大量的 URLs。这条命令从对应的储存库(你在输出中看到的 URLs)中获取软件包信息。
-![Updating Ubuntu Linux][5]
+![更新 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].
+**补充阅读:** 阅读这篇文章了解[命令 `apt update` 的输出中的 Ign,Hit 和 Get 是什么][6]。
#### 说明: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]
+![通过命令行更新 Ubuntu Linux][7]
-You can type ‘yes’, ‘y’ or just press enter to confirm the installation of updates.
+你可以键入 `yes`,`y` 或者只敲回车键去确认安装这些更新。
-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.
+所以总的来说,`sudo apt update` 会检查可用的新版本,而 `sudo apt upgrade` 实际上会执行更新。
-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` 可能会令人困惑,因为你可能期望通过命令 `apt update` 安装更新来更新系统,但这并不会发生。
### 通过 GUI 更新 Ubuntu[适用于桌面用户]
From 7b7ec40b94c86f3bef61a01487c87cee78f90a70 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 15:12:29 +0800
Subject: [PATCH 0185/4278] PRF:20171111 A CEOs Guide to Emacs.md
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
部分
---
.../tech/20171111 A CEOs Guide to Emacs.md | 69 ++++++++++---------
1 file changed, 38 insertions(+), 31 deletions(-)
diff --git a/translated/tech/20171111 A CEOs Guide to Emacs.md b/translated/tech/20171111 A CEOs Guide to Emacs.md
index 6d14ad7a8e..9ddbab89d2 100644
--- a/translated/tech/20171111 A CEOs Guide to Emacs.md
+++ b/translated/tech/20171111 A CEOs Guide to Emacs.md
@@ -13,7 +13,7 @@
这可能给人一种 Emacs 已经过气或过时的印象。但它不是,它是强大和永恒的,只要你耐心地去理解它的一些规则。它的规则很另类,也很奇怪,但其中的逻辑却引人注目,且很有魅力。对于我来说, Emacs 更像是未来而不是过去。就像牵引式钢框架在未来几十年里将会变得好用和舒适,而神奇的碳纤维自行车将会被扔进垃圾场,在撞击中粉碎一样,Emacs 也将会作为一种在最新的流行应用早已被遗忘的时候的好用的工具继续存在这里。
-如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32](PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。
+如果通过编辑 Lisp 代码来构建自己的个人工作环境,并将这种非常适合自己的环境移植到任何计算机的想法吸引了你,那么你可能会爱上 Emacs。如果你喜欢很潮、很炫的,又不想投入太多时间和精力的情况下就能直接工作的话,那么它可能不适合你。我已经不再写代码了(除了 Ludwig 和 Emacs Lisp),但是 Fugue 公司的很多工程师都使用 Emacs 来提高码代码的效率。我公司有 30% 的工程师用 Emacs,40% 用 IDE 和 30% 的用 vim。但这篇文章是关于 CEO 和其他[聪明的老板][32](PHB[^1] )(以及,其它好奇的人)的 Emacs 指南,所以我将解释或者说辩解我为什么喜欢它以及我如何使用它。同时我也希望我能介绍清楚从而让你能有个良好的体验,而不是花上几个小时去 Google。
### 恒久优势
@@ -27,48 +27,49 @@ Org 模式本身就值得花时间,但如果你像我一样,你通常要处
#### 在安静中创造事情
-拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?拥有 `Lisp` 键盘的全部功能?这就是我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。
+拥有我所发现的最好的文本编辑功能的最终结果是什么?有一群人在做各种各样有用的补充吗?发挥了 Lisp 键盘的全部威力了吗?我用 Emacs 来完成所有的创作性工作,处理音乐和图片除外。
-我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等保存在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序努力提供帮助并使其易于使用。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比其 office 应用程序,我更讨厌在线版的应用程序。
+我的办公桌上有两个显示器。其中一块竖屏是将 Emacs 全天全屏显示,另一个显示浏览器,用来搜索和阅读,通常也会打开一个终端。我将日历、邮件等放在 OS X 的另一个桌面上,当我使用 Emacs 时,这个桌面是隐藏的,同时我也会关掉所有通知。这样就能让我专注于我手头上在做的事了。我发现,在更现代的 UI 应用程序中,消除干扰几乎是不可能的,因为这些应用程序致力于提供帮助和易用性。我不需要经常被提醒该如何操作,我已经做了成千上万次了,我真正需要的是一张干净整洁的白纸用来思考。也许因为年龄和自己的“恶习”,我不太喜欢处在嘈杂的环境中,但我认为这值得一试。看看在你电脑环境中有一些真正的宁静是怎样的。当然,现在很多应用程序都有隐藏界面的模式,谢天谢地,苹果和微软现在都有了真正意义上的全屏模式。但是,没有并没有应用程序可以强大到足以“处理”大多数事务。除非你整天写代码,或者像写一本书一样处理很长的文档,否则你仍然会面临其他应用程序的干扰。而且,大多数现代应用程序似乎同时显得自视甚高,缺乏功能和可用性[^5] 。比起 office 应用程序,我更讨厌其在线版。
-![1933 steel bicycle](https://blog.fugue.co/assets/images/desktop.jpg)
-我的桌面布局, Emacs 在左边
+![](https://www.fugue.co/hubfs/Imported_Blog_Media/desktop-1.jpg)
-但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间时,我的效率会更高。在 `Fugue` 中使用了 `Slack`,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。仅仅是风投或董事会董事的一次懈怠,或一封电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。
+*我的桌面布局, Emacs 在左边*
-#### 带上一切,并保留着
+但是交流呢?创造和交流之间的差别很大。当我为两者留出不同的时间段时,我的效率会更高。我们 Fugue 公司使用 Slack,痛并快乐着。我把它和我的日历、电子邮件放在一个即时通讯的桌面上,这样,当我正在做事时,我很高兴地能够忽略所有的聊天。只要一个 Slackstorm 或一封风投或董事会董事的电子邮件,就能让我立刻丢掉手头工作。但是,大多数事情通常可以等上一两个小时。
-第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 `Dropbox` 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何地方,任何环境下工作了,因为你已经精心制作了适合目的套件了。我在 OS X,Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理页面、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。
+#### 包罗万象,永久长青
-永久存储在计算机上的限制是文件格式。假设人类已经解决了存储[^6] 的问题,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最持久的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于办公应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。
+第三个原因是,我发现 Emacs 比其它的环境更有优势的是你可以很容易的用它来处理事务。我的意思是,你所需要的只是通过 Dropbox 类似的网站同步一两个目录,而不是让大量的应用程序以它们自己的方式进行交互和同步。然后,你可以在任何你已经精心打造了适合你的目的的套件的环境中工作了。我在 OS X、Windows,或有时在 Linux 都是这样做的。它非常简单可靠。这种功能很有用,以至于我害怕处理 Pages、Google Docs、Office 或其他类型的文件和应用程序,这些文件和应用程序会迫使我回到文件系统或云中的某个地方去寻找。
+
+限制在计算机上永久存储的因素是文件格式。假设人类已经解决了存储问题[^6] ,随着时间的推移,我们面临的问题是我们能否够继续访问我们创建的信息。文本文件是最长青的计算格式。你可以用 Emacs 轻松地打开 1970 年的文本文件。然而对于 Office 应用程序却并非如此。同时文本文件要比 Office 应用程序数据文件小得多,也要好的多。作为一个数码背包迷,作为一个在脑子里一闪而过就会做很多小笔记的人,拥有一个简单、轻便、永久、随时可用的东西对我来说很重要。
如果你准备尝试 Emacs,请继续阅读!下面的部分不会取代完整的教程,但是在完成阅读时,就可以操作了。
### 学会驾驭 Emacs —— 一个专业的配置
-所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像现代世界已经过去了。这有点像你只开过车,却要你去学骑自行车[^7] 。
+所有这些强大、精神上的平静和安宁的代价是,Emacs 有一个陡峭的学习曲线,它的一切都与你以前所习惯的不同。一开始,这会让你觉得你是在浪费时间在一个过时和奇怪的应用程序上,就好像穿越到过去。这有点像你只开过车,却要你去学骑自行车[^7] 。
#### 该选哪个 Emacs
-我用的是 GNU 中 OS X 和 Windows 的通用版本的 Emacs。你可以在 [][34][http://emacsformacos.com/][35] 获取 OS X 版本,在[][36][http://www.gnu.org/software/emacs/][37]获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(包括 `Lisp` 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] !
+我用的是来自 GNU 的 OS X 和 Windows 的通用版本的 Emacs。你可以在 [http://emacsformacos.com/][35] 获取 OS X 版本,在 [http://www.gnu.org/software/emacs/][37] 获取 Windows 版本。市面上还有很多其他版本,尤其是 Mac 版本,但我发现,要做一些功能强大的东西(涉及到 Lisp 和许多模式),学习曲线要比实际操作低得多。下载,然后我们就可以开始了[^8] !
-#### 首先,学会浏览
+#### 首先,学会导航
-在本文中,我将约定 Emacs 中的键和组合。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组快捷键会指向一个教程,这是你首先要做的一件事。
+在本文中,我将使用 Emacs 的按键和组合键约定。`C` 表示 `Control` 键,`M` 表示 `meta`(通常是 `Alt` 或 `Option` 键),以及用于组合键的连字符。因此,`C-h t` 表示同时按下 `Control` 和 `h` 键,然后释放,再按下 `t`。这个组合快捷键会指向一个教程,这是你首先要做的一件事。
-不要使用方向键或鼠标。它们可以工作,但是你应该给自己一周的时间来使用 Emacs 教程中的原生命令。一旦你这些命令变为了肌肉记忆,你可能就会乐在其中,无论到哪里,你都会非常想念它们。Emacs 教程在介绍它们方面做得很好,但是我将进行总结,所以您不需要阅读全部内容。最无聊的是,不用方向键,用 `C-b` 向前移动,用 `C-f` 向后移动,上一行用 `C-p`,下一行用 `C-n`。你可能会想:“我用方向键就很好,为什么还要这样做?” 有几个原因。首先,你不需要从主键盘区将你的手移开。第二,使用 `Alt`(或用 Emacs 的说法 `Meta`)键来向前或向后移动一个单词。显而易见这样更方便。第三,如果想重复某个命令,可以在命令前面加上一个数字。在编辑文档时,我经常使用这种方法,通过估计向前多少个单词或向上或线下移动多少行,然后按下 `C-9 C-p` 或 `M-5 M-b` 之类的快捷键。其他真正重要的浏览命令基于开头用 `a` 和结尾用 `e`。在行中使用 `C-a|e`,在句中使用 `M-a|e`。为了让句中的命令正常工作,需要在句号后增加两个空格,这同时提供了一个有用的特性,并消除了脑中的[希伯列][38]。如果需要将文档导出到单个空间[发布环境][39],可以编写一个宏来执行此操作。
+不要使用方向键或鼠标。它们可以工作,但是你应该给自己一周的时间来使用 Emacs 教程中的原生的导航命令。一旦你这些命令变为了肌肉记忆,你可能就会乐在其中,无论到哪里,你都会非常想念它们。这个 Emacs 教程在介绍它们方面做得很好,但是我将进行总结,所以您不需要阅读全部内容。最无聊的是,不用方向键,用 `C-b` 向前移动,用 `C-f` 向后移动,上一行用 `C-p`,下一行用 `C-n`。你可能会想:“我用方向键就很好,为什么还要这样做?” 有几个原因。首先,你不需要从主键盘区将你的手移开。第二,使用 `Alt`(或用 Emacs 的说法 `Meta`)键来向前或向后在单词间移动。显而易见这样更方便。第三,如果想重复某个命令,可以在命令前面加上一个数字。在编辑文档时,我经常使用这种方法,通过估计向后移动多少个单词或向上或向下移动多少行,然后按下 `C-9 C-p` 或 `M-5 M-b` 之类的快捷键。其它真正重要的导航命令基于开头用 `a` 和结尾用 `e`。在行中使用 `C-a|e`,在句中使用 `M-a|e`。为了让句中的命令正常工作,需要在句号后增加两个空格,这同时提供了一个有用的特性,并消除了脑中一个过时的[观点][38]。如果需要将文档导出到单个空间[发布环境][39],可以编写一个宏来执行此操作。
-Emacs 附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。
+Emacs 所附带的教程很值得去看。对于真正缺乏耐心的人,我将介绍一些重要的命令,但那个教程非常有用。记住:用 `C-h t` 进入教程。
#### 学会复制和粘贴
-你可以叫 Emacs 设为 `CUA` 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 这样的浏览命令来标记区域(如选择)。所以 `C-F` 是选中管标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除和召回,但它非常类似于剪切和粘贴。在删除的环中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你在这开始摸索, `C-x u` 是撤销。
+你可以把 Emacs 设为 CUA 模式,这将会以熟悉的方式工作来操作复制粘贴,但是原生的 Emacs 方法更好,而且你一旦学会了它,就很容易。你可以使用 `Shift` 和导航命令来标记区域(如同选择)。所以 `C-F` 是选中光标前的一个字符,等等。亦可以用 `M-w` 来复制,用 `C-w` 剪切,然后用 `C-y` 粘贴。这些实际上叫做删除和召回,但它非常类似于剪切和粘贴。在删除中有些小技巧,但是现在,你只需要关注剪切、复制和粘贴。如果你开始尝试了,那么 `C-x u` 是撤销。
-#### 下一步,学会用 `Ido` 模式
+#### 下一步,学会用 Ido 模式
-相信我,`Ido` 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独分开的查找或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 `Ido` 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 `Ido` 是 Emacs 的 22 版时开发出来的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。
+相信我,Ido 会让文件的工作变得很简单。通常,你在 Emacs 中处理文件不需要使用一个单独的访达或文件资源管理器的窗口。相反的,你可以用编辑器的命令来创建、打开和保存文件。如果没有 Ido 的话,这将有点麻烦,所以我建议你在学习其他之前安装好它。 Ido 是 Emacs 的 22 版时开始出现的,但是需要对你的 `.emacs` 文件做一些调整,来确保它一直开启着。这是个配置环境的好理由。
-Emacs 中的大多数功能都表现在模式上。要安装制定的模式,需要做两件事。嗯,一开始你需要做一些额外的事情,但这些只需要做一次,然后再做这两件事。那么,额外的事情是你需要一个单独的位置来放置所有 `Emacs Lisp` 文件,并且你需要告诉 Emacs 这个位置在哪。我建议你在 Dropbox 上创建一个单独的目录,那是你 Emacs 主目录。在这里,你需要创建一个 `.emacs` 文件和 `.emacs.d` 目录。在 `.emacs.d` 目录下,创建一个 `lisp` 的目录。就像这样:
+Emacs 中的大多数功能都表现在模式上。要安装指定的模式,需要做两件事。嗯,一开始你需要做一些额外的事情,但这些只需要做一次,然后再做这两件事。那么,这件额外的事情是你需要一个单独的位置来放置所有 Emacs Lisp 文件,并且你需要告诉 Emacs 这个位置在哪。我建议你在 Dropbox 上创建一个单独的目录,那是你 Emacs 主目录。在这里,你需要创建一个 `.emacs` 文件和 `.emacs.d` 目录。在 `.emacs.d` 目录下,创建一个 `lisp` 的目录。就像这样:
```
home
@@ -80,21 +81,23 @@ home
-lisp
```
-你可以将那些像模式的 `.el` 文件放到 `home/.emacs.d/lis` 目录下,然后在你的 `.emacs` 文件中添加以下代码来指明该路径:
+你可以将那些比如模式的 `.el` 文件放到 `home/.emacs.d/lisp` 目录下,然后在你的 `.emacs` 文件中添加以下代码来指明该路径:
-`(add-to-list 'load-path "~/.emacs.d/lisp/")`
+```
+(add-to-list 'load-path "~/.emacs.d/lisp/")
+```
-`Ido` 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它.
+Ido 模式是 Emacs 自带的,所以你不需要在你的 `lisp` 目录中放这个 `.el` 文件,但你仍然需要添加上面代码,因为下面的介绍会使用到它.
#### 符号链接是你的好伙伴
-等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把他们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并链接到 `.emacs` 和 `.emacs.d`,以及主目录 `~`。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的一部分了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件家的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。
+等等,这里写的 `.emacs` 和 `.emacs.d` 都是存放在你的主目录下,但我们把它们放到了 Dropbox 的某些愚蠢的文件夹!对,这就让你的环境在任何地方都很容易使用。把所有东西都保存在 Dropbox 上,并做符号链接到 `~` 下的 `.emacs` 、`.emacs.d` 和你的主要存放文档的目录。在 OS X 上,使用 `ln -s` 命令非常简单,但在 Windows 上却很麻烦。幸运的是,Emacs 提供了一种简单的方法来替代 Windows 上的符号链接,Windows 的 `HOME` 环境变量。转到 Windows 的环境变量(Windows 10,你可以按 Windows 键然后输入 “环境变量” 来搜索,这是 Windows 10 最好的地方了),在你的帐户下创建一个指向你在 Dropbox 中 Emacs 的文件夹的 `HOME` 环境变量。如果你想方便地浏览 Dropbox 之外的本地文件,你可能想在你的实际主目录下建立一个到 Dropbox 下 Emacs 主目录的符号链接。
-至此,你已经完成了在任意机器上指向 Emacs 配置和配置文件所需的技巧。如果你买了一台新电脑,或者用别人的电脑一小时或一天,你就得到了你的整个工作环境。第一次做这个似乎有点困难,但是一旦你知道你在做什么,就只需要10分钟(最多)。
+至此,你已经完成了在任意机器上指向你的 Emacs 配置和文件所需的技巧。如果你买了一台新电脑,或者用别人的电脑一小时或一天,你就可以得到你的整个工作环境。第一次做这个似乎有点困难,但是一旦你知道你在做什么,就(最多)只需要 10 分钟。
-但我们现在是在配置 `Ido`……
+但我们现在是在配置 Ido ……
-按下 `C-x` `C-f` 然后输入 `~/.emacs RET RET` 来创建 `.emacs` 文件,将下面几行添加进去:
+按下 `C-x` `C-f` 然后输入 `~/.emacs` 和两次回车来创建 `.emacs` 文件,将下面几行添加进去:
```
;; set up ido mode
@@ -104,15 +107,19 @@ home
(ido-mode 1)
```
-在 `.emacs` 窗口开着的时候,执行 `M-x evaluate-buffer` 命令。如果某处弄错了的话,将得到一个错误,或者你将得到 `Ido`。`Ido` 改变了在 `minibuffer` 中操作文件操方式。有一篇比较好的文档,但是我也会指出一些技巧。有效地使用 `~/`;你可以在 `minibuffer` 的任何地方输入 `~/`,它就会跳转到主目录。这就意味着,你应该让你的大部分东西就近的放在主目录下。我用 `~/org` 目录来保存所有非代码的东西,用 `~/code` 保存代码。一旦你进入到正确的目录,通常会拥有一组具有不同扩展名的文件,特别是当你使用 `Org` 模式并从中发布的话。你可以输入 `period` 和想要的扩展名,无论你的在文件名的什么位置,`Ido` 都会将选择限制在具有该扩展名的文件中。例如,我在 `Org` 模式下写这篇博客,所以该文件是:
+在 `.emacs` 窗口开着的时候,执行 `M-x evaluate-buffer` 命令。如果某处弄错了的话,将得到一个错误,或者你将得到 Ido。Ido 改变了在 minibuffer 中操作文件操方式。关于这个有一篇比较好的文档,但是我也会指出一些技巧。有效地使用 `~/`;你可以在 minibuffer 的任何地方输入 `~/`,它就会跳转到主目录。这就意味着,你应该让你的大部分东西就近的放在主目录下。我用 `~/org` 目录来保存所有非代码的东西,用 `~/code` 保存代码。一旦你进入到正确的目录,通常会拥有一组具有不同扩展名的文件,特别是当你使用 Org 模式并从中发布的话。你可以输入 `.` 和想要的扩展名,无论你的在文件名的什么位置,Ido 都会将选择限制在具有该扩展名的文件中。例如,我在 Org 模式下写这篇博客,所以该文件是:
-`~/org/blog/emacs.org`
+```
+~/org/blog/emacs.org
+```
-我偶尔也会用 `Org` 模式发布成 HTML 格式,所以我将在同一目录下得到 `emacs.html` 文件。当我想打开 `Org` 文件时,我会输入:
+我偶尔也会用 Org 模式发布成 HTML 格式,所以我将在同一目录下得到 `emacs.html` 文件。当我想打开该 Org 文件时,我会输入:
-`C-x C-f ~/o[RET]/bl[RET].or[RET]`
+```
+C-x C-f ~/o[RET]/bl[RET].or[RET]
+```
-其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开查找或文件资源管理器再用鼠标点要节省 _很_ 多时间。 `Ido` 模式很有用, 这真的是操作 Emacs 的一种实用的模式。下面让我们去探索一些其他对完成工作很有帮助的模式吧。
+其中 `[RET]` 是我使用 `Ido` 模式的自动补全而按下的回车键。所以,这只需要按 12 个键,如果你习惯了的话, 这将比打开访达或文件资源管理器再用鼠标点要节省 _很_ 多时间。 Ido 模式很有用,而这只是操作 Emacs 的一种实用模式而已。下面让我们去探索一些其它对完成工作很有帮助的模式吧。
#### 字体及风格
From 1704626c5ecb804fae391bf0dc8aa6c46dc7f9f4 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 15:45:26 +0800
Subject: [PATCH 0186/4278] PRF:20180911 Know Your Storage- Block, File -
Object.md
@qhwdw
---
...Know Your Storage- Block, File - Object.md | 31 ++++++++++---------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/translated/tech/20180911 Know Your Storage- Block, File - Object.md
index 3dc77ad8e3..01f4cb4b15 100644
--- a/translated/tech/20180911 Know Your Storage- Block, File - Object.md
+++ b/translated/tech/20180911 Know Your Storage- Block, File - Object.md
@@ -1,43 +1,44 @@
认识存储:块、文件和对象
======
+> 今天产生的大量数据带来了新的存储挑战。在本文中了解各种存储类型以及它们的使用方式。
![](https://www.linux.com/sites/lcom/files/styles/rendered_file/public/block2_1920.jpg?itok=s1y6RLhT)
-现在,对于那些创建或消费数据的公司来说,处理生成的数量巨大的数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。
+现在,对于那些创建或消费数据的公司来说,处理数量巨大的生成数据是个非常大的挑战。而对于那些解决存储相关问题的科技公司来说,也是一个挑战。
- Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“
+Red Hat 存储首席产品营销经理 Michael St. Jean 说,“数据每年呈几何级增长,而我们发现数据大量增长的主要原因是由于消费增长和为拓展价值而进行的产业转型,毫无疑问,物联网对数据增长的贡献很大,但对软件定义存储来说最重要的挑战是,如何处理用户场景相关的数据增长。“
-任何挑战都意味着机遇。Azure 存储、介质和边缘总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。”
+任何挑战都意味着机遇。Azure 存储、介质和边缘计算总经理 Tad Brockway 说,“今天,新旧数据源产生的海量数据为我们满足客户在规模、性能、灵活性、治理方面急剧增长的需求提供了一个机遇。”
### 现代软件定义存储的三种类型
-这里有三个不同类型的存储解决方案 — 块、文件、和对象 — 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。
+这里有三个不同类型的存储解决方案 —— 块、文件、和对象 —— 虽然它们每个都可以与其它的共同工作,但它们每个都有不同的用途。
-块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置”。
+块存储是数据存储的最古老形式,数据都存储在固定长度的块或多个块中。块存储适用于企业存储环境,并且通常使用光纤通道或 iSCSI 接口。根据 SUSE 的软件定义存储高级产品经理 Larry Morris 的说法,“块存储要求一个应用去映射存储设备上存储数据块的位置。”
-块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,它创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。
+块存储在存储区域网和软件定义存储系统中是虚拟的,它是处于一个共享的硬件基础设施上的抽象逻辑设备,其创建和存在于服务器、虚拟服务器、或运行在基于像 SCSI、SATA、SAS、FCP、FCoE、或 iSCSI 这样的协议的系统管理程序上。
-St. Jean 说“块存储将单个的存储卷(像一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。“
+St. Jean 说“块存储将单个的存储卷(如一个虚拟或云存储节点、或一个老式硬盘)分割成单独的被称为块的实体。”
-每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 — 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。
+每个块独立存在,并且能够用它自己的数据传输协议和操作系统格式化 —— 给用户完全的配置自主权。由于块存储系统并不负责像文件存储系统那样的文件查找职责,所以,块存储是一个非常快的存储系统。由于同时具备速度和配置灵活性,使得块存储非常适合原始服务器存储或富媒体数据库。
-块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器、或集群中呈现出的机器访问。
+块存储适合于宿主机操作系统、应用程序、数据库、完整虚拟机和容器。传统上,块存储仅能够被独立的机器访问,或呈现给集群中的机器访问。
### 基于文件的存储
-基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直接或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。 St. Jean 说,”使用文件存储时,数据在服务器侧的排列格式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。
+基于文件的存储使用一个文件系统去映射存储设备上数据的存储位置。这种技术在直连或网络附加存储系统应用领域中处于支配地位。它需要做两件事情:组织数据并呈现给用户。St. Jean 说,”使用文件存储时,数据在服务器侧的存储方式与客户端用户所看到的是完全相同的。这就允许用户通过一些唯一标识符(像文件名、位置、或 URL)去请求一个文件,使用特定的数据传输协议与存储系统沟通。
-最终成为了一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是限制访问处于这些文件和文件夹之下的数据块。
+其结果就是一种能够从上到下进行浏览的分层的文件结构。文件存储处于块存储之上,允许用户去查看和访问文件、文件夹这样的数据,但是被限制访问处于这些文件和文件夹之下的数据块。
-Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录、和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“
+Brockway 解释说,“文件存储一般用于像 NFS 和 CIFS/SMB 这种很多服务器基于 IP 网络进行访问的共享文件系统上。访问控制通过用户和组的权限实现在文件、目录和导出级别上。基于文件的存储可用于被多个用户和机器、二进制应用程序、数据库、虚拟机所需要的文件的存储上,以及容器上。“
### 对象存储
-对象存储是最新的数据存储形式,它为非结构化数据提供一个库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 — 数据和元数据 — 构成了一个对象。
+对象存储是最新的数据存储形式,它为非结构化数据提供一个仓库,它将内容从索引中分离出来,并允许多个文件连接到一个对象上。一个对象就是与任何相关元数据配对的一个数据块,这些元数据提供对象中包含的字节的上下文(比如数据创建时间和数据大小等)。也就是说这两样东西 —— 数据和元数据 —— 构成了一个对象。
对象存储的一个好处是每个数据块都关联了一个唯一标识符。访问数据需要唯一标识符,并且不需要应用程序或用户知道数据的真实存储位置。对象数据是通过 API 来访问的。
-St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被安排在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 — 这使得它们在存储规模巨大时访问速度很快。”
+St. Jean 说,“对象中存储的数据是没有压缩和加密的,对象本身被组织在对象存储(一个填满其它对象的中心库)中或容器(包含应用程序运行所需要的所有文件的一个包)中。与文件存储系统的层次结构相比,对象、对象存储和容器在本质上是平面的 —— 这使得它们在存储规模巨大时访问速度很快。”
对象存储可以扩展到很多 PB 字节大小,以适应巨大的数据集,因此它是图像、音频、视频、日志、备份、和分析服务所使用的数据存储的最佳选择。
@@ -52,7 +53,7 @@ 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)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
From 87d11f5ea0d30a91101f01eac2fd6a79208a2f16 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 15:46:05 +0800
Subject: [PATCH 0187/4278] PUB:20180911 Know Your Storage- Block, File -
Object.md
@qhwdw https://linux.cn/article-10364-1.html
---
.../20180911 Know Your Storage- Block, File - Object.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20180911 Know Your Storage- Block, File - Object.md (100%)
diff --git a/translated/tech/20180911 Know Your Storage- Block, File - Object.md b/published/20180911 Know Your Storage- Block, File - Object.md
similarity index 100%
rename from translated/tech/20180911 Know Your Storage- Block, File - Object.md
rename to published/20180911 Know Your Storage- Block, File - Object.md
From 3bdd047664f41dbda43491fc6efafb06ddea3914 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 17:52:06 +0800
Subject: [PATCH 0188/4278] PRF:20181130 SMPlayer in Linux- Features, Download
and Installation.md
@geekpi
---
...ux- Features, Download and Installation.md | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
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
index be826fc446..1e0147ac10 100644
--- a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
+++ b/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
@@ -1,29 +1,30 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: 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:功能,下载和安装
+SMPlayer:增强版的媒体播放器
======
当你要播放视频时,你会在[全新安装的 Ubuntu][1],或其他许多发行版中,会注意到一个消息:
![][2]
-默认媒体播放器没有适合的编解码器
-这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。了解一下 [SMPlayer][4]。
+*默认媒体播放器没有适合的编解码器*
+
+这意味着系统上没有安装播放媒体的[所需编解码器][3]。现在,由于某些版权问题,某些基于 Linux 的操作系统无法在安装介质中预先打包编解码器。但是它们能让你只需点击即可下载和安装编解码器,或者你可以安装拥有所有媒体编解码器的媒体播放器。让我们了解一下 [SMPlayer][4]。
### 认识 SMPlayer:适用于 Linux 的更好的媒体播放器
-SMPlayer 是一款免费的开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。
+SMPlayer 是一款自由开源媒体播放器,它基于强大的 [MPlayer][5] 媒体引擎。SMPlayer 能够播放 avi、mp4、mkv、mpeg、mov、divx、h.264 以及其他任何主要媒体格式。锦上添花的是,它也可以播放 [YouTube][6] 视频,并且无广告。
![SMPlayer default interface][7]
-SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。
+SMPlayer 是一个完整的媒体解决方案。它是跨平台的,因此可在所有操作系统上使用。如果你是双启动系统,则可以将其安装在 Windows 和 Linux 操作系统上,以便在两个系统上获得统一的体验。它还支持带触摸的可变形笔记本。
你也可以在 SMPlayer 上播放 YouTube。我知道每次复制粘贴视频 URL 并在外部播放器上播放是不切实际的。但是当你观看相对较长的视频时,SMPlayer 特别有用。SMPlayer 以相当好的质量播放 YouTube 视频,我觉得比在浏览器中播放得更好。通过在 SMPlayer 上播放较长的视频,你可以远离视频中间弹出的插播广告。
@@ -51,7 +52,7 @@ SMPlayer 应该可在所有主要 Linux 发行版的软件中心获取。你可
sudo apt install smplayer
```
-或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包
+或者,你可以在[这里][11]下载 Fedora、Arch Linux、OpenSUSE 和 Debian 的软件包。
### 总结
@@ -66,7 +67,7 @@ via: https://itsfoss.com/smplayer/
作者:[Aquil Roshan;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/) 荣誉推出
@@ -83,4 +84,4 @@ via: https://itsfoss.com/smplayer/
[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
+[12]: https://itsfoss.com/essential-linux-applications/
From 228a0a7fbc5fe30c4c28571541ca6d741875b5f5 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Wed, 19 Dec 2018 17:53:02 +0800
Subject: [PATCH 0189/4278] PUB:20181130 SMPlayer in Linux- Features, Download
and Installation.md
@geekpi https://linux.cn/article-10365-1.html
---
... SMPlayer in Linux- Features, Download and Installation.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181130 SMPlayer in Linux- Features, Download and Installation.md (98%)
diff --git a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md b/published/20181130 SMPlayer in Linux- Features, Download and Installation.md
similarity index 98%
rename from translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
rename to published/20181130 SMPlayer in Linux- Features, Download and Installation.md
index 1e0147ac10..5165fed0f7 100644
--- a/translated/tech/20181130 SMPlayer in Linux- Features, Download and Installation.md
+++ b/published/20181130 SMPlayer in Linux- Features, Download and Installation.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: subject: (SMPlayer in Linux: Features, Download and Installation)
[#]: via: (https://itsfoss.com/smplayer/)
[#]: author: (Aquil Roshan;Abhishek Prakash https://itsfoss.com/author/aquil/)
-[#]: url: ( )
+[#]: url: (https://linux.cn/article-10365-1.html)
SMPlayer:增强版的媒体播放器
======
From 45de03a32dcf7afd5789fe4142114aac0757cf93 Mon Sep 17 00:00:00 2001
From: jlztan
Date: Wed, 19 Dec 2018 18:13:24 +0800
Subject: [PATCH 0190/4278] Delete 20171223 Celebrate Christmas In Linux Way
With These Wallpapers.md
---
...tmas In Linux Way With These Wallpapers.md | 201 ------------------
1 file changed, 201 deletions(-)
delete mode 100644 sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
diff --git a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
deleted file mode 100644
index 94c08d72ae..0000000000
--- a/sources/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
+++ /dev/null
@@ -1,201 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (jlztan)
-[#]: reviewer: ( )
-[#]: publisher: ( )
-[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers)
-[#]: via: (https://itsfoss.com/christmas-linux-wallpaper/)
-[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
-[#]: url: ( )
-
-Celebrate Christmas In Linux Way With These Wallpapers
-======
-
-It’s the holiday season and many of you might be celebrating Christmas already. From the team of It’s FOSS, I would like to wish you a Merry Christmas and a happy new year.
-
-To continue the festive mood, I’ll show you some really awesome [Linux wallpapers][1] on Christmas theme. But before we see that, how about a Christmas Tree in Linux terminal.
-
-### Display Christmas Tree in Linux Terminal
-
-
-
-If you want to display an animated Christmas tree in the terminal, you can use the command below:
-
-```
-curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash
-```
-
-If you don’t want to get it from the internet all the time, you can get the shell script from its GitHub repository, change the permission and run it like a normal shell script.
-
-[ChristBASHTree][2]
-
-### Display Christmas Tree in Linux terminal using Perl
-
-[![Christmas Tree in Linux terminal by NixCraft][3]][4]
-
-This trick was originally shared by [NixCraft][5]. You’ll need to install a Perl module for this.
-
-To be honest, I don’t like using Perl modules because uninstalling them is a real pain. So **use this Perl module knowing that you’ll have to manually remove it**.
-
-```
-perl -MCPAN -e 'install Acme::POE::Tree'
-```
-
-You can read the original article [here][5] to know more about it.
-
-## Download Linux Christmas Wallpapers
-
-All these Linux Christmas wallpapers are created by Mark Riedesel and you can find plenty of other artwork on [his website][6].
-
-He has been making such wallpapers almost every year since 2002. Quite understandably some of the earliest wallpapers don’t have modern aspect ratio. I have put them up in reverse chronological order.
-
-One tiny note. The images displayed here are highly compressed so download the wallpapers from the provided link only.
-
-![Christmas Linux Wallpaper][7]
-
-[Download This Wallpaper][8]
-
-[![Christmas Linux Wallpapers][9]][10]
-
-[Download This Wallpaper][11]
-
-[![Christmas Linux Wallpapers][12]][13]
-
-[Download This Wallpaper][14]
-
-[![Christmas Linux Wallpapers][15]][16]
-
-[Download This Wallpaper][17]
-
-[![Christmas Linux Wallpapers][18]][19]
-
-[Download This Wallpaper][20]
-
-[![Christmas Linux Wallpapers][21]][22]
-
-[Download This Wallpaper][23]
-
-[![Christmas Linux Wallpapers][24]][25]
-
-[Download This Wallpaper][26]
-
-[![Christmas Linux Wallpapers][27]][28]
-
-[Download This Wallpaper][29]
-
-[![Christmas Linux Wallpapers][30]][31]
-
-[Download This Wallpaper][32]
-
-[![Christmas Linux Wallpapers][33]][34]
-
-[Download This Wallpaper][35]
-
-[![Christmas Linux Wallpapers][36]][37]
-
-[Download This Wallpaper][38]
-
-[![Christmas Linux Wallpapers][39]][40]
-
-[Download This Wallpaper][41]
-
-[![Christmas Linux Wallpapers][42]][43]
-
-[Download This Wallpaper][44]
-
-[![Christmas Linux Wallpapers][45]][46]
-
-[Download This Wallpaper][47]
-
-[![Christmas Linux Wallpapers][48]][49]
-
-[Download This Wallpaper][50]
-
-### Bonus: Linux Christmas carols
-
-Here is a bonus for you. Christmas carols Linuxified for Linux lovers like us.
-
-In [an article on Computer World][51], [Sandra Henry-Stocker][52] shared such Christmas carols. An excerpt:
-
-To the tune of: [Chestnuts Roasting on an Open Fire][53]
-
-> Running merrily on open source
-> With users happy as can be
-> We’re using Linux and getting lots done
-> And happy everything is free
-
-To the tune of: [The Twelve Days of Christmas][54]
-
-> On my first day with Linux, my admin gave to me a password and a login ID
-> On my second day with Linux my admin gave to me two new commands and a password and a login ID
-
-You can read full carols [here][51].
-
-Merry Linux to you!!
-
---------------------------------------------------------------------------------
-
-via: https://itsfoss.com/christmas-linux-wallpaper/
-
-作者:[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/beautiful-linux-wallpapers/
-[2]: https://github.com/sergiolepore/ChristBASHTree
-[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/perl-tree.gif?resize=600%2C622&ssl=1
-[4]: https://itsfoss.com/christmas-linux-wallpaper/perl-tree/
-[5]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/
-[6]: http://www.klowner.com/
-[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmas-linux-wallpaper-featured.jpeg?resize=800%2C450&ssl=1
-[8]: http://klowner.com/wallery/christmas_tux_2017/download/ChristmasTux2017_3840x2160.png
-[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2016_3840x2160_result.jpg?resize=800%2C450&ssl=1
-[10]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2016_3840x2160_result/
-[11]: http://www.klowner.com/wallpaper/christmas_tux_2016/
-[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2015_2560x1920_result.jpg?resize=800%2C600&ssl=1
-[13]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2015_2560x1920_result/
-[14]: http://www.klowner.com/wallpaper/christmas_tux_2015/
-[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2014_2560x1440_result.jpg?resize=800%2C450&ssl=1
-[16]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2014_2560x1440_result/
-[17]: http://www.klowner.com/wallpaper/christmas_tux_2014/
-[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2013_result.jpg?resize=800%2C450&ssl=1
-[19]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2013_result/
-[20]: http://www.klowner.com/wallpaper/christmas_tux_2013/
-[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2012_2560x1440_result.jpg?resize=800%2C450&ssl=1
-[22]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2012_2560x1440_result/
-[23]: http://www.klowner.com/wallpaper/christmas_tux_2012/
-[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2011_2560x1440_result.jpg?resize=800%2C450&ssl=1
-[25]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2011_2560x1440_result/
-[26]: http://www.klowner.com/wallpaper/christmas_tux_2011/
-[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2010_5120x2880_result.jpg?resize=800%2C450&ssl=1
-[28]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2010_5120x2880_result/
-[29]: http://www.klowner.com/wallpaper/christmas_tux_2010/
-[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2009_1600x1200_result.jpg?resize=800%2C600&ssl=1
-[31]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2009_1600x1200_result/
-[32]: http://www.klowner.com/wallpaper/christmas_tux_2009/
-[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2008_2560x1600_result.jpg?resize=800%2C500&ssl=1
-[34]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2008_2560x1600_result/
-[35]: http://www.klowner.com/wallpaper/christmas_tux_2008/
-[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2007_2560x1600_result.jpg?resize=800%2C500&ssl=1
-[37]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2007_2560x1600_result/
-[38]: http://www.klowner.com/wallpaper/christmas_tux_2007/
-[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2006_1024x768_result.jpg?resize=800%2C600&ssl=1
-[40]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2006_1024x768_result/
-[41]: http://www.klowner.com/wallpaper/christmas_tux_2006/
-[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2005_1600x1200_result.jpg?resize=800%2C600&ssl=1
-[43]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2005_1600x1200_result/
-[44]: http://www.klowner.com/wallpaper/christmas_tux_2005/
-[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2004_1600x1200_result.jpg?resize=800%2C600&ssl=1
-[46]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2004_1600x1200_result/
-[47]: http://www.klowner.com/wallpaper/christmas_tux_2004/
-[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2002_1600x1200_result.jpg?resize=800%2C600&ssl=1
-[49]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2002_1600x1200_result/
-[50]: http://www.klowner.com/wallpaper/christmas_tux_2002/
-[51]: http://www.computerworld.com/article/3151076/linux/merry-linux-to-you.html
-[52]: https://twitter.com/bugfarm
-[53]: https://www.youtube.com/watch?v=dhzxQCTCI3E
-[54]: https://www.youtube.com/watch?v=oyEyMjdD2uk
From c1e7fb3466c15af52f7f7f805fff1a91045a2239 Mon Sep 17 00:00:00 2001
From: jlztan
Date: Wed, 19 Dec 2018 18:16:59 +0800
Subject: [PATCH 0191/4278] Create 20171223 Celebrate Christmas In Linux Way
With These Wallpapers.md
---
...tmas In Linux Way With These Wallpapers.md | 190 ++++++++++++++++++
1 file changed, 190 insertions(+)
create mode 100644 translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
new file mode 100644
index 0000000000..1132a52058
--- /dev/null
+++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
@@ -0,0 +1,190 @@
+使用这些壁纸以 Linux 的方式庆祝圣诞节
+======
+
+当前正是假日季节,很多人可能已经在庆祝圣诞节了。我代表 It's FOSS 团队祝你圣诞快乐,新年快乐。
+
+为了延续节日氛围,我将向你展示一些非常棒的圣诞主题 [Linux壁纸][1]。在呈现这些壁纸之前,先来看一棵 Linux 终端下的圣诞树。
+
+### 在 Linux 终端下显示圣诞树
+
+圣诞树的效果如 [这个页面](https://giphy.com/embed/xUNda6KphvbpYxL3tm) 所示。
+
+使用以下命令在终端中显示一棵动画圣诞树:
+
+```
+curl https://raw.githubusercontent.com/sergiolepore/ChristBASHTree/master/tree-EN.sh | bash
+```
+
+要是不想一直从互联网上获取这棵圣诞树,也可以从它的 [GitHub 仓库][2] 中获取对应的 shell 脚本,更改权限之后按照运行普通 shell 脚本的方式运行它。
+
+### 使用 Perl 在 Linux 终端下显示圣诞树
+
+[![Christmas Tree in Linux terminal by NixCraft][3]][4]
+
+这个技巧最初由 [NixCraft][5] 分享,你需要为此安装 Perl 模块。
+
+说实话,我不喜欢使用 Perl 模块,因为卸载它们真的很痛苦。所以使用这个 Perl 模块时需谨记,你必须手动移除它。
+
+```
+perl -MCPAN -e 'install Acme::POE::Tree'
+```
+
+你可以阅读 [原文][5] 来了解更多信息。
+
+## 下载 Linux 圣诞主题壁纸
+
+所有这些 Linux 圣诞主题壁纸都是由 Mark Riedesel 制作的,你可以在 [他的网站][6] 上找到很多其他艺术品。
+
+自 2002 年以来,他几乎每年都在制作这样的壁纸。可以理解的是,最早的一些壁纸不具有现代的宽高比。我把它们按时间倒序排列。
+
+注意一个小地方,这里显示的图片都是高度压缩的,因此你要通过图片下方提供的链接进行下载。
+
+![Christmas Linux Wallpaper][7]
+
+[下载此壁纸][8]
+
+[![Christmas Linux Wallpapers][9]][10]
+
+[下载此壁纸][11]
+
+[![Christmas Linux Wallpapers][12]][13]
+
+[下载此壁纸][14]
+
+[![Christmas Linux Wallpapers][15]][16]
+
+[下载此壁纸][17]
+
+[![Christmas Linux Wallpapers][18]][19]
+
+[下载此壁纸][20]
+
+[![Christmas Linux Wallpapers][21]][22]
+
+[下载此壁纸][23]
+
+[![Christmas Linux Wallpapers][24]][25]
+
+[下载此壁纸][26]
+
+[![Christmas Linux Wallpapers][27]][28]
+
+[下载此壁纸][29]
+
+[![Christmas Linux Wallpapers][30]][31]
+
+[下载此壁纸][32]
+
+[![Christmas Linux Wallpapers][33]][34]
+
+[下载此壁纸][35]
+
+[![Christmas Linux Wallpapers][36]][37]
+
+[下载此壁纸][38]
+
+[![Christmas Linux Wallpapers][39]][40]
+
+[下载此壁纸][41]
+
+[![Christmas Linux Wallpapers][42]][43]
+
+[下载此壁纸][44]
+
+[![Christmas Linux Wallpapers][45]][46]
+
+[下载此壁纸][47]
+
+[![Christmas Linux Wallpapers][48]][49]
+
+[下载此壁纸][50]
+
+### 福利:Linux 圣诞颂歌
+
+这是给你的一份福利,给像我们一样的 Linux 爱好者的关于 Linux 的圣诞颂歌。
+
+在 [计算机世界的一篇文章][51] 中,[Sandra Henry-Stocker][52] 分享了这些圣诞颂歌。摘录片段如下:
+
+这一段用的 [Chestnuts Roasting on an Open Fire][53] 的曲调:
+
+> Running merrily on open source
+> With users happy as can be
+> We’re using Linux and getting lots done
+> And happy everything is free
+
+这一段用的 [The Twelve Days of Christmas][54] 的曲调:
+
+> On my first day with Linux, my admin gave to me a password and a login ID
+> On my second day with Linux my admin gave to me two new commands and a password and a login ID
+
+在 [这里][51] 阅读完整的颂歌。
+
+祝你享受 Linux!
+
+------
+
+via: https://itsfoss.com/christmas-linux-wallpaper/
+
+作者:[Abhishek Prakash][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://itsfoss.com/author/abhishek/
+[b]: https://github.com/lujun9972
+[1]: https://itsfoss.com/beautiful-linux-wallpapers/
+[2]: https://github.com/sergiolepore/ChristBASHTree
+[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/perl-tree.gif?resize=600%2C622&ssl=1
+[4]: https://itsfoss.com/christmas-linux-wallpaper/perl-tree/
+[5]: https://www.cyberciti.biz/open-source/command-line-hacks/linux-unix-desktop-fun-christmas-tree-for-your-terminal/
+[6]: http://www.klowner.com/
+[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmas-linux-wallpaper-featured.jpeg?resize=800%2C450&ssl=1
+[8]: http://klowner.com/wallery/christmas_tux_2017/download/ChristmasTux2017_3840x2160.png
+[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2016_3840x2160_result.jpg?resize=800%2C450&ssl=1
+[10]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2016_3840x2160_result/
+[11]: http://www.klowner.com/wallpaper/christmas_tux_2016/
+[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2015_2560x1920_result.jpg?resize=800%2C600&ssl=1
+[13]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2015_2560x1920_result/
+[14]: http://www.klowner.com/wallpaper/christmas_tux_2015/
+[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2014_2560x1440_result.jpg?resize=800%2C450&ssl=1
+[16]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2014_2560x1440_result/
+[17]: http://www.klowner.com/wallpaper/christmas_tux_2014/
+[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2013_result.jpg?resize=800%2C450&ssl=1
+[19]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2013_result/
+[20]: http://www.klowner.com/wallpaper/christmas_tux_2013/
+[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2012_2560x1440_result.jpg?resize=800%2C450&ssl=1
+[22]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2012_2560x1440_result/
+[23]: http://www.klowner.com/wallpaper/christmas_tux_2012/
+[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2011_2560x1440_result.jpg?resize=800%2C450&ssl=1
+[25]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2011_2560x1440_result/
+[26]: http://www.klowner.com/wallpaper/christmas_tux_2011/
+[27]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/christmastux2010_5120x2880_result.jpg?resize=800%2C450&ssl=1
+[28]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2010_5120x2880_result/
+[29]: http://www.klowner.com/wallpaper/christmas_tux_2010/
+[30]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2009_1600x1200_result.jpg?resize=800%2C600&ssl=1
+[31]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2009_1600x1200_result/
+[32]: http://www.klowner.com/wallpaper/christmas_tux_2009/
+[33]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2008_2560x1600_result.jpg?resize=800%2C500&ssl=1
+[34]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2008_2560x1600_result/
+[35]: http://www.klowner.com/wallpaper/christmas_tux_2008/
+[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2007_2560x1600_result.jpg?resize=800%2C500&ssl=1
+[37]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2007_2560x1600_result/
+[38]: http://www.klowner.com/wallpaper/christmas_tux_2007/
+[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2006_1024x768_result.jpg?resize=800%2C600&ssl=1
+[40]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2006_1024x768_result/
+[41]: http://www.klowner.com/wallpaper/christmas_tux_2006/
+[42]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2005_1600x1200_result.jpg?resize=800%2C600&ssl=1
+[43]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2005_1600x1200_result/
+[44]: http://www.klowner.com/wallpaper/christmas_tux_2005/
+[45]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2004_1600x1200_result.jpg?resize=800%2C600&ssl=1
+[46]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2004_1600x1200_result/
+[47]: http://www.klowner.com/wallpaper/christmas_tux_2004/
+[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2016/12/ChristmasTux2002_1600x1200_result.jpg?resize=800%2C600&ssl=1
+[49]: https://itsfoss.com/christmas-linux-wallpaper/christmastux2002_1600x1200_result/
+[50]: http://www.klowner.com/wallpaper/christmas_tux_2002/
+[51]: http://www.computerworld.com/article/3151076/linux/merry-linux-to-you.html
+[52]: https://twitter.com/bugfarm
+[53]: https://www.youtube.com/watch?v=dhzxQCTCI3E
+[54]: https://www.youtube.com/watch?v=oyEyMjdD2uk
From 54787c29b9075afa34d775af0a3b6a919ba83cbf Mon Sep 17 00:00:00 2001
From: lixinyuxx <524187166@qq.com>
Date: Wed, 19 Dec 2018 18:35:52 +0800
Subject: [PATCH 0192/4278] Update 20171223 My personal Email setup - Notmuch,
mbsync, postfix and dovecot.md
---
... - Notmuch, mbsync, postfix and dovecot.md | 56 +++++++++----------
1 file changed, 28 insertions(+), 28 deletions(-)
diff --git a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
index 0edd75e2bd..01e5c82f08 100644
--- a/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
+++ b/translated/tech/20171223 My personal Email setup - Notmuch, mbsync, postfix and dovecot.md
@@ -1,20 +1,20 @@
-我的个人电子邮件系统 - Notmuch, mbsync, postfix and dovecot
+我的个人电子邮件系统 - Notmuch, mbsync,postfix and dovecot
======
-我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。
+我使用个人电子邮件系统已经相当长的时间了, 没有文字记录。最近当我换了我的笔记本电脑(职业变更做的变动)我在试图重新创建本地邮件设置时迷茫了。所以这篇文章是一个自己的文档, 这样我就不用费劲就能修正过来。
### 服务器端
-我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说)
+我运行自己的邮件服务器, 并使用 Postfix 作为 SMTP 服务器和用 Dovecot 实现 IMAP 。我不打算详细介绍如何配置这些设置, 因为我的设置主要是通过使用 Jonas 为 Redpill 基础架构创建的脚本完成的。什么是 Redpill ?(用 Jonas 自己的话说)
-> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info)
+> Redpill 是一个概念 - 一种设置 Debian hosts 去跨组织协作的方式 我延申了这个概念, 并将其首次使用 Redpill 去联网 redpill.dk, 涉及我自己的网络 (jones.dk), 我的主要客户的网络 (homebase.dk),在德国的一个网络, 包括Skolelinux Germany (free-owl.de), 和 Vasudev 的网络 (copyninja.info)
-除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。
+除此之外, 我还有一个 dovecot sieve 过滤, 根据邮件的来源, 对高级邮件进行分类, 并将其分类到各种文件夹中。所有的规则都存在于每个有邮件地址的账户下的 ~/dovecot.sieve文件中。
-再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。
+再次, 我不详细介绍如何设置这些东西, 因为这不是我这个帖子的目标。
### 在我的笔记本电脑上
-在我的笔记本电脑上, 我已经按照4个部分设置
+在我的笔记本电脑上,我已经按照4个部分设置
1. 邮件同步: 使用 mbsync 命令完成
2. 分类: 使用 notmuch 完成
@@ -25,7 +25,7 @@
### 邮件同步
-邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户, 最近切换到 mbsync, 因为我觉得它比 OfflineIMAP 的配置更轻, 更简单。命令是由包 isync 提供的。
+邮件同步是使用 mbsync 工具完成的, 我以前是 OfflineIMAP 的用户,最近切换到 mbsync,因为我觉得它比 OfflineIMAP 的配置更轻,更简单。命令是由包 isync 提供的。
配置文件是 ~/.mbsyncrc. 下面是我的例子与一些个人设置。
@@ -79,17 +79,17 @@ SyncState *
Sync All
```
-对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许您提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。
+对上述配置中的一些有趣部分进行说明。一个是 PassCmd , 它允许你提供 shell 命令来获取帐户的密码。这样可以避免在配置文件中填写密码。我在我磁盘上的一些地方使用对称加密 gpg 和存储密码。这当然是由 Unix ACL 保护安全。
-实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。
+实际上, 我想使用我的公钥加密文件, 但当脚本在后台或通过 systemd 运行时, 解锁文件看起来很困难 (或看起来几乎不可能)。如果你有更好的建议, 我洗耳恭听:-)。
-下一个指令部分是模式。这使您可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders.
+下一个指令部分是模式。这使你可以有选择地同步来自邮件服务器的邮件。这对我来说真的很有帮助, 可以排除所有的垃圾 [Gmail]/ folders.
### 邮件分类
-一旦邮件在您本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。
+一旦邮件在你本地的设备, 我们需要一种方法来轻松地在邮件读取器中读取邮件。我最初的设置使用本地 dovecot 实例提供同步 Maildir, 并在 Gnus 中阅读。这种设置相比于设置所有服务器软件是有点大题小作, 但 Gnus 无法很好地应付 maildir 格式, 这是最好的方法。这个设置也有一个缺点, 那就是在你有大量邮件要看的时候快速搜索邮件。这是为数不多的情况。
-不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。
+不多的情况下我想很容易索引通过千兆字节的邮件档案, 并得到我需要的东西。我已经创建了一个小脚本, 它结合了执行 mbsync 和 notmuch 执行语句。我基于 Maildirs 标记邮件, 实际上是创建在服务器端使用 dovecot sieve 。下面是我的完整 shell 脚本, 它正在执行同步分类和删除垃圾邮件的任务。
```
#!/bin/sh
@@ -129,27 +129,27 @@ for mdir in $MDIR; do
done
```
-因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对, 这些邮件逃脱垃圾邮件过滤器进到我的 inbox, 并被我亲自标记为垃圾邮件。
+因此, 在运行 mbsync 之前, 我搜索所有标记为已删除的邮件, 并将其从系统中删除。接下来, 我在我的帐户上查找标记为 "垃圾邮件" 的邮件, 并将其移动到垃圾邮件文件夹。你做的对,这些邮件逃脱垃圾邮件过滤器进到我的 inbox ,并被我亲自标记为垃圾邮件。
-运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。
+运行 mbsync 后, 我基于他们的文件夹标记邮件 (搜索字符串文件夹:)。这让我可以很容易地得到一个邮件列表的内容, 而不需要记住列表地址。
### 阅读邮件
-现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer), 它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。您可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。
+现在, 我们已经实现同步和分类邮件,是时候来设置阅读部分。我使用 notmuch-emacs 界面来阅读邮件。我使用 emacs 的 Spacemacs 风格, 所以我花了一些时间写下一个私有层(private layer),它将我所有的快捷键和分类集中在一个地方, 不会扰乱我的整个. spacemacs 文件。你可以在 [notmuch-emacs-layer repository][1] 找到我私有层的代码。
### 发送邮件
-如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。
+如果我们能阅读邮件, 我们就需要能够回复邮件, 这还不够。而这是最近是我感到迷茫的一个略显棘手的部分, 不得不写这篇文章, 这样我就不会再忘记了。(当然也不必在网络上引用一些过时的帖子)。
-我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。
+我的设置发送邮件使用 postfix 作为 SMTP 客户端与我自己的 SMTP 服务器作为它的转接主机。转接的问题是, 它不是具有动态 IP 的主机。有几种方法可以允许具有动态 ip 的主机使用转接服务器, 一种是将邮件从其中发源于 my_network 或第二个使用 SASL 身份验证的 IP 地址。
-我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法)
+我的首选方法是使用 SASL 身份验证。为此, 我首先要为每台机器创建一个单独的账户, 它将把邮件传递到我的主服务器上。想法是不使用我的主帐户 SASL 进行身份验证。(最初我使用的是主要账户, 但 Jonas 给出了每个可行账户的想法)
```
adduser _relay
```
-这里替换 与您的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行
+这里替换 与你的笔记本电脑的名称或任何你正在使用的设备。现在我们需要调整 postfix , 作为转接服务器。因此, 在 postfix 配置中添加以下行
```
# SASL authentication
smtp_sasl_auth_enable = yes
@@ -159,28 +159,28 @@ relayhost = [smtp.copyninja.info]:submission
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
```
-因此, 这里的 relayhost 是您的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任您的移动主机, 并同意为您转发邮件。
+因此, 这里的 relayhost 是你的 postfix 实例将用于邮件转发到互联网的服务器名称。submission 的部分 postfix 将邮件转发到端口 587 (安全)。smtp_sasl_tls_security_options 设置为不允许匿名连接。这必须使转接服务器信任你的移动主机, 并同意为你转发邮件。
-/etc/postfix/sasl__asswd 是您需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。
+/etc/postfix/sasl__asswd 是你需要存储用于服务器 SASL 身份验证的帐户密码的文件。将以下内容放入其中。
```
[smtp.example.com]:submission user:password
```
- 用你的 SMTP 服务器名称替换 smtp.example.com ,您已输入的 relayhost 认证。 用您创建的用户及其密码替换 user with _relay 。
+ 用你的 SMTP 服务器名称替换 smtp.example.com ,你已输入的 relayhost 认证。 用你创建的用户及其密码替换 user with _relay 。
-若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。
+若要保护 sasl_passwd 文件, 并创建它的 hash(哈希) 进行 postfix 使用以下命令。
```
chown root:root /etc/postfix/sasl_passwd
chmod 0600 /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
```
-最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是您的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从您的系统中取出。
+最后的命令将创建 /etc/postfix/sasl_passwd.db 文件是你的文件的 hash /etc/postfix/sasl_passwd 具有相同的所有者和权限。现在重新加载 postfix, 并检查邮件是否使用邮件命令从你的系统中取出。
### Bonus 的部分
-好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。
+好吧, 因为我有一个脚本创建以上结合了邮件的同步和分类。我继续创建了一个 systemd 计时器, 以定期同步后台的邮件。就我而言, 每10分钟一次。下面是 mailsync.timer 文件。
```
[Unit]
Description=Check Mail Every 10 minutes
@@ -197,7 +197,7 @@ Unit=mailsync.service
WantedBy=default.target
```
-下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。
+下面是 mailsync. 服务, 这是邮件同步计时器执行我们的脚本所需要的。
```
[Unit]
@@ -219,7 +219,7 @@ systemctl enable --user mailsync.service
systemctl start --user mailsync.timer
```
-这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。
+这就是我从系统同步和发送邮件的方式。我从 Jonas Smedegaard 那里了解到了 afew ,他同时阅读了这篇帖子。因此, 下一步, 我将尝试使用 afew 改进我的 notmuch 配置, 当然还会有一个后续的帖子:-)。
--------------------------------------------------------------------------------
From 1cafa689f8fb0e38699d9171075c2abf378b7fe3 Mon Sep 17 00:00:00 2001
From: wwhio
Date: Thu, 20 Dec 2018 00:56:59 +0800
Subject: [PATCH 0193/4278] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=AF=95?=
=?UTF-8?q?=EF=BC=8C=E8=AF=B7=E6=B1=82=E6=A0=A1=E5=AF=B9=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../talk/20180623 The IBM 029 Card Punch.md | 72 -------------------
.../talk/20180623 The IBM 029 Card Punch.md | 71 ++++++++++++++++++
2 files changed, 71 insertions(+), 72 deletions(-)
delete mode 100644 sources/talk/20180623 The IBM 029 Card Punch.md
create mode 100644 translated/talk/20180623 The IBM 029 Card Punch.md
diff --git a/sources/talk/20180623 The IBM 029 Card Punch.md b/sources/talk/20180623 The IBM 029 Card Punch.md
deleted file mode 100644
index 6b36845c2d..0000000000
--- a/sources/talk/20180623 The IBM 029 Card Punch.md
+++ /dev/null
@@ -1,72 +0,0 @@
-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.
-
-There was once a golden era in which it was basically impossible to go over the 80-character limit. The 80-character limit was a physical reality, because there was no 81st column for an 81st character to fit in. Any programmers attempting to name a function something horrendously long and awful would discover, in a moment of delicious, slow-dawning horror, that there literally isn’t room for their whole declaration.
-
-This golden era was the era of punch card programming. By the 1960s, IBM’s punch cards had set the standard and the standard was that punch cards had 80 columns. The 80-column standard survived into the teletype and dumb terminal era and from there embedded itself into the nooks and crannies of our operating systems. Today, when you launch your terminal emulator and open a new window, odds are it will be 80 characters wide, even though we now have plenty of screen real estate and tend to favor longer identifiers over inscrutable nonsense like `iswcntrl()`.
-
-If questions on Quora are any indication, many people have trouble imagining what it must have been like to program computers using punch cards. I will admit that for a long time I also didn’t understand how punch card programming could have worked, because it struck me as awfully labor-intensive to punch all those holes. This was a misunderstanding; programmers never punched holes in cards the same way a train conductor does. They had card punch machines (also known as key punches), which allowed them to punch holes in cards using a typewriter-style keyboard. And card punches were hardly new technology—they were around as early as the 1890s.
-
-One of the most widely used card punch machines was the IBM 029. It is perhaps the best remembered card punch today.
-
-![][1]
-
-The IBM 029 was released in 1964 as part of IBM’s System/360 rollout. System/360 was a family of computing systems and peripherals that would go on to dominate the mainframe computing market in the late 1960s. Like many of the other System/360 machines, the 029 was big. This was an era when the distinction between computing machinery and furniture was blurry—the 029 was not something you put on a table but an entire table in itself. The 029 improved upon its predecessor, the 026, by supporting new characters like parentheses and by generally being quieter. It had cool electric blue highlights and was flat and angular whereas the 026 had a 1940s rounded, industrial look. Another of its big selling points was that it could automatically left-pad numeric fields with zeros, demonstrating that JavaScript programmers were not the first programmers too lazy to do their own left-padding.
-
-But wait, you might say—IBM released a brand-new card punch in 1964? What about that photograph of the Unix gods at Bell Labs using teletype machines in, like, 1970? Weren’t card punching machines passé by the mid- to late-1960s? Well, it might surprise you to know that the 029 was available in IBM’s catalog until as late as 1984. In fact, most programmers programmed using punch cards until well into the 1970s. This doesn’t make much sense given that there were people using teletype machines during World War II. Indeed, the teletype is almost of the same vintage as the card punch. The limiting factor, it turns out, was not the availability of teletypes but the availability of computing time. What kept people from using teletypes was that teletypes assumed an interactive, “online” model of communication with the computer. Before Unix and the invention of timesharing operating systems, your interactive session with a computer would have stopped everyone else from using it, a delay potentially costing thousands of dollars. So programmers instead wrote their programs offline using card punch machines and then fed them into mainframe computers later as batch jobs. Punch cards had the added benefit of being a cheap data store in an era where cheap, reliable data storage was hard to come by. Your programs lived in stacks of cards on your shelves rather than in files on your hard drive.
-
-So what was it actually like using an IBM 029 card punch? That’s hard to explain without first taking a look at the cards themselves. A typical punch card had 12 rows and 80 columns. The bottom nine rows were the digit rows, numbered one through nine. These rows had the appropriate digit printed in each column. The top three rows, called the “zone” rows, consisted of two blank rows and usually a zero row. Row 12 was at the very top of the card, followed by row 11, then rows zero through nine. This somewhat confusing ordering meant that the top edge of the card was called the 12 edge while the bottom was called the nine edge. A corner of each card was usually clipped to make it easier to keep a stack of cards all turned around the right way.
-
-![][2]
-
-When they were first invented, punch cards were meant to be punched with circular holes, but IBM eventually realized that they could fit more columns on a card if the holes were narrow rectangles. Different combinations of holes in a column represented different characters. For human convenience, card punches like the 029 would print each column’s character at the top of the card at the same time as punching the necessary holes. Digits were represented by one punched hole in the appropriate digit row. Alphabetical and symbolic characters were represented by a hole in a zone row and then a combination of one or two holes in the digit rows. The letter A, for example, was represented by a hole in the 12 zone row and another hole in the one row. This was an encoding of sorts, sometimes called the Hollerith code, after the original inventor of the punch card machine. The encoding allowed for only a relatively small character set; lowercase letters, for example, were not represented. Some clever engineer today might wonder why punch cards didn’t just use a binary encoding—after all, with 12 rows, you could encode over 4000 characters. The Hollerith code was used instead because it ensured that no more than three holes ever appeared in a single column. This preserved the structural integrity of the card. A binary encoding would have entailed so many holes that the card would have fallen apart.
-
-Cards came in different flavors. By the 1960s, 80 columns was the standard, but those 80 columns could be used to represent different things. The basic punch card was unlabeled, but cards meant for COBOL programming, for example, divided the 80 columns into fields. On a COBOL card, the last eight columns were reserved for an identification number, which could be used to automatically sort a stack of cards if it were dropped (apparently a perennial hazard). Another column, column seven, could be used to indicate that the statement on this card was a continuation of a statement on a previous card. This meant that if you were truly desperate you could circumvent the 80-character limit, though whether a two-card statement counts as one long line or just two is unclear. FORTRAN cards were similar but had different fields. Universities often watermarked the punch cards handed out by their computing centers, while other kinds of designs were introduced for special occasions like the [1976 bicentennial][3].
-
-Ultimately the cards had to be read and understood by a computer. IBM sold a System/360 peripheral called the IBM 2540 which could read up to 1000 cards per minute. The IBM 2540 ran electrical brushes across the surface of each card which made contact with a plate behind the cards wherever there was a hole. Once read, the System/360 family of computers represented the characters on each punch card using an 8-bit encoding called EBCDIC, which stood for Extended Binary Coded Decimal Interchange Code. EBCDIC was a proper binary encoding, but it still traced its roots back to the punch card via an earlier encoding called BCDIC, a 6-bit encoding which used the low four bits to represent a punch card’s digit rows and the high two bits to represent the zone rows. Punch card programmers would typically hand their cards to the actual computer operators, who would feed the cards into the IBM 2540 and then hand the printed results back to the programmer. The programmer usually didn’t see the computer at all.
-
-What the programmer did see a lot of was the card punch. The 029 was not a computer, but that doesn’t mean that it wasn’t a complicated machine. The best way to understand what it was like using the 029 is to watch [this instructional video][4] made by the computing center at the University of Michigan in 1967. I’m going to do my best to summarize it here, but if you don’t watch the video you will miss out on all the wonderful clacking and whooshing.
-
-The 029 was built around a U-shaped track that the punch cards traveled along. On the right-hand side, at the top of the U, was the card hopper, which you would typically load with a fresh stack of cards before using the machine. The IBM 029 worked primarily with 80-column cards, but the card hopper could accommodate smaller cards if needed. Your punch cards would start in the card hopper, travel along the line of the U, and then end up in the stacker, at the top of the U on the left-hand side. The cards would accumulate there in the order that you punched them.
-
-To turn the machine on, you flipped a switch under the desk at about the height of your knees. You then pressed the “FEED” key twice to get cards loaded into the machine. The business part of the card track, the bottom of the U, was made up of three separate stations: On the right was a kind of waiting area, in the middle was the punching station, and on the left was the reading station. Pressing the “FEED” key twice loaded one card into the punching station and one card into the waiting area behind it. A column number indicator right above the punching station told you which column you were currently punching. With every keystroke, the machine would punch the requisite holes, print the appropriate character at the top of the card, and then advance the card through the punching station by one column. If you punched all 80 columns, the card would automatically be released to the reading station and a new card would be loaded into the punching station. If you wanted this to happen before you reached the 80th column, you could press the “REL” key (for “release”).
-
-The printed characters made it easy to spot a mistake. But fixing a mistake, as the University of Michigan video warns, is not as easy as whiting out the printed character at the top of the card and writing in a new one. The holes are all that the computer will read. Nor is it as easy as backspacing one space and typing in a new character. The holes have already been punched in the column, after all, and cannot be unpunched. Punching more holes will only produce an invalid combination not associated with any character. The IBM 029 did have a backspace button that moved the punched card backward one column, but the button was placed on the face of the machine instead of on the keyboard. This was probably done to discourage its use, since backspacing was so seldom what the user actually wanted to do.
-
-Instead, the only way to correct a mistake was scrap the incorrect card and punch a new one. This is where the reading station came in handy. Say you made a mistake in the 68th column of a card. To fix your mistake, you could carefully repunch the first 67 columns of a new card and then punch the correct character in the 68th column. Alternatively, you could release the incorrect card to the reading station, load a new card into the punching station, and hold down the “DUP” key (for duplicate) until the column number indicator reads 68. You could then correct your mistake by punching the correct character. The reading station and the “DUP” key together allowed IBM 029 operators to easily copy the contents of one card to the next. There were all sorts of reasons to do this, but correcting mistakes was the most common.
-
-The “DUP” key allowed the 029’s operator to invoke the duplicate functionality manually. But the 029 could also duplicate automatically where necessary. This was particularly useful when punched cards were used to record data rather than programs. For example, you might be using each card to record information about a single undergraduate university student. On each card, you might have a field that contains the name of that student’s residence hall. Perhaps you find yourself entering data for all the students in one residence hall at one time. In that case, you’d want the 029 to automatically copy over the previous card’s residence hall field every time you reached the first column of the field.
-
-Automated behavior like this could be programmed into the 029 by using the program drum. The drum sat upright in the middle of the U above the punching station. You programmed the 029 by punching holes in a card and wrapping that card around the program drum. The punched card allowed you to specify the automatic behavior you expected from the machine at each column of the card currently in the punching station. You could specify that a column should automatically be copied from the previous card, which is how an 029 operator might more quickly enter student records. You could also specify, say, that a particular field should contain numeric or alphabetic characters, or that a given field should be left blank and skipped altogether. The program drum made it much easier to punch schematized cards where certain column ranges had special meanings. There is another [“advanced” instructional video][5] produced by the University of Michigan that covers the program drum that is worth watching, provided, of course, that you have already mastered the basics.
-
-Watching either of the University of Michigan videos today, what’s surprising is how easy the card punch is to operate. Correcting mistakes is tedious, but otherwise the machine seems to be less of an obstacle than I would have expected. Moving from one card to the next is so seamless that I can imagine COBOL or FORTRAN programmers forgetting that they are creating separate cards rather than one long continuous text file. On the other hand, it’s interesting to consider how card punches, even though they were only an input tool, probably limited how early programming languages evolved. Structured programming would eventually come along and encourage people to think of entire blocks of code as one unit, but I can see how punch card programming’s emphasis on each line made structured programming hard to conceive of. It’s no wonder that punch card programmers were not the ones that decided to enclose blocks with single curly braces entirely on their own lines. How wasteful that would have seemed!
-
-So even though nobody programs using punch cards anymore, every programmer ought to [try it][6] at least once—if only to understand why COBOL and FORTRAN look the way they do, or how 80 characters somehow became everybody’s favorite character limit.
-
-If you enjoyed this post, more like it come out every two weeks! Follow [@TwoBitHistory][7] on Twitter or subscribe to the [RSS feed][8] to make sure you know when a new post is out.
-
---------------------------------------------------------------------------------
-
-via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html
-
-作者:[Two-Bit History][a]
-选题:[lujun9972][b]
-译者:[译者ID](https://github.com/译者ID)
-校对:[校对者ID](https://github.com/校对者ID)
-
-本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
-
-[a]: https://twobithistory.org
-[b]: https://github.com/lujun9972
-[1]: https://twobithistory.org/images/ibm029_front.jpg
-[2]: https://twobithistory.org/images/card.png
-[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg
-[4]: https://www.youtube.com/watch?v=kaQmAybWn-w
-[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU
-[6]: http://www.masswerk.at/keypunch/
-[7]: https://twitter.com/TwoBitHistory
-[8]: https://twobithistory.org/feed.xml
diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md
new file mode 100644
index 0000000000..a1283e70b2
--- /dev/null
+++ b/translated/talk/20180623 The IBM 029 Card Punch.md
@@ -0,0 +1,71 @@
+IBM 029 型打孔机
+======
+我知道这很学院派,可一行超过 80 个字符的代码还是让我抓狂。我也在网上见过不少人认为即在现代视网膜屏幕下也应当采用行长度为 80 个字符的标准,可他们都不理解我对破坏这一标准的怒火,就算 1 个字符也不行。
+
+在这一标准的黄金时期,一行代码的长度几乎不会超过 80 个字符的限制。在那时,这一限制是物理的,没有第 81 列用于存放第 81 个字符。每一个试图把函数名起的又长又臭的程序员都会在短暂的愉悦后迎来更多的麻烦,而这仅仅时因为没有足够的空间放下整个函数的声明。
+
+这一黄金时期也是打孔卡编程时期。在 20 世纪 60 年代, IBM 打孔卡的特性,也就是打孔卡的长度为 80 个字符成为了打孔卡的标准。这一标准在后来的电传打字机和哑终端时期得以延续,并逐渐成为操作系统中隐藏的细节。时至今日,即使我们用上了更大、更好的屏幕,偏向于使用更长的标识符而不是类似 `iswcntrl()` 这样令人难以猜测的函数名,可当你打开新的终端模拟器窗口时,默认的宽度依然是 80 个字符。
+
+从 Quora 上的很多问题中可以发现,很多人并不能想象如何使用打孔卡给计算机编程。我承认,在很长的一段时间里我也不能理解卡编程成是如何工作的,因为这让我想到有很多劳工不停的给这些打孔卡打孔。当然,这是一个误解,程序员不需要亲自给打孔卡打孔,就像是火车调度员不用亲自扳道岔。程序员们有打孔机(也被称为键控打孔机),这让他们可以使用打字机式的键盘给打孔卡打孔。这样的设备在 19 世纪 90 年代时就已经不是什么新技术了。
+
+那时,最为广泛使用的打孔机之一便是 IBM 029 型打孔机。就算在今天,它也许是最棒的打孔机。
+
+![][1]
+
+IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充的程序员。
+(译者注:这项功能需要额外的 4 张 [标准模块系统卡](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如数字区长度为 6 时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch))
+
+等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。
+
+那么实际使用 IBM 029 型打孔机是个什么样子呢?这很难向没有实际看过打孔卡的人解释。一张打孔卡通常有12行80列。打孔卡下面是从 1 到 9 的数字行,打孔卡上的每一列都有这些行所对应的数字。最上面的三行是空间行,通常由两行空白行和一行 0 行组成。第 12 行是打孔卡最顶层的行,接下来是 11 行,随后是从数字 0 到 9 所在的行。这个有点让人感到困惑的顺序的原因是打孔卡的上边缘被称为12 边、下边缘被称为 9 边。那时,为了让打孔卡便于整理,常常会剪去打孔卡的一个角。
+
+![][2]
+(译者注:可参考[EBCDIC 编码](https://zh.wikipedia.org/wiki/EBCDIC))
+
+在打孔卡发明之初,孔洞的形状是圆形的,但是 IBM 最终意识到如果使用窄长方形作为孔洞,一张卡就可以放下更多的列了。每一列中孔洞的不同组合就可以表达不同的字符。像 029 型这样的拥有人性化设计的打孔机除了完成本质的打孔任务外,还会在打孔卡最上方打印出每一列所对应的字符。输入是数字就在对应的数字行上打孔。输入的是字母或符号就用一个在空间列的孔和一或俩个在数字列的孔的组合表示,例如字母 A 就用一个在第 12 空间行的空和一个数字 1 所在行的孔表示。这是一种顺序编码,在第一台打孔机被发明后,也叫 Hollerith 编码。这种编码只能表示相对较小的一套字符集,小写字母就没有包含在这套字符集中,但它的优势在于保留了打孔卡的结构强度。如果直接使用二进制编码,打孔卡可能会因为孔洞过于密集而断裂。
+
+打孔卡也有不同。在 20 世纪 60 年代,80 列虽然是标准,但表达的方式不一定相同。基础打孔卡是无标注的,但用于 COBOL 编程的打孔卡会把最后的 8 列保留,供标识数保存使用。这一标识数可以在打孔卡被打乱 (例如一叠打孔卡掉在地上了) 后用于自动排序。此外,第 7 列被用于表示本张打孔卡上的是否是上一张打孔卡一起构成一条语句。也就是说当你真的对 80 字符的限制感到绝望的时候,还可以用两张卡甚至更多的卡拼接成一条长语句。用于 FORTRAN 编程的打孔卡和 COBOL 打孔卡类似,但是定义的列不同。大学里使用的打孔卡通常会由其计算机中心加上水印,其他的设计则会在如 [1976 年美国独立 200 周年][3] 的特殊场合才会加入。
+
+最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。
+
+程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。
+
+029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。
+
+029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放” 键完成上面的操作。
+
+在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。
+
+实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。
+
+“重复”按键允许 029 型打孔机的操作员手动调用重复的函数。但是 029 型打孔机还可以设置为自动重复。当用于记录数据而不是编程时,这项功能十分有效。举个例子,当用打孔卡来记录大学生的信息时,每张卡片上都需要输入学生的宿舍楼的名字,如果发现所输入信息的学生都在同一栋楼,就可以使用 029 型打孔机的自动重复功能来完成宿舍楼名称的填写。
+
+像这样的自动化操作可以通过打孔卡给 029 型打孔机编程控制。安装打孔卡的圆柱形装置就在 U 形轨道中间部分的右上角。通过使用 029 型在打孔卡上写下程序,然后把打孔卡的装入圆柱形装置,再将其安装到打孔机内后,就完成了一次给 029 型打孔机的编程任务。用户可以通过这种方式对打孔卡的每一列都按需要定义不同的自动化操作。029 型打孔机允许指定某些列重复上一张打孔卡相同位置的字符,这就是它能更快的输入学生信息的理由。它还允许指定某些列只能输入数字或者字母,指定特定的列为空或者到某一列时就直接跳过一整张打孔卡。这样的可编程特性使它在输入拥有固定格式的数据时效率很高。密歇根大学制作的[进阶教学视频][5]包括了给 029 型打孔机编程的过程,如果你已经掌握了它的基础操作,就快去看看吧。
+
+这会儿,无论你是否看了密歇根大学制作的视频,都会感叹打孔机的操作之简便。虽然修正错误的过程很乏味,但除此之外,操作一台打孔机并不像想象的那样复杂。我甚至可以想象打孔卡之间的无缝切换让 COBOL 和 FORTRAN 程序员忘记了他们的程序是打在不同的打孔卡上而不是写在一个连续的文本文件内。另一方面,思考一下打孔机是如何影响编程语言的发展也是很有趣的,虽然它仅仅是一台输入设备。结构化编程最终会出现并鼓励程序员把整个代码块视为一个整体,但可以想象打孔卡程序员们强调每一行的作用且难以认同结构化编程的场景。同时你能够理解他们为什么不把代码块闭合所使用的括号放在单独的一行,只是因为这样会浪费打孔卡。
+
+现在,虽然没有人再使用打孔卡编程了,每个程序员都该试试[这个][6],哪怕一次也好。或许你因此能够更好的理解 COBOL 和 FORTRAN 的历史,或许你就能体会到为什么每个人把 80 个字符作为长度限制的标注。
+
+喜欢吗?这里每两周都会发表一篇这样的文章。请在推特上关注我们 [@TwoBitHistory][7] 或者订阅我们的 [RSS][8],这样你就能在第一时间收到新文章的通知。
+
+--------------------------------------------------------------------------------
+
+via: https://twobithistory.org/2018/06/23/ibm-029-card-punch.html
+
+作者:[Two-Bit History][a]
+选题:[lujun9972][b]
+译者:[wwhio](https://github.com/wwhio)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: https://twobithistory.org
+[b]: https://github.com/lujun9972
+[1]: https://twobithistory.org/images/ibm029_front.jpg
+[2]: https://twobithistory.org/images/card.png
+[3]: http://www.jkmscott.net/data/Punched%20card%20013.jpg
+[4]: https://www.youtube.com/watch?v=kaQmAybWn-w
+[5]: https://www.youtube.com/watch?v=SWD1PwNxpoU
+[6]: http://www.masswerk.at/keypunch/
+[7]: https://twitter.com/TwoBitHistory
+[8]: https://twobithistory.org/feed.xml
From 6abe0371b0c84efcec18609eb2656a360cf58121 Mon Sep 17 00:00:00 2001
From: wwhio
Date: Thu, 20 Dec 2018 00:58:33 +0800
Subject: [PATCH 0194/4278] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E6=A0=A1=E5=AF=B9=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
translated/talk/20180623 The IBM 029 Card Punch.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md
index a1283e70b2..f905ee1481 100644
--- a/translated/talk/20180623 The IBM 029 Card Punch.md
+++ b/translated/talk/20180623 The IBM 029 Card Punch.md
@@ -28,13 +28,13 @@ IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件
最终,这些打孔卡都要被计算机读取和计算。 IBM 出售的 System/360 大型计算机的外设 IBM 2540 可以以每分钟 1000 张打孔卡的速度读取这些卡片。IBM 2540 使用电刷扫过每张打孔卡,电刷通过孔洞就可以接触到卡片后面的金属板完成一次读取。一旦读取完毕, System/360 大型计算机就会把每张打孔卡上的数据使用一种定长的 8 位编码保存,这种编码是扩展的二进制十数交换码,简写为 EBCDIC 编码。它的源自于早期打孔卡所使用的 BCDIDC 编码,这一 6 位编码使用低 4 位表示数字行,高 2 位表示空间行。程序员们在打孔卡上编写玩程序后,会把卡片们交给计算机操作员,操作员们会把这些卡片放入 IBM 2540 ,再把打印结果交给程序员。那时的程序员大多都没有见过计算机长什么样。
-程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。
+程序员们真正能见到的是很多打孔机。 029 型打孔机虽然不是计算机,但这并不意味着它不是一台复杂的机器。看看这个由密歇根大学在 1967 年制作的[教学视频][4],你就能更好的理解使用一台 029 型打孔机是什么情形了。我会尽可能在这里总结这段视频,但如果你不去亲自看看的话,你会错过许多惊奇和感叹。
029 型打孔机的结构围绕着一个打孔卡穿过机器的 U 形轨道开始。使用打孔机时,右手边也就是 U 形轨道的右侧顶部是进卡卡槽,使用前通常在里面放入一叠未使用的打孔卡。虽然 029 型打孔机主要使用 80 列打孔卡,但在需要的情况下也可以使用更小号的打孔卡。在打孔机的使用过程中,打孔卡离开轨道右上端的进卡卡槽,顺着 U 形轨道移动并最终进入左上端的出卡卡槽。这一流程可以保证出卡卡槽中的打孔卡按打孔时的先后顺序排列。
-029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放” 键完成上面的操作。
+029 型打孔机的开关在桌面下膝盖高度的位置。在开机后,连按两次 “装入” 键让机器自动将打孔卡从进卡卡槽中取出并移动到机器内。 U 形轨道的底部是打孔机的核心区域,它由三个部分组成:右侧是等待区,中间是打孔操作区,左侧是阅读区。连按两次 “装入” 键,机器就会把一张打孔卡装入打孔机的打孔操作区,另一张打孔卡进入等待区。在打孔操作区上方有一个列数指示器来显示当前打孔所在的列的位置。这时,每按下一个按键,机器就会在打孔卡对应的位置打孔并在卡片的顶部打印按键对应的字符,随后将打孔卡向左移动一列。如果一张卡片的 80 列全部被打上了数据,这张卡片会被打孔操作区自动释放并进入阅读区,同时,一张新的打孔卡会被装入打孔操作区。如果没有打完全部的 80 列,可以使用 “释放” 键完成上面的操作。
-在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。
+在打孔卡上打印对应的字符这一设计让人很容易分辨出错误。但就像密歇根大学的视频中警告的那样,打孔卡上修正一个错误可不像擦掉一个打印的字符然后再写上一个新的那样容易,因为计算机只会根据卡片上的孔来读取信息。因为被打出的孔不能被复原,所以并不能直接退回一列然后再打上一个新的字符。打出更多的孔也只能让这一列的组合变成一个无效字符。 IBM 029 型打孔机上虽然有一个可以让打孔卡回退一列的退格按键,但这个按键被放置在机器上而非在键盘上。这样的设计也许是为了阻止这个按键的使用,因为实际上很少有用户需要这个功能。
实际上,只有废弃错误的打孔卡再在新的打孔卡上重新打孔这一种修正错误的方式。这就是阅读区的用武之处了。当你发现打孔卡上的第 68 列出错时,你需要在新的打孔卡上小心的给前 67 列打孔,然后给第 68 列打上正确的字母。另一种操作方式是把带有错误信息的打孔卡放在阅读区,同时在打孔操作区载入一张新的打孔卡,然后按下 “重复” 按键直到列数指示器显示 68 列。这时按下正确的字符来修正错误。阅读区和重复按键使得 029 型打孔机很容易复制打孔卡上的内容。当然,这一功能的使用可能有各种各样的原因,但改错是最常见的。
From 9a7e0dce391e93e9566f04297cdaef29ceff1ff8 Mon Sep 17 00:00:00 2001
From: wwhio
Date: Thu, 20 Dec 2018 00:59:32 +0800
Subject: [PATCH 0195/4278] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?=
=?UTF-8?q?=EF=BC=8C=E7=94=B3=E8=AF=B7=E6=A0=A1=E5=AF=B9=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
translated/talk/20180623 The IBM 029 Card Punch.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/translated/talk/20180623 The IBM 029 Card Punch.md b/translated/talk/20180623 The IBM 029 Card Punch.md
index f905ee1481..e13a10593c 100644
--- a/translated/talk/20180623 The IBM 029 Card Punch.md
+++ b/translated/talk/20180623 The IBM 029 Card Punch.md
@@ -13,7 +13,7 @@ IBM 029 型打孔机
![][1]
IBM 029 型打孔机在 1964 年作为 IBM 的 System/360 大型电脑的配件发售的。 System/360 是计算系统与外设所组成的一个系列,在 20 世纪 60 年代晚期,它几乎垄断了整个大型计算机市场。就像其它 System/360 外设一样, 029 型打孔机也是个大块头。那时,计算机和家具的界限还很模糊,但 029 型打孔机可不是那种会占领你的整张桌子的机器。它改进自 026 型打孔机,增加了新的字符支持,如括号,总体上也更加安静。与前辈 026 型所展出 20 世纪 40 年代的圆形按钮与工业化的样貌相比, 029 型的按键方正扁平、功能按键还有酷炫的蓝色高亮提示。它的另一个重要买点是它能够在数字区左侧自动的填充 0 ,这证明了 JavaScript 程序员不是第一批懒得自己做左填充的程序员。
-(译者注:这项功能需要额外的 4 张 [标准模块系统卡](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如数字区长度为 6 时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch))
+(译者注:这项功能需要额外的 4 张 [标准模块系统卡](https://en.wikipedia.org/wiki/IBM_Standard_Modular_System)才能使用。例如设置数字区域长度为 6 列时,操作员只需要输入 73 ,打孔机会自动填充起始位置上的 4 个 0 ,故最终输出 000073。[更多信息](https://en.wikipedia.org/wiki/Keypunch#IBM_029_Card_Punch))
等等!你说的是 IBM 在 1964 年发布了全新的打孔机?你知道那张在贝尔实验室拍摄的 Unix 之父正在使用电传打字机的照片吗?那是哪一年的来着?1970?打孔机不是应该在 20 世纪 60 年代中期到晚期时就过时了吗?是的,你也许会奇怪,为什么直到 1984 年, IBM 的产品目录中才出现 029 型打孔机的身影。事实上,直到 20 世纪 70 年代,大多数程序员仍然在使用打孔卡编程。其实二战期间就已经有人在用电传打字机了,可那时并没能普及。客观的讲,电传打字机几乎和打孔卡一样古老。也许和你想象的恰恰相反,并不是电传打字机本身限制了他的普及,而是计算时间。人们拒绝使用电传打字机的原因是,它是可交互的,它和计算机使用“在线”的传输方式。在以 Unix 为代表的分时操作系统被发明前,你和电脑的交互会被任何人的使用而打断,而这一点延迟通常意味着几千美元的损失。所以程序员们普遍选择离线地使用打孔机编程,再将打孔卡放入大型计算机中,作为批任务执行。在那时,还没有即廉价又可靠的存储设备,可打孔卡的廉价优势已经足够让他成为那时最流行的数据存储方式了。那时的程序是书架上一落的打孔卡而不是硬盘里的一堆文件。
From d12dfbfd5465731b90ad51d3c8ed9b8e98cffe65 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Thu, 20 Dec 2018 08:52:51 +0800
Subject: [PATCH 0196/4278] translated
---
...to The Matrix at the Linux command line.md | 54 -------------------
...to The Matrix at the Linux command line.md | 54 +++++++++++++++++++
2 files changed, 54 insertions(+), 54 deletions(-)
delete mode 100644 sources/tech/20181212 Patch into The Matrix at the Linux command line.md
create mode 100644 translated/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
deleted file mode 100644
index 108fb7c97d..0000000000
--- a/sources/tech/20181212 Patch into The Matrix at the Linux command line.md
+++ /dev/null
@@ -1,54 +0,0 @@
-[#]: collector: (lujun9972)
-[#]: translator: (geekpi)
-[#]: 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.
-![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr)
-
-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.
-![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif)
-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
diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md
new file mode 100644
index 0000000000..1793ec25ad
--- /dev/null
+++ b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md
@@ -0,0 +1,54 @@
+[#]: collector: (lujun9972)
+[#]: translator: (geekpi)
+[#]: 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)
+
+在命令行中步入黑客帝国
+======
+使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。
+![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr)
+
+你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。
+
+其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。
+
+在我们在接近下一年的时候,现在是回顾和期待的好时机。2019 年会为你带来什么?2019 年意味着什么?
+
+我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。
+
+当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。
+
+今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需:
+
+```
+$ dnf install cmatrix
+```
+
+接着,只需在你的终端输入 **cmatrix** 即可运行。
+![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif)
+你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。
+
+你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
+
+了解一下昨天的玩具,[在 Linux 中让 Bash 提示符变得像冬天][2],还有记得明天再来!
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/12/linux-toy-cmatrix
+
+作者:[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://en.wikipedia.org/wiki/The_Matrix
+[2]: https://github.com/abishekvashok/cmatrix
+[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt
\ No newline at end of file
From d32cebf5e13418d3503d69ab39076dad932ea782 Mon Sep 17 00:00:00 2001
From: geekpi
Date: Thu, 20 Dec 2018 08:59:40 +0800
Subject: [PATCH 0197/4278] translating
---
sources/tech/20181208 Play Tetris at your Linux terminal.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sources/tech/20181208 Play Tetris at your Linux terminal.md b/sources/tech/20181208 Play Tetris at your Linux terminal.md
index d3a94bcaf6..db1fe62c24 100644
--- a/sources/tech/20181208 Play Tetris at your Linux terminal.md
+++ b/sources/tech/20181208 Play Tetris at your Linux terminal.md
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From c2550effc87eb921631245f2c7209043d7d4d8ad Mon Sep 17 00:00:00 2001
From: zjon
Date: Thu, 20 Dec 2018 11:09:22 +0800
Subject: [PATCH 0198/4278] Update 20171012 7 Best eBook Readers for Linux.md
zjon is translating
20171012 7 Best eBook Readers for Linux
---
sources/tech/20171012 7 Best eBook Readers for Linux.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/sources/tech/20171012 7 Best eBook Readers for Linux.md b/sources/tech/20171012 7 Best eBook Readers for Linux.md
index 5198f1bdc0..9f69c6decb 100644
--- a/sources/tech/20171012 7 Best eBook Readers for Linux.md
+++ b/sources/tech/20171012 7 Best eBook Readers for Linux.md
@@ -1,3 +1,4 @@
+zjon is translating
7 Best eBook Readers for Linux
======
**Brief:** In this article, we are covering some of the best ebook readers for Linux. These apps give a better reading experience and some will even help in managing your ebooks.
From 83278751d60a03c62e3dfe31a6d5bb8507078479 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com>
Date: Thu, 20 Dec 2018 20:26:31 +0800
Subject: [PATCH 0199/4278] Create 20180912 How to turn on an LED with Fedora
IoT.md
---
...2 How to turn on an LED with Fedora IoT.md | 201 ++++++++++++++++++
1 file changed, 201 insertions(+)
create mode 100644 translated/tech/20180912 How to turn on an LED with Fedora IoT.md
diff --git a/translated/tech/20180912 How to turn on an LED with Fedora IoT.md b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md
new file mode 100644
index 0000000000..59bbc1280b
--- /dev/null
+++ b/translated/tech/20180912 How to turn on an LED with Fedora IoT.md
@@ -0,0 +1,201 @@
+# 如何使用 Fedora IoT 开启 LED 灯
+
+![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg)
+
+你喜欢 Fedora、容器和树莓派吗?这三者结合操控 LED 会怎么样?本文介绍的是 Fedora IoT,将展示如何在树莓派上安装预览镜像。还将学习如何与 GPIO 交互以开启 LED。
+
+### 什么是 Fedora IoT?
+
+Fedora IoT 是当前 Fedora 项目的目标之一,计划成为一个完整的 Fedora 版本。Fedora IoT 将是一个在ARM(目前仅限 aarch64)例如树莓派,以及 x86_64 架构设备上运行的系统。
+
+![][1]
+
+Fedora IoT 基于 OSTree 开发, 就像[Fedora Silverblue][2] 和以往的 [Atomic Host][3].
+
+### 下载和安装 Fedora IoT
+
+官方 Fedora IoT 镜像将和 Fedora 29 一起发布。但是在此期间你可以下载 [Fedora 28-based 镜像][4] 来进行这个实验。
+
+你有两种方法来安装这个系统:使用 dd 命令闪存SD卡,或者使用 fedora-arm-installer 工具。Fedora 的 Wiki 里面提供了更多关于[设置物理设备][5] 的信息来开发 IoT。另外,你可能需要调整第三个分区的大小。
+
+把 SD 卡插入到设备并运行,需要创建一个用户来完成安装。这个步骤需要串行连接或带键盘的 HDMI 显示器来与设备进行交互。
+
+当系统安装完成后,下一步就是要设置网络连接。使用你刚才创建的用户登录系统,可以使用下列方式之一完成网络连接设置:
+
+- 如果你需要手动配置你的网络,可能需要执行类似如下命令,需要保证设置正确的网络地址:
+
+```
+ $ nmcli connection add con-name cable ipv4.addresses \
+ 192.168.0.10/24 ipv4.gateway 192.168.0.1 \
+ connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \
+ type ethernet ifname eth0 ipv4.method manual
+
+```
+
+- 如果你网络上运行着 DHCP 服务,可能需要类似如下命令:
+
+```
+ $ nmcli con add type ethernet con-name cable ifname eth0
+```
+
+
+
+### **Fedora 中的 GPIO 接口**
+
+许多关于 Linux 上 GPIO 的教程都关注传统的 GPIO sysfis 接口。这个接口已经不推荐使用了,并且上游 Linux 内核社区由于安全和其他问题的缘故打算完全删除它。
+
+Fedora 已经不将这个传统的接口编译到内核了,因此在系统上没有 /sys/class/gpio 这个文件。此教程使用一个上游内核提供的一个新的字符设备 /dev/gpiochipN 。这是目前和 GPIO 交互的方式。
+
+为了和这个新设备进行交互,你需要使用一个库和一系列命令行界面工具。公共命令行工具比如说 echo 和 cat 在此设备上无法正常工作。
+
+你可以通过安装 libgpiod-utils 包来安装命令行界面工具。python3-libgpiod 包提供了相应的 Python 库。
+
+### **使用 Podman 来创建一个容器**
+
+[Podman][6] 是一个容器运行环境,其命令行界面类似于Docker。Podman的一大优势是它不会在后台运行任何守护进程。这对于资源有限的设备尤其有用。Podman 还允许您使用 systemd 单元文件启动容器化服务。此外,它还有许多其他功能。
+
+我们使用如下两步来创建一个容器:
+
+```
+1. 创建包含所需包的分层镜像。
+2. 使用分层镜像创建一个新容器。
+```
+
+
+
+首先创建一个 Dockerfile 文件,内容如下。这些内容告诉 podman 基于可使用的最新 Fedora 镜像来构建我们的分层镜像。然后就是更新系统和安装一些软件包:
+
+```
+FROM fedora:latest
+RUN dnf -y update
+RUN dnf -y install libgpiod-utils python3-libgpiod
+
+```
+
+这样你就完成了镜像的生成前的配置工作,这个镜像基于最新的 Fedora,而且包含了和 GPIO 交互的软件包。
+
+现在你就可以运行下方命令来构建你的基本镜像了:
+
+```
+$ sudo podman build --tag fedora:gpiobase -f ./Dockerfile
+
+```
+
+你已经成功创建了你的自定义镜像。这样以后你就可以不用每次都重新搭建环境了,而是基于你创建的镜像来完成工作。
+
+### 使用 Podman 完成工作
+
+为了确认当前的镜像,可以运行下方命令:
+
+```
+$ sudo podman images
+REPOSITORY TAG IMAGE ID CREATED SIZE
+localhost/fedora gpiobase 67a2b2b93b4b 10 minutes ago 488MB
+docker.io/library/fedora latest c18042d7fac6 2 days ago 300MB
+
+```
+
+现在,启动容器并进行一些实际的实验。 容器通常是隔离的,无法访问主机系统,包括GPIO接口。 因此需要在启动容器时将其挂载在容器内。 可以使用以下命令中的 -device 选项来解决:
+
+```
+$ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash
+
+```
+
+运行之后就进入了正在运行的容器中。 在继续之前,这里有一些容器命令。 输入 exit 或者按下 **Ctrl+D** 来退出容器。
+
+显示所有存在的容器可以运行如下命令:
+
+```
+$ sudo podman container ls -a
+CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+64e661d5d4e8 localhost/fedora:gpiobase /bin/bash 37 seconds ago Exited (0) Less than a second ago gpioexperiment
+
+```
+
+使用如下命令创建一个新的容器:
+
+```
+$ sudo podman run -it --name newexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash
+
+```
+
+如果想删除容器可以使用如下命令:
+
+```
+$ sudo podman rm newexperiment
+
+```
+
+### **开启 LED 灯**
+
+现在可以使用已创建的容器。 如果容器已经退出,请使用以下命令再次启动它:
+
+```
+$ sudo podman start -ia gpioexperiment
+
+```
+
+如前所述,可以使用 Fedora 中 libgpiod-utils 包提供的 CLI 工具。 要列出可用的 GPIO 芯片可以使用如下命令:
+
+```
+$ gpiodetect
+gpiochip0 [pinctrl-bcm2835] (54 lines)
+
+```
+
+要获取特定芯片的公开列表,请运行:
+
+```
+$ gpioinfo gpiochip0
+
+```
+
+请注意,物理引脚数与前一个命令打印的行数之间没有相关性。 重要的是 BCM 编号,如 [pinout.xyz][7] 所示。 建议不要使用没有相应 BCM 编号的线路。
+
+现在,将 LED 连接到物理引脚40,也就是 BCM 21。请记住:LED的短腿(负极,称为阴极)必须连接到带有330欧姆电阻的树莓派的 GND 引脚, 并且长腿(阳极)到物理引脚40。
+
+运行以下命令打开LED。,按下 **Ctrl + C ** 关闭:
+
+```
+$ gpioset --mode=wait gpiochip0 21=1
+
+```
+
+要点亮一段时间,请添加 -b(在后台运行)和 -s NUM(多少秒)参数,如下所示。 例如,要点亮 LED 5秒钟,运行如下命令:
+
+```
+$ gpioset -b -s 5 --mode=time gpiochip0 21=1
+
+```
+
+另一个有用的命令是 gpioget。 它可以获得引脚的状态(高或低),可用于检测按钮和开关。
+
+![Closeup of LED connection with GPIO][8]
+
+### **总结**
+
+你也可以使用 Python 操控 LED - [这里有一些例子][9]。 也可以在容器内使用 i2c 设备。 此外,Podman 与此 Fedora 版本并不严格相关。 你可以在任何现有的 Fedora Edition 上安装它,或者在 Fedora 中使用两个基于 OSTree 的新系统进行尝试:[Fedora Silverblue][2] 和 [Fedora CoreOS][10]。
+
+------
+
+via: https://fedoramagazine.org/turnon-led-fedora-iot/
+
+作者:[Alessio Ciregia][a]
+选题:[lujun9972](https://github.com/lujun9972)
+译者:[ScarboroughCoral](https://github.com/ScarboroughCoral)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]: http://alciregi.id.fedoraproject.org/
+[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/oled-1024x768.png
+[2]: https://teamsilverblue.org/
+[3]: https://www.projectatomic.io/
+[4]: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/
+[5]: https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device
+[6]: https://github.com/containers/libpod
+[7]: https://pinout.xyz/
+[8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png
+[9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples
+[10]: https://coreos.fedoraproject.org/
From 3c68a0d9d6b73f7ebd64bc1bca2a51bdc59cdb06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E6=98=8E=E5=B2=B3?= <3249977074@qq.com>
Date: Thu, 20 Dec 2018 20:28:22 +0800
Subject: [PATCH 0200/4278] Delete 20180912 How to turn on an LED with Fedora
IoT.md
---
...2 How to turn on an LED with Fedora IoT.md | 202 ------------------
1 file changed, 202 deletions(-)
delete mode 100644 sources/tech/20180912 How to turn on an LED with Fedora IoT.md
diff --git a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md b/sources/tech/20180912 How to turn on an LED with Fedora IoT.md
deleted file mode 100644
index 5f1843fc83..0000000000
--- a/sources/tech/20180912 How to turn on an LED with Fedora IoT.md
+++ /dev/null
@@ -1,202 +0,0 @@
-Translating by ScarboroughCoral
-How to turn on an LED with Fedora IoT
-======
-
-![](https://fedoramagazine.org/wp-content/uploads/2018/08/LED-IoT-816x345.jpg)
-
-Do you enjoy running Fedora, containers, and have a Raspberry Pi? What about using all three together to play with LEDs? This article introduces Fedora IoT and shows you how to install a preview image on a Raspberry Pi. You’ll also learn how to interact with GPIO in order to light up an LED.
-
-### What is Fedora IoT?
-
-Fedora IoT is one of the current Fedora Project objectives, with a plan to become a full Fedora Edition. The result will be a system that runs on ARM (aarch64 only at the moment) devices such as the Raspberry Pi, as well as on the x86_64 architecture.
-
-![][1]
-
-Fedora IoT is based on OSTree, like [Fedora Silverblue][2] and the former [Atomic Host][3].
-
-### Download and install Fedora IoT
-
-The official Fedora IoT images are coming with the Fedora 29 release. However, in the meantime you can download a [Fedora 28-based image][4] for this experiment.
-
-You have two options to install the system: either flash the SD card using a dd command, or use a fedora-arm-installer tool. The Fedora Wiki offers more information about [setting up a physical device][5] for IoT. Also, remember that you might need to resize the third partition.
-
-Once you insert the SD card into the device, you’ll need to complete the installation by creating a user. This step requires either a serial connection, or a HDMI display with a keyboard to interact with the device.
-
-When the system is installed and ready, the next step is to configure a network connection. Log in to the system with the user you have just created choose one of the following options:
-
- * If you need to configure your network manually, run a command similar to the following. Remember to use the right addresses for your network:
-```
- $ nmcli connection add con-name cable ipv4.addresses \
- 192.168.0.10/24 ipv4.gateway 192.168.0.1 \
- connection.autoconnect true ipv4.dns "8.8.8.8,1.1.1.1" \
- type ethernet ifname eth0 ipv4.method manual
-
-```
-
- * If there’s a DHCP service on your network, run a command like this:
-
-```
- $ nmcli con add type ethernet con-name cable ifname eth0
-```
-
-
-
-
-### **The GPIO interface in Fedora**
-
-Many tutorials about GPIO on Linux focus on a legacy GPIO sysfis interface. This interface is deprecated, and the upstream Linux kernel community plan to remove it completely, due to security and other issues.
-
-The Fedora kernel is already compiled without this legacy interface, so there’s no /sys/class/gpio on the system. This tutorial uses a new character device /dev/gpiochipN provided by the upstream kernel. This is the current way of interacting with GPIO.
-
-To interact with this new device, you need to use a library and a set of command line interface tools. The common command line tools such as echo or cat won’t work with this device.
-
-You can install the CLI tools by installing the libgpiod-utils package. A corresponding Python library is provided by the python3-libgpiod package.
-
-### **Creating a container with Podman**
-
-[Podman][6] is a container runtime with a command line interface similar to Docker. The big advantage of Podman is it doesn’t run any daemon in the background. That’s especially useful for devices with limited resources. Podman also allows you to start containerized services with systemd unit files. Plus, it has many additional features.
-
-We’ll create a container in these two steps:
-
- 1. Create a layered image containing the required packages.
- 2. Create a new container starting from our image.
-
-
-
-First, create a file Dockerfile with the content below. This tells podman to build an image based on the latest Fedora image available in the registry. Then it updates the system inside and installs some packages:
-
-```
-FROM fedora:latest
-RUN dnf -y update
-RUN dnf -y install libgpiod-utils python3-libgpiod
-
-```
-
-You have created a build recipe of a container image based on the latest Fedora with updates, plus packages to interact with GPIO.
-
-Now, run the following command to build your base image:
-
-```
-$ sudo podman build --tag fedora:gpiobase -f ./Dockerfile
-
-```
-
-You have just created your custom image with all the bits in place. You can play with this base container images as many times as you want without installing the packages every time you run it.
-
-### Working with Podman
-
-To verify the image is present, run the following command:
-
-```
-$ sudo podman images
-REPOSITORY TAG IMAGE ID CREATED SIZE
-localhost/fedora gpiobase 67a2b2b93b4b 10 minutes ago 488MB
-docker.io/library/fedora latest c18042d7fac6 2 days ago 300MB
-
-```
-
-Now, start the container and do some actual experiments. Containers are normally isolated and don’t have an access to the host system, including the GPIO interface. Therefore, you need to mount it inside while starting the container. To do this, use the –device option in the following command:
-
-```
-$ sudo podman run -it --name gpioexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash
-
-```
-
-You are now inside the running container. Before you move on, here are some more container commands. For now, exit the container by typing exit or pressing **Ctrl+D**.
-
-To list the the existing containers, including those not currently running, such as the one you just created, run:
-
-```
-$ sudo podman container ls -a
-CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-64e661d5d4e8 localhost/fedora:gpiobase /bin/bash 37 seconds ago Exited (0) Less than a second ago gpioexperiment
-
-```
-
-To create a new container, run this command:
-
-```
-$ sudo podman run -it --name newexperiment --device=/dev/gpiochip0 localhost/fedora:gpiobase /bin/bash
-
-```
-
-Delete it with the following command:
-
-```
-$ sudo podman rm newexperiment
-
-```
-
-### **Turn on an LED**
-
-Now you can use the container you already created. If you exited from the container, start it again with this command:
-
-```
-$ sudo podman start -ia gpioexperiment
-
-```
-
-As already discussed, you can use the CLI tools provided by the libgpiod-utils package in Fedora. To list the available GPIO chips, run:
-
-```
-$ gpiodetect
-gpiochip0 [pinctrl-bcm2835] (54 lines)
-
-```
-
-To get the list of the lines exposed by a specific chip, run:
-
-```
-$ gpioinfo gpiochip0
-
-```
-
-Notice there’s no correlation between the number of physical pins and the number of lines printed by the previous command. What’s important is the BCM number, as shown on [pinout.xyz][7]. It is not advised to play with the lines that don’t have a corresponding BCM number.
-
-Now, connect an LED to the physical pin 40, that is BCM 21. Remember: the shorter leg of the LED (the negative leg, called the cathode) must be connected to a GND pin of the Raspberry Pi with a 330 ohm resistor, and the long leg (the anode) to the physical pin 40.
-
-To turn the LED on, run the following command. It will stay on until you press **Ctrl+C** :
-
-```
-$ gpioset --mode=wait gpiochip0 21=1
-
-```
-
-To light it up for a certain period of time, add the -b (run in the background) and -s NUM (how many seconds) parameters, as shown below. For example, to light the LED for 5 seconds, run:
-
-```
-$ gpioset -b -s 5 --mode=time gpiochip0 21=1
-
-```
-
-Another useful command is gpioget. It gets the status of a pin (high or low), and can be useful to detect buttons and switches.
-
-![Closeup of LED connection with GPIO][8]
-
-### **Conclusion**
-
-You can also play with LEDs using Python — [there are some examples here][9]. And you can also use the i2c devices inside the container as well. In addition, Podman is not strictly related to this Fedora edition. You can install it on any existing Fedora Edition, or try it on the two new OSTree-based systems in Fedora: [Fedora Silverblue][2] and [Fedora CoreOS][10].
-
-
---------------------------------------------------------------------------------
-
-via: https://fedoramagazine.org/turnon-led-fedora-iot/
-
-作者:[Alessio Ciregia][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://alciregi.id.fedoraproject.org/
-[1]: https://fedoramagazine.org/wp-content/uploads/2018/08/oled-1024x768.png
-[2]: https://teamsilverblue.org/
-[3]: https://www.projectatomic.io/
-[4]: https://kojipkgs.fedoraproject.org/compose/iot/latest-Fedora-IoT-28/compose/IoT/
-[5]: https://fedoraproject.org/wiki/InternetOfThings/GettingStarted#Setting_up_a_Physical_Device
-[6]: https://github.com/containers/libpod
-[7]: https://pinout.xyz/
-[8]: https://fedoramagazine.org/wp-content/uploads/2018/08/breadboard-1024x768.png
-[9]: https://github.com/brgl/libgpiod/tree/master/bindings/python/examples
-[10]: https://coreos.fedoraproject.org/
From ccff8ae5e89141ad282f78a42bfe3c58950dc78f Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 20 Dec 2018 22:15:39 +0800
Subject: [PATCH 0201/4278] PRF:20181205 How To Fix Broken Ubuntu OS Without
Reinstalling It.md
@geekpi
---
...roken Ubuntu OS Without Reinstalling It.md | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
index 2fbdc6f07e..858862096e 100644
--- a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
+++ b/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: 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/)
@@ -18,29 +18,20 @@
首先,尝试使用 live cd 登录并**在外部驱动器中备份数据**。以防这个方法没用,你仍然可以获取数据并重新安装系统!
-在登录页上,按下 **CTRL+ALT+F1** 切换到 **tty1**。你可以在[**此处**][1]了解有关在 TTY 之间切换的更多信息。
+在登录页上,按下 `CTRL+ALT+F1` 切换到 tty1。你可以在[此处][1]了解有关在 TTY 之间切换的更多信息。
现在,逐个输入以下命令来修复损坏的 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
```
@@ -52,7 +43,7 @@ $ sudo reboot
你现在可以像往常一样登录到你的 Ubuntu 系统。
-我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的贴士对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。
+我做完这些步骤后,我 Ubuntu 18.04 测试系统中的所有数据都还在,一切都之前的一样。此方法可能不适用于所有人。但是,这个小小的技巧对我有用,并且比重装节省了一些时间。如果你了解其他更好的方法,请在评论区告诉我。我也会在本指南中添加它们。
这是这些了。希望这篇文章有用。
@@ -69,10 +60,10 @@ via: https://www.ostechnix.com/how-to-fix-broken-ubuntu-os-without-reinstalling-
作者:[SK][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
-校对:[校对者ID](https://github.com/校对者ID)
+校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
-[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
\ No newline at end of file
+[1]: https://www.ostechnix.com/how-to-switch-between-ttys-without-using-function-keys-in-linux/
From b84383d0c6c5243606f103ae11a70a76f8efee3a Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 20 Dec 2018 22:16:47 +0800
Subject: [PATCH 0202/4278] PUB:20181205 How To Fix Broken Ubuntu OS Without
Reinstalling It.md
@geekpi https://linux.cn/article-10367-1.html
---
...205 How To Fix Broken Ubuntu OS Without Reinstalling It.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
rename {translated/tech => published}/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md (97%)
diff --git a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md b/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
similarity index 97%
rename from translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
rename to published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
index 858862096e..4db620bf58 100644
--- a/translated/tech/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
+++ b/published/20181205 How To Fix Broken Ubuntu OS Without Reinstalling It.md
@@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
-[#]: publisher: ( )
+[#]: publisher: (wxy)
[#]: 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: ( )
+[#]: url: (https://linux.cn/article-10367-1.html)
如何不重装修复损坏的 Ubuntu 系统
======
From 39ffd0e98559e69ca53f58784373ebe2f81d7a63 Mon Sep 17 00:00:00 2001
From: jlztan
Date: Thu, 20 Dec 2018 22:20:41 +0800
Subject: [PATCH 0203/4278] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20PR=EF=BC=9A?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=B4=E9=83=A8=E7=9A=84=E5=85=83=E4=BF=A1?=
=?UTF-8?q?=E6=81=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...brate Christmas In Linux Way With These Wallpapers.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
index 1132a52058..3c282ce7d5 100644
--- a/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
+++ b/translated/tech/20171223 Celebrate Christmas In Linux Way With These Wallpapers.md
@@ -1,3 +1,12 @@
+[#]: collector: (lujun9972)
+[#]: translator: (jlztan)
+[#]: reviewer: ( )
+[#]: publisher: ( )
+[#]: subject: (Celebrate Christmas In Linux Way With These Wallpapers)
+[#]: via: (https://itsfoss.com/christmas-linux-wallpaper/)
+[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
+[#]: url: ( )
+
使用这些壁纸以 Linux 的方式庆祝圣诞节
======
From a99040998a1f6e1b2b9cedf7687234f9915cfd4a Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 20 Dec 2018 22:26:02 +0800
Subject: [PATCH 0204/4278] PRF:20181212 Patch into The Matrix at the Linux
command line.md
@geekpi
---
...to The Matrix at the Linux command line.md | 22 +++++++++++--------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md
index 1793ec25ad..9660bf046d 100644
--- a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md
+++ b/translated/tech/20181212 Patch into The Matrix at the Linux command line.md
@@ -1,6 +1,6 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
-[#]: reviewer: ( )
+[#]: reviewer: (wxy)
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Patch into The Matrix at the Linux command line)
@@ -9,10 +9,12 @@
在命令行中步入黑客帝国
======
-使用 cmatrix 重建每个人最喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。
+
+> 使用 cmatrix 重建每个人都喜欢的 20 世纪 90 年代科幻电影中滚动代码的经典外观。
+
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cmatrix.png?itok=YlmbHVPr)
-你发现了今天的命令行玩具日历。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。
+这是今天的命令行玩具日历推荐项目。如果这是你第一次访问该系列,你可能想知道什么是命令行玩具?它可以是在命令行中任何可以娱乐的东西,可以是一个游戏,一个有趣的工具,或者一个消遣的东西。
其中一些是经典,有些是全新的(至少对我而言),但我希望你们所有人都能在这个系列中找到你喜欢的东西。
@@ -20,17 +22,19 @@
我想起 2019 年将是我青少年时期最喜欢的科幻电影之一[黑客帝国][1]的二十周年纪念日,它当时让我思考了未来将会发生什么。对于像我这样的痴迷计算机小孩来说,这是一个电脑程序员通过利用自己思维的力量崛起并成为虚拟宇宙中的动作英雄的终极故事。
-当时,没有一部电影对我来说似乎更具未来感。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。
+当时,对我来说没有比这部电影更具未来感了。无论是故事本身,还是迷人的特效。即使意识到它是在二十多年前拍摄的也并没有改变我的想法。
-今天将它带回我们的命令行玩具,让我们在终端用 **cmatrix** 重建黑客帝国中那向下滚动的代码流。 **cmatrix** 对我来说很容易安装,它在 Fedora 中被打包了,所以安装它只需:
+今天将它带回我们的命令行玩具,让我们在终端用 `cmatrix` 重建黑客帝国中那向下滚动的代码流。 `cmatrix` 很容易安装,它在 Fedora 中被打包了,所以安装它只需:
```
$ dnf install cmatrix
```
-接着,只需在你的终端输入 **cmatrix** 即可运行。
+接着,只需在你的终端输入 `cmatrix` 即可运行。
+
![](https://opensource.com/sites/default/files/uploads/linux-toy-cmatrix-animated.gif)
-你可以在 [GitHub][2] 上找到使用 GPL 许可的 **cmatrix** 的源代码。
+
+你可以在 [GitHub][2] 上找到使用 GPL 许可的 `cmatrix` 的源代码。
你有特别喜欢的命令行小玩具需要我介绍的吗?这个系列要介绍的小玩具大部分已经有了落实,但还预留了几个空位置。评论留言让我知道,我会查看的。如果还有空位置,我会考虑介绍它的。如果没有,但如果我得到了一些很好的意见,我会在最后做一些有价值的提及。
@@ -43,7 +47,7 @@ via: https://opensource.com/article/18/12/linux-toy-cmatrix
作者:[Jason Baker][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/) 荣誉推出
@@ -51,4 +55,4 @@ via: https://opensource.com/article/18/12/linux-toy-cmatrix
[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
\ No newline at end of file
+[3]: https://opensource.com/article/18/12/linux-toy-bash-prompt
From cf6fc9935c5903a66f7daaaf932052d77dc28479 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"
Date: Thu, 20 Dec 2018 22:27:30 +0800
Subject: [PATCH 0205/4278] PUB:20181212 Patch into The Matrix at the Linux
command line.md
@geekpi https://linux.cn/article-10368-1.html
---
.../20181212 Patch into The Matrix at the Linux command line.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {translated/tech => published}/20181212 Patch into The Matrix at the Linux command line.md (100%)
diff --git a/translated/tech/20181212 Patch into The Matrix at the Linux command line.md b/published/20181212 Patch into The Matrix at the Linux command line.md
similarity index 100%
rename from translated/tech/20181212 Patch into The Matrix at the Linux command line.md
rename to published/20181212 Patch into The Matrix at the Linux command line.md
From eb69ee153ff6179759dad824fcdf2c253080127d Mon Sep 17 00:00:00 2001
From: lxy <524187166@qq.com>
Date: Thu, 20 Dec 2018 22:41:16 +0800
Subject: [PATCH 0206/4278] commit
---
...en solutions to everything in education.md | 113 ------------------
...en solutions to everything in education.md | 110 +++++++++++++++++
2 files changed, 110 insertions(+), 113 deletions(-)
delete mode 100644 sources/tech/20180101 27 open solutions to everything in education.md
create mode 100644 translated/tech/20180101 27 open solutions to everything in education.md
diff --git a/sources/tech/20180101 27 open solutions to everything in education.md b/sources/tech/20180101 27 open solutions to everything in education.md
deleted file mode 100644
index eeba3692e4..0000000000
--- a/sources/tech/20180101 27 open solutions to everything in education.md
+++ /dev/null
@@ -1,113 +0,0 @@
-translating by lixinyuxx
-
-27 open solutions to everything in education
-======
-![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo)
-
-Openness (from open source software, to open hardware, to open principles) is changing the paradigm of education. So, to celebrate all that's gone on this year, I collected 27 of the best articles published on Opensource.com in 2017 on the subject. I divided them into broad themes, rather than ordering them by popularity. And, if these 27 stories don't satisfy your appetite for information about open source in education, check out our companion article on how [education is leveraging Raspberry Pi and Linux][30].
-
-### Open is better for everyone
-
-1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt reviews David Price's book OPEN, which explores the idea that "open" isn't just a technological shift, rather it's "how we'll work, live, and learn in the future."
-
-2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur points out how to get ahead in the workforce by learning open source. This advice isn't just for programmers; designers, writers, marketers, and other creative professionals are also essential to the success of open source.
-
-3. [A graduate degree could springboard you into an open source job][3]: Citing research that shows that Linux skills lead to higher pay, Joshua Pearce makes the case that open source proficiency and a graduate degree are an unbeatable career combination.
-
-4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger shows us how open practices are creating a more inclusive, agile, and open culture in a Pennsylvania school district. Charlie says it's not just about saving money; the district also gains from "open leadership principles that foster innovation among teachers and students, help to better engage the community, and create a more vibrant and inclusive learning community."
-
-5. [15 ways to empower students with open source tools][5]: I write how open source gives students the freedom to explore, tinker, and learn, whether they're learning basic digital literacy or expanding on those skills with fun projects.
-
-6. [Developer opportunities to code for good][6]: Open source is often the backbone of socially beneficial projects. As Ahn Bui, vice president of Benetech Labs, states in this interview: "Establishing open data standards is an integral step in breaking down data silos. Those open standards will provide the foundation for interoperability and in turn, translate to more organizations building together, often more cost effectively. The ultimate goal is to serve more people at the same cost or even less."
-
-### Open education resources for remixing and reusing
-
-1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis, director of programs for Wiki Ed, discusses how open educational resources (OERs), such as Wiki Ed, are providing high-quality and affordable open source learning resources as classroom teaching tools.
-
-2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green, director of open education for Creative Commons, shares how the face of education is changing in higher education and what Creative Commons is doing to facilitate it.
-
-3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites, community evangelist and chief marketing officer of Open Up Resources, talks about the nonprofit organization's efforts to provide open, standards-aligned curricula for K-12 schools.
-
-4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke, educational technologist at the University of Hawaii at Manoa, says that transitioning to OER in college courses will "empower faculty to take control of what content they teach with, which we expect will result in their saving students money."
-
-5. [How open courses are slashing the cost of higher education][11]: Saylor Academy's director of education Devon Ritter reports how Saylor is building its college credit-eligible courses on openly licensed content, with the goal of making higher education affordable and accessible to more people.
-
-6. [Open educational resources movement gains speed][12]: Alexis Clifton, executive director of the State University of New York OER Services, describes how New York's US$ 8 million investment is spurring growth in open education and making college more affordable.
-
-7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik from Duke University explores OSPRI (Open Source Pedagogy Research and Innovation), a collaboration between Duke and Red Hat that's building a 21st-century, preK-12 learning ecosystem that is open by design.
-
-8. [Perma.cc stops scholarly link rot][14]: Virginia Tech's Phillip Young writes about Perma.cc, a solution to "link rot," which is the high probability that hyperlinks in academic papers will disappear or change over time.
-
-9. [Open education: How students save money by creating open textbooks][15]: OER pioneer Robin DeRosa talks about "the freedom that the openly licensed textbook introduced, and the overarching idea that education and learning should be contextualized in inclusive ecosystems that enhance the public good."
-
-### Open source tools in the classroom
-
-1. [How an open source board game is saving the planet][16]: Joshua Pearce writes about Save the Planet, a board game that empowers students to solve environmental problems while having fun and contributing to the maker community.
-
-2. [A new Android app for teaching kids how to read][17]: Michael Hall talks about Phoenicia, a children's literacy app he developed after his son was diagnosed with autism, the value of coding for good, and why user testing matters more than you think.
-
-3. [8 open source Android apps for education][18]: Joshua Allen Holm challenges us to use our smartphones as learning tools by recommending eight open source apps from the F-Droid repository to try.
-
-4. [3 open source alternatives to MATLAB][19]: Jason Baker's update to his 2016 survey of open source mathematical computing software presents alternatives to MATLAB, the expensive, proprietary solution nearly ubiquitous in mathematics, physical sciences, engineering, and economics.
-
-5. [What does SVG have to do with teaching kids to code?][20] Retired engineer Jay Nick talks about how he uses art as a creative way to introduce students to coding. He volunteers in schools, using Scalable Vector Graphics (SVG) to teach an approach to coding that combines principles of mathematics and art.
-
-6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, who holds a PhD in fine arts from Texas Tech, shares his experience using open source tools in a world ruled by proprietary solutions. Kyle says there's a bias against using open source in disciplines outside of computer science: "Many people think non-technical students can't use Linux, and they make a lot of assumptions about people who use it in their advanced degree programs. … Well, it is possible, and I'm proof."
-
-7. [A list of open source tools for college][22]: Aaron Cocker outlines the open source tools (including presentation, backup, and programming software) he uses while working on his undergraduate degree in computer science.
-
-8. [5 great KDE apps to help you study][23]: Zsolt Szakács offers five KDE applications that help anyone who wants to learn new skills or cultivate existing ones.
-
-### Coding in the classroom
-
-1. [How to get the next generation coding early][24]: Bryson Payne says we need to teach kids to code before high school: By ninth grade 80% of girls and 60% of boys have already self-selected out of a STEM career. But it's not only about jobs and closing the IT skills gap, he suggests. "Teaching a young person to code could be the single most life-changing skill you can give them. And it's not just a career-enhancer. Coding is about problem-solving, it's about creativity, and more importantly, it's about empowerment."
-
-2. [Kids can't code without computers][25]: Patrick Masson introduces the FLOSS Desktops for Kids program, which teaches students at underserved schools to repurpose older computers with open source software, such as Linux, LibreOffice, and GIMP. Not only is the program breathing new life into broken or decommissioned hardware, it's also giving students important skills that may translate into future careers.
-
-3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva offers suggestions for using [Scratch][27] to spark kids' interest in programming, just as LOGO did when he started using it in the 1980s.
-
-4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger describes App Inventor, a programming framework for building Android applications using a visual blocks language (similar to Scratch or [Snap][29]).
-
-Throughout the year we learned that there is an open solution to everything in education, and I expect this theme to continue in 2018 and beyond. Are there open education topics you'd like Opensource.com to cover in the coming year? If so, please share your ideas in the comments.
-
---------------------------------------------------------------------------------
-
-via: https://opensource.com/article/18/1/best-open-education
-
-作者:[Don Watkins][a]
-译者:[译者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
-[1]:https://opensource.com/article/17/7/book-review-open
-[2]:https://opensource.com/article/17/8/jump-start-your-career
-[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab
-[4]:https://opensource.com/article/17/7/open-school-leadership
-[5]:https://opensource.com/article/17/7/empower-students-open-source-tools
-[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs
-[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation
-[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons
-[9]:https://opensource.com/article/17/1/open-up-resources
-[10]:https://opensource.com/article/17/2/interview-education-billy-meinke
-[11]:https://opensource.com/article/17/7/college-alternatives
-[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton
-[13]:https://opensource.com/article/17/3/education-should-be-open-design
-[14]:https://opensource.com/article/17/9/stop-link-rot-permacc
-[15]:https://opensource.com/article/17/11/creating-open-textbooks
-[16]:https://opensource.com/article/17/7/save-planet-board-game
-[17]:https://opensource.com/article/17/4/phoenicia-education-software
-[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education
-[19]:https://opensource.com/alternatives/matlab
-[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
-[21]:https://opensource.com/article/17/5/how-linux-higher-education
-[22]:https://opensource.com/article/17/6/open-source-tools-university-student
-[23]:https://opensource.com/article/17/6/kde-education-software
-[24]:https://opensource.com/article/17/8/teach-kid-code-change-life
-[25]:https://opensource.com/article/17/9/floss-desktops-kids
-[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids
-[27]:https://scratch.mit.edu/
-[28]:https://opensource.com/article/17/8/app-inventor-android-app-development
-[29]:http://snap.berkeley.edu/
-[30]:https://opensource.com/article/17/12/best-opensourcecom-linux-and-raspberry-pi-education
diff --git a/translated/tech/20180101 27 open solutions to everything in education.md b/translated/tech/20180101 27 open solutions to everything in education.md
new file mode 100644
index 0000000000..43f4717c1f
--- /dev/null
+++ b/translated/tech/20180101 27 open solutions to everything in education.md
@@ -0,0 +1,110 @@
+27个解决教学问题的开放式方法
+======
+![27 open solutions to everything in education](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OpenEducationResources_520x292_cm.png?itok=9y4FGgRo)
+
+开放式理念 (从开源软件到开放硬件, 再到开放原则) 正在改变教育的范式。因此, 为了庆祝今年发生的一切, 我收集了2017年在 Opensource.com 上发表的27篇关于这个主题的最好的文章。我把它们分成明确的主题, 而不是按人气来分类。而且, 如果这27个故事不能满足你对教育公开信息的胃口, 那就看看我们的合作文章吧 “ [education is leveraging Raspberry Pi and Linux][30]”
+
+### 开放对每个人都有好处
+
+1. [Book review: 'OPEN' explores broad cultural implications of openness][1]: Scott Nesbitt 评价David Price 的书 'OPEN' ,该书探讨了 “开放” 不仅仅是技术转变的观点, 而是 “我们未来将如何工作、生活和学习”。
+
+2. [Jump-start your career with open source skills][2]: VM (Vicky) Brasseur 指出了如何利用开放式学习在工作群体中脱颖而出。 这个建议不仅仅是针对程序员的, 而是针对程序员的。设计师、作家、营销人员和其他创意专业人士也是开放式成功的关键。
+
+3. [A graduate degree could springboard you into an open source job][3]: 引用的研究表明会 Linux 技能会带来更高的薪水, Joshua Pearce 说对开源的熟练和研究生学位是无与伦比的职业技能组合。
+
+4. [These 3 practices revolutionized Penn Manor's school culture][4]: Charlie Reisinger 向我们展示了开放的做法是如何在宾夕法尼亚州的一个学区创造一种更具包容性、敏捷性和开放性的文化的。 Charlie 说, 这不仅仅是为了省钱;该区还受益于 “开放式领导原则, 促进师生创新, 帮助更好地吸引社区, 创造一个更有活力和包容性的学习社区”。
+
+5. [15 ways to empower students with open source tools][5]: 我写开源是如何让学生自由探索、补拙和学习的, 不管他们是在学习基本的数字化素养, 还是通过有趣的项目来扩展这些技能。
+
+6. [Developer opportunities to code for good][6]: 开源往往是对社会有益的项目的支柱。正如 Benetech Labs 副总裁 Ahn Bui 在这次采访中指出的那样: “建立开放数据标准是打破数据孤岛不可或缺的一步。这些开放标准将为互操作性提供基础, 进而转化为更多的组织共同建设, 往往更具成本效益。最终目标是以同样的成本甚至更低的成本为更多的人服务。”
+
+### 用于再融合和再利用的开放式教育资源
+
+1. [Can academic faculty members teach with Wikipedia?][7] LiAnna Davis,Wiki Ed 的, 项目总监,讨论开放教育资源 (OERs) ,如 Wiki Ed,如何提供高质量且经济实惠的开源学习资源作为课堂教学工具。
+
+2. [Are textbooks in or out? The state of open educational resources][8]: Cable Green,是 Creative Common 开放教育主任,分享高等教育中教育面貌是如何变化的, 以及 Creative Common 正在采取哪些措施来促进教育。
+
+3. [School systems desperate for standards-aligned curricula find hope][9]: Karen Vaites,是 Open Up Resources 社区的福音传教士和首席营销官, 谈论非营利组织努力为 K-12 学校提供开放的, 标准一致的课程。
+
+4. [How the University of Hawaii is solving today's higher ed problems][10]: Billy Meinke , Hawaii 大学 Manoa 分校的教育技术专家,他说, 在大学课程中过渡到 ORE 将 “使教师能够控制他们教授的内容, 我们预计这将为他们节省学生的费用。”
+
+5. [How open courses are slashing the cost of higher education][11]: Saylor Academy 的教育主任 Devon Ritter 报告了 Saylor 是如何建立以公开许可内容为基础的大学学分课程, 目的是使更多的人能够负担得起和获得高等教育。
+
+6. [Open educational resources movement gains speed][12]: Alexis Clifton,State University of New York 的 OER 服务的执行主任, 描述了纽约800万美元的投资如何刺激开放教育的增长, 并使大学更实惠。
+
+7. [Open project collaboration from elementary to university classrooms][13]: Aria F. Chernik 在Duke University 探索 OSPRI (Open Source Pedagogy Research and Innovation,开源教育学的研究与创新), 在 Duke 和 Red Hat 的联合合作这是建立一个21世纪的, preK-12 学习生态系统, 是开放的设计。
+
+8. [Perma.cc stops scholarly link rot][14]: Virginia Tech 的 Phillip Young 写关于 Perma.cc, “link rot”(链接失效) 的解决方案 很大可能在学术论文中的超链接随着时间的推移而消失或变化。
+
+9. [Open education: How students save money by creating open textbooks][15]: OER 先驱 Robin DeRosa 谈到 “公开许可教科书引入的自由, 以及教育和学习应结合包容性生态系统, 以增强公益的总体理念”。
+
+### 课堂上的开源工具
+
+1. [How an open source board game is saving the planet][16]: Joshua Pearce 写的关于拯救地球的一个棋盘游戏, 使学生能够解决环境问题, 同时有乐趣, 并为制造商社区作出贡献。
+
+2. [A new Android app for teaching kids how to read][17]: Michael Hall 谈到他的儿子 Phoenicia,他在儿子被诊断为自闭症后开发的儿童识字应用, 为了产生更好的编码价值, 以及为什么用户测试比你想象的更重要。
+
+3. [8 open source Android apps for education][18]: Joshua Allen Holm 通过推荐 F-Droid 存储库中的8个开源应用来尝试, 这将挑战我们将智能手机用作学习工具。
+
+4. [3 open source alternatives to MATLAB][19]: Jason Baker's 更新了他2016年的开源数学计算软件调查, 提出了 MATLAB 的替代方案, 这是数学、物理科学、工程和经济学中几乎无处不在的昂贵的专用解决方案。
+
+5. [What does SVG have to do with teaching kids to code?][20] 退休工程师 Jay Nick 谈论他如何使用艺术作为一种创造性的方式, 向学生介绍编码。他在学校做志愿者, 使用可缩放矢量图形 (SVG,Scalable Vector Graphics) 教授一种结合数学和艺术原理的编码方法。
+
+6. [5 myths busted: Using open source in higher education][21]: Kyle Conway, 在 Texas Tech 拥有美术博士学位分享他在单一解决方案统治的世界中使用开源工具的经验。 Kyle 说有一种偏见, 反对在计算机科学以外的学科中使用开源:“很多人认为非技术专业的学生不能使用 Linux, 他们对在高级学位课程中使用 Linux 的人做出了很多假设。...嗯, 这是有可能的, 我就是证明。”
+
+7. [A list of open source tools for college][22]: Aaron Cocker 概述了他在攻读计算机科学本科学位时使用的开源工具 (包括演示、备份和编程软件)。
+
+8. [5 great KDE apps to help you study][23]: Zsolt Szakács 提供五个 KDE 应用程序, 帮助任何想要学习新技能或培养现有技能的人。
+
+### 在教室编码
+
+1. [How to get the next generation coding early][24]: Bryson Payne 说我们需要教孩子们在高中前编码: 到了九年级, 80% 的女孩和60% 的男孩已经从 STEM 职业中自选。但他建议, 这不仅仅是就业和缩小 IT 技能差距的问题。“教一个年轻人编写代码可能是你能给他们的最改变生活的技能。而且这不仅仅是一个职业提升者。编码是关于解决问题, 它是关于创造力, 更重要的是, 它是关于授权。
+
+2. [Kids can't code without computers][25]: Patrick Masson 推出了 FLOSS 儿童桌面计划, 该计划教授服务不足学校的学生使用开源软件 (如 Linux、LibreOffice 和 GIMP) 重新设计较旧的计算机。该计划不仅为破旧或退役的硬件注入新的生命, 还为学生提供了重要的技能, 这些技能可能会利于转化为未来的职业。
+
+3. [Is Scratch today like the Logo of the '80s for teaching kids to code?][26] Anderson Silva 提出 [Scratch][27] 的使用建议以激发孩子们对编程的兴趣, 就像 LOGO 在20世纪80年代开始使用它时一样。
+
+4. [Learn Android development with this drag-and-drop framework][28]: Eric Eslinger 描述应用发明者, 一个编程框架, 用于构建 Android 应用程序使用可视块语言 (类似 Scratch 或者[Snap][29]).
+
+在这一年里, 我们了解到, 教育领域的一切都有一个开放的解决方案, 我预计这一主题将在2018年及以后继续下去。在未来的一年里, 你是否希望 Opensource.com 涵盖开放式的教育主题?如果是, 请在评论中分享你的想法。
+
+--------------------------------------------------------------------------------
+
+via: https://opensource.com/article/18/1/best-open-education
+
+作者:[Don Watkins][a]
+译者:[lixinyuxx](https://github.com/lixinyuxx)
+校对:[校对者ID](https://github.com/校对者ID)
+
+本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
+
+[a]:https://opensource.com/users/don-watkins
+[1]:https://opensource.com/article/17/7/book-review-open
+[2]:https://opensource.com/article/17/8/jump-start-your-career
+[3]:https://opensource.com/article/17/1/grad-school-open-source-academic-lab
+[4]:https://opensource.com/article/17/7/open-school-leadership
+[5]:https://opensource.com/article/17/7/empower-students-open-source-tools
+[6]:https://opensource.com/article/17/3/interview-anh-bui-benetech-labs
+[7]:https://opensource.com/article/17/1/Wiki-Education-Foundation
+[8]:https://opensource.com/article/17/2/future-textbooks-cable-green-creative-commons
+[9]:https://opensource.com/article/17/1/open-up-resources
+[10]:https://opensource.com/article/17/2/interview-education-billy-meinke
+[11]:https://opensource.com/article/17/7/college-alternatives
+[12]:https://opensource.com/article/17/10/open-educational-resources-alexis-clifton
+[13]:https://opensource.com/article/17/3/education-should-be-open-design
+[14]:https://opensource.com/article/17/9/stop-link-rot-permacc
+[15]:https://opensource.com/article/17/11/creating-open-textbooks
+[16]:https://opensource.com/article/17/7/save-planet-board-game
+[17]:https://opensource.com/article/17/4/phoenicia-education-software
+[18]:https://opensource.com/article/17/8/8-open-source-android-apps-education
+[19]:https://opensource.com/alternatives/matlab
+[20]:https://opensource.com/article/17/5/coding-scalable-vector-graphics-make-steam
+[21]:https://opensource.com/article/17/5/how-linux-higher-education
+[22]:https://opensource.com/article/17/6/open-source-tools-university-student
+[23]:https://opensource.com/article/17/6/kde-education-software
+[24]:https://opensource.com/article/17/8/teach-kid-code-change-life
+[25]:https://opensource.com/article/17/9/floss-desktops-kids
+[26]:https://opensource.com/article/17/3/logo-scratch-teach-programming-kids
+[27]:https://scratch.mit.edu/
+[28]:https://opensource.com/article/17/8/app-inventor-android-app-development
+[29]:http://snap.berkeley.edu/
From aaecf1d4609269144f95e5fe79a5dfa825cd36a3 Mon Sep 17 00:00:00 2001
From: qhwdw
Date: Thu, 20 Dec 2018 22:50:29 +0800
Subject: [PATCH 0207/4278] Translating by qhwdw
---
sources/tech/20181212 How to Build a Netboot Server, Part 2.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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
index 0301a34da5..1d1ce2f68f 100644
--- 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
@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
-[#]: translator: ( )
+[#]: translator: (qhwdw)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
From 5a97264a42ecefac7b2243aa65c0a80cba61fe13 Mon Sep 17 00:00:00 2001
From: wwhio
Date: Thu, 20 Dec 2018 22:57:44 +0800
Subject: [PATCH 0208/4278] =?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/20171119 The Ruby Story.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sources/talk/20171119 The Ruby Story.md b/sources/talk/20171119 The Ruby Story.md
index 90d5f41790..4c6b46b7de 100644
--- a/sources/talk/20171119 The Ruby Story.md
+++ b/sources/talk/20171119 The Ruby Story.md
@@ -1,3 +1,5 @@
+Translating by wwhio
+
The Ruby Story
======
Ruby has always been one of my favorite languages, though I’ve sometimes found it hard to express why that is. The best I’ve been able to do is this musical analogy: Whereas Python feels to me like punk rock—it’s simple, predictable, but rigid—Ruby feels like jazz. Ruby gives programmers a radical freedom to express themselves, though that comes at the cost of added complexity and can lead to programmers writing programs that don’t make immediate sense to other people.
From 4a06c0160382196631c5cb6762b5305f5e47ddf8 Mon Sep 17 00:00:00 2001
From: "Xingyu.Wang"