From 3cadc3568621d5f531c6c4be847bd03b49c442eb Mon Sep 17 00:00:00 2001 From: wyxplus <32919297+wyxplus@users.noreply.github.com> Date: Sun, 4 Apr 2021 01:12:15 +0800 Subject: [PATCH 001/307] =?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 --- .../tech/20210331 A tool to spy on your DNS queries- dnspeep.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md index c91e05dc72..15d1cad2b8 100644 --- a/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md +++ b/sources/tech/20210331 A tool to spy on your DNS queries- dnspeep.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/03/31/dnspeep-tool/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wyxplus) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9b4561996a45d4a96ee62fc60ccbf58776a290c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Apr 2021 05:03:36 +0800 Subject: [PATCH 002/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210404=20?= =?UTF-8?q?Converting=20Multiple=20Markdown=20Files=20into=20HTML=20or=20O?= =?UTF-8?q?ther=20Formats=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md --- ...les into HTML or Other Formats in Linux.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md diff --git a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md new file mode 100644 index 0000000000..bbee3f9270 --- /dev/null +++ b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -0,0 +1,160 @@ +[#]: subject: (Converting Multiple Markdown Files into HTML or Other Formats in Linux) +[#]: via: (https://itsfoss.com/convert-markdown-files/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Converting Multiple Markdown Files into HTML or Other Formats in Linux +====== + +Many times, when I use Markdown, I work on one file and when I’m done with it, I convert it to HTML or some other format. Occasionally, I have to create a few files. When I do work with more than one Markdown file, I usually wait until I have finished them before I convert them. + +I use pandoc to convert files, and it’s possible convert all the Markdown files in one shot. + +Markdown can convert its files to .html, but if there’s a chance that I will have to convert to other formats like epub, [pandoc][1] is the tool to use. I prefer to use the command line, so I will cover that first, but you can also do this in [VSCodium][2] without the command line. I’ll cover that too. + +### Converting multiple Markdown files to another format with Pandoc [command line method] + +To get started quickly, Ubuntu, and other Debian distros can type the following commands in the terminal: + +``` +sudo apt-get install pandoc +``` + +In this example, I have four Markdown files in a directory called md_test. + +``` +[email protected]:~/Documents/md_test$ ls -l *.md +-rw-r--r-- 1 bdyer bdyer 3374 Apr 7 2020 file01.md +-rw-r--r-- 1 bdyer bdyer 782 Apr 2 05:23 file02.md +-rw-r--r-- 1 bdyer bdyer 9257 Apr 2 05:21 file03.md +-rw-r--r-- 1 bdyer bdyer 9442 Apr 2 05:21 file04.md +[email protected]:~/Documents/md_test$ +``` + +There are no HTML files yet. Now I’ll use Pandoc to do its magic on the collection of files. To do this, I run a one-line command that: + + * calls pandoc + * reads the .md files and exports them as .html + + + +This is the command: + +``` +for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +``` + +If you are not aware already, `;` is used for [running multiple commands at once in Linux][3]. + +Here’s what the display looks like once I have executed the command: + +``` +[email protected]:~/Documents/md_test$ for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +file01.md +file02.md +file03.md +file04.md +[email protected]:~/Documents/md_test$ +``` + +Let me use the `ls` command once more to see if HTML files were created: + +``` +[email protected]:~/Documents/md_test$ ls -l *.html +-rw-r--r-- 1 bdyer bdyer 4291 Apr 2 06:08 file01.md.html +-rw-r--r-- 1 bdyer bdyer 1781 Apr 2 06:08 file02.md.html +-rw-r--r-- 1 bdyer bdyer 10272 Apr 2 06:08 file03.md.html +-rw-r--r-- 1 bdyer bdyer 10502 Apr 2 06:08 file04.md.html +[email protected]:~/Documents/md_test$ +``` + +The conversion was a success, and you have four HTML files ready to go on the Web server. + +Pandoc is quite versatile and you can convert the markdown files to some other supported format by specifying the extension of the output files. You can understand why it is considered among the [best open source tools for writers][4]. + +**Recommended Read:** + +![][5] + +#### [11 Best Markdown Editors for Linux][6] + +A list of best Markdown Editors for Linux distributions that not only look good but are also feature rich. + +### Converting Markdown files to HTML using VSCodium [GUI method] + +Like I’ve said earlier, I normally use the command line, but I don’t always use it for batch conversions, and you don’t have to either. VSCode or [VSCodium][7] can do the job. You just need to add one extension, called: _Markdown-All-in-One_ which will allow you to convert more than one Markdown file in one run. + +There are two ways to install the extension: + + * VSCodium’s terminal + * VSCodium’s plug-in manager + + + +To install the extension through VSCodium’s terminal: + + 1. Click on `Terminal` on the menu bar. The terminal panel will open + 2. Type, or [copy-and-paste, the following command in the terminal][8]: + + + +``` +codium --install-extension yzhang.markdown-all-in-one +``` + +**Note**: If you’re using VSCode instead of VSCodium, replace the word, `codium`, in the above command, with `code` + +![][9] + +The second way to install is through VSCodium’s plug-in, or extension, manager: + + 1. Click on the blocks on the left side of the VSCodium window. A list of extensions will appear. At the top of the list, there will be a search bar. + 2. In the search bar, type: `Markdown All in One`. The extension will be listed at the top of the list. Click on the `Install` button to install it. If it is already installed, a gear icon will appear in place of the install button. + + + +![][10] + +Once the extension is installed, you can open the folder that contains the Markdown files you want to convert. + +Click on the paper icon located on the left side of the VSCodium window. You’ll be given the opportunity to choose your folder. Once a folder is open, you’ll need to open at least one file. You can open as many files as you want, but one is the minimum. + +Once a file is open, bring up the Command Palette by pressing `CTRL+SHIFT+P`. Then, start typing `Markdown`in the search bar that will appear. As you do this, a list of Markdown related commands will appear. One of these will be `Markdown All in One: Print documents to HTML` command. Click on that one. + +![][11] + +You’ll be asked to choose a folder containing the files. This is so an output directory (called `out`) can be made and this is where the HTML files will go. The image below shows that the HTML was made after exporting the Markdown documents. From here, you can open, view, and edit the HTML as you wish. + +![][12] + +By waiting to convert your Markdown files, you can concentrate more on writing. Conversion to HTML can come when you’re ready – and you have two ways to get that done. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-markdown-files/ + +作者:[Bill Dyer][a] +选题:[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/bill/ +[b]: https://github.com/lujun9972 +[1]: https://pandoc.org/ +[2]: https://vscodium.com/ +[3]: https://itsfoss.com/run-multiple-commands-linux/ +[4]: https://itsfoss.com/open-source-tools-writers/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/10/Best-Markdown-Editors-for-Linux.jpg?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/best-markdown-editors-linux/ +[7]: https://itsfoss.com/vscodium/ +[8]: https://itsfoss.com/copy-paste-linux-terminal/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_terminal.jpg?resize=800%2C564&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_extension_select.jpg?resize=800%2C564&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_markdown_function_options.jpg?resize=800%2C564&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_html_filelist_shown.jpg?resize=800%2C564&ssl=1 From 0058457879861ae2e8b47b6ed5304b4169b7cbcf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Apr 2021 05:03:58 +0800 Subject: [PATCH 003/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210403=20?= =?UTF-8?q?FreeDOS=20commands=20you=20need=20to=20know?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210403 FreeDOS commands you need to know.md --- ...10403 FreeDOS commands you need to know.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/tech/20210403 FreeDOS commands you need to know.md diff --git a/sources/tech/20210403 FreeDOS commands you need to know.md b/sources/tech/20210403 FreeDOS commands you need to know.md new file mode 100644 index 0000000000..34cb48280e --- /dev/null +++ b/sources/tech/20210403 FreeDOS commands you need to know.md @@ -0,0 +1,169 @@ +[#]: subject: (FreeDOS commands you need to know) +[#]: via: (https://opensource.com/article/21/4/freedos-commands) +[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +FreeDOS commands you need to know +====== +Learn how to make, remove, copy, and do other things with directories +and files in FreeDOS. +![woman on laptop sitting at the window][1] + +[FreeDOS][2], the open source implementation of DOS, provides a lightweight operating system for running legacy applications on modern hardware (or in an emulator) and for updating hardware vendor fails with a Linux-compatible firmware flasher. Getting familiar with FreeDOS is not only a fun throwback to the computing days of the past, it's an investment into gaining useful computing skills. In this article, I'll look at some of the essential commands you need to know to work on a FreeDOS system. + +### Essential directory and file commands + +FreeDOS uses directories to organize files on a hard drive. That means you need to use directory commands to create a structure to store your files and find the files you've stored there. The commands you need to manage your directory structure are relatively few: + + * `MD` (or `MKDIR`) creates a new directory or subdirectory. + * `RD` (or `RMDIR`) removes (or deletes) a directory or subdirectory. + * `CD` (or `CHDIR`) changes from the current working directory to another directory. + * `DELTREE` erases a directory, including any files or subdirectories it contains. + * `DIR` lists the contents of the current working directory. + + + +Because working with directories is central to what FreeDOS does, all of these (except DELTREE) are internal commands contained within COMMAND.COM. Therefore, they are loaded into RAM and ready for use whenever you boot (even from a boot disk). The first three commands have two versions: a two-letter short name and a long name. There is no difference in practice, so I'll use the short form in this article. + +### Make a directory with MD + +FreeDOS's `MD` command creates a new directory or subdirectory. (Actually, since the _root_ is the main directory, all directories are technically subdirectories, so I'll refer to _subdirectories_ in all examples.) An optional argument is the path to the directory you want to create, but if no path is included, the subdirectory is created in the current working subdirectory. + +For example, to create a subdirectory called `letters` in your current location: + + +``` +`C:\HOME\>MD LETTERS` +``` + +This creates the subdirectory `C:\letters`. + +By including a path, you can create a subdirectory anywhere: + + +``` +`C:\>MD C:\HOME\LETTERS\LOVE` +``` + +This has the same result as moving into `C:\HOME\LETTERS` first and then creating a subdirectory there: + + +``` +C:\CD HOME\LETTERS +C:\HOME\LETTERS\>MD LOVE +C:\HOME\LETTERS\>DIR +LOVE +``` + +A path specification cannot exceed 63 characters, including backslashes. + +### Remove a directory with RD + +FreeDOS's `RD` command removes a subdirectory. The subdirectory must be empty. If it contains files or other subdirectories, you get an error message. This has an optional path argument with the same syntax as `MD`. + +You cannot remove your current working subdirectory. To do that, you must `CD` to the parent subdirectory and then remove the undesired subdirectory. + +### Delete files and directories with DELTREE + +The `RD` command can be a little confusing because of safeguards FreeDOS builds into the command. That you cannot delete a subdirectory that has contents, for instance, is a safety measure. `DELTREE` is the solution. + +`DELTREE` deletes an entire subdirectory "tree" (a subdirectory), plus all of the files it contains, plus all of the subdirectories those contain, and all of the files _they_ contain, and so on, all in one easy command. Sometimes it can be a little _too_ easy because it can wipe out so much data so quickly. It ignores file attributes, so you can wipe out hidden, read-only, and system files without knowing it. + +You can even wipe out multiple trees by specifying them in the command. This would wipe out both of these subdirectories in one command: + + +``` +`C:\>DELTREE C:\FOO C:\BAR` +``` + +This is one of those commands where you really ought to think twice before you use it. It has its place, definitely. I can still remember how tedious it was to go into each subdirectory, delete the individual files, check each subdirectory for contents, delete each subdirectory one at a time, then jump up one level and repeat the process. `DELTREE` is a great timesaver when you need it. But I would never use it for ordinary maintenance because one false move can do so much damage. + +### Format a hard drive + +The `FORMAT` command can also be used to prepare a blank hard drive to have files written to it. This formats the `D:` drive: + + +``` +`C:\>FORMAT D:` +``` + +### Copy files + +The `COPY` command, as the name implies, copies files from one place to another. The required arguments are the file to be copied and the path and file to copy it to. Switches include: + + * `/Y` prevents a prompt when a file is being overwritten. + * `/-Y` requires a prompt when a file is being overwritten. + * `/V` verifies the contents of the copy. + + + +This copies the file `MYFILE.TXT` from the working directory on `C:` to the root directory of the `D:` drive and renames it `EXAMPLE.TXT`: + + +``` +`C:\>COPY MYFILE.TXT D:\EXAMPLE.TXT` +``` + +This copies the file `EXAMPLE.TXT` from the working directory on `C:` to the `C:\DOCS\` directory and then verifies the contents of the file to ensure that the copy is complete: + + +``` +`C:\>COPY EXAMPLE.TXT C:\DOCS\EXAMPLE.TXT /V` +``` + +You can also use the `COPY` command to combine and append files. This combines the two files `MYFILE1.TXT` and `MYFILE2.TXT` and places them in a new file called `MYFILE3.TXT`: + + +``` +`C:\>COPY MYFILE1.TXT+MYFILE2.TXT MYFILE3.TXT` +``` + +### Copy directories with XCOPY + +The `XCOPY` command copies entire directories, along with all of their subdirectories and all of the files contained in those subdirectories. Arguments are the files and path to be copied and the destination to copy them to. Important switches are: + + * `/S` copies all files in the current directory and any subdirectory within it. + * `/E` copies subdirectories, even if they are empty. This option must be used with the `/S` option. + * `/V` verifies the copies that were made. + + + +This is a very powerful and useful command, particularly for backing up directories or an entire hard drive. + +This command copies the entire contents of the directory `C:\DOCS`, including all subdirectories and their contents (except empty subdirectories) and places them on drive `D:` in the directory `D:\BACKUP\DOCS\`: + + +``` +`C:\>XCOPY C:\DOCS D:\BACKUP\DOCS\ /S` +``` + +### Using FreeDOS + +FreeDOS is a fun, lightweight, open source operating system. It provides lots of great utilities to enable you to get work done on it, whether you're using it to update the firmware of your motherboard or to give new life to an old computer. Learn the basics of FreeDOS. You might be surprised at how versatile it is. + +* * * + +_Some of the information in this article was previously published in [DOS lesson 8: Format; copy; diskcopy; Xcopy][3]; [DOS lesson 10: Directory commands][4] (both CC BY-SA 4.0); and [How to work with DOS][5]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/freedos-commands + +作者:[Kevin O'Brien][a] +选题:[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/ahuka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://www.freedos.org/ +[3]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-8-format-copy-diskcopy-xcopy/ +[4]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-10-directory-commands/ +[5]: https://allaboutdosdirectoires.blogspot.com/ From 720725ebf0d244d2c64b37e0d135307ad3bd5b76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 4 Apr 2021 05:04:12 +0800 Subject: [PATCH 004/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210403=20?= =?UTF-8?q?What=20problems=20do=20people=20solve=20with=20strace=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210403 What problems do people solve with strace.md --- ...at problems do people solve with strace.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20210403 What problems do people solve with strace.md diff --git a/sources/tech/20210403 What problems do people solve with strace.md b/sources/tech/20210403 What problems do people solve with strace.md new file mode 100644 index 0000000000..1b8080d60a --- /dev/null +++ b/sources/tech/20210403 What problems do people solve with strace.md @@ -0,0 +1,144 @@ +[#]: subject: (What problems do people solve with strace?) +[#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What problems do people solve with strace? +====== + +Yesterday I [asked on Twitter about what problems people are solving with strace][1] and as usual everyone really delivered! I got 200 answers and then spent a bunch of time manually categorizing them into 9 categories of problems. + +All of the problems are about either finding files a program depends on, figuring out why a program is stuck or slow, or finding out why a program is failing. These generally matched up with what I use strace for myself, but there were some things I hadn’t thought of too! + +I’m not going to explain what strace is in this post but I have a [free zine about it][2] and [a talk][3] and [lots of blog posts][4]. + +### problem 1: where’s the config file? + +The #1 most popular problem was “this program has a configuration file and I don’t know where it is”. This is probably my most common use for strace too, because it’s such a simple question. + +This is great because there are a million ways for a program to document where its config file is (in a man page, on its website, in `--help`, etc), but there’s only one way for it to actually open it (with a system call!) + +### problem 2: what other files does this program depend on? + +You can also use strace to find other types of files a program depends on, like: + + * dynamically linked libraries (“why is my program loading the wrong version of this `.so` file?“) like [this ruby problem I debugged in 2014][5] + * where it’s looking for its Ruby gems (Ruby specifically came up a few times!) + * SSL root certificates + * a game’s save files + * a closed-source program’s data files + * [which node_modules files aren’t being used][6] + + + +### problem 3: why is this program hanging? + +You have a program, it’s just sitting there doing nothing, what’s going on? This one is especially easy to answer because a lot of the time you just need to run `strace -p PID` and look at what system call is currently running. You don’t even have to look through hundreds of lines of output! + +The answer is usually ‘waiting for some kind of I/O’. Some possible answers for “why is this stuck” (though there are a lot more!): + + * it’s polling forever on a `select()` + * it’s `wait()`ing for a subprocess to finish + * it’s making a network request to something that isn’t responding + * it’s doing `write()` but it’s blocked because the buffer is full + * it’s doing a `read()` on stdin and it’s waiting for input + + + +Someone also gave a nice example of using strace to debug a stuck `df`: ‘with strace df -h you can find the stuck mount and unmount it”. + +### problem 4: is this program stuck? + +A variation on the previous one: sometimes a program has been running for longer than you expected, and you just want to know if it’s stuck or of it’s still making progress. + +As long as the program makes system calls while it’s running, this is super easy to answer with strace – just strace it and see if it’s making new system calls! + +### problem 5: why is this program slow? + +You can use strace as a sort of coarse profiling tool – `strace -t` will show the timestamp of each system call, so you can look for big gaps and find the culprit. + +Here are 9 short stories from Twitter of people using strace to debug “why is this program slow?”. + + * Back in 2000, a Java-based web site that I helped support was dying under modest load: pages loaded slowly, if at all. We straced the J2EE application server and found that it was reading class files one. byte. at. a. time. Devs weren’t using BufferedReader, classic Java mistake. + * Optimizing app startup times… running strace can be an eye-opening experience, in terms of the amount of unnecessary file system interaction going on (e.g. open/read/close on the same config file over and over again; loading gobs of font files over a slow NFS mount, etc) + * Asked myself why reading from session files in PHP (usually <100 bytes) was incredibly slow. Turned out some `flock`-syscalls took ~60s + * A program was behaving abnormally slow. Used strace to figure out it was re-initializing its internal pseudo-random number generator on every request by reading from /dev/random and exhausting entropy + * Last thing I remember was attaching to a job worker and seeing just how many network calls it was making (which was unexpected). + * Why is this program so slow to start? strace shows it opening/reading the same config file thousands of times. + * Server using 100% CPU time randomly with low actual traffic. Turns out it’s hitting the number of open files limit accepting a socket, and retrying forever after getting EMFILE and not reporting it. + * A workflow was running super slow but no logs, ends up it was trying to do a post request that was taking 30s before timing out and then retrying 5 times… ends up the backend service was overwhelmed but also had no visibility + * using strace to notice that gethostbyname() is taking a long time to return (you can’t see the `gethostbyname` directly but you can see the DNS packets in strace) + + + +### problem 6: hidden permissions errors + +Sometimes a program is failing for a mysterious reason, but the problem is just that there’s some file that it doesn’t have permission to open. In an ideal world programs would report those errors (“Error opening file /dev/whatever: permission denied”), but of course the world is not perfect, so strace can really help with this! + +This is actually the most recent thing I used strace for: I was using an AxiDraw pen plotter and it printed out an inscrutable error message when I tried to start it. I `strace`d it and it turned out that my user just didn’t have permission to open the USB device. + +### problem 7: what command line arguments are being used? + +Sometimes a script is running another program, and you want to know what command line flags it’s passing! + +A couple of examples from Twitter: + + * find what compiler flags are actually being used to build some code + * a command was failing due to having too long a command line + + + +### problem 8: why is this network connection failing? + +Basically the goal here is just to find which domain / IP address the network connection is being made to. You can look at the DNS request to find the domain or the `connect` system call to find the IP. + +In general there are a lot of stories about using strace to debug network issues when `tcpdump` isn’t available for some reason or just because it’s what the person is more familiar with. + +### problem 9: why does this program succeed when run one way and fail when run in another way? + +For example: + + * the same binary works on one machine, fails on another machine + * works when you run it, fails when spawned by a systemd unit file + * works when you run it, fails when you run it as “su - user /some/script” + * works when you run it, fails when run as a cron job + + + +Being able to compare the strace output in both cases is very helpful. Though my first step when debugging “this works as my user and fails when run in a different way on the same computer” would be “look at my environment variables”. + +### what I’m doing with this: slowly building some challenges + +The reason I’m thinking about this is that I’ve been slowly working on some challenges to help people practice using strace and other command line tools. The idea is that you’re given a problem to solve, a terminal, and you’re free to solve it in any way you want. + +So my goal is to use this to build some practice problems that you can solve with strace that reflect the kinds of problems that people actually use it for in real life. + +### that’s all! + +There are probably more problems that can be solved with strace that I haven’t covered here – I’d love to hear what I’ve missed! + +I really loved seeing how many of the same uses came up over and over and over again – at least 20 different people replied saying that they use strace to find config files. And as always I think it’s really delightful how such a simple tool (“trace system calls!”) can be used to solve so many different kinds of problems. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1378014888405168132 +[2]: https://wizardzines.com/zines/strace +[3]: https://www.youtube.com/watch?v=4pEHfGKB-OE +[4]: https://jvns.ca/categories/strace +[5]: https://jvns.ca/blog/2014/03/10/debugging-shared-library-problems-with-strace/ +[6]: https://indexandmain.com/post/shrink-node-modules-with-refining From 195be1d650b6b0e7296c20678c8517cf7fcc34a9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 08:41:03 +0800 Subject: [PATCH 005/307] APL --- .../tech/20210403 What problems do people solve with strace.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210403 What problems do people solve with strace.md b/sources/tech/20210403 What problems do people solve with strace.md index 1b8080d60a..a1b9c1a02a 100644 --- a/sources/tech/20210403 What problems do people solve with strace.md +++ b/sources/tech/20210403 What problems do people solve with strace.md @@ -2,7 +2,7 @@ [#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) [#]: author: (Julia Evans https://jvns.ca/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 54fe7c136af380dca01e925e34c6321d7e3a9b1b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 09:44:24 +0800 Subject: [PATCH 006/307] TSL&PRF --- ...at problems do people solve with strace.md | 144 ------------------ ...at problems do people solve with strace.md | 134 ++++++++++++++++ 2 files changed, 134 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20210403 What problems do people solve with strace.md create mode 100644 translated/tech/20210403 What problems do people solve with strace.md diff --git a/sources/tech/20210403 What problems do people solve with strace.md b/sources/tech/20210403 What problems do people solve with strace.md deleted file mode 100644 index a1b9c1a02a..0000000000 --- a/sources/tech/20210403 What problems do people solve with strace.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: subject: (What problems do people solve with strace?) -[#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) -[#]: author: (Julia Evans https://jvns.ca/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What problems do people solve with strace? -====== - -Yesterday I [asked on Twitter about what problems people are solving with strace][1] and as usual everyone really delivered! I got 200 answers and then spent a bunch of time manually categorizing them into 9 categories of problems. - -All of the problems are about either finding files a program depends on, figuring out why a program is stuck or slow, or finding out why a program is failing. These generally matched up with what I use strace for myself, but there were some things I hadn’t thought of too! - -I’m not going to explain what strace is in this post but I have a [free zine about it][2] and [a talk][3] and [lots of blog posts][4]. - -### problem 1: where’s the config file? - -The #1 most popular problem was “this program has a configuration file and I don’t know where it is”. This is probably my most common use for strace too, because it’s such a simple question. - -This is great because there are a million ways for a program to document where its config file is (in a man page, on its website, in `--help`, etc), but there’s only one way for it to actually open it (with a system call!) - -### problem 2: what other files does this program depend on? - -You can also use strace to find other types of files a program depends on, like: - - * dynamically linked libraries (“why is my program loading the wrong version of this `.so` file?“) like [this ruby problem I debugged in 2014][5] - * where it’s looking for its Ruby gems (Ruby specifically came up a few times!) - * SSL root certificates - * a game’s save files - * a closed-source program’s data files - * [which node_modules files aren’t being used][6] - - - -### problem 3: why is this program hanging? - -You have a program, it’s just sitting there doing nothing, what’s going on? This one is especially easy to answer because a lot of the time you just need to run `strace -p PID` and look at what system call is currently running. You don’t even have to look through hundreds of lines of output! - -The answer is usually ‘waiting for some kind of I/O’. Some possible answers for “why is this stuck” (though there are a lot more!): - - * it’s polling forever on a `select()` - * it’s `wait()`ing for a subprocess to finish - * it’s making a network request to something that isn’t responding - * it’s doing `write()` but it’s blocked because the buffer is full - * it’s doing a `read()` on stdin and it’s waiting for input - - - -Someone also gave a nice example of using strace to debug a stuck `df`: ‘with strace df -h you can find the stuck mount and unmount it”. - -### problem 4: is this program stuck? - -A variation on the previous one: sometimes a program has been running for longer than you expected, and you just want to know if it’s stuck or of it’s still making progress. - -As long as the program makes system calls while it’s running, this is super easy to answer with strace – just strace it and see if it’s making new system calls! - -### problem 5: why is this program slow? - -You can use strace as a sort of coarse profiling tool – `strace -t` will show the timestamp of each system call, so you can look for big gaps and find the culprit. - -Here are 9 short stories from Twitter of people using strace to debug “why is this program slow?”. - - * Back in 2000, a Java-based web site that I helped support was dying under modest load: pages loaded slowly, if at all. We straced the J2EE application server and found that it was reading class files one. byte. at. a. time. Devs weren’t using BufferedReader, classic Java mistake. - * Optimizing app startup times… running strace can be an eye-opening experience, in terms of the amount of unnecessary file system interaction going on (e.g. open/read/close on the same config file over and over again; loading gobs of font files over a slow NFS mount, etc) - * Asked myself why reading from session files in PHP (usually <100 bytes) was incredibly slow. Turned out some `flock`-syscalls took ~60s - * A program was behaving abnormally slow. Used strace to figure out it was re-initializing its internal pseudo-random number generator on every request by reading from /dev/random and exhausting entropy - * Last thing I remember was attaching to a job worker and seeing just how many network calls it was making (which was unexpected). - * Why is this program so slow to start? strace shows it opening/reading the same config file thousands of times. - * Server using 100% CPU time randomly with low actual traffic. Turns out it’s hitting the number of open files limit accepting a socket, and retrying forever after getting EMFILE and not reporting it. - * A workflow was running super slow but no logs, ends up it was trying to do a post request that was taking 30s before timing out and then retrying 5 times… ends up the backend service was overwhelmed but also had no visibility - * using strace to notice that gethostbyname() is taking a long time to return (you can’t see the `gethostbyname` directly but you can see the DNS packets in strace) - - - -### problem 6: hidden permissions errors - -Sometimes a program is failing for a mysterious reason, but the problem is just that there’s some file that it doesn’t have permission to open. In an ideal world programs would report those errors (“Error opening file /dev/whatever: permission denied”), but of course the world is not perfect, so strace can really help with this! - -This is actually the most recent thing I used strace for: I was using an AxiDraw pen plotter and it printed out an inscrutable error message when I tried to start it. I `strace`d it and it turned out that my user just didn’t have permission to open the USB device. - -### problem 7: what command line arguments are being used? - -Sometimes a script is running another program, and you want to know what command line flags it’s passing! - -A couple of examples from Twitter: - - * find what compiler flags are actually being used to build some code - * a command was failing due to having too long a command line - - - -### problem 8: why is this network connection failing? - -Basically the goal here is just to find which domain / IP address the network connection is being made to. You can look at the DNS request to find the domain or the `connect` system call to find the IP. - -In general there are a lot of stories about using strace to debug network issues when `tcpdump` isn’t available for some reason or just because it’s what the person is more familiar with. - -### problem 9: why does this program succeed when run one way and fail when run in another way? - -For example: - - * the same binary works on one machine, fails on another machine - * works when you run it, fails when spawned by a systemd unit file - * works when you run it, fails when you run it as “su - user /some/script” - * works when you run it, fails when run as a cron job - - - -Being able to compare the strace output in both cases is very helpful. Though my first step when debugging “this works as my user and fails when run in a different way on the same computer” would be “look at my environment variables”. - -### what I’m doing with this: slowly building some challenges - -The reason I’m thinking about this is that I’ve been slowly working on some challenges to help people practice using strace and other command line tools. The idea is that you’re given a problem to solve, a terminal, and you’re free to solve it in any way you want. - -So my goal is to use this to build some practice problems that you can solve with strace that reflect the kinds of problems that people actually use it for in real life. - -### that’s all! - -There are probably more problems that can be solved with strace that I haven’t covered here – I’d love to hear what I’ve missed! - -I really loved seeing how many of the same uses came up over and over and over again – at least 20 different people replied saying that they use strace to find config files. And as always I think it’s really delightful how such a simple tool (“trace system calls!”) can be used to solve so many different kinds of problems. - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/ - -作者:[Julia Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://twitter.com/b0rk/status/1378014888405168132 -[2]: https://wizardzines.com/zines/strace -[3]: https://www.youtube.com/watch?v=4pEHfGKB-OE -[4]: https://jvns.ca/categories/strace -[5]: https://jvns.ca/blog/2014/03/10/debugging-shared-library-problems-with-strace/ -[6]: https://indexandmain.com/post/shrink-node-modules-with-refining diff --git a/translated/tech/20210403 What problems do people solve with strace.md b/translated/tech/20210403 What problems do people solve with strace.md new file mode 100644 index 0000000000..8a40314aab --- /dev/null +++ b/translated/tech/20210403 What problems do people solve with strace.md @@ -0,0 +1,134 @@ +[#]: subject: (What problems do people solve with strace?) +[#]: via: (https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +strace 可以解决什么问题? +====== + +昨天我 [在 Twitter 上询问大家用 strace 解决了什么问题?][1],和往常一样,大家真的是给出了自己的答案! 我收到了大约 200 个答案,然后花了很多时间手动将它们归为 9 类。 + +这些解决的问题都是关于寻找程序依赖的文件、找出程序卡住或慢的原因、或者找出程序失败的原因。这些总体上与我自己使用 `strace` 的内容相吻合,但也有一些我没有想到的东西! + +我不打算在这篇文章里解释什么是 `strace`,但我有一本 [关于它的免费杂志][2] 和 [一个讲座][3] 以及 [很多博文][4]。 + +### 问题 1:配置文件在哪里? + +最受欢迎的问题是“这个程序有一个配置文件,但我不知道它在哪里”。这可能也是我最常使用 `strace` 解决的问题,因为这是个很简单的问题。 + +这很好,因为一个程序有一百万种方法来记录它的配置文件在哪里(在手册页、网站上、`--help`等),但只有一种方法可以让它真正打开它(用系统调用!)。 + +### 问题 2:这个程序还依赖什么文件? + +你也可以使用 `strace` 来查找程序依赖的其他类型的文件,比如: + + * 动态链接库(“为什么我的程序加载了这个错误版本的 `.so` 文件?"),比如 [我在 2014 年调试的这个 ruby 问题][5] + * 它在哪里寻找它的 Ruby gem(Ruby 出现了几次这种情况!) + * SSL 根证书 + * 游戏的存档文件 + * 一个闭源程序的数据文件 + * [哪些 node_modules 文件没有被使用][6] + +### 问题 3:为什么这个程序会挂掉? + +你有一个程序,它只是坐在那里什么都不做,这是怎么回事?这个问题特别容易回答,因为很多时候你只需要运行 `strace -p PID`,看看当前运行的是什么系统调用。你甚至不需要看几百行的输出。 + +答案通常是“正在等待某种 I/O”。“为什么会卡住”的一些可能的答案(虽然还有很多!): + + * 它一直在轮询 `select()` + * 正在 `wait()` 等待一个子进程完成 + * 它在向某个没有响应的东西发出网络请求 + * 正在进行 `write()`,但由于缓冲区已满而被阻止。 + * 它在 stdin 上做 `read()`,等待输入。 + +有人还举了一个很好的例子,用 `strace` 调试一个卡住的 `df` 命令:“用 `strace df -h` 你可以找到卡住的挂载,然后卸载它”。 + +### 问题 4:这个程序卡住了吗? + +这是上一个问题的变种:有时一个程序运行的时间比你预期的要长,你只是想知道它是否卡住了,或者它是否还在继续进行。 + +只要程序在运行过程中进行系统调用,用 `strace` 就可以超简单地回答这个问题:只需 `strace` 它,看看它是否在进行新的系统调用! + +### 问题 5:为什么这个程序很慢? + +你可以使用 `strace` 作为一种粗略的剖析工具:`strace -t` 会显示每次系统调用的时间戳,这样你就可以寻找大的漏洞,找到罪魁祸首。 + +以下是 Twitter 上 9 个人使用 `strace` 调试“为什么这个程序很慢?”的小故事。 + + * 早在 2000 年,我帮助支持的一个基于 Java 的网站在适度的负载下奄奄一息:页面加载缓慢,甚至完全加载不出来。我们对 J2EE 应用服务器进行了测试,发现它每次只读取一个类文件。开发人员没有使用 BufferedReader,这是典型的 Java 错误。 + * 优化应用程序的启动时间……运行 `strace` 可以让人大开眼界,因为有大量不必要的文件系统交互在进行(例如,在同一个配置文件上反复打开/读取/关闭;在一个缓慢的 NFS 挂载上加载大量的字体文件,等等)。 + * 问自己为什么在 PHP 中从会话文件中读取(通常是小于 100 字节)非常慢。结果发现一些 `flock` 系统调用花了大约 60 秒。 + * 一个程序表现得异常缓慢。使用 `strace` 找出它在每次请求时,通过从 `/dev/random` 读取数据并耗尽熵来重新初始化其内部伪随机数发生器。 + * 我记得最近一件事是连接到一个任务处理程序,看到它有多少网络调用(这是意想不到的)。 + * `strace` 显示它打开/读取同一个配置文件数千次。 + * 服务器随机使用 100% 的 CPU 时间,实际流量很低。原来是碰到打开文件数限制,接受一个套接字时,得到 EMFILE 错误而没有报告,然后一直重试。 + * 一个工作流运行超慢,但是没有日志,结果它做一个 POST 请求花了 30 秒而超时,然后重试了 5 次……结果后台服务不堪重负,但是也没有可视性。 + * 使用 `strace` 注意到 `gethostbyname()` 需要很长时间才能返回(你不能直接看到 `gethostbyname`,但你可以看到 `strace` 中的 DNS 数据包) + +### 问题 6:隐藏的权限错误 + +有时候程序因为一个神秘的原因而失败,但问题只是有一些它没有权限打开的文件。在理想的世界里,程序会报告这些错误(“Error opening file /dev/whatever: permission denied”),当然这个世界并不完美,所以 `strace` 真的可以帮助解决这个问题! + +这其实是我最近使用 `strace` 做的事情。我使用了一台 AxiDraw 绘图仪,当我试图启动它时,它打印出了一个难以理解的错误信息。我 `strace` 它,结果发现我的用户没有权限打开 USB 设备。 + +### 问题 7:正在使用什么命令行参数? + +有时候,一个脚本正在运行另一个程序,你想知道它传递的是什么命令行标志! + +几个来自 Twitter 的例子。 + + * 找出实际上是用来编译代码的编译器标志 + * 由于命令行太长,命令失败了 + +### 问题 8:为什么这个网络连接失败? + +基本上,这里的目标是找到网络连接的域名 / IP 地址。你可以通过 DNS 请求来查找域名,或者通过 `connect` 系统调用来查找 IP。 + +一般来说,当 `tcpdump` 因为某些原因不能使用或者只是因为比较熟悉 `strace` 时,就经常会使用 `strace` 调试网络问题。 + +### 问题 9:为什么这个程序以一种方式运行时成功,以另一种方式运行时失败? + +例如: + + * 同样的二进制程序在一台机器上可以运行,在另一台机器上却失败了 + * 可以运行,但被 systemd 单元文件生成时失败 + * 可以运行,但以 `su - user /some/script` 的方式运行时失败 + * 可以运行,作为 cron 作业运行时失败 + +能够比较两种情况下的 `strace` 输出是非常有用的。虽然我在调试“以我的用户身份工作,而在同一台计算机上以不同方式运行时却失败了”时,第一步是“看看我的环境变量”。 + +### 我在做什么:慢慢地建立一些挑战 + +我之所以会想到这个问题,是因为我一直在慢慢地进行一些挑战,以帮助人们练习使用 `strace` 和其他命令行工具。我的想法是,给你一个问题,一个终端,你可以自由地以任何方式解决它。 + +所以我的目标是用它来建立一些你可以用 `strace` 解决的练习题,这些练习题反映了人们在现实生活中实际使用它解决的问题。 + +### 就是这样! + +可能还有更多的问题可以用 `strace` 解决,我在这里还没有讲到,我很乐意听到我错过了什么! + +我真的很喜欢看到很多相同的用法一次又一次地出现:至少有 20 个不同的人回答说他们使用 `strace` 来查找配置文件。而且和以往一样,我觉得这样一个简单的工具(“跟踪系统调用!”)可以用来解决这么多不同类型的问题,真的很令人高兴。 + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/04/03/what-problems-do-people-solve-with-strace/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1378014888405168132 +[2]: https://wizardzines.com/zines/strace +[3]: https://www.youtube.com/watch?v=4pEHfGKB-OE +[4]: https://jvns.ca/categories/strace +[5]: https://jvns.ca/blog/2014/03/10/debugging-shared-library-problems-with-strace/ +[6]: https://indexandmain.com/post/shrink-node-modules-with-refining From bcf242f41a7c6453fb3e2a85260f2a2b75df36be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 09:49:56 +0800 Subject: [PATCH 007/307] PUB @wxy https://linux.cn/article-13267-1.html --- .../20210403 What problems do people solve with strace.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210403 What problems do people solve with strace.md (98%) diff --git a/translated/tech/20210403 What problems do people solve with strace.md b/published/20210403 What problems do people solve with strace.md similarity index 98% rename from translated/tech/20210403 What problems do people solve with strace.md rename to published/20210403 What problems do people solve with strace.md index 8a40314aab..3160de5910 100644 --- a/translated/tech/20210403 What problems do people solve with strace.md +++ b/published/20210403 What problems do people solve with strace.md @@ -4,12 +4,14 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13267-1.html) strace 可以解决什么问题? ====== +![](https://img.linux.net.cn/data/attachment/album/202104/05/094825y66126r56z361rz1.jpg) + 昨天我 [在 Twitter 上询问大家用 strace 解决了什么问题?][1],和往常一样,大家真的是给出了自己的答案! 我收到了大约 200 个答案,然后花了很多时间手动将它们归为 9 类。 这些解决的问题都是关于寻找程序依赖的文件、找出程序卡住或慢的原因、或者找出程序失败的原因。这些总体上与我自己使用 `strace` 的内容相吻合,但也有一些我没有想到的东西! From 4a52ebe4075dce556a54ff4c6a72b22f1850f6a2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 10:24:59 +0800 Subject: [PATCH 008/307] PRF @geekpi --- ...10329 Manipulate data in files with Lua.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210329 Manipulate data in files with Lua.md b/translated/tech/20210329 Manipulate data in files with Lua.md index dfbae5c7fb..f8b938bf28 100644 --- a/translated/tech/20210329 Manipulate data in files with Lua.md +++ b/translated/tech/20210329 Manipulate data in files with Lua.md @@ -3,14 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Lua 操作文件中的数据 ====== -了解 Lua 如何处理数据的读写。 -![Person standing in front of a giant computer screen with numbers, data][1] + +> 了解 Lua 如何处理数据的读写。 + +![](https://img.linux.net.cn/data/attachment/album/202104/05/102424yczwucc3xcuyzkgw.jpg) 有些数据是临时的,存储在 RAM 中,只有在应用运行时才有意义。但有些数据是要持久的,存储在硬盘上供以后使用。当你编程时,无论是简单的脚本还是复杂的工具套件,通常都需要读取和写入文件。有时文件可能包含配置选项,而另一些时候这个文件是你的用户用你的应用创建的数据。每种语言都会以不同的方式处理这项任务,本文将演示如何使用 Lua 处理文件数据。 @@ -22,8 +24,7 @@ ### 用 Lua 读取文件 -Lua 使用 `io` 库进行数据输入和输出。下面的例子创建了一个名为 `ingest` 的函数来从文件中读取数据,然后用 `:read` 函数进行解析。在 Lua 中打开一个文件时,有几种模式可以启用。因为我只需要从这个文件中读取数据,所以我使用 `r`(代表”读“)模式: - +Lua 使用 `io` 库进行数据输入和输出。下面的例子创建了一个名为 `ingest` 的函数来从文件中读取数据,然后用 `:read` 函数进行解析。在 Lua 中打开一个文件时,有几种模式可以启用。因为我只需要从这个文件中读取数据,所以我使用 `r`(代表“读”)模式: ``` function ingest(file) @@ -37,7 +38,7 @@ myfile=ingest("example.txt") print(myfile) ``` -在这段代码中,注意到变量 `myfile` 是为了触发 `ingest` 函数而创建的,因此,它接收该函数返回的任何内容。`ingest` 函数返回文件的行数(从一个称为 `lines` 的变量中)。当最后一步打印 `myfile` 变量的内容时,文件的行数就会出现在终端中。 +在这段代码中,注意到变量 `myfile` 是为了触发 `ingest` 函数而创建的,因此,它接收该函数返回的任何内容。`ingest` 函数返回文件的行数(从一个称为 `lines` 的变量中0。当最后一步打印 `myfile` 变量的内容时,文件的行数就会出现在终端中。 如果文件 `example.txt` 中包含了配置选项,那么我会写一些额外的代码来解析这些数据,可能会使用另一个 Lua 库,这取决于配置是以 INI 文件还是 YAML 文件或其他格式存储。如果数据是 SVG 图形,我会写额外的代码来解析 XML,可能会使用 Lua 的 SVG 库。换句话说,你的代码读取的数据一旦加载到内存中,就可以进行操作,但是它们都需要加载 `io` 库。 @@ -45,7 +46,6 @@ print(myfile) 无论你是要存储用户用你的应用创建的数据,还是仅仅是关于用户在应用中做了什么的元数据(例如,游戏保存或最近播放的歌曲),都有很多很好的理由来存储数据供以后使用。在 Lua 中,这是通过 `io` 库实现的,打开一个文件,将数据写入其中,然后关闭文件: - ``` function exgest(file)    local f = io.open(file, "a") @@ -63,13 +63,11 @@ exgest("example.txt") 在 Lua 中打开文件时,有一些保护措施和参数来定义如何处理文件。默认值是 `r`,允许你只读数据: - * **r** 只读 - * **w** 如果文件不存在,覆盖或创建一个新文件。 - * **r+** 读取和覆盖。 - * **a** 追加数据到文件中,或在文件不存在的情况下创建一个新文件。 - * **a+** 读取数据,将数据追加到文件中,或文件不存在的话,创建一个新文件。 - - + * `r` 只读 + * `w` 如果文件不存在,覆盖或创建一个新文件。 + * `r+` 读取和覆盖。 + * `a` 追加数据到文件中,或在文件不存在的情况下创建一个新文件。 + * `a+` 读取数据,将数据追加到文件中,或文件不存在的话,创建一个新文件。 还有一些其他的(例如,`b` 代表二进制格式),但这些是最常见的。关于完整的文档,请参考 [Lua.org/manual][5] 上的优秀 Lua 文档。 @@ -84,7 +82,7 @@ via: https://opensource.com/article/21/3/lua-files 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bf383c8ba5530759c35826cd57f47765e11114e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 10:25:42 +0800 Subject: [PATCH 009/307] PUB @geekpi https://linux.cn/article-13268-1.html --- .../20210329 Manipulate data in files with Lua.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210329 Manipulate data in files with Lua.md (98%) diff --git a/translated/tech/20210329 Manipulate data in files with Lua.md b/published/20210329 Manipulate data in files with Lua.md similarity index 98% rename from translated/tech/20210329 Manipulate data in files with Lua.md rename to published/20210329 Manipulate data in files with Lua.md index f8b938bf28..eb0bf8808b 100644 --- a/translated/tech/20210329 Manipulate data in files with Lua.md +++ b/published/20210329 Manipulate data in files with Lua.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13268-1.html) 用 Lua 操作文件中的数据 ====== From 21bdaca6e31e4905db2ecd06dc3a92b2ac9eb3db Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 5 Apr 2021 16:14:59 +0800 Subject: [PATCH 010/307] APL --- ...ltiple Markdown Files into HTML or Other Formats in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md index bbee3f9270..2fb398c106 100644 --- a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/convert-markdown-files/) [#]: author: (Bill Dyer https://itsfoss.com/author/bill/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 20f852eb9e2dcd46fbf9ac8698b300d6ff8c5264 Mon Sep 17 00:00:00 2001 From: "Xiaobin.Liu" Date: Mon, 5 Apr 2021 17:02:51 +0800 Subject: [PATCH 011/307] TSL --- ...les into HTML or Other Formats in Linux.md | 160 ------------------ ...les into HTML or Other Formats in Linux.md | 160 ++++++++++++++++++ 2 files changed, 160 insertions(+), 160 deletions(-) delete mode 100644 sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md create mode 100644 translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md diff --git a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md deleted file mode 100644 index 2fb398c106..0000000000 --- a/sources/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ /dev/null @@ -1,160 +0,0 @@ -[#]: subject: (Converting Multiple Markdown Files into HTML or Other Formats in Linux) -[#]: via: (https://itsfoss.com/convert-markdown-files/) -[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) -[#]: collector: (lujun9972) -[#]: translator: (lxbwolf) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Converting Multiple Markdown Files into HTML or Other Formats in Linux -====== - -Many times, when I use Markdown, I work on one file and when I’m done with it, I convert it to HTML or some other format. Occasionally, I have to create a few files. When I do work with more than one Markdown file, I usually wait until I have finished them before I convert them. - -I use pandoc to convert files, and it’s possible convert all the Markdown files in one shot. - -Markdown can convert its files to .html, but if there’s a chance that I will have to convert to other formats like epub, [pandoc][1] is the tool to use. I prefer to use the command line, so I will cover that first, but you can also do this in [VSCodium][2] without the command line. I’ll cover that too. - -### Converting multiple Markdown files to another format with Pandoc [command line method] - -To get started quickly, Ubuntu, and other Debian distros can type the following commands in the terminal: - -``` -sudo apt-get install pandoc -``` - -In this example, I have four Markdown files in a directory called md_test. - -``` -[email protected]:~/Documents/md_test$ ls -l *.md --rw-r--r-- 1 bdyer bdyer 3374 Apr 7 2020 file01.md --rw-r--r-- 1 bdyer bdyer 782 Apr 2 05:23 file02.md --rw-r--r-- 1 bdyer bdyer 9257 Apr 2 05:21 file03.md --rw-r--r-- 1 bdyer bdyer 9442 Apr 2 05:21 file04.md -[email protected]:~/Documents/md_test$ -``` - -There are no HTML files yet. Now I’ll use Pandoc to do its magic on the collection of files. To do this, I run a one-line command that: - - * calls pandoc - * reads the .md files and exports them as .html - - - -This is the command: - -``` -for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done -``` - -If you are not aware already, `;` is used for [running multiple commands at once in Linux][3]. - -Here’s what the display looks like once I have executed the command: - -``` -[email protected]:~/Documents/md_test$ for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done -file01.md -file02.md -file03.md -file04.md -[email protected]:~/Documents/md_test$ -``` - -Let me use the `ls` command once more to see if HTML files were created: - -``` -[email protected]:~/Documents/md_test$ ls -l *.html --rw-r--r-- 1 bdyer bdyer 4291 Apr 2 06:08 file01.md.html --rw-r--r-- 1 bdyer bdyer 1781 Apr 2 06:08 file02.md.html --rw-r--r-- 1 bdyer bdyer 10272 Apr 2 06:08 file03.md.html --rw-r--r-- 1 bdyer bdyer 10502 Apr 2 06:08 file04.md.html -[email protected]:~/Documents/md_test$ -``` - -The conversion was a success, and you have four HTML files ready to go on the Web server. - -Pandoc is quite versatile and you can convert the markdown files to some other supported format by specifying the extension of the output files. You can understand why it is considered among the [best open source tools for writers][4]. - -**Recommended Read:** - -![][5] - -#### [11 Best Markdown Editors for Linux][6] - -A list of best Markdown Editors for Linux distributions that not only look good but are also feature rich. - -### Converting Markdown files to HTML using VSCodium [GUI method] - -Like I’ve said earlier, I normally use the command line, but I don’t always use it for batch conversions, and you don’t have to either. VSCode or [VSCodium][7] can do the job. You just need to add one extension, called: _Markdown-All-in-One_ which will allow you to convert more than one Markdown file in one run. - -There are two ways to install the extension: - - * VSCodium’s terminal - * VSCodium’s plug-in manager - - - -To install the extension through VSCodium’s terminal: - - 1. Click on `Terminal` on the menu bar. The terminal panel will open - 2. Type, or [copy-and-paste, the following command in the terminal][8]: - - - -``` -codium --install-extension yzhang.markdown-all-in-one -``` - -**Note**: If you’re using VSCode instead of VSCodium, replace the word, `codium`, in the above command, with `code` - -![][9] - -The second way to install is through VSCodium’s plug-in, or extension, manager: - - 1. Click on the blocks on the left side of the VSCodium window. A list of extensions will appear. At the top of the list, there will be a search bar. - 2. In the search bar, type: `Markdown All in One`. The extension will be listed at the top of the list. Click on the `Install` button to install it. If it is already installed, a gear icon will appear in place of the install button. - - - -![][10] - -Once the extension is installed, you can open the folder that contains the Markdown files you want to convert. - -Click on the paper icon located on the left side of the VSCodium window. You’ll be given the opportunity to choose your folder. Once a folder is open, you’ll need to open at least one file. You can open as many files as you want, but one is the minimum. - -Once a file is open, bring up the Command Palette by pressing `CTRL+SHIFT+P`. Then, start typing `Markdown`in the search bar that will appear. As you do this, a list of Markdown related commands will appear. One of these will be `Markdown All in One: Print documents to HTML` command. Click on that one. - -![][11] - -You’ll be asked to choose a folder containing the files. This is so an output directory (called `out`) can be made and this is where the HTML files will go. The image below shows that the HTML was made after exporting the Markdown documents. From here, you can open, view, and edit the HTML as you wish. - -![][12] - -By waiting to convert your Markdown files, you can concentrate more on writing. Conversion to HTML can come when you’re ready – and you have two ways to get that done. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/convert-markdown-files/ - -作者:[Bill Dyer][a] -选题:[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/bill/ -[b]: https://github.com/lujun9972 -[1]: https://pandoc.org/ -[2]: https://vscodium.com/ -[3]: https://itsfoss.com/run-multiple-commands-linux/ -[4]: https://itsfoss.com/open-source-tools-writers/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/10/Best-Markdown-Editors-for-Linux.jpg?fit=800%2C450&ssl=1 -[6]: https://itsfoss.com/best-markdown-editors-linux/ -[7]: https://itsfoss.com/vscodium/ -[8]: https://itsfoss.com/copy-paste-linux-terminal/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_terminal.jpg?resize=800%2C564&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_extension_select.jpg?resize=800%2C564&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_markdown_function_options.jpg?resize=800%2C564&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_html_filelist_shown.jpg?resize=800%2C564&ssl=1 diff --git a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md new file mode 100644 index 0000000000..e9aee0c478 --- /dev/null +++ b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -0,0 +1,160 @@ +[#]: subject: "Converting Multiple Markdown Files into HTML or Other Formats in Linux" +[#]: via: "https://itsfoss.com/convert-markdown-files/" +[#]: author: "Bill Dyer https://itsfoss.com/author/bill/" +[#]: collector: "lujun9972" +[#]: translator: "lxbwolf" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Linux 中把多个 Markdown 文件转换成 HTML 或其他格式 +====== + +很多时候我与 Markdown 打交道的方式是,先写完一个文件,然后把它转换成 HTML 或其他格式。也有些时候,需要创建一些新的文件。当我要写多个 Markdown 文件时,通常要把他们全部写完之后才转换它们。 + +我用 pandoc 来转换文件,它可以一次性地转换所有 Markdown 文件。 + +Markdown 格式的文件可以转换成 .html 文件,有时候我需要把它转换成其他格式,如 epub,这个时候 [pandoc][1] 就派上了用场。我更喜欢用命令行,因此本文我会首先介绍它,然而你还可以使用 [VSCodium][2] 在非命令行下完成转换。后面我也会介绍它。 + +### 使用 pandoc 把多个 Markdown 文件转换成其他格式(命令行方式) + +你可以在 Ubuntu 及其他 Debian 系发行版本终端输入下面的命令来快速开始: + +``` +sudo apt-get install pandoc +``` + +本例中,在名为 md_test 目录下我有四个 Markdown 文件需要转换。 + +``` +[email protected]:~/Documents/md_test$ ls -l *.md +-rw-r--r-- 1 bdyer bdyer 3374 Apr 7 2020 file01.md +-rw-r--r-- 1 bdyer bdyer 782 Apr 2 05:23 file02.md +-rw-r--r-- 1 bdyer bdyer 9257 Apr 2 05:21 file03.md +-rw-r--r-- 1 bdyer bdyer 9442 Apr 2 05:21 file04.md +[email protected]:~/Documents/md_test$ +``` + +现在还没有 HTML 文件。现在我要对这些文件使用 pandoc。我会运行一行命令来实现: + + * 调用 pandoc + * 读取 .md 文件并导出为 .html + + + +下面是我要运行的命令: + +``` +for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +``` + +如果你不太理解上面的命令中的 `;`,可以参考[在 Linux 中一次执行多个命令][3]。 + +我执行命令后,运行结果如下: + +``` +[email protected]:~/Documents/md_test$ for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done +file01.md +file02.md +file03.md +file04.md +[email protected]:~/Documents/md_test$ +``` + +让我再使用一次 `ls` 命令来看看是否已经生成了 HTML 文件: + +``` +[email protected]:~/Documents/md_test$ ls -l *.html +-rw-r--r-- 1 bdyer bdyer 4291 Apr 2 06:08 file01.md.html +-rw-r--r-- 1 bdyer bdyer 1781 Apr 2 06:08 file02.md.html +-rw-r--r-- 1 bdyer bdyer 10272 Apr 2 06:08 file03.md.html +-rw-r--r-- 1 bdyer bdyer 10502 Apr 2 06:08 file04.md.html +[email protected]:~/Documents/md_test$ +``` + +转换很成功,现在你已经有了四个 HTML 文件,它们可以用在 Web 服务器上。 + +pandoc 功能相当多,你可以通过指定输出文件的扩展名来把 markdown 文件转换成其他支持的格式。不难理解它为什么会被认为是[最好的写作开源工具][4]。 + +**推荐阅读:** + +![][5] + +#### [Linux 下 11 个最好的 Markdown 编辑器][6] + +列出了 Linux 不同发行版本下好看且功能多样的最好的 Markdown 编辑器。 + +### 使用 VSCodium 把 Markdown 文件转换成 HTML(GUI 方式) + +就像我们前面说的那样,我通常使用命令行,但是对于批量转换,我不会使用命令行,你也不必。VSCode 或 [VSCodium][7] 可以完成批量操作。你只需要安装一个 _Markdown-All-in-One_ 扩展,就可以在一次运行中转换多个 Markdown 文件。 + +有两种方式安装这个扩展: + + * VSCodium 的终端 + * VSCodium 的插件管理器 + + + +通过 VSCodium 的终端安装该扩展: + + 1. 点击菜单栏的 `终端`。会打开终端面板 + 2. 输入,或[复制下面的命令并粘贴到终端][8]: + + + +``` +codium --install-extension yzhang.markdown-all-in-one +``` + +**注意**:如果你使用的 VSCode 而不是 VSCodium,那么请把上面命令中的 `codium` 替换为 `code` + +![][9] + +第二种安装方式是通过 VSCodium 的插件/扩展管理器: + + 1. 点击 VSCodium 窗口左侧的块区域。会出现一个扩展列表,列表最上面有一个搜索框。 + 2. 在搜索框中输入 `Markdown All in One`。在列表最上面会出现该扩展。点击 `安装` 按钮来安装它。如果你已经安装过,在安装按钮的位置会出现一个齿轮图标。 + + + +![][10] + +安装完成后,你可以打开含有需要转换的 Markdown 文件的文件夹。 + +点击 VSCodium 窗口左侧的纸张图标。你可以选择文件夹。打开文件夹后,你需要打开至少一个文件。你也可以打开多个文件,但是最少打开一个。 + +当打开文件后,按下 `CTRL+SHIFT+P` 唤起命令面板。然后,在出现的搜索框中输入 `Markdown`。当你输入时,会出现一列 Markdown 相关的命令。其中有一个是 `Markdown All in One: Print documents to HTML` 命令。点击它: + +![][11] + +你需要选择一个文件夹来存放这些文件。它会自动创建一个 `out` 目录,转换后的 HTML 文件会存放在 `out` 目录下。从下面的图中可以看到,Markdown 文档被转换成了 HTML 文件。在这里,你可以打开、查看、编辑这些 HTML 文件。 + +![][12] + +在等待转换 Markdown 文件时,你可以更多地集中精力在写作上。当你准备好时,你就可以把它们转换成 HTML —— 你可以通过两种方式转换它们。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-markdown-files/ + +作者:[Bill Dyer][a] +选题:[lujun9972][b] +译者:[lxbwolf](https://github.com/lxbwolf) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/bill/ +[b]: https://github.com/lujun9972 +[1]: https://pandoc.org/ +[2]: https://vscodium.com/ +[3]: https://itsfoss.com/run-multiple-commands-linux/ +[4]: https://itsfoss.com/open-source-tools-writers/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2016/10/Best-Markdown-Editors-for-Linux.jpg?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/best-markdown-editors-linux/ +[7]: https://itsfoss.com/vscodium/ +[8]: https://itsfoss.com/copy-paste-linux-terminal/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_terminal.jpg?resize=800%2C564&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_extension_select.jpg?resize=800%2C564&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_markdown_function_options.jpg?resize=800%2C564&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/vscodium_html_filelist_shown.jpg?resize=800%2C564&ssl=1 From f6c472dd3f5b217acec763d6748c0973c3f29ff4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 21:37:01 +0800 Subject: [PATCH 012/307] APL --- sources/tech/20210225 How to use the Linux anacron command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210225 How to use the Linux anacron command.md b/sources/tech/20210225 How to use the Linux anacron command.md index ee3e849111..610254e799 100644 --- a/sources/tech/20210225 How to use the Linux anacron command.md +++ b/sources/tech/20210225 How to use the Linux anacron command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/2/linux-automation) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 052bce07e62650c9a6533f2d953b06df0f485413 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 5 Apr 2021 22:43:30 +0800 Subject: [PATCH 013/307] TSL --- ...25 How to use the Linux anacron command.md | 170 ------------------ ...25 How to use the Linux anacron command.md | 160 +++++++++++++++++ 2 files changed, 160 insertions(+), 170 deletions(-) delete mode 100644 sources/tech/20210225 How to use the Linux anacron command.md create mode 100644 translated/tech/20210225 How to use the Linux anacron command.md diff --git a/sources/tech/20210225 How to use the Linux anacron command.md b/sources/tech/20210225 How to use the Linux anacron command.md deleted file mode 100644 index 610254e799..0000000000 --- a/sources/tech/20210225 How to use the Linux anacron command.md +++ /dev/null @@ -1,170 +0,0 @@ -[#]: subject: (How to use the Linux anacron command) -[#]: via: (https://opensource.com/article/21/2/linux-automation) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to use the Linux anacron command -====== -Instead of manually performing repetitive tasks, let Linux do them for -you. -![Command line prompt][1] - -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. Automation is one of the best reasons to use Linux. - -One of my favorite things about Linux is its willingness to do work for me. Instead of performing repetitive tasks that eat up my time, or are prone to error, or that I'm likely to forget, I schedule Linux to do them for me. - -### Preparing for automation - -The term "automation" can be as intimidating as it is appealing. I find it helps to approach it modularly. - -#### 1\. What do you want to make happen? - -First, know what outcome you want to produce. Are you watermarking images? Removing files from a cluttered directory? Performing a backup of important data? Define the task clearly for yourself so that you know what to aim for. If there's any task you find yourself doing every day, much less more than once a day, then it could be a candidate for automation. - -#### 2\. Learn the applications you need - -Break down big tasks into small components and learn how to produce each result manually but in a repeatable and predictable way. Much of what can be done on Linux can be scripted, but it's important to recognize your current limitations. There's a world of difference between learning how to automate resizing several images so that they can be emailed conveniently vs. using machine learning to generate elaborate artwork for your weekly newsletter. One of these things you can learn in an afternoon and the other could take years. However, we all have to start somewhere, so just start small and always be on the lookout for ways to improve. - -#### 3\. Automate it - -Use an automation tool on Linux to make it happen on a regular basis. This is the step this article covers! - -To automate something, you need a script that automates a task. When testing, it's best to keep things simple, so the task this article automates is the creation of a file called `hello` in the `/tmp` directory: - - -``` -#!/bin/sh - -touch /tmp/hello -``` - -Copy and paste that simple script into a text file and name it `example`. - -### Cron - -The built-in automation solution that every Linux install comes with is the cron system. Linux users tend to refer to cron generically as the method you use to schedule a task (usually called a "cron job"), but there are multiple applications that provide cron's functionality. The most versatile is [cronie][2]; its advantage is that it does _not_ assume that your computer is always on, the way historical cron applications designed for system administrators do. - -Verify which cron system your Linux distribution provides. If it's anything other than cronie, you can probably install cronie from your distro's software repository. If your distribution doesn't have a package for cronie, you can use the old `anacron` package instead. The `anacron` command is included with cronie, so regardless of how you acquire it, you want to ensure that you have the `anacron` command available on your system before continuing. Anacron may require administrative root privileges, depending on your setup. - - -``` -$ which anacron -/usr/sbin/anacron -``` - -Anacron's job is to ensure that your automation jobs are executed on a regular basis. To do this, anacron checks to find out when the last time a job ran and then checks how often you have told it to run jobs. - -Suppose you set anacron to run a script once every five days. Every time you turn your computer on or wake it from sleep, anacron scans its logs to determine whether it needs to run the job. If a job ran five or more days ago, then anacron runs the job. - -### Cron jobs - -Many Linux systems come bundled with a few maintenance jobs for cron to perform. I like to keep my jobs separate from the system jobs, so I create a directory in my home directory. Specifically, there's a hidden folder called `~/.local` ("local" in the sense that it's customized for your user account rather than for your "global" computer system), so I create the subdirectory `etc/cron.daily` to mirror cron's usual home on my system. You must also create a spool directory to keep track of the last time jobs were run. - - -``` -`$ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron` -``` - -You can place any script you want to run regularly into the `~/.local/etc/cron.daily` directory. Copy the `example` script into the directory now, and [mark it executable using the chmod command][3]. - - -``` -$ cp example ~/.local/etc/cron.daily -# chmod +x ~/.local/etc/cron.daily/example -``` - -Next, set up anacron to run whatever scripts are located in the `~/.local/etc/cron.daily` directory. - -### Anacron - -By default, much of the cron system is considered the systems administrator's domain because it's often used for important low-level tasks, like rotating log files and updating certificates. The configuration demonstrated in this article is designed for a regular user setting up personal automation tasks. - -To configure anacron to run your cron jobs, create a configuration file at `/.local/etc/anacrontab`: - - -``` -SHELL=/bin/sh -PATH=/sbin:/bin:/usr/sbin:/usr/bin -1  0  cron.mine    run-parts /home/tux/.local/etc/cron.daily/ -``` - -This file tells anacron to run all executable scripts (`run-parts`) found in `~/.local/etc/cron.daily` every one day (that is, daily), with a zero-minute delay. Sometimes, a few minutes' delay is used so that your computer isn't hit with all the possible tasks right after you log in. These settings are suitable for testing, though. - -The `cron.mine` value is an arbitrary name for the process. I call it `cron.mine` but you could call it `cron.personal` or `penguin` or anything you want. - -Verify your `anacrontab` file's syntax: - - -``` -$ anacron -T -t ~/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron -``` - -Silence means success. - -### Adding anacron to .profile - -Finally, you must ensure that anacron runs with your local configuration. Because you're running anacron as a regular user and not as the root user, you must direct it to your local configurations —the `anacrontab` file telling anacron what to do, and the spool directory helping anacron keep track of how many days it's been since each job was last executed: - - -``` -anacron -fn -t /home/tux/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron -``` - -The `-fn` options tell anacron to _ignore_ timestamps, meaning that you're forcing it to run your cron job no matter what. This is exclusively for testing purposes. - -### Testing your cron job - -Now that everything's set up, you can test the job. You can technically test this without rebooting, but it makes the most sense to reboot because that's what this is designed to handle: interrupted and irregular login sessions. Take a moment to reboot your computer, log in, and then look for the test file: - - -``` -$ ls /tmp/hello -/tmp/hello -``` - -Assuming the file exists, your example script has executed successfully. You can now remove the test options from `~/.profile`, leaving this as your final configuration: - - -``` -anacron -t /home/tux/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron -``` - -### Using anacron - -You have your personal automation infrastructure configured, so you can place any script you want your computer to manage for you into the `~/.local/etc/cron.daily` directory and it will run as scheduled. - -It's up to you how often you want jobs to run. Your example script is executed once a day. Obviously, that depends on whether your computer is powered on and awake on any given day. If you use your computer on Friday but set it aside for the weekend, the script won't run on Saturday and Sunday. However, on Monday the script will execute because anacron will know that at least one day has passed. You can add weekly, fortnightly, or even monthly directories to `~/.local/etc` to schedule a wide variety of intervals. - -To add a new interval: - - 1. Add a directory to `~/.local/etc` (for instance, `cron.weekly`). - 2. Add a line to `~/.local/etc/anacrontab` to run scripts in the new directory. For a weekly interval, the configuration would be: [code]`7 0 cron.mine run-parts /home/tux/.local/etc/cron.weekly/`[/code] (with the `0` value optionally being some number of minutes to politely delay the start of the script). - 3. Place your scripts in the `cron.weekly` directory. - - - -Welcome to the automated lifestyle. It won't feel like it, but you're about to become a lot more productive. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-automation - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://github.com/cronie-crond/cronie -[3]: https://opensource.com/article/19/8/linux-chmod-command diff --git a/translated/tech/20210225 How to use the Linux anacron command.md b/translated/tech/20210225 How to use the Linux anacron command.md new file mode 100644 index 0000000000..32b91271e2 --- /dev/null +++ b/translated/tech/20210225 How to use the Linux anacron command.md @@ -0,0 +1,160 @@ +[#]: subject: (How to use the Linux anacron command) +[#]: via: (https://opensource.com/article/21/2/linux-automation) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何使用 Linux anacron 命令 +====== + +> 与其手动执行重复性的任务,不如让 Linux 为你做。 + +![命令行提示][1] + +在 2021 年,人们有更多的理由喜欢 Linux。在这个系列中,我将分享使用 Linux 的 21 个不同理由。自动化是使用 Linux 的最佳理由之一。 + +我最喜欢 Linux 的一个原因是它愿意为我做工作。我不需要执行重复性的任务,这些任务会占用我的时间,或者容易出错,或者我可能会忘记,我安排 Linux 为我做这些工作。 + +### 为自动化做准备 + +“自动化”这个词既让人望而生畏,又让人心动。我发现用模块化的方式来处理它是有帮助的。 + +#### 1、你想实现什么? + +首先,要知道你想产生什么结果。你是要给图片加水印吗?从杂乱的目录中删除文件?执行重要数据的备份?为自己明确定义任务,这样你就知道自己的目标是什么。如果有什么任务你发现自己每天都在做,甚至一天一次以上,那么它可能是自动化的候选者。 + +#### 2、学习你需要的应用 + +将大的任务分解成小的组件,并学习如何手动但以可重复和可预测的方式产生每个结果。在 Linux 上可以做的很多事情都可以用脚本来完成,但重要的是要认识到你当前的局限性。学习如何自动调整几张图片的大小,以便可以方便地通过电子邮件发送,与使用机器学习为你的每周通讯生成精心制作的艺术品之间有天壤之别。其中一件事你可以在一个下午学会,而另一件事可能要花上几年时间。然而,我们都必须从某个地方开始,所以只要从小做起,并时刻注意改进的方法。 + +#### 3、自动化 + +在 Linux 上使用一个自动化工具来定期实现它。这就是本文介绍的步骤! + +要想自动化一些东西,你需要一个脚本来自动化一个任务。在测试时,最好保持简单,所以本文自动化的任务是在 `/tmp` 目录下创建一个名为 `hello` 的文件。 + +``` +#!/bin/sh + +touch /tmp/hello +``` + +将这个简单的脚本复制并粘贴到一个文本文件中,并将其命名为 `example`。 + +### Cron + +每个 Linux 安装都会有的内置自动化解决方案就是 cron 系统。Linux 用户往往把 cron 笼统地称为你用来安排任务的方法(通常称为 “cron 作业”),但有多个应用程序可以提供 cron 的功能。最通用的是 [cronie][2];它的优点是,它不会像历史上为系统管理员设计的 cron 应用程序那样,假设你的计算机总是开着。 + +验证你的 Linux 发行版提供的是哪个 cron 系统。如果不是 cronie,你可以从发行版的软件仓库中安装 cronie。如果你的发行版没有 cronie 的软件包,你可以使用旧的 anacron 软件包来代替。`anacron` 命令是包含在 cronie 中的,所以不管你是如何获得它的,你都要确保在你的系统上有 `anacron` 命令,然后再继续。anacron 可能需要管理员 root 权限,这取决于你的设置。 + +``` +$ which anacron +/usr/sbin/anacron +``` + +anacron 的工作是确保你的自动化作业定期执行。为了做到这一点,anacron 会检查找出最后一次运行作业的时间,然后检查你告诉它运行作业的频率。 + +假设你将 anacron 设置为每五天运行一次脚本。每次你打开电脑或从睡眠中唤醒电脑时,anacron都会扫描其日志以确定是否需要运行作业。如果一个作业在五天或更久之前运行,那么 anacron 就会运行该作业。 + +### Cron 作业 + +许多 Linux 系统都捆绑了一些维护工作,让 cron 来执行。我喜欢把我的工作与系统工作分开,所以我在我的主目录中创建了一个目录。具体来说,有一个叫做 `~/.local` 的隐藏文件夹(“local” 的意思是它是为你的用户账户定制的,而不是为你的“全局”计算机系统定制的),所以我创建了子目录 `etc/cron.daily` 来镜像 cron 在我的系统上通常的家目录。你还必须创建一个 spool 目录来跟踪上次运行作业的时间。 + +``` +$ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron +``` + +你可以把任何你想定期运行的脚本放到 `~/.local/etc/cron.daily` 目录中。现在把 `example` 脚本复制到目录中,然后 [用 chmod 命令使其可执行][3]。 + +``` +$ cp example ~/.local/etc/cron.daily +# chmod +x ~/.local/etc/cron.daily/example +``` + +接下来,设置 anacron 来运行位于 `~/.local/etc/cron.daily` 目录下的任何脚本。 + +### anacron + +默认情况下,cron 系统的大部分内容都被认为是系统管理员的领域,因为它通常用于重要的低层任务,如轮换日志文件和更新证书。本文演示的配置是为普通用户设置个人自动化任务而设计的。 + +要配置 anacron 来运行你的 cron 作业,请在 `/.local/etc/anacrontab` 创建一个配置文件: + +``` +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +1  0  cron.mine    run-parts /home/tux/.local/etc/cron.daily/ +``` + +这个文件告诉 anacron 每到新的一天(也就是是每日),延迟 0 分钟,就运行(`run-parts`)所有在 `~/.local/etc/cron.daily` 中找到的可执行脚本。有时,会使用几分钟的延迟,这样你的计算机就不会在你登录后就被所有可能的任务冲击。不过这些设置适合测试。 + +`cron.mine` 值是进程的一个任意名称。我称它为 `cron.mine`,但你也可以称它为 `cron.personal` 或 `penguin` 或任何你想要的名字。 + +验证你的 `anacrontab` 文件的语法: + +``` +$ anacron -T -t ~/.local/etc/anacrontab \ +-S /home/tux/.var/spool/anacron +``` + +沉默意味着成功。 + +### 在 .profile 中添加 anacron + +最后,你必须确保 anacron 以你的本地配置运行。因为你是以普通用户而不是 root 用户的身份运行 anacron,所以你必须将它引导到你的本地配置:告诉 anacron 要做什么的 `anacrontab` 文件,以及帮助 anacron 跟踪每一个作业最后一次执行是多少天的 spool 目录: + +``` +anacron -fn -t /home/tux/.local/etc/anacrontab \ + -S /home/tux/.var/spool/anacron +``` + +`-fn` 选项告诉 anacron *忽略* 时间戳,这意味着你强迫它无论如何都要运行你的 cron 工作。这完全是为了测试的目的。 + +### 测试你的 cron 作业 + +现在一切都设置好了,你可以测试作业了。从技术上讲,你可以在不重启的情况下进行测试,但重启是最有意义的,因为这就是设计用来处理:中断和不规则的登录会话。花点时间重启电脑、登录,然后寻找测试文件: + +``` +$ ls /tmp/hello +/tmp/hello +``` + +假设文件存在,那么你的示例脚本已经成功执行。现在你可以从 `~/.profile` 中删除测试选项,留下这个作为你的最终配置。 + +``` +anacron -t /home/tux/.local/etc/anacrontab \ + -S /home/tux/.var/spool/anacron +``` + +### 使用 anacron + +你已经配置好了你的个人自动化基础设施,所以你可以把任何你想让你的计算机替你管理的脚本放到 `~/.local/etc/cron.daily` 目录下,它就会按计划运行。 + +这取决于你希望作业运行的频率。你的示例脚本是每天执行一次。很明显,这取决于你的计算机在任何一天是否开机和醒着。如果你在周五使用电脑,但把它设置在周末,脚本就不会在周六和周日运行。然而,在周一,脚本会执行,因为 anacron 会知道至少有一天已经过去了。你可以在 `~/.local/etc` 中添加每周、每两周、甚至每月的目录,以安排各种各样的间隔。 + +要添加一个新的时间间隔: + + 1. 在 `~/.local/etc` 中添加一个目录(例如 `cron.weekly`)。 + 2. 在 `~/.local/etc/anacrontab` 中添加一行,以便在新目录下运行脚本。对于每周一次的间隔,其配置如下。`7 0 cron.mine run-parts /home/tux/.local/etc/cron.weekly/`(`0` 的值可以选择一些分钟数,以适当地延迟脚本的启动)。 + 3. 把你的脚本放在 `cron.weekly` 目录下。 + +欢迎来到自动化的生活方式。它不会让人感觉到,但你将会变得更有效率。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-automation + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://github.com/cronie-crond/cronie +[3]: https://opensource.com/article/19/8/linux-chmod-command From d1bac51792d70085105644ecc75963af8da988b8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Apr 2021 05:03:05 +0800 Subject: [PATCH 014/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405=20?= =?UTF-8?q?7=20Git=20tips=20for=20managing=20your=20home=20directory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 7 Git tips for managing your home directory.md --- ...t tips for managing your home directory.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20210405 7 Git tips for managing your home directory.md diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/sources/tech/20210405 7 Git tips for managing your home directory.md new file mode 100644 index 0000000000..1239482260 --- /dev/null +++ b/sources/tech/20210405 7 Git tips for managing your home directory.md @@ -0,0 +1,142 @@ +[#]: subject: (7 Git tips for managing your home directory) +[#]: via: (https://opensource.com/article/21/4/git-home) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +7 Git tips for managing your home directory +====== +Here is how I set up Git to manage my home directory. +![Houses in a row][1] + +I have several computers. I've got a laptop at work, a workstation at home, a Raspberry Pi (or four), a [Pocket CHIP][2], a [Chromebook running various forms of Linux][3], and so on. I used to set up my user environment on each computer by more or less following the same steps, and I often told myself that I enjoyed that each one was slightly unique. For instance, I use [Bash aliases][4] more often at work than at home, and the helper scripts I use at home might not be useful at work. + +Over the years, my expectations across devices began to merge, and I'd forget that a feature I'd built up on my home machine wasn't ported over to my work machine, and so on. I needed a way to standardize my customized toolkit. The answer, to my surprise, was Git. + +Git is version-tracker software. It's famously used by the biggest and smallest open source projects and even by the largest proprietary software companies. But it was designed for source code—not a home directory filled with music and video files, games, photos, and so on. I'd heard of people managing their home directory with Git, but I assumed that it was a fringe experiment done by coders, not real-life users like me. + +Managing my home directory with Git has been an evolving process. I've learned and adapted along the way. Here are the things you might want to keep in mind should you decide to manage your home directory with Git. + +### 1\. Text and binary locations + +![home directory][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +When managed by Git, your home directory becomes something of a no-man 's-land for everything but configuration files. That means when you open your home directory, you should see nothing but a list of predictable directories. There shouldn't be any stray photos or LibreOffice documents, and no "I'll put this here for just a minute" files. + +The reason for this is simple: when you manage your home directory with Git, everything in your home directory that's _not_ being committed becomes noise. Every time you do a `git status`, you'll have to scroll past any file that Git isn't tracking, so it's vital that you keep those files in subdirectories (which you add to your `.gitignore` file). + +Many Linux distributions provide a set of default directories: + + * Documents + * Downloads + * Music + * Photos + * Templates + * Videos + + + +You can create more if you need them. For instance, I differentiate between the music I create (Music) and the music I purchase to listen to (Albums). Likewise, my Cinema directory contains movies by other people, while Videos contains video files I need for editing. In other words, my default directory structure has more granularity than the default set provided by most Linux distributions, but I think there's a benefit to that. Without a directory structure that works for you, you'll be more likely to just stash stuff in your home directory, for lack of a better place for it, so think ahead and plan out directories that work for you. You can always add more later, but it's best to start strong. + +### 2\. Setting up your very best .gitignore + +Once you've cleaned up your home directory, you can instantiate it as a Git repository as usual: + + +``` +$ cd +$ git init . +``` + +Your Git repository contains nothing yet, so everything in your home directory is untracked. Your first job is to sift through the list of untracked files and determine what you want to remain untracked. To see untracked files: + + +``` +$ git status +  .AndroidStudio3.2/ +  .FBReader/ +  .ICEauthority +  .Xauthority +  .Xdefaults +  .android/ +  .arduino15/ +  .ash_history +[...] +``` + +Depending on how long you've been using your home directory, this list may be long. The easy ones are the directories you decided on in the first step. By adding these to a hidden file called `.gitignore`, you tell Git to stop listing them as untracked files and never to track them: + + +``` +`$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore` +``` + +With that done, go through the remaining untracked files shown by `git status` and determine whether any other files warrant exclusion. This process helped me discover several stale old configuration files and directories, which I ended up trashing altogether, but also some that were very specific to one computer. I was fairly strict here because many configuration files do better when they're auto-generated. For instance, I never commit my KDE configuration files because many contain information like recent documents and other elements that don't exist on another machine. + +I track my personalized configuration files, scripts and utilities, profile and Bash configs, and cheat sheets and other snippets of text that I refer to frequently. If the software is mostly responsible for maintaining a file, I ignore it. And when in doubt about a file, I ignore it. You can always un-ignore it later (by removing it from your `.gitignore` file). + +### 3\. Get to know your data + +I'm on KDE, so I use the open source scanner [Filelight][7] to get an overview of my data. Filelight gives you a chart that lets you see the size of each directory. You can navigate through each directory to see what's taking up all the space and then backtrack to investigate elsewhere. It's a fascinating view of your system, and it lets you see your files in a completely new light. + +![Filelight][8] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +Use Filelight or a similar utility to find unexpected caches of data you don't need to commit. For instance, the KDE file indexer (Baloo) generates quite a lot of data specific to its host that I definitely wouldn't want to transport to another computer. + +### 4\. Don't ignore your .gitignore file + +On some projects, I tell Git to ignore my `.gitignore` file because what I want to ignore is sometimes specific to my working directory, and I don't presume other developers on the same project need me to tell them what their `.gitignore` file ought to look like. Because my home directory is for my use only, I do _not_ ignore my home's `.gitignore` file. I commit it along with other important files, so it's inherited across all of my systems. And of course, all of my systems are identical from the home directory's viewpoint: they have the same set of default folders and many of the same hidden configuration files. + +### 5\. Don't fear the binary + +I put my system through weeks and weeks of rigorous testing, convinced that it was _never_ wise to commit binary files to Git. I tried GPG encrypted password files, I tried LibreOffice documents, JPEGs, PNGs, and more. I even had a script that unarchived LibreOffice files before adding them to Git, extracted the XML inside so I could commit just the XML, and then rebuilt the LibreOffice file so that I could work on it within LibreOffice. My theory was that committing XML would render a smaller Git repository than a ZIP file (which is all a LibreOffice document really is). + +To my great surprise, I found that committing a few binary files every now and then did not substantially increase the size of my Git repository. I've worked with Git long enough to know that if I were to commit gigabytes of binary data, my repository would suffer, but the occasional binary file isn't an emergency to avoid at all costs. + +Armed with this new confidence, I add font OTF and TTF files to my standard home repo, my `.face` file for GDM, and other incidental minor binary blobs. Don't overthink it, don't waste time trying to avoid it; just commit it. + +### 6\. Use a private repo + +Don't commit your home directory to a public Git repository, even if the host offers private accounts. If you're like me, you have SSH keys and GPG keychains and GPG-encrypted files that ought not end up on anybody's server but my own. + +I [run a local Git server][9] on a Raspberry Pi (it's easier than you think), so I can update any computer any time I'm home. I'm a remote worker, so that's usually good enough, but I can also reach the computer when traveling over my [VPN][10]. + +### 7\. Remember to push + +The thing about Git is that it only pushes changes to your server when you tell it to. If you're a longtime Git user, this process is probably natural to you. For new users who might be accustomed to the automatic synchronization in Nextcloud or Syncthing, this may take some getting used to. + +### Git at home + +Managing my common files with Git hasn't just made life more convenient across devices. Knowing that I have a full history for all my configurations and utility scripts encourages me to try out new ideas because it's always easy to roll back my changes if they turn out to be _bad_ ideas. Git has rescued me from an ill-advised umask setting in `.bashrc`, a poorly executed late-night addition to my package management script, and an it-seemed-like-a-cool-idea-at-the-time change of my [rxvt][11] color scheme—and probably a few other mistakes in my past. Try Git in your home because a home that commits together merges together. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-home + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/house_home_colors_live_building.jpg?itok=HLpsIfIL (Houses in a row) +[2]: https://opensource.com/article/17/2/pocketchip-or-pi +[3]: https://opensource.com/article/21/2/chromebook-linux +[4]: https://opensource.com/article/17/5/introduction-alias-command-line-tool +[5]: https://opensource.com/sites/default/files/uploads/home-git.jpg (home directory) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://utils.kde.org/projects/filelight +[8]: https://opensource.com/sites/default/files/uploads/filelight.jpg (Filelight) +[9]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[10]: https://www.redhat.com/sysadmin/run-your-own-vpn-libreswan +[11]: https://opensource.com/article/19/10/why-use-rxvt-terminal From b0c4455aaa36e9c3f7158ec94f17ea39f5d19ae7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Apr 2021 05:03:26 +0800 Subject: [PATCH 015/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405=20?= =?UTF-8?q?How=20different=20programming=20languages=20do=20the=20same=20t?= =?UTF-8?q?hing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 How different programming languages do the same thing.md --- ...programming languages do the same thing.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20210405 How different programming languages do the same thing.md diff --git a/sources/tech/20210405 How different programming languages do the same thing.md b/sources/tech/20210405 How different programming languages do the same thing.md new file mode 100644 index 0000000000..2220c2d410 --- /dev/null +++ b/sources/tech/20210405 How different programming languages do the same thing.md @@ -0,0 +1,156 @@ +[#]: subject: (How different programming languages do the same thing) +[#]: via: (https://opensource.com/article/21/4/compare-programming-languages) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How different programming languages do the same thing +====== +Compare 13 different programming languages by writing a simple game. +![Developing code.][1] + +Whenever I start learning a new programming language, I focus on defining variables, writing a statement, and evaluating expressions. Once I have a general understanding of those concepts, I can usually figure out the rest on my own. Most programming languages have some similarities, so once you know one programming language, learning the next one is a matter of figuring out the unique details and recognizing the differences. + +To help me practice a new programming language, I like to write a few test programs. One sample program I often write is a simple "guess the number" game, where the computer picks a number between one and 100 and asks me to guess it. The program loops until I guess correctly. This is a very simple program, as you can see using pseudocode like this: + + 1. The computer picks a random number between 1 and 100 + 2. Loop until I guess the random number + 1. The computer reads my guess + 2. It tells me if my guess is too low or too high + + + +Recently, Opensource.com ran an article series that wrote this program in different languages. This was an interesting opportunity to compare how to do the same thing in each language. I also found that most programming languages do things similarly, so learning the next programming language is mostly about learning its differences. + +C is an early general-purpose programming language, created in 1972 at Bell Labs by Dennis Ritchie. C proved popular and quickly became a standard programming language on Unix systems. Because of its popularity, many other programming languages adopted a similar programming syntax. That's why learning C++, Rust, Java, Groovy, JavaScript, awk, or Lua is easier if you already know how to program in C. + +For example, look at how these different programming languages implement the major steps in the "guess the number" game. I'll skip some of the surrounding code, such as assigning temporary variables, to focus on how the basics are similar or different. + +### The computer picks a random number between one and 100 + +You can see a lot of similarities here. Most of the programming languages generate a random number with a function like `rand()` that you can put into a range on your own. Other languages use a special function where you can specify the range for the random value. + +C | Using the Linux `getrandom` system call: +`getrandom(&randval, sizeof(int), GRND_NONBLOCK); number = randval % maxval + 1;` + +Using the standard C library: +`number = rand() % 100 + 1;` +---|--- +C++ | `int number = rand() % 100+1;` +Rust | `let random = rng.gen_range(1..101);` +Java | `private static final int NUMBER = r.nextInt(100) + 1;` +Groovy | `int randomNumber = (new Random()).nextInt(100) + 1` +JavaScript | `const randomNumber = Math.floor(Math.random() * 100) + 1` +awk | `randomNumber = int(rand() * 100) + 1` +Lua | `number = math.random(1,100)` + +### Loop until I guess the random number + +Loops are usually done with a flow-control block such as `while` or `do-while`. The JavaScript implementation doesn't use a loop and instead updates the HTML page "live" until the user guesses the correct number. Awk supports loops, but it doesn't make sense to loop to read input because awk is based around data pipelines, so it reads input from a file instead of directly from the user.  + +C | `do { … } while (guess != number); ` +---|--- +C++ | `do { …  } while ( number != guess ); ` +Rust | `for line in std::io::stdin().lock().lines() { … break; } ` +Java | `while ( guess != NUMBER ) { … } ` +Groovy | `while ( … ) { … break; } ` +Lua | ` while ( player.guess ~= number ) do … end` + +### The computer reads my guess + +Different programming languages handle input differently. So there's some variation here. For example, JavaScript reads values directly from an HTML form, and awk reads data from its data pipeline. + +C | `scanf("%d", &guess); ` +---|--- +C++ | `cin >> guess; ` +Rust | `let parsed = line.ok().as_deref().map(str::parse::); if let Some(Ok(guess)) = parsed { … } ` +Java | `guess = player.nextInt(); ` +Groovy | `response = reader.readLine() int guess = response as Integer ` +JavaScript | `let myGuess = guess.value ` +awk | `guess = int($0) ` +Lua | `player.answer = io.read() player.guess = tonumber(player.answer) ` + +### Tell me if my guess is too low or too high + +Comparisons are fairly consistent across these C-like programming languages, usually through an `if` statement. There's some variation in how each programming language prints output, but the print statement remains recognizable across each sample. + +C | `    if (guess < number) {       puts("Too low");     }     else if (guess > number) {       puts("Too high");     } …   puts("That's right!");``  ` +---|--- +C++ | `  if ( guess > number) { cout << "Too high.\n" << endl; }   else if ( guess < number ) { cout << "Too low.\n" << endl; }   else {     cout << "That's right!\n" << endl;     exit(0);   }``  ` +Rust | `                _ if guess < random => println!("Too low"),                 _ if guess > random => println!("Too high"),                 _ => {                     println!("That's right");                     break;                 } ` +Java | `            if ( guess > NUMBER ) {                 System.out.println("Too high");             } else if ( guess < NUMBER ) {                 System.out.println("Too low");             } else {                 System.out.println("That's right!");                 System.exit(0);             } ` +Groovy | `                  if (guess < randomNumber)                       print 'too low, try again: '                   else if (guess > randomNumber)                       print 'too high, try again: '                   else {                       println "that's right"                       break                   } ` +JavaScript | `      if (myGuess === randomNumber) {         feedback.textContent = "You got it right!"       } else if (myGuess > randomNumber) {         feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!"       } else if (myGuess < randomNumber) {        feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!"      } ` +awk | `            if (guess < randomNumber) {                 printf "too low, try again:"             } else if (guess > randomNumber) {                 printf "too high, try again:"             } else {                 printf "that's right\n"                 exit             } ` +Lua | `  if ( player.guess > number ) then     print("Too high")   elseif ( player.guess < number) then     print("Too low")   else     print("That's right!")     os.exit()   end ` + +### What about non-C-based languages? + +Programming languages that are not based on C can be quite different and require learning specific syntax to do each step. Racket derives from Lisp and Scheme, so it uses Lisp's prefix notation and lots of parentheses. Python uses whitespace rather than brackets to indicate blocks like loops. Elixir is a functional programming language with its own syntax. Bash is based on the Bourne shell from Unix systems, which itself borrows from Algol68—and supports additional shorthand notation such as `&&` as a variation of "and." Fortran was created when code was entered using punched cards, so it relies on an 80-column layout where some columns are significant. + +As an example of how these other programming languages can differ, I'll compare just the "if" statement that sees if one value is less than or greater than another and prints an appropriate message to the user. + +Racket | `  (cond [(> number guess) (displayln "Too low") (inquire-user number)]         [(< number guess) (displayln "Too high") (inquire-user number)]         [else (displayln "Correct!")])) ` +---|--- +Python | `    if guess < random:         print("Too low")     elif guess > random:         print("Too high")     else:         print("That's right!") ` +Elixir | `    cond do       guess < num ->         IO.puts "Too low!"         guess_loop(num)       guess > num ->         IO.puts "Too high!"         guess_loop(num)       true ->         IO.puts "That's right!"     end ` +Bash | `        [ "0$guess" -lt $number ] && echo "Too low"         [ "0$guess" -gt $number ] && echo "Too high" ` +Fortran | `      IF (GUESS.LT.NUMBER) THEN          PRINT *, 'TOO LOW'       ELSE IF (GUESS.GT.NUMBER) THEN          PRINT *, 'TOO HIGH'       ENDIF ` + +### Read more + +This "guess the number" game is a great introductory program when learning a new programming language because it exercises several common programming concepts in a pretty straightforward way. By implementing this simple game in different programming languages, you can demonstrate some core concepts and compare each language's details. + +Learn how to write the "guess the number" game in C and C-like languages: + + * [C][2], by Jim Hall + * [C++][3], by Seth Kenlon + * [Rust][4], by Moshe Zadka + * [Java][5], by Seth Kenlon + * [Groovy][6], by Chris Hermansen + * [JavaScript][7], by Mandy Kendall + * [awk][8], by Chris Hermansen + * [Lua][9], by Seth Kenlon + + + +And in non-C-based languages: + + * [Racket][10], by Cristiano L. Fontana + * [Python][11], by Moshe Zadka + * [Elixir][12], by Moshe Zadka + * [Bash][13], by Jim Hall + * [Fortran][14], by Jim Hall + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/compare-programming-languages + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_development_programming.png?itok=M_QDcgz5 (Developing code.) +[2]: https://opensource.com/article/21/1/learn-c +[3]: https://opensource.com/article/20/12/learn-c-game +[4]: https://opensource.com/article/20/12/learn-rust +[5]: https://opensource.com/article/20/12/learn-java +[6]: https://opensource.com/article/20/12/groovy +[7]: https://opensource.com/article/21/1/learn-javascript +[8]: https://opensource.com/article/21/1/learn-awk +[9]: https://opensource.com/article/20/12/lua-guess-number-game +[10]: https://opensource.com/article/21/1/racket-guess-number +[11]: https://opensource.com/article/20/12/learn-python +[12]: https://opensource.com/article/20/12/elixir +[13]: https://opensource.com/article/20/12/learn-bash +[14]: https://opensource.com/article/21/1/fortran From f5afb29f0891a13569f56cc89608839e8cfb4804 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 6 Apr 2021 05:03:38 +0800 Subject: [PATCH 016/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405=20?= =?UTF-8?q?What=20motivates=20open=20source=20software=20contributors=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 What motivates open source software contributors.md --- ...vates open source software contributors.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210405 What motivates open source software contributors.md diff --git a/sources/tech/20210405 What motivates open source software contributors.md b/sources/tech/20210405 What motivates open source software contributors.md new file mode 100644 index 0000000000..c8f8dd148c --- /dev/null +++ b/sources/tech/20210405 What motivates open source software contributors.md @@ -0,0 +1,93 @@ +[#]: subject: (What motivates open source software contributors?) +[#]: via: (https://opensource.com/article/21/4/motivates-open-source-contributors) +[#]: author: (Igor Steinmacher https://opensource.com/users/igorsteinmacher) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What motivates open source software contributors? +====== +New study finds people's reasons for contributing have changed since the +early 2000s. +![Practicing empathy][1] + +The reasons people contribute to free and open source (FOSS) projects has been a topic of much interest. However, the research on this topic dates back 10 or more years, and much has changed in the world since then. This article shares seven insights from a recent research study that revisited old motivation studies and asked open source contributors what motivates them today. + +These insights can be used by open source community managers who want to grow a community, organizations that want to understand how community members behave, or anyone working with others in open source. Understanding what motivates today's contributors helps us make impactful decisions. + +### A brief history of open source motivation research + +We need to look into the origins of open source and the free software movement to understand why studying what motivates contributors is so fascinating. When the free software movement started, it was in defiance of corporations using copyright and license terms to restrict user and developer freedoms. The free software movement is a story of rebellion. It was difficult for many to understand how high-quality software emerged from a movement of people who "scratched their own itch" or "volunteered" their skills. At the core of the free software movement was a collaborative way for creating software that became interesting to companies as well. The emergence of open source was a philosophical shift to make this collaboration method available and acceptable to businesses. + +The state of the art of research into motivation in open source is a [publication from 2012][2] that summarizes research studies from more than a decade prior. Gordon Haff reviewed this topic in [_Why do we contribute to open source software?_][3] and Ruth Suehle in _[Drive and motivation: Daniel Pink webcast recap][4]_. + +Over the last 10 years, much has changed in open source. With corporations' increasing interest in open source and having paid employees working on open source projects, it was high time to revisit motivation in open source. + +### Contributors' changing motivations + +In our scientific study, _[The shifting sands of motivation: Revisiting what drives contributors in open source][5]_, we investigated why people join FOSS projects and why they continue contributing. One of our goals was to study how contributors' motivations have changed since the 2000s. A second goal was to take the research to the next level and investigate how people's motivations change as they continue contributing. The research is based on a questionnaire answered by almost 300 FOSS contributors in late 2020. + +### Seven key findings + +Some of the study's results include: + + 1. **Intrinsic motivations play a key role.** The large majority of people contribute to FOSS because of fun (91%), altruism (85%), and kinship (80%). Moreover, when analyzing differences in motivations to join and continue, the study found that ideology, own-use, or education-related programs can be an impetus to join FOSS, but individuals continue for intrinsic reasons (fun, altruism, reputation, and kinship). + + 2. **Reputation and career motivate more than payment**. Many contributors seek reputation (68%) and career (67%), while payment was referenced by less than 30% of the participants. Compared to earlier studies, reputation is now considered more important. + + 3. **Social aspects have gained considerable importance since the 2000s.** Enjoying helping others (89%) and kinship (80%) rose in the rankings compared to surveys from the early 2000s. + + 4. **Motivation changes as people gain tenure.** A clear outcome of the paper is that current contributors often have a different motivation from what led them to join. Of the 281 respondents, 155 (55%) did not report the same motivation for joining and continuing to contribute. + +The figure below shows individuals' shifts in motivation from when they joined to what leads them to keep contributing. The size of the boxes on the left represents the number of contributors with that motivation to start contributing to FOSS, and on the right, the motivation to continue contributing. The width of the connections is proportional to the number of contributors who shifted from one motivation to the other.  + +![Motivations for contributing to FOSS][6] + +(Source: [Gerosa, et al.][7]) + + 5. **Scratching one's own itch is a doorway.** Own-use ("scratch own itch") has decreased in importance since the early days. The contributors who joined FOSS for own-use-related reasons often shifted to altruism, learning, fun, and reciprocity. You can see this in the figure above. + + 6. **Experience and age explain different motivations**. Experienced developers have higher rates of reporting altruism (5.6x), pay (5.2x), and ideology (4.6x) than novices, who report career (10x), learning (5.5x), and fun (2.5x) as greater motivations to contribute. Looking at individual shifts in motivation, there was a considerable increase (120%) in altruism for experienced respondents and a slight decrease (-16%) for novices. A few young respondents joined FOSS because of career, but many of them shifted towards altruism (100% increase). + + 7. **Coders and non-coders report different motivations.** The odds of a coder reporting fun is 4x higher than non-coders, who are more likely (2.5x) to report ideology as a motivator. + + + + +### Motivating contributors based on their contributor journey + +Knowing how new and long-time contributors differ in motivation helps us discover how to support them better.  + +For example, to attract and retain new contributors, who might become the future workforce, projects could invest in promoting career, fun, kinship, and learning, which are particularly relevant for young contributors. + +Because over time altruism becomes more important to contributors, FOSS projects aiming to retain experienced contributors, who tend to be core members or maintainers, could invest in strategies and tools showing how their work benefits the community and society (altruism) and improve social interactions. + +Also in response to the increased rank of altruism, hosting platforms could offer social features to pair those needing help with those willing to help, highlight when a contributor helps someone, and make it easier to show appreciation to others (similar to stars given to projects). + +These are some of our ideas after reviewing the study's findings. We hope that sharing our insights helps others with different backgrounds and experiences come up with more ideas for using this data to motivate new and seasoned contributors. Please share your ideas in the comments below. + +The research paper's authors are Marco A. Gerosa (Northern Arizona University), Igor Wiese (Universidade Tecnologica Federal do Paraná), Bianca Trinkenreich (Northern Arizona University), Georg Link (Bitergia), Gregorio Robles (Universidad Rey Juan Carlos), Christoph Treude (University of Adelaide), Igor Steinmacher (Universidade Tecnologica Federal do Paraná), and Anita Sarma (Oregon State University). The full [study report][7] is available, as well as the [anonymized data and artifacts][8] related to the research. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/motivates-open-source-contributors + +作者:[Igor Steinmacher][a] +选题:[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/igorsteinmacher +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) +[2]: https://www.semanticscholar.org/paper/Carrots-and-Rainbows%3A-Motivation-and-Social-in-Open-Krogh-Haefliger/52ec46a827ba5d6aeb38aaeb24b0780189c16856?p2df +[3]: https://opensource.com/article/19/11/why-contribute-open-source-software +[4]: https://opensource.com/business/11/6/today-drive-webcast-daniel-pink +[5]: https://arxiv.org/abs/2101.10291 +[6]: https://opensource.com/sites/default/files/pictures/sankey_motivations.png (Motivations for contributing to FOSS) +[7]: https://arxiv.org/pdf/2101.10291.pdf +[8]: https://zenodo.org/record/4453904#.YFtFRa9KhaR From 33a4c96768f0b5b5c0ef06162bb640b91ec74db4 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 6 Apr 2021 08:23:58 +0800 Subject: [PATCH 017/307] Rename sources/tech/20210405 What motivates open source software contributors.md to sources/talk/20210405 What motivates open source software contributors.md --- .../20210405 What motivates open source software contributors.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210405 What motivates open source software contributors.md (100%) diff --git a/sources/tech/20210405 What motivates open source software contributors.md b/sources/talk/20210405 What motivates open source software contributors.md similarity index 100% rename from sources/tech/20210405 What motivates open source software contributors.md rename to sources/talk/20210405 What motivates open source software contributors.md From c93bfe30660c4790f9a723e17698f9de04c710ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Apr 2021 08:42:17 +0800 Subject: [PATCH 018/307] PRF @wxy --- ...25 How to use the Linux anacron command.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210225 How to use the Linux anacron command.md b/translated/tech/20210225 How to use the Linux anacron command.md index 32b91271e2..524ee98eba 100644 --- a/translated/tech/20210225 How to use the Linux anacron command.md +++ b/translated/tech/20210225 How to use the Linux anacron command.md @@ -3,7 +3,7 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,11 +12,11 @@ > 与其手动执行重复性的任务,不如让 Linux 为你做。 -![命令行提示][1] +![](https://img.linux.net.cn/data/attachment/album/202104/06/084133bphrxxeolhoyqr0o.jpg) 在 2021 年,人们有更多的理由喜欢 Linux。在这个系列中,我将分享使用 Linux 的 21 个不同理由。自动化是使用 Linux 的最佳理由之一。 -我最喜欢 Linux 的一个原因是它愿意为我做工作。我不需要执行重复性的任务,这些任务会占用我的时间,或者容易出错,或者我可能会忘记,我安排 Linux 为我做这些工作。 +我最喜欢 Linux 的一个原因是它愿意为我做工作。我不想执行重复性的任务,这些任务会占用我的时间,或者容易出错,或者我可能会忘记,我安排 Linux 为我做这些工作。 ### 为自动化做准备 @@ -24,11 +24,11 @@ #### 1、你想实现什么? -首先,要知道你想产生什么结果。你是要给图片加水印吗?从杂乱的目录中删除文件?执行重要数据的备份?为自己明确定义任务,这样你就知道自己的目标是什么。如果有什么任务你发现自己每天都在做,甚至一天一次以上,那么它可能是自动化的候选者。 +首先,要知道你想产生什么结果。你是要给图片加水印吗?从杂乱的目录中删除文件?执行重要数据的备份?为自己明确定义任务,这样你就知道自己的目标是什么。如果有什么任务是你发现自己每天都在做的,甚至一天一次以上,那么它可能是自动化的候选者。 #### 2、学习你需要的应用 -将大的任务分解成小的组件,并学习如何手动但以可重复和可预测的方式产生每个结果。在 Linux 上可以做的很多事情都可以用脚本来完成,但重要的是要认识到你当前的局限性。学习如何自动调整几张图片的大小,以便可以方便地通过电子邮件发送,与使用机器学习为你的每周通讯生成精心制作的艺术品之间有天壤之别。其中一件事你可以在一个下午学会,而另一件事可能要花上几年时间。然而,我们都必须从某个地方开始,所以只要从小做起,并时刻注意改进的方法。 +将大的任务分解成小的组件,并学习如何手动但以可重复和可预测的方式产生每个结果。在 Linux 上可以做的很多事情都可以用脚本来完成,但重要的是要认识到你当前的局限性。学习如何自动调整几张图片的大小,以便可以方便地通过电子邮件发送,与使用机器学习为你的每周通讯生成精心制作的艺术品之间有天壤之别。有的事你可以在一个下午学会,而另一件事可能要花上几年时间。然而,我们都必须从某个地方开始,所以只要从小做起,并时刻注意改进的方法。 #### 3、自动化 @@ -46,7 +46,7 @@ touch /tmp/hello ### Cron -每个 Linux 安装都会有的内置自动化解决方案就是 cron 系统。Linux 用户往往把 cron 笼统地称为你用来安排任务的方法(通常称为 “cron 作业”),但有多个应用程序可以提供 cron 的功能。最通用的是 [cronie][2];它的优点是,它不会像历史上为系统管理员设计的 cron 应用程序那样,假设你的计算机总是开着。 +每个安装好的 Linux 系统都会有的内置自动化解决方案就是 cron 系统。Linux 用户往往把 cron 笼统地称为你用来安排任务的方法(通常称为 “cron 作业”),但有多个应用程序可以提供 cron 的功能。最通用的是 [cronie][2];它的优点是,它不会像历史上为系统管理员设计的 cron 应用程序那样,假设你的计算机总是开着。 验证你的 Linux 发行版提供的是哪个 cron 系统。如果不是 cronie,你可以从发行版的软件仓库中安装 cronie。如果你的发行版没有 cronie 的软件包,你可以使用旧的 anacron 软件包来代替。`anacron` 命令是包含在 cronie 中的,所以不管你是如何获得它的,你都要确保在你的系统上有 `anacron` 命令,然后再继续。anacron 可能需要管理员 root 权限,这取决于你的设置。 @@ -61,7 +61,7 @@ anacron 的工作是确保你的自动化作业定期执行。为了做到这一 ### Cron 作业 -许多 Linux 系统都捆绑了一些维护工作,让 cron 来执行。我喜欢把我的工作与系统工作分开,所以我在我的主目录中创建了一个目录。具体来说,有一个叫做 `~/.local` 的隐藏文件夹(“local” 的意思是它是为你的用户账户定制的,而不是为你的“全局”计算机系统定制的),所以我创建了子目录 `etc/cron.daily` 来镜像 cron 在我的系统上通常的家目录。你还必须创建一个 spool 目录来跟踪上次运行作业的时间。 +许多 Linux 系统都捆绑了一些维护工作,让 cron 来执行。我喜欢把我的工作与系统工作分开,所以我在我的主目录中创建了一个目录。具体来说,有一个叫做 `~/.local` 的隐藏文件夹(“local” 的意思是它是为你的用户账户定制的,而不是为你的“全局”计算机系统定制的),所以我创建了子目录 `etc/cron.daily` 来作为 cron 在我的系统上的家目录。你还必须创建一个 spool 目录来跟踪上次运行作业的时间。 ``` $ mkdir -p ~/.local/etc/cron.daily ~/.var/spool/anacron @@ -78,7 +78,7 @@ $ cp example ~/.local/etc/cron.daily ### anacron -默认情况下,cron 系统的大部分内容都被认为是系统管理员的领域,因为它通常用于重要的低层任务,如轮换日志文件和更新证书。本文演示的配置是为普通用户设置个人自动化任务而设计的。 +默认情况下,cron 系统的大部分内容都被认为是系统管理员的领域,因为它通常用于重要的底层任务,如轮换日志文件和更新证书。本文演示的配置是为普通用户设置个人自动化任务而设计的。 要配置 anacron 来运行你的 cron 作业,请在 `/.local/etc/anacrontab` 创建一个配置文件: @@ -88,7 +88,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin 1  0  cron.mine    run-parts /home/tux/.local/etc/cron.daily/ ``` -这个文件告诉 anacron 每到新的一天(也就是是每日),延迟 0 分钟,就运行(`run-parts`)所有在 `~/.local/etc/cron.daily` 中找到的可执行脚本。有时,会使用几分钟的延迟,这样你的计算机就不会在你登录后就被所有可能的任务冲击。不过这些设置适合测试。 +这个文件告诉 anacron 每到新的一天(也就是每日),延迟 0 分钟后,就运行(`run-parts`)所有在 `~/.local/etc/cron.daily` 中找到的可执行脚本。有时,会使用几分钟的延迟,这样你的计算机就不会在你登录后就被所有可能的任务冲击。不过这个设置适合测试。 `cron.mine` 值是进程的一个任意名称。我称它为 `cron.mine`,但你也可以称它为 `cron.personal` 或 `penguin` 或任何你想要的名字。 @@ -96,7 +96,7 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin ``` $ anacron -T -t ~/.local/etc/anacrontab \ --S /home/tux/.var/spool/anacron + -S /home/tux/.var/spool/anacron ``` 沉默意味着成功。 @@ -110,11 +110,11 @@ anacron -fn -t /home/tux/.local/etc/anacrontab \ -S /home/tux/.var/spool/anacron ``` -`-fn` 选项告诉 anacron *忽略* 时间戳,这意味着你强迫它无论如何都要运行你的 cron 工作。这完全是为了测试的目的。 +`-fn` 选项告诉 anacron *忽略* 时间戳,这意味着你强迫它无论如何都要运行你的 cron 作业。这完全是为了测试的目的。 ### 测试你的 cron 作业 -现在一切都设置好了,你可以测试作业了。从技术上讲,你可以在不重启的情况下进行测试,但重启是最有意义的,因为这就是设计用来处理:中断和不规则的登录会话。花点时间重启电脑、登录,然后寻找测试文件: +现在一切都设置好了,你可以测试作业了。从技术上讲,你可以在不重启的情况下进行测试,但重启是最有意义的,因为这就是设计用来处理中断和不规则的登录会话的。花点时间重启电脑、登录,然后寻找测试文件: ``` $ ls /tmp/hello @@ -132,7 +132,7 @@ anacron -t /home/tux/.local/etc/anacrontab \ 你已经配置好了你的个人自动化基础设施,所以你可以把任何你想让你的计算机替你管理的脚本放到 `~/.local/etc/cron.daily` 目录下,它就会按计划运行。 -这取决于你希望作业运行的频率。你的示例脚本是每天执行一次。很明显,这取决于你的计算机在任何一天是否开机和醒着。如果你在周五使用电脑,但把它设置在周末,脚本就不会在周六和周日运行。然而,在周一,脚本会执行,因为 anacron 会知道至少有一天已经过去了。你可以在 `~/.local/etc` 中添加每周、每两周、甚至每月的目录,以安排各种各样的间隔。 +这取决于你希望作业运行的频率。示例脚本是每天执行一次。很明显,这取决于你的计算机在任何一天是否开机和醒着。如果你在周五使用电脑,但把它设置在周末,脚本就不会在周六和周日运行。然而,在周一,脚本会执行,因为 anacron 会知道至少有一天已经过去了。你可以在 `~/.local/etc` 中添加每周、每两周、甚至每月的目录,以安排各种各样的间隔。 要添加一个新的时间间隔: @@ -149,7 +149,7 @@ via: https://opensource.com/article/21/2/linux-automation 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2ca864dd4486a73a6f492f71f60b3a5488e0ab3f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Apr 2021 08:42:54 +0800 Subject: [PATCH 019/307] PUB @wxy https://linux.cn/article-13270-1.html --- .../20210225 How to use the Linux anacron command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210225 How to use the Linux anacron command.md (99%) diff --git a/translated/tech/20210225 How to use the Linux anacron command.md b/published/20210225 How to use the Linux anacron command.md similarity index 99% rename from translated/tech/20210225 How to use the Linux anacron command.md rename to published/20210225 How to use the Linux anacron command.md index 524ee98eba..ea7e31d4fe 100644 --- a/translated/tech/20210225 How to use the Linux anacron command.md +++ b/published/20210225 How to use the Linux anacron command.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13270-1.html) 如何使用 Linux anacron 命令 ====== From aae72bd28df14c4cd572b238990e2e2842962fb3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 6 Apr 2021 08:48:29 +0800 Subject: [PATCH 020/307] translated --- ...rce tool to monitor variables in Python.md | 180 ------------------ ...rce tool to monitor variables in Python.md | 179 +++++++++++++++++ 2 files changed, 179 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20210331 Use this open source tool to monitor variables in Python.md create mode 100644 translated/tech/20210331 Use this open source tool to monitor variables in Python.md diff --git a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md b/sources/tech/20210331 Use this open source tool to monitor variables in Python.md deleted file mode 100644 index 08eef2cbc6..0000000000 --- a/sources/tech/20210331 Use this open source tool to monitor variables in Python.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: subject: (Use this open source tool to monitor variables in Python) -[#]: via: (https://opensource.com/article/21/4/monitor-debug-python) -[#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use this open source tool to monitor variables in Python -====== -Watchpoints is a simple but powerful tool to help you with monitoring -variables while debugging Python. -![Looking back with binoculars][1] - -When debugging code, you're often faced with figuring out when a variable changes. Without any advanced tools, you have the option of using print statements to announce the variables when you expect them to change. However, this is a very ineffective way because the variables could change in many places, and constantly printing them to a terminal is noisy, while printing them to a log file becomes unwieldy. - -This is a common issue, but now there is a simple but powerful tool to help you with monitoring variables: [watchpoints][2]. - -The [watchpoint concept is common in C and C++ debuggers][3] to monitor memories, but there's a lack of equivalent tools in Python. `watchpoints` fills in the gap. - -### Installing - -To use it, you must first install it by using `pip`: - - -``` -`$ python3 -m pip install watchpoints` -``` - -### Using watchpoints in Python - -For any variable you'd like to monitor, use the **watch** function on it. - - -``` -from watchpoints import watch - -a = 0 -watch(a) -a = 1 -``` - -As the variable changes, information about its value is printed to **stdout**: - - -``` -====== Watchpoints Triggered ====== - -Call Stack (most recent call last): -  <module> (my_script.py:5): -> a = 1 -a: -0 --> -1 -``` - -The information includes: - - * The line where the variable was changed. - * The call stack. - * The previous/current value of the variable. - - - -It not only works with the variable itself, but it also works with object changes: - - -``` -from watchpoints import watch - -a = [] -watch(a) -a = {} # Trigger -a["a"] = 2 # Trigger -``` - -The callback is triggered when the variable **a** is reassigned, but also when the object assigned to a is changed. - -What makes it even more interesting is that the monitor is not limited by the scope. You can watch the variable/object anywhere you want, and the callback is triggered no matter what function the program is executing. - - -``` -from watchpoints import watch - -def func(var): -    var["a"] = 1 - -a = {} -watch(a) -func(a) -``` - -For example, this code prints: - - -``` -====== Watchpoints Triggered ====== - -Call Stack (most recent call last): - -  <module> (my_script.py:8): -> func(a) -  func (my_script.py:4): -> var["a"] = 1 -a: -{} --> -{'a': 1} -``` - -The **watch** function can monitor more than a variable. It can also monitor the attributes and an element of a dictionary or list. - - -``` -from watchpoints import watch - -class MyObj: -    def __init__(self): -        self.a = 0 - -obj = MyObj() -d = {"a": 0} -watch(obj.a, d["a"]) # Yes you can do this -obj.a = 1 # Trigger -d["a"] = 1 # Trigger -``` - -This could help you narrow down to some specific objects that you are interested in. - -If you are not happy about the format of the output, you can customize it. Just define your own callback function: - - -``` -watch(a, callback=my_callback) - -# Or set it globally - -watch.config(callback=my_callback) -``` - -You can even bring up **pdb** when the trigger is hit: - - -``` -`watch.config(pdb=True)` -``` - -This behaves similarly to **breakpoint()**, giving you a debugger-like experience. - -If you don’t want to import the function in every single file, you can make it global by using **install** function: - - -``` -`watch.install() # or watch.install("func_name") and use it as func_name()` -``` - -Personally, I think the coolest thing about watchpoints is its intuitive usage. Are you interested in some data? Just "watch" it, and you'll know when your variable changes. - -### Try watchpoints - -I developed and maintain `watchpoints` on [GitHub][2], and have released it under the licensed under Apache 2.0. Install it and use it, and of course contribution is always welcome. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/monitor-debug-python - -作者:[Tian Gao][a] -选题:[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/gaogaotiantian -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) -[2]: https://github.com/gaogaotiantian/watchpoints -[3]: https://opensource.com/article/21/3/debug-code-gdb diff --git a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md new file mode 100644 index 0000000000..a2be6f4c97 --- /dev/null +++ b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md @@ -0,0 +1,179 @@ +[#]: subject: (Use this open source tool to monitor variables in Python) +[#]: via: (https://opensource.com/article/21/4/monitor-debug-python) +[#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用这个开源工具来监控 Python 中的变量 +====== +Watchpoints 是一个简单但功能强大的工具,可以帮助你在调试 Python 时监控变量。 +![Looking back with binoculars][1] + +在调试代码时,你经常面临着要弄清楚一个变量何时发生变化。如果没有任何高级工具,那么可以选择使用打印语句在期望它们更改时输出变量。然而,这是一种非常低效的方法,因为变量可能在很多地方发生变化,并且不断地将其打印到终端上会产生很大的干扰,而将它们打印到日志文件中则变得很麻烦。 + +这是一个常见的问题,但现在有一个简单而强大的工具可以帮助你监控变量:[watchpoints][2]。 + +[watchpoint 的概念在 C 和 C++ 调试器中很常见][3],用于监控内存,但在 Python 中缺乏相应的工具。`watchpoints` 填补了这个空白。 + +### 安装 + +要使用它,你必须先用 `pip` 安装它: + + +``` +`$ python3 -m pip install watchpoints` +``` + +### 在Python中使用 watchpoints + +对于任何一个你想监控的变量,使用 **watch** 函数对其进行监控。 + + +``` +from watchpoints import watch + +a = 0 +watch(a) +a = 1 +``` + +当变量发生变化时,它的值就会被打印到**标准输出**: + + +``` +====== Watchpoints Triggered ====== + +Call Stack (most recent call last): +  <module> (my_script.py:5): +> a = 1 +a: +0 +-> +1 +``` + +信息包括: + + * 变量被改变的行。 + * 调用栈。 + * 变量的先前值/当前值。 + + + +它不仅适用于变量本身,也适用于对象的变化: + + +``` +from watchpoints import watch + +a = [] +watch(a) +a = {} # Trigger +a["a"] = 2 # Trigger +``` + +当变量 **a** 被重新分配时,回调会被触发,同时当分配给 a 的对象发生变化时也会被触发。 + +更有趣的是,监控不受作用域的限制。你可以在任何地方观察变量/对象,而且无论程序在执行什么函数,回调都会被触发。 + + +``` +from watchpoints import watch + +def func(var): +    var["a"] = 1 + +a = {} +watch(a) +func(a) +``` + +例如,这段代码打印: + + +``` +====== Watchpoints Triggered ====== + +Call Stack (most recent call last): + +  <module> (my_script.py:8): +> func(a) +  func (my_script.py:4): +> var["a"] = 1 +a: +{} +-> +{'a': 1} +``` + +**watch** 函数不仅可以监视一个变量,它也可以监视一个字典或列表的属性和元素。 + + +``` +from watchpoints import watch + +class MyObj: +    def __init__(self): +        self.a = 0 + +obj = MyObj() +d = {"a": 0} +watch(obj.a, d["a"]) # Yes you can do this +obj.a = 1 # Trigger +d["a"] = 1 # Trigger +``` + +这可以帮助你缩小到一些你感兴趣的特定对象。 + +如果你对输出格式不满意,你可以自定义它。只需定义你自己的回调函数: + + +``` +watch(a, callback=my_callback) + +# 或者全局设置 + +watch.config(callback=my_callback) +``` + +当触发时,你甚至可以使用 **pdb**: + + +``` +`watch.config(pdb=True)` +``` + +这与 **breakpoint()** 的行为类似,会给你带来类似调试器的体验。 + +如果你不想在每个文件中都导入这个函数,你可以通过 **install** 函数使其成为全局: + + +``` +`watch.install() # or watch.install("func_name") and use it as func_name()` +``` + +我个人认为,watchpoints 最酷的地方就是使用直观。你对一些数据感兴趣吗?只要”观察“它,你就会知道你的变量何时发生变化。 + +### 尝试 watchpoints + +我在 [GitHub][2] 上开发维护了 `watchpoints`,并在 Apache 2.0 许可下发布了它。安装并使用它,当然也欢迎大家做出贡献。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/monitor-debug-python + +作者:[Tian Gao][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/gaogaotiantian +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/look-binoculars-sight-see-review.png?itok=NOw2cm39 (Looking back with binoculars) +[2]: https://github.com/gaogaotiantian/watchpoints +[3]: https://opensource.com/article/21/3/debug-code-gdb From 2997efc2ac1dd1e2d90ad8f07c2075adcd0ed21b Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 6 Apr 2021 08:59:23 +0800 Subject: [PATCH 021/307] translating --- ... Why I love using the IPython shell and Jupyter notebooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md index 8696ee5e4d..50f09539f1 100644 --- a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ b/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c07412758f6ec232e599653b3eb8b1c0562cd1dd Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:21:54 +0800 Subject: [PATCH 022/307] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210222 5 benefits of choosing Linux.md | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/sources/tech/20210222 5 benefits of choosing Linux.md index 6ac46979d5..591c6c1518 100644 --- a/sources/tech/20210222 5 benefits of choosing Linux.md +++ b/sources/tech/20210222 5 benefits of choosing Linux.md @@ -7,56 +7,57 @@ [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -5 benefits of choosing Linux -====== -One of the great things about Linux is choice, and choice inspires users -to freely share ideas and solutions. How will Linux inspire you to -contribute to this community? +# 选择 Linux 的5大好处 + +--- + +Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? + ![Hand putting a Linux file folder into a drawer][1] -In 2021, there are more reasons why people love Linux than ever before. In this series, I'll share 21 different reasons to use Linux. This article discusses the benefit of choice Linux brings.  +到了2021年,人​​们比以往任何时候都更有理由喜欢 Linux。在本系列中,我将分享21个使用 Linux 的理由。本文讨论选择 Linux 带来的好处。 -_Choice_ is one of the most misunderstood features of Linux. It starts with how many Linuxes there are to choose from. Distrowatch.org reports hundreds of available and active Linux distributions. Many of these distributions, of course, are hobby projects or extremely specific to some obscure requirement. Because it's open source, in fact, anyone can "re-spin" or "remix" an existing distribution of Linux, give it a new name, maybe a new default wallpaper, and call it their own. And while that may seem trivial, I see it as an indication of something very special. +_选择_ 是 Linux 中被误解最深的特性之一。这种误解从可被选择的 Linux 发行版数量就开始了。Distrowatch.org 报告了数百种可用的和活跃的 Linux 发行版。当然,在这些发行版当中,许多都是业余爱好项目或者对于某些晦涩需求的特别版。因为它是开源的,所以实际上,任何人都可以“重新设计”或“重新混搭”现有的Linux发行版,赋予一个新名称,提供一个新的默认墙纸,然后称其为自己的作品。尽管这些修改似乎微不足道,但我认为这显示了 Linux 的一些特别之处。 -### Inspiration +### 灵感 -Linux, it seems, inspires people, from the very moment they learn about it, to make it their own. +Linux 似乎一直在启迪着人们,从了解它的那一刻起,到创造出自己的版本。 -There are dozens of companies spending millions of dollars to generate inspiration from their product. Commercials for technology overwhelmingly try to convince you that as long as you buy some product, you'll feel more connected to the people you care about, more creative, and more alive. Shot in 4k video with soft focus and played to the beat of cheerful and uplifting music, these advertisements are attempts to convince people to not only purchase but then also to support and advertise that company's product. +有数十家公司花费数百万美元来从他们自己的产品中获取灵感。商业技术广告试着强硬地说服你,只要你购买某种产品,你就会与所关心的人建立更多的联系,更具创造力,更加充满活力。这些广告以柔和的焦点拍摄4k视频,并使用愉悦而振奋的背景音乐,试图说服人们不仅购买而且还要支持和宣传该公司的产品。 -Of course, Linux has essentially no marketing budget because Linux is a diverse collection of individuals, a body _discorporate_. Yet when people discover it, they are seemingly inspired to build their own version of it. +当然,Linux 基本没有营销预算,因为 Linux 是个形形色色的大集合,*没有固定实体*。然而,当人们发现它的存在时候,他们似乎就被启发着去构建属于自己的版本。 -It's difficult to quantify amounts of inspiration, but there's obvious value to it, or else companies wouldn't spend money in an attempt to create it. +量化灵感的数量是件难事,但是它显然很有价值,要不然那些公司不会花钱来尝试创造灵感。 -### Innovation +### 革新 -Inspiration, however difficult it is to put a price tag on it, is valuable because of what it produces. Many Linux users have been inspired to create custom solutions to odd problems. Many of the problems we each solve seem trivial to most other people. Maybe you monitor moisture levels of your tomato plant's soil with a [Seeed micro-controller][2], or you have a script to search through an index of Python packages because you keep forgetting the names of libraries you import every day, or you've automated cleaning out your Downloads folder because dragging icons to the Trash is too much work. Whatever problem you've solved for yourself on Linux, it's a feature of the platform that you're inspired by the open technology you're running to make it work better for yourself. +灵感,无论给它标价有多难,它都因它的生产创造而有价值。许多 Linux 用户受启发来为各种奇怪问题定制解决方案。大多数由我们各自解决的问题,对于其他大部分人而言,似乎微不足道:也许你使用 [Seeed微控制器][2] 来监控番茄植株土壤的水分含量;或者你使用脚本来搜索 Python 软件包的索引,因为你会忘记每天导入的库的名称;或者设置了自动清理下载文件夹,因为将文件图标拖进回收站这个活儿干太多了。不管你在使用 Linux 的过程中,为自己解决过什么问题,都是这个平台包含的特性之一,你被这个正在运行中的开放的技术所启发,使其更好地服务于你自己。 -### Staying out of the way +### 开放策略 -Of course, neither inspiration nor innovation are exclusive properties of Linux. Other platforms do authentically produce inspiration in us, and we do innovate in small and huge ways. Computing has largely leveled most playing fields, and anything you can do on one OS, you can likely find a way to do on another. +诚然,不论是灵感,还是创新,都不能算 Linux 独有的属性。其他平台也确实让我们激发灵感,我们也以或大或小大的方式进行创新。运算能力已在很大程度上拉平了操作系统的竞争领域,你在一个操作系统上可以完成的任何事,在另一个操作系统上或许都能找到对应的方法来完成。 -What many users find, however, is that the Linux operating system maintains a firm policy of staying out of your way when you have the idea of trying something that possibly nobody else has thought to try yet. This doesn't and cannot happen, by design, on a proprietary operating system because there's just no way to get into certain areas of the system because they don't happen to be open source. There are arbitrary blockades. You tend not to bump up against invisible walls when you're doing exactly what the OS expects you to do, but when you have it in mind to do something that makes sense only to you, your environment may fail to adapt. +但是,许多用户发现,Linux 操作系统保留了坚定的开放策略,即当你尝试可能无人想到过的尝试时,Linux 不会阻挡你。这在闭源操作系统上不会发生,而且不可能发生,因为无法进入系统层级的某些区域,因为它们本身就是被设计为不开放源码的。有任意的封锁。当你完全按照操作系统的期望进行操作时,你不会碰到那些看不见的墙,但是当你明知要执行的操作只对你自己有意义的时候,你的系统环境可能变得无从适应。 -### Small choices and why they matter +### 小小的选择,大大的意义 -Not all innovations are big or important, but collectively they make a big difference. The crazy ideas that millions of users have had are evident today in every part of Linux. They're in the ways that the KDE and GNOME desktops work, they're in [31 different text editors][3] each of them loved by someone, and countless plugins for browsers and media applications, in file systems and extended attributes, and in the millions of lines of the Linux kernel. And if just one of these features gives you an extra hour each day to spend with your family or friends or hobby, then it's by definition, to use an over-used phrase, "life-changing." +并非所有创新都是大的或重要的,但总的来说,它们带来的变化并不小。如今,数百万用户的那些疯狂想法在 Linux 的各个部分中愈发显现。它们存在于 KDE 或 GNOME 桌面的工作方式中,存在于 [31种不同的文本编辑器][3] 中——每一种都有人喜爱,存在于不计其数的浏览器插件和多媒体应用程序中,存在于文件系统和扩展属性中,以及数以百万计的 Linux 内核代码中。而且,如果上述功能中的哪怕仅其中一项,能让你每天额外节省下一小时时间,陪家人、朋友或用在自己的业余爱好上,那么按照定义,套用一句老话就是,“改变生活”。 -### Connecting with a community +### 在社区中交流 -An important part of open source is the sharing of work. Sharing code is the obvious, prevalent transaction of open source software, but I think there's a lot more to the act of sharing than just making a commit to Gitlab. When people share their ideas with one another, with no ulterior motive aside from potentially getting useful code contributions in return, we all recognize it as a gift. It feels very different from when you purchase software from a company, and it's even different from when a company shares open source code they've produced. The reality of open source is that it's made by humans for humans. There's a connection created when knowledge and inspiration are given freely. It's not something that a marketing campaign can replicate, and I think that we recognize that. +开源行动的重要组成部分之一是共享工作。共享代码是开源软件中显而易见的、普遍流行的事务,但我认为,分享,可不仅仅是在 Gitlab 做一次提交那么简单。当人们彼此分享着自己的奇思妙想,除了获得有用的代码贡献作为回报外,再无其他动机,我们一致认为这是一种馈赠。这与你花钱从某公司购买软件时的感觉非常不同,甚至与得到某公司对外分享他们自己生产的开源代码时的感觉也有很大不同。开源的实质是,由全人类创造,服务于全人类。当知识和灵感可以被自由地分享时,人与人之间就建立了连接,这是市场营销学无法复制的东西,我认为我们都认同这一点。 -### Choice +### 选择 -Linux isn't the only platform with a lot of choices. You can find several solutions to the same problem regardless of your OS, especially when you delve into open source software. However, the level of choice evident on Linux is indicative of what drives Linux forward: The invitation to collaborate. Some things created on Linux fade quickly away, others stay on your home computer for years doing whatever small mundane task you've automated, and others are so successful that they get borrowed by other platforms and become commonplace. It doesn't matter. Whatever you create on Linux, don't hesitate to add it to the cacophony of choice. You never know who it might inspire. +Linux 并不是唯一拥有很多选择的平台。无论使用哪种操作系统,你都可以找到针对同一问题的多种解决方案,尤其是在深入研究开源软件的时候。但是,Linux 明显的决策水准指示了推动 Linux 前进的因素:诚邀协作。在 Linux 上,有些创造会很快消失,有些会在你家用电脑中保留数年——即便只是执行一些不起眼的自动化任务,然而有一些则非常成功,以至于被其他系统平台借鉴并变得司空见惯。没关系,无论你在 Linux 上创作出什么,都请毫不犹豫地把它加入千奇百怪的选择之中,你永远都不知道它可能会激发到谁的灵感。 --------------------------------------------------------------------------------- +--- via: https://opensource.com/article/21/2/linux-choice 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 909a475e3f414f8200639296c0ef3fd61447449e Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:24:41 +0800 Subject: [PATCH 023/307] Update 20210222 5 benefits of choosing Linux.md --- sources/tech/20210222 5 benefits of choosing Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/sources/tech/20210222 5 benefits of choosing Linux.md index 591c6c1518..d2ec4ab807 100644 --- a/sources/tech/20210222 5 benefits of choosing Linux.md +++ b/sources/tech/20210222 5 benefits of choosing Linux.md @@ -7,7 +7,7 @@ [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -# 选择 Linux 的5大好处 +选择 Linux 的5大好处 --- From 05e28794b69848569f6cff12acff6324dda535c1 Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 10:29:56 +0800 Subject: [PATCH 024/307] Update 20210222 5 benefits of choosing Linux.md --- sources/tech/20210222 5 benefits of choosing Linux.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/sources/tech/20210222 5 benefits of choosing Linux.md index d2ec4ab807..f56e7b4566 100644 --- a/sources/tech/20210222 5 benefits of choosing Linux.md +++ b/sources/tech/20210222 5 benefits of choosing Linux.md @@ -7,9 +7,7 @@ [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -选择 Linux 的5大好处 - ---- +# 选择 Linux 的5大好处 Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? From 195c9d9b7ede2bb18c25a63be915be792dc02faf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 6 Apr 2021 10:35:34 +0800 Subject: [PATCH 025/307] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wyxplus 这篇用心了~ --- ...t applications you should use right now.md | 57 ++++++++----------- 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/translated/tech/20200423 4 open source chat applications you should use right now.md b/translated/tech/20200423 4 open source chat applications you should use right now.md index 8f78f0b157..1c848343a4 100644 --- a/translated/tech/20200423 4 open source chat applications you should use right now.md +++ b/translated/tech/20200423 4 open source chat applications you should use right now.md @@ -1,23 +1,23 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (4 open source chat applications you should use right now) [#]: via: (https://opensource.com/article/20/4/open-source-chat) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) -现如今你应当使用的四款开源聊天应用软件 +值得现在就去尝试的四款开源聊天应用软件 ====== -现在,远程协作已作为一项必不可少的能力,让开源实时聊天成为你工具箱中必不可少的一部分吧。 -![Chat bubbles][1] +> 现在,远程协作已作为一项必不可少的能力,让开源实时聊天成为你工具箱中必不可少的一部分吧。 +![](https://img.linux.net.cn/data/attachment/album/202104/06/103454xundd858446u08r0.jpg) 清晨起床后,我们通常要做的第一件事是检查手机,看看是否有同事和朋友发来的重要信息。无论这是否是一个好习惯,但这种行为早已成为我们日常生活的一部分。 -> 人是理性动物。他总能想出任何自己愿意相信的理由。 -> –阿纳托尔·法朗士 +> 人是理性动物。他可以为任何他想相信的事情想出一个理由。 +> – 阿纳托尔·法朗士 无论理由是否合理,我们每天都在使用的一系列的通讯工具,例如电子邮件、电话、网络会议工具或社交网络。甚至在 COVID-19 之前,居家办公就已经使这些通信工具成为我们生活中的重要部分。随着疫情出现,居家办公成为新常态,我们交流方式的方方面面正面临着前所未有的改变,这让这些工具变得不可或缺。 @@ -25,7 +25,7 @@ 作为全球团队的一部分进行远程工作时,我们必须要有一个相互协作的环境。聊天应用软件在帮助我们保持相互联系中起着至关重要的作用。与电子邮件相比,聊天应用软件可提供与全球各地的同事快速、实时的通信。 -考虑选择一款聊天应用软件需要考虑很多因素。为了帮助你选择最适合你的应用软件,在本文中,我将探讨四款开源聊天应用软件和一个开源视频通信工具(用于当你需要与同事“面对面”时),然后概述在高效的通讯应用软件中,你应当考虑的一些功能。 +选择一款聊天应用软件需要考虑很多因素。为了帮助你选择最适合你的应用软件,在本文中,我将探讨四款开源聊天应用软件,和一个当你需要与同事“面对面”时的开源视频通信工具,然后概述在高效的通讯应用软件中,你应当考虑的一些功能。 ### 四款开源聊天软件 @@ -33,64 +33,53 @@ ![Rocket.Chat][2] - [Rocket.Chat][3] 是一个综合性的通讯平台,其将频道分为公开房间(任何人都可以加入)和私有房间(仅受邀请)。你还可以直接将消息发送给已登录的人员。其能共享文档、链接、照片、视频和动态图GIF,以及进行视频通话,并可以在平台中发送语音信息。 - - -Rocket.Chat 是免费开源的软件,但是其独特之处在于其可自托管的聊天系统。你可以将其下载到你的服务器上,无论它是本地服务器或是在公有云上的虚拟专用服务器。 - - +Rocket.Chat 是自由开源软件,但是其独特之处在于其可自托管的聊天系统。你可以将其下载到你的服务器上,无论它是本地服务器或是在公有云上的虚拟专用服务器。 Rocket.Chat 是完全免费,其 [源码][4] 可在 Github 获得。许多开源项目都使用 Rocket.Chat 作为他们官方交流平台。该软件在持续不断的发展且不断更新和改进新功能。 - -我最喜欢 Rocket.Chat 的地方是其能够根据用户需求来进行自定义操作,并且它使用机器学习来自动化处理,在用户通讯间实时翻译信息。你也可以下载适用于你移动设备的 Rocket.Chat,以便能随时随地使用。 +我最喜欢 Rocket.Chat 的地方是其能够根据用户需求来进行自定义操作,并且它使用机器学习在用户通讯间进行自动的、实时消息翻译。你也可以下载适用于你移动设备的 Rocket.Chat,以便能随时随地使用。 #### IRC ![IRC on WeeChat 0.3.5][5] -[Internet Relay Chat (IRC)][6] 是一款实时、基于文本格式的通信软件。尽管其是最古老的电子通讯形式之一,但在许多知名的软件项目中仍受欢迎。 +IRC([互联网中继聊天][6]Internet Relay Chat)是一款实时、基于文本格式的通信软件。尽管其是最古老的电子通讯形式之一,但在许多知名的软件项目中仍受欢迎。 +IRC 频道是单独的聊天室。它可以让你在一个开放的频道中与多人进行聊天或与某人私下一对一聊天。如果频道名称以 `#` 开头,则可以假定它是官方的聊天室,而以 `##` 开头的聊天室通常是非官方的聊天室。 -IRC 频道是单独的聊天室。它可以让你在一个开放的频道中与多人进行聊天或与某人私下一对一聊天。如果频道名称以 # 开头,则可以假定它是官方的聊天室,然而以 ## 开头的聊天室通常是非官方的聊天室。 +[上手 IRC][7] 很容易。你的 IRC 昵称可以让人们找到你,因此它必须是唯一的。但是,你可以完全自主地选择 IRC 客户端。如果你需要比标准 IRC 客户端更多功能的应用程序,则可以使用 [Riot.im][8] 连接到 IRC。 -[使用 IRC][7] 是很容易上手。你的 IRC 昵称可以让人们找到你,因此它必须是唯一的。但是,你可以完全自主地选择 IRC 客户端。如果你需要比标准 IRC 客户端更多功能的应用程序,则可以使用 [Riot.im][8] 连接到 IRC。 - -考虑到它悠久的历史,你为什么还要继续使用 IRC?出于一个原因是,其仍是我们所依赖的许多免费和开源项目的家园。如果你想参于开源软件开发和社区,可以选择用 IRC。 +考虑到它悠久的历史,你为什么还要继续使用 IRC?出于一个原因是,其仍是我们所依赖的许多自由及开源项目的家园。如果你想参于开源软件开发和社区,可以选择用 IRC。 #### Zulip ![Zulip][9] +[Zulip][10] 是十分流行的群聊应用程序,它遵循基于话题线索的模式。在 Zulip 中,你可以订阅stream,就像在 IRC 频道或 Rocket.Chat 中一样。但是,每个 Zulip 流都会拥有一个唯一的话题topic,该话题可帮助你以后查找对话,因此其更有条理。 -[Zulip][10] 是遵循基于话题时间线模式且十分流行的群聊应用程序。在 Zulip 中,你可以订阅stream,就像在 IRC 频道或 Rocket.Chat 中一样。但是,每个 Zulip 流都会拥有一个唯一的话题topic,该话题可帮助你以后查找对话,因此其更有条理。 +与其他平台一样,它支持表情符号、内嵌图片、视频和推特预览。它还支持 LaTeX 来分享数学公式或方程式、支持 Markdown 和语法高亮来分享代码。 +Zulip 是跨平台的,并提供 API 用于编写你自己的程序。我特别喜欢 Zulip 的一点是它与 GitHub 的集成整合功能:如果我正在处理某个议题issue,则可以使用 Zulip 的标记回链某个拉取请求pull request ID。 -与其他平台一样,它支持表情符号、图片、视频和推特预览。它还支持 LaTeX 共享数学公式或等式、Markdown 语法和共享代码的语法高亮。 - - -Zulip 是跨平台、并提供 API 用于编写你自己的程序。我特别喜欢 Zulip 的一点是它与 GitHub 的集成整合功能:如果我正在处理某个问题issue,则可以使用 Zulip 的标记链接拉回pull某个请求 ID。 - -Zulip是开源(你可以在 GitHub 上访问其[源码][11])并且免费使用,但是其已经为本地支持、[LDAP][12] 的集成整合和存储扩展提供了付费服务。 +Zulip 是开源的(你可以在 GitHub 上访问其 [源码][11])并且免费使用,但它有提供预置支持、[LDAP][12] 集成和更多存储类型的付费产品。 #### Let's Chat ![Let's Chat][13] -[Let's Chat][14] 是面向小型团队的自托管的聊天解决方案。它使用 Node.js 和 MongoDB 编写运行,只需鼠标点击几下即可将其部署到本地服务器或云服务器。它是免费且开源,可以在 GitHub 上查看其 [源码][15]。 +[Let's Chat][14] 是一个面向小型团队的自托管的聊天解决方案。它使用 Node.js 和 MongoDB 编写运行,只需鼠标点击几下即可将其部署到本地服务器或云服务器。它是自由开源软件,可以在 GitHub 上查看其 [源码][15]。 Let's Chat 与其他开源聊天工具的不同之处在于其企业功能:它支持 LDAP 和 [Kerberos][16] 身份验证。它还具有新用户想要的所有功能:你可以在历史记录中搜索过往消息,并使用 @username 之类的标签来标记人员。 -我喜欢 Let's Chat 的地方是它拥有私人、受密码保护的聊天室、发送图片、GIPHY 支持和代码拷贝。它不断更新,并不断增加新功能。 +我喜欢 Let's Chat 的地方是它拥有私人的受密码保护的聊天室、发送图片、支持 GIPHY 和代码粘贴。它不断更新,不断增加新功能。 ### 附加:开源视频聊天软件 Jitsi ![Jitsi][17] -有时,文字聊天还不够,你还可能需要与某人面谈。在这种情况下,如果不能选择面对面开会交流,那么视频聊天是最好的选择。[Jitsi][18] 是一个完全开源的,多平台且兼容 WebRTC 的视频会议工具。 - +有时,文字聊天还不够,你还可能需要与某人面谈。在这种情况下,如果不能选择面对面开会交流,那么视频聊天是最好的选择。[Jitsi][18] 是一个完全开源的、支持多平台且兼容 WebRTC 的视频会议工具。 Jitsi 从 Jitsi Desktop 开始,已经发展成为许多 [项目][19],包括 Jitsi Meet、Jitsi Videobridge、jibri 和 libjitsi,并且每个项目都在 GitHub 上开放了 [源码][20]。 @@ -106,10 +95,10 @@ Jitsi 是安全且可扩展的,并支持诸如联播simulcast Date: Tue, 6 Apr 2021 10:36:38 +0800 Subject: [PATCH 026/307] PUB @wyxplus https://linux.cn/article-13271-1.html --- ... open source chat applications you should use right now.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200423 4 open source chat applications you should use right now.md (99%) diff --git a/translated/tech/20200423 4 open source chat applications you should use right now.md b/published/20200423 4 open source chat applications you should use right now.md similarity index 99% rename from translated/tech/20200423 4 open source chat applications you should use right now.md rename to published/20200423 4 open source chat applications you should use right now.md index 1c848343a4..5c445b9586 100644 --- a/translated/tech/20200423 4 open source chat applications you should use right now.md +++ b/published/20200423 4 open source chat applications you should use right now.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wyxplus) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13271-1.html) [#]: subject: (4 open source chat applications you should use right now) [#]: via: (https://opensource.com/article/20/4/open-source-chat) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) From df95bca16e6fc2142c67801b914362122c91617e Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Tue, 6 Apr 2021 13:08:49 +0800 Subject: [PATCH 027/307] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20210222 5 benefits of choosing Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210222 5 benefits of choosing Linux.md (100%) diff --git a/sources/tech/20210222 5 benefits of choosing Linux.md b/translated/tech/20210222 5 benefits of choosing Linux.md similarity index 100% rename from sources/tech/20210222 5 benefits of choosing Linux.md rename to translated/tech/20210222 5 benefits of choosing Linux.md From e122d661d3884ff2578a62ad558c914034c57c07 Mon Sep 17 00:00:00 2001 From: Max27149 <47019171+max27149@users.noreply.github.com> Date: Tue, 6 Apr 2021 18:27:57 +0800 Subject: [PATCH 028/307] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 0a6589a01b..4bce68f512 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (max27149) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0386b1c29059be7c01852c27b654e5619d5aea34 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:02:51 +0800 Subject: [PATCH 029/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210405=20?= =?UTF-8?q?Scaling=20Microservices=20on=20Kubernetes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210405 Scaling Microservices on Kubernetes.md --- ...405 Scaling Microservices on Kubernetes.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/tech/20210405 Scaling Microservices on Kubernetes.md diff --git a/sources/tech/20210405 Scaling Microservices on Kubernetes.md b/sources/tech/20210405 Scaling Microservices on Kubernetes.md new file mode 100644 index 0000000000..26fa6a2334 --- /dev/null +++ b/sources/tech/20210405 Scaling Microservices on Kubernetes.md @@ -0,0 +1,179 @@ +[#]: subject: (Scaling Microservices on Kubernetes) +[#]: via: (https://www.linux.com/news/scaling-microservices-on-kubernetes/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/scaling-microservices-on-kubernetes/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Scaling Microservices on Kubernetes +====== + +_By Ashley Davis_ + +_*This article was originally published at [TheNewStack][1]_ + +Applications built on microservices can be scaled in multiple ways. We can scale them to support development by larger development teams and we can also scale them up for better performance. Our application can then have a higher capacity and can handle a larger workload. + +Using microservices gives us granular control over the performance of our application. We can easily measure the performance of our microservices to find the ones that are performing poorly, are overworked, or are overloaded at times of peak demand. Figure 1 shows how we might use the [Kubernetes dashboard][2] to understand CPU and memory usage for our microservices. + + + +_Figure 1: Viewing CPU and memory usage for microservices in the Kubernetes dashboard_ + +If we were using a monolith, however, we would have limited control over performance. We could vertically scale the monolith, but that’s basically it. + +Horizontally scaling a monolith is much more difficult; and we simply can’t independently scale any of the “parts” of a monolith. This isn’t ideal, because it might only be a small part of the monolith that causes the performance problem. Yet, we would have to vertically scale the entire monolith to fix it. Vertically scaling a large monolith can be an expensive proposition. + +Instead, with microservices, we have numerous options for scaling. For instance, we can independently fine-tune the performance of small parts of our system to eliminate bottlenecks and achieve the right mix of performance outcomes. + +There are also many advanced ways we could tackle performance issues, but in this post, we’ll overview a handful of relatively simple techniques for scaling our microservices using [Kubernetes][3]: + + 1. Vertically scaling the entire cluster + 2. Horizontally scaling the entire cluster + 3. Horizontally scaling individual microservices + 4. Elastically scaling the entire cluster + 5. Elastically scaling individual microservices + + + +Scaling often requires risky configuration changes to our cluster. For this reason, you shouldn’t try to make any of these changes directly to a production cluster that your customers or staff are depending on. + +Instead, I would suggest that you create a new cluster and use **blue-green deployment**, or a similar deployment strategy, to buffer your users from risky changes to your infrastructure. + +### **Vertically Scaling the Cluster** + +As we grow our application, we might come to a point where our cluster generally doesn’t have enough compute, memory or storage to run our application. As we add new microservices (or replicate existing microservices for redundancy), we will eventually max out the nodes in our cluster. (We can monitor this through our cloud vendor or the Kubernetes dashboard.) + +At this point, we must increase the total amount of resources available to our cluster. When scaling microservices on a [Kubernetes cluster][4], we can just as easily make use of either vertical or horizontal scaling. Figure 2 shows what vertical scaling looks like for Kubernetes. + + + +_Figure 2: Vertically scaling your cluster by increasing the size of the virtual machines (VMs)_ + +We scale up our cluster by increasing the size of the virtual machines (VMs) in the node pool. In this example, we increased the size of three small-sized VMs so that we now have three large-sized VMs. We haven’t changed the number of VMs; we’ve just increased their size — scaling our VMs vertically. + +Listing 1 is an extract from Terraform code that provisions a cluster on Azure; we change the vm_size field from Standard_B2ms to Standard_B4ms. This upgrades the size of each VM in our Kubernetes node pool. Instead of two CPUs, we now have four (one for each VM). As part of this change, memory and hard-drive for the VM also increase. If you are deploying to AWS or GCP, you can use this technique to vertically scale, but those cloud platforms offer different options for varying VM sizes. + +We still only have a single VM in our cluster, but we have increased our VM’s size. In this example, scaling our cluster is as simple as a code change. This is the power of infrastructure-as-code, the technique where we store our infrastructure configuration as code and make changes to our infrastructure by committing code changes that trigger our continuous delivery (CD) pipeline + + + +_Listing 1: Vertically scaling the cluster with Terraform (an extract)_ + +### Horizontally Scaling the Cluster + +In addition to vertically scaling our cluster, we can also scale it horizontally. Our VMs can remain the same size, but we simply add more VMs. + +By adding more VMs to our cluster, we spread the load of our application across more computers. Figure 3 illustrates how we can take our cluster from three VMs up to six. The size of each VM remains the same, but we gain more computing power by having more VMs. + + + +_Figure 3: Horizontally scaling your cluster by increasing the number of VMs_ + +Listing 2 shows an extract of Terraform code to add more VMs to our node pool. Back in listing 1, we had node_count set to 1, but here we have changed it to 6. Note that we reverted the vm_size field to the smaller size of Standard_B2ms. In this example, we increase the number of VMs, but not their size; although there is nothing stopping us from increasing both the number and the size of our VMs. + +Generally, though, we might prefer horizontal scaling because it is less expensive than vertical scaling. That’s because using many smaller VMs is cheaper than using fewer but bigger and higher-priced VMs. + + + +_Listing 2: Horizontal scaling the cluster with Terraform (an extract)_ + +### Horizontally Scaling an Individual Microservice + +Assuming our cluster is scaled to an adequate size to host all the microservices with good performance, what do we do when individual microservices become overloaded? (This can be monitored in the Kubernetes dashboard.) + +Whenever a microservice becomes a performance bottleneck, we can horizontally scale it to distribute its load over multiple instances. This is shown in figure 4. + + + +_Figure 4: Horizontally scaling a microservice by replicating it_ + +We are effectively giving more compute, memory and storage to this particular microservice so that it can handle a bigger workload. + +Again, we can use code to make this change. We can do this by setting the replicas field in the specification for our Kubernetes deployment or pod as shown in listing 3. + + + +_Listing 3: Horizontally scaling a microservice with Terraform (an extract)_ + +Not only can we scale individual microservices for performance, we can also horizontally scale our microservices for redundancy, creating a more fault-tolerant application. By having multiple instances, there are others available to pick up the load whenever any single instance fails. This allows the failed instance of a microservice to restart and begin working again. + +### Elastic Scaling for the Cluster + +Moving into more advanced territory, we can now think about elastic scaling. This is a technique where we automatically and dynamically scale our cluster to meet varying levels of demand. + +Whenever a demand is low, [Kubernetes][5] can automatically deallocate resources that aren’t needed. During high-demand periods, new resources are allocated to meet the increased workload. This generates substantial cost savings because, at any given moment, we only pay for the resources necessary to handle our application’s workload at that time. + +We can use elastic scaling at the cluster level to automatically grow our clusters that are nearing their resource limits. Yet again, when using Terraform, this is just a code change. Listing 4 shows how we can enable the Kubernetes autoscaler and set the minimum and maximum size of our node pool. + +Elastic scaling for the cluster works by default, but there are also many ways we can customize it. Search for “auto_scaler_profile” in [the Terraform documentation][6] to learn more. + + + +_Listing 4: Enabling elastic scaling for the cluster with Terraform (an extract)_ + +### Elastic Scaling for an Individual Microservice + +We can also enable elastic scaling at the level of an individual microservice. + +Listing 5 is a sample of Terraform code that gives microservices a “burstable” capability. The number of replicas for the microservice is expanded and contracted dynamically to meet the varying workload for the microservice (bursts of activity). + +The scaling works by default, but can be customized to use other metrics. See the [Terraform documentation][7] to learn more. To learn more about pod auto-scaling in Kubernetes, [see the Kubernetes docs][8]. + + + +_Listing 5: Enabling elastic scaling for a microservice with Terraform_ + +### About the Book: Bootstrapping Microservices + +You can learn about building applications with microservices with [Bootstrapping Microservices][9]. + +Bootstrapping Microservices is a practical and project-based guide to building applications with microservices. It will take you all the way from building one single microservice all the way up to running a microservices application in production on [Kubernetes][10], ending up with an automated continuous delivery pipeline and using _infrastructure-as-code_ to push updates into production. + +### Other Kubernetes Resources + +This post is an extract from _Bootstrapping Microservices_ and has been a short overview of the ways we can scale microservices when running them on Kubernetes. + +We specify the configuration for our infrastructure using Terraform. Creating and updating our infrastructure through code in this way is known as **intrastructure-as-code**, as a technique that turns working with infrastructure into a coding task and paved the way for the DevOps revolution. + +To learn more about [Kubernetes][11], please see [the Kubernetes documentation][12] and the free [Introduction to Kubernetes][13] training course. + +To learn more about working with Kubernetes using Terraform, please see [the Terraform documentation][14]. + +**About the Author, Ashley Davis** + +Ashley is a software craftsman, entrepreneur, and author with over 20 years of experience in software development, from coding to managing teams, then to founding companies. He is the CTO of Sortal, a product that automatically sorts digital assets through the magic of machine learning. + +The post [Scaling Microservices on Kubernetes][15] appeared first on [Linux Foundation – Training][16]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/scaling-microservices-on-kubernetes/ + +作者:[Dan 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://training.linuxfoundation.org/announcements/scaling-microservices-on-kubernetes/ +[b]: https://github.com/lujun9972 +[1]: https://thenewstack.io/scaling-microservices-on-kubernetes/ +[2]: https://coding-bootcamps.com/blog/kubernetes-evolution-from-virtual-servers-and-kubernetes-architecture.html +[3]: https://learn.coding-bootcamps.com/p/complete-live-training-for-mastering-devops-and-all-of-its-tools +[4]: https://blockchain.dcwebmakers.com/blog/advance-topics-for-deploying-and-managing-kubernetes-containers.html +[5]: http://myhsts.org/tutorial-review-of-17-essential-topics-for-mastering-kubernetes.php +[6]: https://www.terraform.io/docs/providers/azurerm/r/kubernetes_cluster.html +[7]: http://www.terraform.io/docs/providers/kubernetes/r/horizontal_pod_autoscaler.html +[8]: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ +[9]: https://www.manning.com/books/bootstrapping-microservices-with-docker-kubernetes-and-terraform +[10]: https://coding-bootcamps.com/blog/build-containerized-applications-with-golang-on-kubernetes.html +[11]: https://learn.coding-bootcamps.com/p/live-training-class-for-mastering-kubernetes-containers-and-cloud-native +[12]: https://kubernetes.io/docs/home/ +[13]: https://training.linuxfoundation.org/training/introduction-to-kubernetes/ +[14]: https://registry.terraform.io/providers/hashicorp/kubernetes/latest +[15]: https://training.linuxfoundation.org/announcements/scaling-microservices-on-kubernetes/ +[16]: https://training.linuxfoundation.org/ From b990dba93120d9f64af835b4ec20cf8f5ae4c8d8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:07 +0800 Subject: [PATCH 030/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407=20?= =?UTF-8?q?Show=20CPU=20Details=20Beautifully=20in=20Linux=20Terminal=20Wi?= =?UTF-8?q?th=20CPUFetch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md --- ...tifully in Linux Terminal With CPUFetch.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md diff --git a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md new file mode 100644 index 0000000000..84413537f4 --- /dev/null +++ b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -0,0 +1,105 @@ +[#]: subject: (Show CPU Details Beautifully in Linux Terminal With CPUFetch) +[#]: via: (https://itsfoss.com/cpufetch/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Show CPU Details Beautifully in Linux Terminal With CPUFetch +====== + +There are [ways to check CPU information on Linux][1]. Probably the most common is the `lscpu` command that gives you plenty of information about all the CPU cores on your system. + +![lscpu command output][2] + +You may find CPU information there without installing any additional packages. That works of course. However, I recently stumbled upon a new tool that displays the CPU details in Linux in a beautiful manner. + +The ASCII art of the processor manufacturer makes it look cool. + +![][3] + +This looks beautiful, isn’t it? This is similar to [Neoftech or Screenfetch tools that show the system information in beautiful ASCII art in Linux][4]. Similar to those tools, you can use CPUFetch if you are showcasing your desktop screenshot. + +The tool outputs the ASCII art of the processor manufacturer, its name, microarchitecture, frequency, cores, threads, peak performance, cache sizes, [Advanced Vector Extensions][5], and more. + +You can use custom colors apart from a few themes it provides. This gives you additional degree of freedom when you are ricing your desktop and want to color match all the elements on your Linux setup. + +### Installing CPUFetch on Linux + +Unfortunately, CPUFetch is rather new, and it is not included in your distribution’s repository. It doesn’t even provide ready to use DEB/RPM binaries, PPAs, Snap or Flatpak packages. + +Arch Linux users can [find][6] it in [AUR][7] but for others, the only way forward here is to [build from source code][8]. + +Don’t worry. Installation as well as removal is not that complicated. Let me show you the steps. + +I am using Ubuntu and you would [need to install Git on Ubuntu first][9]. Some other distributions come preinstalled with it, if not use your distribution’s package manager to install it. + +Now, clone the Git repository wherever you want. Home directory is fine as well. + +``` +git clone https://github.com/Dr-Noob/cpufetch +``` + +Switch to the directory you just cloned: + +``` +cd cpufetch +``` + +You’ll see a make file here. Use it to compile the code. + +``` +make +``` + +![CPUFetch Installation][10] + +Now you’ll see a new executable file named `cpufetch`. You run this executable to display the CPU information in the terminal. + +``` +./cpufetch +``` + +This is what it showed for my system. AMD logo looks a lot cooler in ASCII, don’t you think? + +![][11] + +How do you remove Cpufetch? It’s pretty simple. When you compiled the code, it produced just one file and that too in the same directory as the rest of the code. + +So, to remove CPUFetch from your system, simply remove its entire folder. You know how to [remove a directory in Linux terminal][12], don’t you? Come out of the cpufetch directory and use the rm command: + +``` +rm -rf cpufetch +``` + +That was simple, thankfully because removing software installed from source code could be really tricky at times. + +Back to cpufetch. I think it’s a utility for those who like to show off their desktop screenshots in various Linux group. Since we have Neofetch for the distribution and CPUFetch for CPU, I wonder if we could have a GPU fetch with ASCII art of Nvidia as well :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cpufetch/ + +作者:[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://linuxhandbook.com/check-cpu-info-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/lscpu-command-output.png?resize=800%2C415&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-1.png?resize=800%2C307&ssl=1 +[4]: https://itsfoss.com/display-linux-logo-in-ascii/ +[5]: https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html +[6]: https://aur.archlinux.org/packages/cpufetch-git +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://itsfoss.com/install-software-from-source-code/ +[9]: https://itsfoss.com/install-git-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-installation.png?resize=800%2C410&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-for-itsfoss.png?resize=800%2C335&ssl=1 +[12]: https://linuxhandbook.com/remove-files-directories/ From 0f0a027e67fa59f9a7c7294b6f99ee097d12c5e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:24 +0800 Subject: [PATCH 031/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210406=20?= =?UTF-8?q?Experiment=20on=20your=20code=20freely=20with=20Git=20worktree?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210406 Experiment on your code freely with Git worktree.md --- ...t on your code freely with Git worktree.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/tech/20210406 Experiment on your code freely with Git worktree.md diff --git a/sources/tech/20210406 Experiment on your code freely with Git worktree.md b/sources/tech/20210406 Experiment on your code freely with Git worktree.md new file mode 100644 index 0000000000..57f7d57f6b --- /dev/null +++ b/sources/tech/20210406 Experiment on your code freely with Git worktree.md @@ -0,0 +1,144 @@ +[#]: subject: (Experiment on your code freely with Git worktree) +[#]: via: (https://opensource.com/article/21/4/git-worktree) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Experiment on your code freely with Git worktree +====== +Get freedom to try things out alongside the security of having a new, +linked clone of your repository if your experiment goes wrong. +![Science lab with beakers][1] + +Git is designed in part to enable experimentation. Once you know that your work is safely being tracked and safe states exist for you to fall back upon if something goes horribly wrong, you're not afraid to try new ideas. Part of the price of innovation, though, is that you're likely to make a mess along the way. Files get renamed, moved, removed, changed, and cut into pieces. New files are introduced. Temporary files that you don't intend to track take up residence in your working directory. + +In short, your workspace becomes a house of cards, balancing precariously between _"it's almost working!"_ and _"oh no, what have I done?"_. So what happens when you need to get your repository back to a known state for an afternoon so that you can get some _real_ work done? The classic commands git branch and [git stash][2] come immediately to mind, but neither is designed to deal, one way or another, with untracked files, and changed file paths and other major shifts can make it confusing to just stash your work away for later. The answer is Git worktree. + +### What is a Git worktree + +A Git worktree is a linked copy of your Git repository, allowing you to have multiple branches checked out at a time. A worktree has a separate path from your main working copy, but it can be in a different state and on a different branch. The advantage of a new worktree in Git is that you can make a change unrelated to your current task, commit the change, and then merge it at a later date, all without disturbing your current work environment. + +The canonical example, straight from the `git-worktree` man page, is that you're working on an exciting new feature for a project when your project manager tells you there's an urgent fix required. The problem is that your working repository (your "worktree") is in disarray because you're developing a major new feature. You don't want to "sneak" the fix into your current sprint, and you don't feel comfortable stashing changes to create a new branch for the fix. Instead, you decide to create a fresh worktree so that you can make the fix there: + + +``` +$ git branch | tee +* dev +trunk +$ git worktree add -b hotfix ~/code/hotfix trunk +Preparing ../hotfix (identifier hotfix) +HEAD is now at 62a2daf commit +``` + +In your `code` directory, you now have a new directory called `hotfix`, which is a Git worktree linked to your main project repository, with its `HEAD` parked at the branch called `trunk`. You can now treat this worktree as if it were your main workspace. You can change directory into it, make the urgent fix, commit it, and eventually remove the worktree: + + +``` +$ cd ~/code/hotfix +$ sed -i 's/teh/the/' hello.txt +$ git commit --all --message 'urgent hot fix' +``` + +Once you've finished your urgent work, you can return to your previous task. You're in control of when your hotfix gets integrated into the main project. For instance, you can push the change directly from its worktree to the project's remote repo: + + +``` +$ git push origin HEAD +$ cd ~/code/myproject +``` + +Or you can archive the worktree as a TAR or ZIP file: + + +``` +$ cd ~/code/myproject +$ git archive --format tar --output hotfix.tar master +``` + +Or you can fetch the changes locally from the separate worktree: + + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +From there, you can merge your changes using whatever strategy works best for you and your team. + +### Listing active worktrees + +You can get a list of the worktrees and see what branch each has checked out using the `git worktree list` command: + + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +You can use this from within either worktree. Worktrees are always linked (unless you manually move them, breaking Git's ability to locate a worktree, and therefore severing the link). + +### Moving a worktree + +Git tracks the locations and states of a worktree in your project's `.git` directory: + + +``` +$ cat ~/code/myproject/.git/worktrees/hotfix/gitdir +/home/seth/code/hotfix/.git +``` + +If you need to relocate a worktree, you must do that using `git worktree move`; otherwise, when Git tries to update the worktree's status, it fails: + + +``` +$ mkdir ~/Temp +$ git worktree move hotfix ~/Temp +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/Temp/hotfix     09e585d [master] +``` + +### Removing a worktree + +When you're finished with your work, you can remove it with the `remove` subcommand: + + +``` +$ git worktree remove hotfix +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +``` + +To ensure your `.git` directory is clean, use the `prune` subcommand after removing a worktree: + + +``` +`$ git worktree remove prune` +``` + +### When to use worktrees + +As with many options, whether it's tabs or bookmarks or automatic backups, it's up to you to keep track of the data you generate, or it could get overwhelming. Don't use worktrees so often that you end up with 20 copies of your repo, each in a slightly different state. I find it best to create a worktree, do the task that requires it, commit the work, and then remove the tree. Keep it simple and focused. + +The important thing is that worktrees provide improved flexibility for how you manage a Git repository. Use them when you need them, and never again scramble to preserve your working state just to check something on another branch. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-worktree + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) +[2]: https://opensource.com/article/21/4/git-stash From 43f413537a624a76c5b5ac699c3cbd78b4b76977 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:37 +0800 Subject: [PATCH 032/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210406=20?= =?UTF-8?q?Teach=20anyone=20how=20to=20code=20with=20Hedy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210406 Teach anyone how to code with Hedy.md --- ...0406 Teach anyone how to code with Hedy.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20210406 Teach anyone how to code with Hedy.md diff --git a/sources/tech/20210406 Teach anyone how to code with Hedy.md b/sources/tech/20210406 Teach anyone how to code with Hedy.md new file mode 100644 index 0000000000..1e2122fc50 --- /dev/null +++ b/sources/tech/20210406 Teach anyone how to code with Hedy.md @@ -0,0 +1,82 @@ +[#]: subject: (Teach anyone how to code with Hedy) +[#]: via: (https://opensource.com/article/21/4/hedy-teach-code) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Teach anyone how to code with Hedy +====== +Hedy is a new programming language designed specifically for teaching +people to code. +![Teacher or learner?][1] + +Learning to code involves learning both the programming logic and the syntax of a specific programming language. When I took my first programming class in college, the language taught was C++. The first code example, the basic "Hello World" program, looked like the example below. + + +``` +#include <iostream> + +int main() { +    std::cout << "Hello World!"; +    return 0; +} +``` + +The instructor would not explain most of the code until several lessons later. The expectation was that we would just type in the code and eventually learn why things were required and how they worked. + +The complex syntax of C++ (and other, similar languages) is why Python is often suggested as an easier language for teaching programming. Here is the same example in Python: + + +``` +`print("Hello World!")` +``` + +While the basic "Hello World" example in Python is much simpler, it still has complex and precise syntax rules. The `print` function requires parentheses and quotes around the string. This can still confuse those who have no experience with programming. Python has fewer "I'll explain later" syntax issues than C++, but it still has them. + +[Hedy][2], a new language designed specifically for teaching coding, addresses the issue of syntax complexity by building multiple levels of complexity into the language. Instead of providing the full features of the language right away, Hedy takes a gradual approach and slowly becomes more complex as students work through Hedy's levels. As the levels progress, the language gains new features and eventually becomes more Python-like. There are currently seven levels available, but more are planned. + +At level 1, a Hedy program cannot do anything except print a statement (which does not require quotes or parentheses), ask a question, and echo back an answer. Level 1 has no variables, no loops, and minimal structure. Echo works almost like a variable but only for the last user input. This allows students to become comfortable with basic concepts without having to learn everything all at once. + +This is a level 1 Hedy "Hello World" program: + + +``` +`print Hello World` +``` + +Level 2 introduces variables, but because the `print` function does not use quotes, there can be some interesting outcomes. If the variable used to store a person's name is `name`, it is impossible to print the output "Your name is [name]" because both the first use of name, which is intended to be a string, and the second use, which is a variable, are both interpreted as a variable. If `name` is set to `John Doe`, the output of `print Your name is name.` would be "Your John Doe is John Doe." As odd as this sounds, it is a good way for to introduce the concept of variables, which just happens to be a feature added in Level 3. + +Level 3 requires quotation marks around strings, which makes variables function like they do in Python. It is now possible to output strings combined with variables to make complex statements without worrying about conflicts between variable names and words in a string. This level does away with the `echo` function, which does seem like something that might frustrate some learners. They should be using variables, which is better code, but it could be confusing if an `ask`/`echo` block of code becomes invalid syntax. + +Level 4 adds basic `if`/`else` functionality. Students can move from simple ask/answer code to complex interactions. For example, a prompt that asks, "What is your favorite color?" can accept different replies depending on what the user enters. If they enter green, the reply can be "Green! That's also my favorite color." If they enter anything else, the reply could be different. The `if`/`else` block is a basic programming concept, which Hedy introduces without having to worry about complex syntax or overly precise formatting. + +Level 5 has a `repeat` function, which adds a basic loop to the features available. This loop can only repeat the same command multiple times, so it is not as powerful as loops in Python, but it lets the students get used to the general concept of repeating commands. It's one more programming concept introduced without bogging things down with needless complexity. The students can grasp the basics of the concept before moving on to more powerful, complex versions of the same thing. + +At level 6, Hedy can now do basic math calculations. Addition, subtraction, multiplication, and division are supported, but more advanced math features are not. It is not possible to use exponents, modulo, or anything else that Python and other languages handle. As yet, no higher level of Hedy adds more complex math. + +Level 7 brings in Python-style indenting, which means `repeat` can work with multiple lines of code. Students worked with code line by line up to this point, but now they can work with blocks of code. This Hedy level still falls way short of what a non-teaching programming language can do, but it can teach students a lot. + +The easiest way to get started with Hedy is to access the [lessons][3] on the Hedy website, which is currently available in Dutch, English, French, German, Portuguese, and Spanish. This makes the learning process accessible to anyone with a web browser. It is also possible to download Hedy from [GitHub][4] and run the interpreter from the command line or run a local copy of the Hedy website with its interactive lessons. The web-based version is more approachable, but both the web and command-line versions support running Hedy programs targeted at its various levels of complexity. + +Hedy will never compete with Python, C++, or other languages as the language of choice for coding for real-world projects, but it is an excellent way to teach coding. The programs students write as part of the learning process are real and possibly even complex. Hedy can foster learning and creativity without confusing students with too much information too soon in the learning process. Like math classes, which start with counting, adding, etc., long before getting to calculus (a process that takes years), programming does not have to start with "I'll explain later" for programming language syntax issues that must be followed precisely to produce even the most basic program in the language. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/hedy-teach-code + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/5538035618_4e19c9787c_o.png?itok=naiD1z1S (Teacher or learner?) +[2]: https://www.hedycode.com/ +[3]: https://www.hedycode.com/hedy?lang=en +[4]: https://github.com/felienne/hedy From 5c1492dabe9f145f6cacb7d152aa017137d0cefb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 7 Apr 2021 05:03:51 +0800 Subject: [PATCH 033/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210406=20?= =?UTF-8?q?Use=20Apache=20Superset=20for=20open=20source=20business=20inte?= =?UTF-8?q?lligence=20reporting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md --- ... source business intelligence reporting.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md diff --git a/sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md b/sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md new file mode 100644 index 0000000000..48ee2a41fa --- /dev/null +++ b/sources/tech/20210406 Use Apache Superset for open source business intelligence reporting.md @@ -0,0 +1,145 @@ +[#]: subject: (Use Apache Superset for open source business intelligence reporting) +[#]: via: (https://opensource.com/article/21/4/business-intelligence-open-source) +[#]: author: (Maxime Beauchemin https://opensource.com/users/mistercrunch) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use Apache Superset for open source business intelligence reporting +====== +Since its creation in 2015 at an Airbnb hackathon, Apache Superset has +matured into a leading open source BI solution. +![metrics and data shown on a computer screen][1] + +They say software is eating the world, but it's equally clear that open source is taking over software. + +Simply put, open source is a superior approach for building and distributing software because it provides important guarantees around how software can be discovered, tried, operated, collaborated on, and packaged. For those reasons, it is not surprising that it has taken over most of the modern data stack: Infrastructure, databases, orchestration, data processing, AI/ML, and beyond. + +Looking back, the main reason why I originally created both [Apache Airflow][2] and [Apache Superset][3] while I was at Airbnb from 2014-17 is that the vendors in the data space were failing to: + + * Keep up with the pace of innovation in the data ecosystem + * Give power to users who wanted to satisfy their more advanced use cases + + + +As is often the case with open source, the capacity to integrate and extend was always at the core of how we approached the architecture of those two projects. + +### Headaches with Tableau + +More specifically, for Superset, the main driver to start the project at the time was the fact that Tableau (which was, at the time, our main data visualization tool) couldn't connect natively to [Apache Druid][4] and [Trino][5]/[Presto][6]. These were our data engines of choice that provided the properties and guarantees that we needed to satisfy our data use cases. + +With Tableau's "Live Mode" misbehaving in intricate ways at the time (I won't get into this!), we were steered towards using Tableau Extracts. Extracts crumbled under the data volumes we had at Airbnb, creating a whole lot of challenges around non-additive metrics (think distinct user counts) and forcing us to intricately pre-compute multiple "grouping sets," which broke down some of the Tableau paradigms and confused users. Secondarily, we had a limited number of licenses for Tableau and generally had an order of magnitude more employees that wanted/needed access to our internal than our contract allowed. That's without mentioning the fact that for a cloud-native company, Tableau's Windows-centric approach at the time didn't work well for the team. + +Some of the above premises have since changed, but the power of open source and the core principles on which it's built have only grown. In this blog post, I will explain why the future of business intelligence is open source. + +## Benefits of open source + +If I could only use a single word to describe why the time is right for organizations to adopt open source BI, the word would be _freedom_. Flowing from the principle of freedom comes a few more concrete superpowers for an organization: + + * The power to customize, extend and integrate + * The power of the community + * Avoid vendor lock-in + + + +### Extend, customize, and integrate + +Airbnb wanted to integrate in-house tools like Dataportal and Minerva with a dashboarding tool to enable data democratization within their organization. Because Superset is open source and Airbnb actively contributes to the project, they could supercharge Superset with in-house components with relative ease. + +On the visualization side, organizations like Nielsen create new visualizations and deploy them in their Superset environments. They're going a step further by empowering their engineers to contribute to Superset's customizability and extensibility. The Superset platform is now flexible enough so that anyone can build their [own custom visualization plugins][7], a benefit that is unmatched in the marketplace. + +Many report using the rich [REST API that ships with Superset][8] within the wider community, allowing them full programmatic control over all aspects of the platform. Given that pretty much everything that users can do in Superset can be done through the API, the sky is the limit for automating processes in and around Superset. + +Around the topic of integration, members from the Superset community have added support for over 30 databases ([and growing!][9]) by submitting code and documentation contributions. Because the core contributors bet on the right open source components ([SQLAlchemy][10] and Python [DB-API 2.0][11]), the Superset community both gives and receives to/from the broader Python community. + +### The power of the community + +Open source communities are composed of a diverse group of people who come together over a similar set of needs. This group is empowered to contribute to the common good. Vendors, on the other hand, tend to focus on their most important customers. Open source is a fundamentally different model that's much more collaborative and frictionless. As a result of this fundamentally de-centralized model, communities are very resilient to changes that vendor-led products struggle with. As contributors and organizations come and go, the community lives on! + +At the core of the community are the active contributors that typically operate as a dynamic meritocracy. Network effects attract attention and talent, and communities welcome and offer guidance to newcomers because their goals are aligned. With the rise of platforms like Gitlab and Github, software is pretty unique in that engineers and developers from around the world seem to be able to come together and work collaboratively with minimal overhead. Those dynamics are fairly well understood and accepted as a disruptive paradigm shift in how people collaborate to build modern software. + +![Growth in Monthly Unique Contributors][12] + +Growth in Monthly Unique Contributors + +Beyond the software at the core of the project, dynamic communities contribute in all sorts of ways that provide even more value. Here are some examples: + + * Rich and up-to-date documentation + * Example use cases and testimonials, often in the form of blog posts + * Bug reports and bug fixes, contributing to stability and quality + * Ever-growing online knowledge bases and FAQs + * How-to videos and conference talks + * Real-time support networks of enthusiasts and experts in forums and on [chat platforms][13] + * Dynamic mailing lists where core contributors propose and debate over complex issues + * Feedback loops, ways to suggest features and influence roadmaps + + + +### Avoid lock-in + +Recently, [Atlassian acquired the proprietary BI platform Chart.io][14], started to downsize the Chart.io team, and announced their intention to shut down the platform. Their customers now have to scramble and find a new home for their analytics assets that they now have to rebuild. + +![Chart.io Shutting Down][15] + +Chart.io Shutting Down + +This isn't a new phenomenon. Given how mature and dynamic the BI market is, consolidation has been accelerating over the past few years: + + * Tableau was acquired by Salesforce + * Looker was acquired by Google Cloud + * Periscope was acquired by Sisense + * Zoomdata was acquired by Logi Analytics + + + +While consolidation is likely to continue, these concerns don't arise when your BI platform is open source. If you're self-hosting, you are essentially immune to vendor lock-in. If you choose to partner with a commercial open source software (COSS), you should have an array of options from alternative vendors to hiring expertise in the marketplace, all the way to taking ownership and operating the software on your own. + +For example, if you were using Apache Airflow service to take care of your Airflow needs, and your cloud provider decided to shut down the service, you'd be left with a set of viable options: + + * Select and migrate to another service provider in the space, such as Apache Airflow specialist [Astronomer][16]. + * Hire or consult Airflow talent that can help you take control. The community has fostered a large number of professionals who know and love Airflow and can help your organization. + * Learn and act. That is, take control and tap into the community's amazing resources to run the software on your own (Docker, Helm, k8s operator, and so on.) + + + +Even at [Preset][17], where we offer a cloud-hosted version of Superset, we don't fork the Superset code and instead run the same Superset that's available to everyone. In the Preset cloud, you can freely import and export data sources, charts, and dashboards. This is not unique to Preset. Many vendors understand that "no lock-in!" is integral to their value proposition and are incentivized to provide clear guarantees around this. + +## Open source for your data + +Open source is disruptive in the best of ways, providing freedom, and a set of guarantees that really matter when it comes to adopting software. These guarantees fully apply when it comes to business intelligence. In terms of business intelligence, Apache Superset has matured to a level where it's a compelling choice over any proprietary solution. Since its creation in 2015 at an Airbnb hackathon, the project has come a very long way indeed. Try it yourself to discover a combination of features and guarantees unique to open source BI. To learn more, visit and [join our growing community][18]. + +In this article, I review some of the top open source business intelligence (BI) and reporting... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/business-intelligence-open-source + +作者:[Maxime Beauchemin][a] +选题:[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/mistercrunch +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://airflow.apache.org/ +[3]: https://superset.apache.org/ +[4]: https://druid.apache.org/ +[5]: https://trino.io/ +[6]: https://prestodb.io/ +[7]: https://preset.io/blog/2020-07-02-hello-world/ +[8]: https://superset.apache.org/docs/rest-api/ +[9]: https://superset.apache.org/docs/databases/installing-database-drivers +[10]: https://www.sqlalchemy.org/ +[11]: https://www.python.org/dev/peps/pep-0249/ +[12]: https://opensource.com/sites/default/files/uniquecontributors.png +[13]: https://opensource.com/article/20/7/mattermost +[14]: https://www.atlassian.com/blog/announcements/atlassian-acquires-chartio +[15]: https://opensource.com/sites/default/files/chartio.jpg +[16]: https://www.astronomer.io/ +[17]: https://preset.io/ +[18]: https://superset.apache.org/community/ From 3c792b993d185babb1a465e466751b1ca9badbd6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 7 Apr 2021 08:40:42 +0800 Subject: [PATCH 034/307] translating --- ...x Dual Boot Setup- Here-s How to Fix it.md | 104 ------------------ ...x Dual Boot Setup- Here-s How to Fix it.md | 104 ++++++++++++++++++ 2 files changed, 104 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md create mode 100644 translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md diff --git a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md deleted file mode 100644 index fd32676c3b..0000000000 --- a/sources/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: (Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it) -[#]: via: (https://itsfoss.com/wrong-time-dual-boot/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it -====== - -If you [dual boot Windows and Ubuntu][1] or any other Linux distribution, you might have noticed a time difference between the two operating systems. - -When you [use Linux][2], it shows the correct time. But when you boot into Windows, it shows the wrong time. Sometimes, it is the opposite and Linux shows the wrong time and Windows has the correct time. - -That’s strange specially because you are connected to the internet and your date and time is set to be used automatically. - -Don’t worry! You are not the only one to face this issue. You can fix it by using the following command in the Linux terminal: - -``` -timedatectl set-local-rtc 1 -``` - -Again, don’t worry. I’ll explain why you encounter a time difference in a dual boot setup. I’ll show you how the above command fixes the wrong time issue in Windows after dual boot. - -### Why Windows and Linux show different time in dual boot? - -A computer has two main clocks: a system clock and a hardware clock. - -A hardware clock which is also called RTC ([real time clock][3]) or CMOS/BIOS clock. This clock is outside the operating system, on your computer’s motherboard. It keeps on running even after your system is powered off. - -The system clock is what you see inside your operating system. - -When your computer is powered on, the hardware clock is read and used to set the system clock. Afterwards, the system clock is used for tracking time. If your operating system makes any changes to system clock, like changing time zone etc, it tries to sync this information to the hardware clock. - -By default, Linux assumes that the time stored in the hardware clock is in UTC, not the local time. On the other hand, Windows thinks that the time stored on the hardware clock is local time. That’s where the trouble starts. - -Let me explain with examples. - -You see I am in Kolkata time zone which is UTC+5:30. After installing when I set the [timezon][4][e][4] [in Ubuntu][4] to the Kolkata time zone, Ubuntu syncs this time information to the hardware clock but with an offset of 5:30 because it has to be in UTC for Linux. - -Let’ say the current time in Kolkata timezone is 15:00 which means that the UTC time is 09:30. - -Now when I turn off the system and boot into Windows, the hardware clock has the UTC time (09:30 in this example). But Windows thinks the hardware clock has stored the local time. And thus it changes the system clock (which should have shown 15:00) to use the UTC time (09:30) as the local time. And hence, Windows shows 09:30 as the time which is 5:30 hours behind the actual time (15:00 in our example). - -![][5] - -Again, if I set the correct time in Windows by toggling the automatic time zone and time buttons, you know what is going to happen? Now it will show the correct time on the system (15:00) and sync this information (notice the “Synchronize your clock” option in the image) to the hardware clock. - -If you boot into Linux, it reads the time from the hardware clock which is in local time (15:00) but since Linux believes it to be the UTC time, it adds an offset of 5:30 to the system clock. Now Linux shows a time of 20:30 which is 5:30 hours ahead of the actual time. - -Now that you understand the root cause of the time difference issues in dual boot, it’s time to see how to fix the issue. - -### Fixing Windows Showing Wrong Time in a Dual Boot Setup With Linux - -There are two ways you can go about handling this issue: - - * Make Windows use UTC time for the hardware clock - * Make Linux use local time for the hardware clock - - - -It is easier to make the changes in Linux and hence I’ll recommend going with the second method. - -Ubuntu and most other Linux distributions use systemd these days and hence you can use timedatectl command to change the settings. - -What you are doing is to tell your Linux system to use the local time for the hardware clock (RTC). You do that with the `set-local-rtc` (set local time for RTC) option: - -``` -timedatectl set-local-rtc 1 -``` - -As you can notice in the image below, the RTC now uses the local time. - -![][6] - -Now if you boot into Windows, it takes the hardware clock to be as local time which is actually correct this time. When you boot into Linux, your Linux system knows that the hardware clock is using local time, not UTC. And hence, it doesn’t try to add the off-set this time. - -This fixes the time difference issue between Linux and Windows in dual boot. - -You see a warning about not using local time for RTC. For desktop setups, it should not cause any issues. At least, I cannot think of one. - -I hope I made things clear for you. If you still have questions, please leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/wrong-time-dual-boot/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ -[2]: https://itsfoss.com/why-use-linux/ -[3]: https://www.computerhope.com/jargon/r/rtc.htm -[4]: https://itsfoss.com/change-timezone-ubuntu/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-time-windows.jpg?resize=800%2C491&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-local-time-for-rtc-ubuntu.png?resize=800%2C490&ssl=1 diff --git a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md new file mode 100644 index 0000000000..ec01d190c1 --- /dev/null +++ b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -0,0 +1,104 @@ +[#]: subject: (Wrong Time Displayed in Windows-Linux Dual Boot Setup? Here’s How to Fix it) +[#]: via: (https://itsfoss.com/wrong-time-dual-boot/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Windows-Linux 双启动设置中显示时间错误?如何解决这个问题 +====== + +如果你[双启动 Windows 和 Ubuntu][1] 或任何其他 Linux 发行版,你可能会注意到两个操作系统之间的时间差异。 + +当你[使用 Linux][2] 时,它会显示正确的时间。但当你进入 Windows 时,它显示的时间是错误的。有时,情况正好相反,Linux 显示的是错误的时间,而 Windows 的时间是正确的。 + +特别奇怪的是,因为你已连接到互联网,并且已将日期和时间设置为自动使用。 + +别担心!你并不是唯一一个遇到这种问题的人。你可以在 Linux 终端上使用以下命令来解决这个问题: + +``` +timedatectl set-local-rtc 1 +``` + +同样,不要担心。我会解释为什么你在双启动设置中会遇到时间差。我会向你展示上面的命令是如何修复 Windows 双启动后的时间错误问题的。 + +### 为什么 Windows 和 Linux 在双启动时显示不同的时间? + +一台电脑有两个主要时钟:系统时钟和硬件时钟。 + +硬件时钟也叫 RTC([实时时钟][3])或 CMOS/BIOS 时钟。这个时钟在操作系统之外,在电脑的主板上。即使在你的系统关机后,它也会继续运行。 + +系统时钟是你在操作系统内看到的。 + +当计算机开机时,硬件时钟被读取并用于设置系统时钟。之后,系统时钟被用于跟踪时间。如果你的操作系统对系统时钟做了任何改变,比如改变时区等,它就会尝试将这些信息同步到硬件时钟上。 + +默认情况下,Linux 认为硬件时钟中存储的时间是 UTC,而不是本地时间。另一方面,Windows 认为硬件时钟上存储的时间是本地时间。这就是问题的开始。 + +让我用例子来解释一下。 + +你看我在加尔各答 UTC+5:30 时区。安装后,当我把 [Ubuntu 中的时区][4]]设置为加尔各答时区时,Ubuntu 会把这个时间信息同步到硬件时钟上,但会有 5:30 的偏移,因为对于 Linux 来说它必须是 UTC。 + +假设加尔各答时区的当前时间是 15:00,这意味着 UTC 时间是 09:30。 + +现在当我关闭系统并启动到 Windows 时,硬件时钟有 UTC 时间(本例中为 09:30)。但是 Windows 认为硬件时钟已经存储了本地时间。因此,它改变了系统时钟(应该显示为 15:00),而使用 UTC 时间(09:30)作为本地时间。因此,Windows 显示时间为 09:30,这比实际时间(我们的例子中为 15:00)早了 5:30。 + +![][5] + +同样,如果我在 Windows 中通过自动时区和时间按钮来设置正确的时间,你知道会发生什么吗?现在它将在系统上显示正确的时间(15:00),并将此信息(注意图片中的”同步你的时钟“选项)同步到硬件时钟。 + +如果你启动到 Linux,它会从硬件时钟读取时间,而硬件时钟是当地时间(15:00),但由于 Linux 认为它是 UTC 时间,所以它在系统时钟上增加了 5:30 的偏移。现在 Linux 显示的时间是 20:30,比实际时间超出晚了 5:30。 + +现在你了解了双启动中时差问题的根本原因,是时候看看如何解决这个问题了。 + +### 修复 Windows 在 Linux 双启动设置中显示错误时间的问题 + +有两种方法可以处理这个问题: + + * 让 Windows 将硬件时钟作为 UTC 时间 + * 让 Linux 将硬件时钟作为本地时间 + + + +在 Linux 中进行修改是比较容易的,因此我推荐使用第二种方法。 + +现在 Ubuntu 和大多数其他 Linux 发行版都使用 systemd,因此你可以使用 timedatectl 命令来更改设置。 + +你要做的是告诉你的 Linux 系统将硬件时钟(RTC)作为本地时间。你可以通过 `set-local-rtc` (为 RTC 设置本地时间)选项来实现: + +``` +timedatectl set-local-rtc 1 +``` + +如下图所示,RTC 现在使用本地时间。 + +![][6] + +现在如果你启动 Windows,它把硬件时钟当作本地时间,而这个时间实际上是正确的。当你在 Linux 中启动时,你的 Linux 系统知道硬件时钟使用的是本地时间,而不是 UTC。因此,它不会尝试添加这个时间的偏移。 + +这就解决了 Linux 和 Windows 双启动时的时差问题。 + +你会看到一个关于 RTC 不使用本地时间的警告。对于桌面设置,它不应该引起任何问题。至少,我想不出有什么问题。 + +希望我把事情给你讲清楚了。如果你还有问题,请在下面留言。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/wrong-time-dual-boot/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[2]: https://itsfoss.com/why-use-linux/ +[3]: https://www.computerhope.com/jargon/r/rtc.htm +[4]: https://itsfoss.com/change-timezone-ubuntu/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-time-windows.jpg?resize=800%2C491&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/set-local-time-for-rtc-ubuntu.png?resize=800%2C490&ssl=1 From 15eafd167783d33b74d8d5b00fb8aee7e11e6e6d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 7 Apr 2021 08:51:11 +0800 Subject: [PATCH 035/307] translating --- ...5 Plausible- Privacy-Focused Google Analytics Alternative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index fdd765447f..51938e2449 100644 --- a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/plausible/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4c2803a96d2c454125e8f14be75863fee935d4bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 09:55:39 +0800 Subject: [PATCH 036/307] PRF @lxbwolf --- ...les into HTML or Other Formats in Linux.md | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md index e9aee0c478..997468b2fc 100644 --- a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ b/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -3,16 +3,18 @@ [#]: author: "Bill Dyer https://itsfoss.com/author/bill/" [#]: collector: "lujun9972" [#]: translator: "lxbwolf" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 在 Linux 中把多个 Markdown 文件转换成 HTML 或其他格式 ====== +![](https://img.linux.net.cn/data/attachment/album/202104/07/095441bztj6cz68j89568u.jpg) + 很多时候我与 Markdown 打交道的方式是,先写完一个文件,然后把它转换成 HTML 或其他格式。也有些时候,需要创建一些新的文件。当我要写多个 Markdown 文件时,通常要把他们全部写完之后才转换它们。 -我用 pandoc 来转换文件,它可以一次性地转换所有 Markdown 文件。 +我用 `pandoc` 来转换文件,它可以一次性地转换所有 Markdown 文件。 Markdown 格式的文件可以转换成 .html 文件,有时候我需要把它转换成其他格式,如 epub,这个时候 [pandoc][1] 就派上了用场。我更喜欢用命令行,因此本文我会首先介绍它,然而你还可以使用 [VSCodium][2] 在非命令行下完成转换。后面我也会介绍它。 @@ -24,7 +26,7 @@ Markdown 格式的文件可以转换成 .html 文件,有时候我需要把它 sudo apt-get install pandoc ``` -本例中,在名为 md_test 目录下我有四个 Markdown 文件需要转换。 +本例中,在名为 `md_test` 目录下我有四个 Markdown 文件需要转换。 ``` [email protected]:~/Documents/md_test$ ls -l *.md @@ -35,20 +37,18 @@ sudo apt-get install pandoc [email protected]:~/Documents/md_test$ ``` -现在还没有 HTML 文件。现在我要对这些文件使用 pandoc。我会运行一行命令来实现: +现在还没有 HTML 文件。现在我要对这些文件使用 `pandoc`。我会运行一行命令来实现: - * 调用 pandoc + * 调用 `pandoc` * 读取 .md 文件并导出为 .html - - 下面是我要运行的命令: ``` for i in *.md ; do echo "$i" && pandoc -s $i -o $i.html ; done ``` -如果你不太理解上面的命令中的 `;`,可以参考[在 Linux 中一次执行多个命令][3]。 +如果你不太理解上面的命令中的 `;`,可以参考 [在 Linux 中一次执行多个命令][3]。 我执行命令后,运行结果如下: @@ -74,34 +74,22 @@ file04.md 转换很成功,现在你已经有了四个 HTML 文件,它们可以用在 Web 服务器上。 -pandoc 功能相当多,你可以通过指定输出文件的扩展名来把 markdown 文件转换成其他支持的格式。不难理解它为什么会被认为是[最好的写作开源工具][4]。 - -**推荐阅读:** - -![][5] - -#### [Linux 下 11 个最好的 Markdown 编辑器][6] - -列出了 Linux 不同发行版本下好看且功能多样的最好的 Markdown 编辑器。 +pandoc 功能相当多,你可以通过指定输出文件的扩展名来把 Markdown 文件转换成其他支持的格式。不难理解它为什么会被认为是[最好的写作开源工具][4]。 ### 使用 VSCodium 把 Markdown 文件转换成 HTML(GUI 方式) -就像我们前面说的那样,我通常使用命令行,但是对于批量转换,我不会使用命令行,你也不必。VSCode 或 [VSCodium][7] 可以完成批量操作。你只需要安装一个 _Markdown-All-in-One_ 扩展,就可以在一次运行中转换多个 Markdown 文件。 +就像我们前面说的那样,我通常使用命令行,但是对于批量转换,我不会使用命令行,你也不必。VSCode 或 [VSCodium][7] 可以完成批量操作。你只需要安装一个 Markdown-All-in-One 扩展,就可以在一次运行中转换多个 Markdown 文件。 有两种方式安装这个扩展: * VSCodium 的终端 * VSCodium 的插件管理器 - - 通过 VSCodium 的终端安装该扩展: 1. 点击菜单栏的 `终端`。会打开终端面板 2. 输入,或[复制下面的命令并粘贴到终端][8]: - - ``` codium --install-extension yzhang.markdown-all-in-one ``` @@ -113,9 +101,7 @@ codium --install-extension yzhang.markdown-all-in-one 第二种安装方式是通过 VSCodium 的插件/扩展管理器: 1. 点击 VSCodium 窗口左侧的块区域。会出现一个扩展列表,列表最上面有一个搜索框。 - 2. 在搜索框中输入 `Markdown All in One`。在列表最上面会出现该扩展。点击 `安装` 按钮来安装它。如果你已经安装过,在安装按钮的位置会出现一个齿轮图标。 - - + 2. 在搜索框中输入 “Markdown All in One”。在列表最上面会出现该扩展。点击 “安装” 按钮来安装它。如果你已经安装过,在安装按钮的位置会出现一个齿轮图标。 ![][10] @@ -123,7 +109,7 @@ codium --install-extension yzhang.markdown-all-in-one 点击 VSCodium 窗口左侧的纸张图标。你可以选择文件夹。打开文件夹后,你需要打开至少一个文件。你也可以打开多个文件,但是最少打开一个。 -当打开文件后,按下 `CTRL+SHIFT+P` 唤起命令面板。然后,在出现的搜索框中输入 `Markdown`。当你输入时,会出现一列 Markdown 相关的命令。其中有一个是 `Markdown All in One: Print documents to HTML` 命令。点击它: +当打开文件后,按下 `CTRL+SHIFT+P` 唤起命令面板。然后,在出现的搜索框中输入 `Markdown`。当你输入时,会出现一列 Markdown 相关的命令。其中有一个是 `Markdown All in One: Print documents to HTML` 命令。点击它: ![][11] @@ -140,7 +126,7 @@ via: https://itsfoss.com/convert-markdown-files/ 作者:[Bill Dyer][a] 选题:[lujun9972][b] 译者:[lxbwolf](https://github.com/lxbwolf) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08a2b418714ce0a9720ad31faa09a5435ec41272 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 09:56:10 +0800 Subject: [PATCH 037/307] PUB @lxbwolf https://linux.cn/article-13274-1.html --- ...iple Markdown Files into HTML or Other Formats in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md (98%) diff --git a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md b/published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md similarity index 98% rename from translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md rename to published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md index 997468b2fc..fea402d238 100644 --- a/translated/tech/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md +++ b/published/20210404 Converting Multiple Markdown Files into HTML or Other Formats in Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "lxbwolf" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13274-1.html" 在 Linux 中把多个 Markdown 文件转换成 HTML 或其他格式 ====== From ebf8df169e90c8ed98ae255131ac433ec693246d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 22:06:00 +0800 Subject: [PATCH 038/307] APL --- sources/tech/20210303 5 signs you might be a Rust programmer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210303 5 signs you might be a Rust programmer.md b/sources/tech/20210303 5 signs you might be a Rust programmer.md index 8c73cc5220..e2ae42e8a5 100644 --- a/sources/tech/20210303 5 signs you might be a Rust programmer.md +++ b/sources/tech/20210303 5 signs you might be a Rust programmer.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/rust-programmer) [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 536c7c1ec32d981776d8fba92080c1d3f32011f9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 7 Apr 2021 23:13:37 +0800 Subject: [PATCH 039/307] TSL --- ... 5 signs you might be a Rust programmer.md | 71 ------------------ ... 5 signs you might be a Rust programmer.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20210303 5 signs you might be a Rust programmer.md create mode 100644 translated/tech/20210303 5 signs you might be a Rust programmer.md diff --git a/sources/tech/20210303 5 signs you might be a Rust programmer.md b/sources/tech/20210303 5 signs you might be a Rust programmer.md deleted file mode 100644 index e2ae42e8a5..0000000000 --- a/sources/tech/20210303 5 signs you might be a Rust programmer.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: (5 signs you might be a Rust programmer) -[#]: via: (https://opensource.com/article/21/3/rust-programmer) -[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 signs you might be a Rust programmer -====== -During my journey to learning Rust, I've noticed a few common behaviors -of fellow Rustaceans. -![name tag that says hello my name is open source][1] - -I'm a fairly recent [convert to Rust][2], which I started to learn around the end of April 2020. But, like many converts, I'm an enthusiastic evangelist. I'm also not a very good Rustacean, truth be told, in that my coding style isn't great, and I don't write particularly idiomatic Rust. I suspect this is partly because I never really finished learning Rust before diving in and writing quite a lot of code (some of which is coming back to haunt me) and partly because I'm just not that good a programmer. - -But I love Rust, and so should you. It's friendly—well, more friendly than C or C++; it's ready for low-level systems tasks—more so than Python, it's well-structured—more than Perl; and, best of all, it's completely open source from the design level up—much more than Java, for instance. - -Despite my lack of expertise, I noticed a few things that I suspect are common to many Rust enthusiasts and programmers. If you say "yes" to the following five signs (the first of which was sparked by some exciting recent news), you, too, might be a Rust programmer. - -### 1\. The word "foundation" excites you - -For Rust programmers, the word "foundation" will no longer be associated first and foremost with Isaac Asimov but with the newly formed [Rust Foundation][3]. Microsoft, Huawei, Google, AWS, and Mozilla are providing the directors (and presumably most of the initial funding) for the Foundation, which will look after all aspects of the language, "heralding Rust's arrival as an enterprise production-ready technology," [according to interim executive director][4] Ashley Williams. (On a side note, it's great to see a woman heading up such a major industry initiative.) - -The Foundation seems committed to safeguarding the philosophy of Rust and ensuring that everybody has the opportunity to get involved. Rust is, in many ways, a poster-child example of an open source project. Not that it's perfect (neither the language nor the community), but in that there seem to be sufficient enthusiasts who are dedicated to preserving the high-involvement, low-bar approach to community, which I think of as core to much of open source. I strongly welcome the move, which I think can only help promote Rust's adoption and maturity over the coming years and months. - -### 2\. You get frustrated by newsfeed references to Rust (the game) - -There's another computer-related thing out there that goes by the name "Rust," and it's a "multi-player only survival video game." It's newer than Rust the language (having been announced in 2013 and released in 2018), but I was once searching for Rust-related swag and made the mistake of searching for the game by that name. The interwebs being what they are, this meant that my news feed is now infected with this alternative Rust beast, and I now get random updates from their fandom and PR folks. This is low-key annoying, but I'm pretty sure I'm not alone in the Rust (language) community. I strongly suggest that if you _do_ want to find out more about this upstart in the computing world, you use a privacy-improving (I refuse to say "privacy-preserving") [open source browser][5] to do your research. - -### 3\. The word "unsafe" makes you recoil in horror - -Rust (the language, again) does a _really_ good job of helping you do the Right Thing™, certainly in terms of memory safety, which is a major concern within C and C++ (not because it's impossible but because it's really hard to get right consistently). Dave Herman wrote a post in 2016 on why safety is such a positive attribute of the Rust language: [_Safety is Rust's fireflower_][6]. Safety (memory, type safety) may not be glamourous, but it's something you become used to—and grateful for—as you write more Rust, particularly if you're involved in any systems programming, which is where Rust often excels. - -Now, Rust doesn't _stop_ you from doing the Wrong Thing™, but it does make you make a conscious decision when you wish to go outside the bounds of safety by making you use the `unsafe` keyword. This is good not only for you, as it will (hopefully) make you think really, really carefully about what you're putting in any code block that uses it; it is also good for anyone reading your code. It's a trigger-word that makes any half-sane Rustacean shiver at least slightly, sit upright in their chair, and think, "hmm, what's going on here? I need to pay special attention." If you're lucky, the person reading your code may be able to think of ways of rewriting it such that it _does_ make use of Rust's safety features or at least reduces the amount of unsafe code that gets committed and released. - -### 4\. You wonder why there's no emoji for `?;` or `{:?}` or `::<>` - -Everybody loves (to hate) the turbofish (`::<>`) but there are other semantic constructs that you see regularly in Rust code. In particular, `{:?}` (for string formatting) and `?;` (`?` is a way of propagating errors up the calling stack, and `;` ends the line/block, so you often see them together). They're so common in Rust code that you just learn to parse them as you go, and they're also so useful that I sometimes wonder why they've not made it into normal conversation, at least as emojis. There are probably others, too. What would be your suggestions? - -### 5\. Clippy is your friend (and not an animated paperclip) - -Clippy, the Microsoft animated paperclip, was a "feature" that Office users learned very quickly to hate and has become the starting point for many [memes][7]. On the other hand, `cargo clippy` is one of those [amazing Cargo commands][8] that should become part of every Rust programmer's toolkit. Clippy is a language linter and helps improve your code to make it cleaner, tidier, more legible, more idiomatic, and generally less embarrassing when you share it with your colleagues or the rest of the world. Cargo has arguably rehabilitated the name "Clippy," and although it's not something I'd choose to name one of my kids, I don't feel a sense of unease whenever I come across the term on the web anymore. - -* * * - -_This article was originally published on [Alice, Eve, and Bob][9] and is reprinted with the author's permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/rust-programmer - -作者:[Mike Bursell][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mikecamel -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OSDC_IntroOS_520x292_FINAL.png?itok=woiZamgj (name tag that says hello my name is open source) -[2]: https://opensource.com/article/20/6/why-rust -[3]: https://foundation.rust-lang.org/ -[4]: https://foundation.rust-lang.org/posts/2021-02-08-hello-world/ -[5]: https://opensource.com/article/19/7/open-source-browsers -[6]: https://www.thefeedbackloop.xyz/safety-is-rusts-fireflower/ -[7]: https://knowyourmeme.com/memes/clippy -[8]: https://opensource.com/article/20/11/commands-rusts-cargo -[9]: https://aliceevebob.com/2021/02/09/5-signs-that-you-may-be-a-rust-programmer/ diff --git a/translated/tech/20210303 5 signs you might be a Rust programmer.md b/translated/tech/20210303 5 signs you might be a Rust programmer.md new file mode 100644 index 0000000000..582bac6d3e --- /dev/null +++ b/translated/tech/20210303 5 signs you might be a Rust programmer.md @@ -0,0 +1,73 @@ +[#]: subject: (5 signs you might be a Rust programmer) +[#]: via: (https://opensource.com/article/21/3/rust-programmer) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +你可能是 Rust 程序员的五个迹象 +====== + +> 在我学习 Rust 的过程中,我注意到了 Rust 一族的一些常见行为。 + +![name tag that says hello my name is open source][1] + +我是最近才 [皈依 Rust][2] 的,我大约在 2020 年 4 月底开始学习。但是,像许多皈依者一样,我还是一个热情的布道者。说实话,我也不是一个很好的 Rust 人,因为我的编码风格不是很好,我写的也不是特别符合 Rust 习惯。我猜想这一方面是因为我在写大量代码之前还没有没有真正学完 Rust(其中一些代码又困扰了我),另一方面是因为我并不是那么优秀的程序员。 + +但我喜欢 Rust,你也应该喜欢。它很友好,比 C 或 C++ 更友好;它为低级系统任务做好了准备,这比 Python 做的更好;而且结构良好,这要超过 Perl;而且,最重要的是,它从设计层面开始,它就是完全开源的,这要比 Java 那些语言好得多。 + +尽管我缺乏专业知识,但我注意到了一些我认为是许多 Rust 爱好者和程序员的共同点。如果你对以下五个迹象说“是”(其中第一个迹象是由最近的一些令人兴奋的新闻引发的),那么你也可能是一个 Rust 程序员。 + +### 1、“基金会”一词会使你兴奋 + +对于 Rust 程序员来说,“基金会”一词将不再与艾萨克·阿西莫夫Isaac Asimov关联在一起,而是与新成立的 [Rust 基金会][3] 关联。微软、华为、谷歌、AWS 和Mozilla 正在为该基金会提供了董事(大概也是大部分初始资金),该基金会将负责该语言的各个方面,“预示着 Rust 成为企业生产级技术的到来”,[根据临时执行董事][4] Ashley Williams 说。(顺便说一句,很高兴看到一位女士领导这样一项重大的行业计划。) + +该基金会似乎致力于维护 Rust 的理念,并确保每个人都有参与的机会。在许多方面,Rust 都是开源项目的典型示例。并不是说它是完美的(无论是语言还是社区),而是因为似乎有足够的爱好者致力于维护高参与度、低门槛的社区方法,我认为这是许多开源项目的核心。我强烈欢迎此举,我认为此举只会帮助促进 Rust 在未来数年和数月内的采用和成熟。 + +### 2、你会因为新闻源中提到 Rust 游戏而感到沮丧 + +还有一款和电脑有关的东西,也叫做“Rust”,它是一款“只限多玩家的生存电子游戏”。它比 Rust 这个语言更新一些(2013 年宣布,2018 年发布),但我曾经在搜索 Rust 相关的内容时,犯了一个错误,这个名字搜索了游戏。互联网络就是这样的,这意味着我的新闻源现在被这个另类的 Rust 野兽感染了,我现在会从它的影迷和公关人员那里随机得到一些更新消息。这是个低调的烦恼,但我很确定在 Rust(语言)社区中并不是就我一个人这样。我强烈建议,如果你确实想了解更多关于这个计算世界的后起之秀的信息,你可以使用一个提高隐私(我拒绝说 "保护隐私")的 [开源浏览器][5] 来进行研究。 + +### 3、“不安全”这个词会让你感到恐惧。 + +Rust(语言,再次强调)在帮助你做**正确的事情**™方面做得非常好,当然,在内存安全方面,这是 C 和 C++ 内部的主要关注点(不是因为不可能做到,而是因为真的很难持续正确)。Dave Herman 在 2016 年写了一篇文章,讲述了为什么安全是 Rust 语言的一个积极属性:《[Safety is Rust's fireflower][6]》。安全性(内存、类型安全)可能并不赏心悦目,但随着你写的 Rust 越多,你就会习惯并感激它,尤其是当你参与任何系统编程时,这也是 Rust 经常擅长的地方。 + +现在,Rust 并不能阻止你做**错误的事情**™,但它确实通过让你使用 `unsafe` 关键字,让你在希望超出安全范围的时候做出一个明智的决定。这不仅对你有好处,因为它(希望)会让你非常、非常仔细地思考你在任何使用它的代码块中放入了什么;它对任何阅读你的代码的人也有好处,这是一个触发词,它能让任何不太清醒的 Rust 人至少微微打起精神,在椅子上坐直,然后想:“嗯,这里发生了什么?我需要特别注意。”如果幸运的话,读你代码的人也许能想到重写它的方法,使它利用到 Rust 的安全特性,或者至少减少了提交和发布的不安全代码的数量。 + +### 4、你想知道为什么没有 `?;`、`{:?}` 、`::<>` 这样的表情符号 + +人们喜欢(或讨厌)涡轮鱼(`::<>`),但在 Rust 代码中你经常还会看到其他的语义结构。特别是 `{:?}` (用于字符串格式化)和 `?;`(`?` 是向调用栈传播错误的一种方式,`;` 则是行/块的结束符,所以你经常会看到它们在一起)。它们在 Rust 代码中很常见,你只需边走边学,边走边解析,而且它们也很有用,我有时会想,为什么它们没有被纳入到正常对话中,至少作为表情符号。可能还有其他的。你有什么建议? + +### 5、Clippy 是你的朋友(而不是一个动画回形针) + +微软的动画回形针 Clippy 可能是 Office 用户很快就觉得讨厌的“功能”,并成为许多 [模因][7] 的起点。另一方面,`cargo clippy` 是那些 [很棒的 Cargo 命令][8] 之一,应该成为每个 Rust 程序员工具箱的一部分。Clippy 是一个语言整洁器,它可以帮助改进你的代码,使它更干净、更整洁、更易读、更惯用,让你与同事或其他人分享 Rust 代码时,不会感到尴尬。Cargo 可以说是让 “Clippy” 这个名字恢复了声誉,虽然我不会选择给我的孩子起这个名字,但现在每当我在网络上遇到这个词的时候,我不会再有一种不安的感觉。 + +* * * + +这篇文章最初发表在 [Alice, Eve, and Bob] [9]上,经作者许可转载。 + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/rust-programmer + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OSDC_IntroOS_520x292_FINAL.png?itok=woiZamgj (name tag that says hello my name is open source) +[2]: https://opensource.com/article/20/6/why-rust +[3]: https://foundation.rust-lang.org/ +[4]: https://foundation.rust-lang.org/posts/2021-02-08-hello-world/ +[5]: https://opensource.com/article/19/7/open-source-browsers +[6]: https://www.thefeedbackloop.xyz/safety-is-rusts-fireflower/ +[7]: https://knowyourmeme.com/memes/clippy +[8]: https://opensource.com/article/20/11/commands-rusts-cargo +[9]: https://aliceevebob.com/2021/02/09/5-signs-that-you-may-be-a-rust-programmer/ From 3e37c87ac294737cde9601f7da38a912980e0c1d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:02:31 +0800 Subject: [PATCH 040/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407=20?= =?UTF-8?q?Using=20network=20bound=20disk=20encryption=20with=20Stratis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Using network bound disk encryption with Stratis.md --- ...work bound disk encryption with Stratis.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20210407 Using network bound disk encryption with Stratis.md diff --git a/sources/tech/20210407 Using network bound disk encryption with Stratis.md b/sources/tech/20210407 Using network bound disk encryption with Stratis.md new file mode 100644 index 0000000000..becf63e533 --- /dev/null +++ b/sources/tech/20210407 Using network bound disk encryption with Stratis.md @@ -0,0 +1,288 @@ +[#]: subject: (Using network bound disk encryption with Stratis) +[#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) +[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Using network bound disk encryption with Stratis +====== + +![][1] + +Photo by [iMattSmart][2] on [Unsplash][3] + +In an environment with many encrypted disks, unlocking them all is a difficult task. Network bound disk encryption (NBDE) helps automate the process of unlocking Stratis volumes. This is a critical requirement in large environments. Stratis version 2.1 added support for encryption, which was introduced in the article “[Getting started with Stratis encryption][4].” Stratis version 2.3 recently introduced support for Network Bound Disk Encryption (NBDE) when using encrypted Stratis pools, which is the topic of this article. + +The [Stratis website][5] describes Stratis as an “_easy to use local storage management for Linux_.” The  short video [“Managing Storage With Stratis”][6] gives a quick demonstration of the basics. The video was recorded on a Red Hat Enterprise Linux 8 system, however, the concepts shown in the video also apply to Stratis in Fedora Linux. + +### Prerequisites + +This article assumes you are familiar with Stratis, and also Stratis pool encryption. If you aren’t familiar with these topics, refer to this [article][4] and the [Stratis overview video][6] previously mentioned. + +NBDE requires Stratis 2.3 or later. The examples in this article use a pre-release version of Fedora Linux 34. The Fedora Linux 34 final release will include Stratis 2.3. + +### Overview of network bound disk encryption (NBDE) + +One of the main challenges of encrypting storage is having a secure method to unlock the storage again after a system reboot. In large environments, typing in the encryption passphrase manually doesn’t scale well. NBDE addresses this and allows for encrypted storage to be unlocked in an automated manner. + +At a high level, NBDE requires a Tang server in the environment. Client systems (using Clevis Pin) can automatically decrypt storage as long as they can establish a network connection to the Tang server. If there is no network connectivity to the Tang server, the storage would have to be decrypted manually. + +The idea behind this is that the Tang server would only be available on an internal network, thus if the encrypted device is lost or stolen, it would no longer have access to the internal network to connect to the Tang server, therefore would not be automatically decrypted. + +For more information on Tang and Clevis, see the man pages (man tang, man clevis) , the [Tang GitHub page][7], and the [Clevis GitHub page][8]. + +### Setting up the Tang server + +This example uses another Fedora Linux system as the Tang server with a hostname of tang-server. Start by installing the tang package: + +``` +dnf install tang +``` + +Then enable and start the tangd.socket with systemctl: + +``` +systemctl enable tangd.socket --now +``` + +Tang uses TCP port 80, so you also need to open that in the firewall: + +``` +firewall-cmd --add-port=80/tcp --permanent +firewall-cmd --add-port=80/tcp +``` + +Finally, run _tang-show-keys_ to display the output signing key thumbprint. You’ll need this later. + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### Creating the encrypted Stratis Pool + +The previous article on Stratis encryption goes over how to setup an encrypted Stratis pool in detail, so this article won’t cover that in depth. + +The first step is capturing a key that will be used to decrypt the Stratis pool. Even when using NBDE, you need to set this, as it can be used to manually unlock the pool in the event that the NBDE server is unreachable. Capture the pool1 key with the following command: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +Then I’ll create an encrypted Stratis pool (using the pool1key just created) named pool1 using the _/dev/vdb_ device: + +``` +# stratis pool create --key-desc pool1key pool1 /dev/vdb +``` + +Next, create a filesystem in this Stratis pool named filesystem1, create a mount point, mount the filesystem, and create a testfile in it: + +``` +# stratis filesystem create pool1 filesystem1 +# mkdir /filesystem1 +# mount /dev/stratis/pool1/filesystem1 /filesystem1 +# cd /filesystem1 +# echo "this is a test file" > testfile +``` + +### Binding the Stratis pool to the Tang server + +At this point, we have the encrypted Stratis pool created, and also have a filesystem created in the pool. The next step is to bind your Stratis pool to the Tang server that you just setup. Do this with the _stratis pool bind nbde_ command. + +When you make the Tang binding, you need to pass several parameters to the command: + + * the pool name (in this example, pool1) + * the key descriptor name (in this example, pool1key) + * the Tang server name (in this example, ) + + + +Recall that on the Tang server, you previously ran _tang-show-keys_ which showed the Tang output signing key thumbprint is _l3fZGUCmnvKQF_OA6VZF9jf8z2s_. In addition to the previous parameters, you either need to pass this thumbprint with the parameter _–thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s_, or skip the verification of the thumbprint with the _–trust-url_ parameter. **** + +It is more secure to use the _–thumbprint_ parameter. For example: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### Unlocking the Stratis Pool with NBDE + +Next reboot the host, and validate that you can unlock the Stratis pool with NBDE, without requiring the use of the key passphrase. After rebooting the host, the pool is no longer available: + +``` +# stratis pool list +Name Total Physical Properties +``` + +To unlock the pool using NBDE, run the following command: + +``` +# stratis pool unlock clevis +``` + +Note that you did not need to use the key passphrase. This command could be automated to run during the system boot up. + +At this point, the pool is now available: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +You can mount the filesystem and access the file that was previously created: + +``` +# mount /dev/stratis/pool1/filesystem1 /filesystem1/ +# cat /filesystem1/testfile +this is a test file +``` + +### Rotating Tang server keys + +Best practices recommend that you periodically rotate the Tang server keys and update the Stratis client servers to use the new Tang keys. + +To generate new Tang keys, start by logging in to your Tang server and look at the current status of the /var/db/tang directory. Then, run the _tang-show-keys_ command: + +``` +# ls -al /var/db/tang +total 8 +drwx------. 1 tang tang 124 Mar 15 15:51 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +To generate new keys, run tangd-keygen and point it to the /var/db/tang directory: + +``` +# /usr/libexec/tangd-keygen /var/db/tang +``` + +If you look at the /var/db/tang directory again, you will see two new files: + +``` +# ls -al /var/db/tang +total 16 +drwx------. 1 tang tang 248 Mar 22 10:41 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 root root 354 Mar 22 10:41 iyG5HcF01zaPjaGY6L_3WaslJ_E.jwk +-rw-r--r--. 1 root root 349 Mar 22 10:41 jHxerkqARY1Ww_H_8YjQVZ5OHao.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +And if you run _tang-show-keys_, it will show the keys being advertised by Tang: + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +You can prevent the old key (starting with l3fZ) from being advertised by renaming the two original files to be hidden files, starting with a period. With this method, the old key will no longer be advertised, however it will still be usable by any existing clients that haven’t been updated to use the new key. Once all clients have been updated to use the new key, these old key files can be deleted. + +``` +# cd /var/db/tang +# mv hbjJEDXy8G8wynMPqiq8F47nJwo.jwk .hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +# mv l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk .l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +At this point, if you run _tang-show-keys_ again, only the new key is being advertised by Tang: + +``` +# tang-show-keys +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +Next, switch over to your Stratis system and update it to use the new Tang key. Stratis supports doing this while the filesystem(s) are online. + +First, unbind the pool: + +``` +# stratis pool unbind pool1 +``` + +Next, set the key with the original passphrase used when the encrypted pool was created: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +Finally, bind the pool to the Tang server with the updated key thumbprint: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +The Stratis system is now configured to use the updated Tang key. Once any other client systems using the old Tang key have been updated, the two original key files that were renamed to hidden files in the /var/db/tang directory on the Tang server can be backed up and deleted. + +### What if the Tang server is unavailable? + +Next, shutdown the Tang server to simulate it being unavailable, then reboot the Stratis system. + +Again, after the reboot, the Stratis pool is not available: + +``` +# stratis pool list +Name Total Physical Properties +``` + +If you try to unlock it with NBDE, this fails because the Tang server is unavailable: + +``` +# stratis pool unlock clevis +Execution failed: +An iterative command generated one or more errors: The operation 'unlock' on a resource of type pool failed. The following errors occurred: +Partial action "unlock" failed for pool with UUID 4d62f840f2bb4ec9ab53a44b49da3f48: Cryptsetup error: Failed with error: Error: Command failed: cmd: "clevis" "luks" "unlock" "-d" "/dev/vdb" "-n" "stratis-1-private-42142fedcb4c47cea2e2b873c08fcf63-crypt", exit reason: 1 stdout: stderr: /dev/vdb could not be opened. +``` + +At this point, without the Tang server being reachable, the only option to unlock the pool is to use the original key passphrase: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +You can then unlock the pool using the key: + +``` +# stratis pool unlock keyring +``` + +Next, verify the pool was successfully unlocked: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ + +作者:[briansmith][a] +选题:[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/briansmith/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg +[2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ +[5]: https://stratis-storage.github.io/ +[6]: https://www.youtube.com/watch?v=CJu3kmY-f5o +[7]: https://github.com/latchset/tang +[8]: https://github.com/latchset/clevis From 96e79ddf86de4c1dd701058a92a2a78ecd8e3152 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:03:13 +0800 Subject: [PATCH 041/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407=20?= =?UTF-8?q?Why=20I=20love=20using=20bspwm=20for=20my=20Linux=20window=20ma?= =?UTF-8?q?nager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Why I love using bspwm for my Linux window manager.md --- ...using bspwm for my Linux window manager.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210407 Why I love using bspwm for my Linux window manager.md diff --git a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md new file mode 100644 index 0000000000..c3285f24f2 --- /dev/null +++ b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -0,0 +1,114 @@ +[#]: subject: (Why I love using bspwm for my Linux window manager) +[#]: via: (https://opensource.com/article/21/4/bspwm-linux) +[#]: author: (Stephen Adams https://opensource.com/users/stevehnh) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why I love using bspwm for my Linux window manager +====== +Install, configure, and start using the bspwm window manager on Fedora +Linux. +![Tall building with windows][1] + +Some folks like to rearrange furniture. Other folks like to try new shoes or redecorate their bedroom on the regular. Me? I try out Linux desktops. + +After drooling over some of the incredible desktop environments I've seen online, I got curious about one window manager in particular: [bspwm][2]. + +![bspwm desktop][3] + +(Stephen Adams, [CC BY-SA 4.0][4]) + +I've been a fan of the [i3][5] window manager for quite a while, and I enjoy the way everything is laid out and the ease of getting started. But something about bspwm called to me. There are a few reasons I decided to try it out: + + * It is _only_ a window manager. + * It is managed by a few easy-to-configure scripts. + * It supports gaps between windows by default. + + + +The first reason—that it is simply a window manager—is probably the top thing to point out. Like i3, there are no graphical bells and whistles applied by default. You can certainly customize it to your heart's content, but _you_ will be putting in all the work to make it look like you want. That's part of its appeal to me. + +Although it is available on many distributions, my examples use Fedora Linux. + +### Install bspwm + +Bspwm is packaged in most common distributions, so you can install it with your system's package manager. This command also installs [sxkhd][6], a daemon for the X Window System "that reacts to input events by executing commands," and [dmenu][7], a generic X Window menu: + + +``` +`dnf install bspwm sxkhd dmenu` +``` + +Since bspwm is _just_ a window manager, there aren't any built-in shortcuts or keyboard commands. This is where it stands in contrast to something like i3. sxkhd makes it easier to get going. So, go ahead and configure sxkhd before you fire up the window manager for the first time: + + +``` +systemctl start sxkhd +systemctl enable sxkhd +``` + +This enables sxkhd at login, but you also need a configuration with some basic functionality ready to go: + + +``` +`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` +``` + +It's worth taking a look at this file before you get much further, as some commands that the scripts call may not exist on your system. A good example is the `super + Return` shortcut that calls `urxvt`. Change this to your preferred terminal, especially if you do not have urxvt installed: + + +``` +# +# wm independent hotkeys +# +    +# terminal emulator +super + Return +        urxvt +    +# program launcher +super + @space +        dmenu_run +``` + +If you are using GDM, LightDM, or another display manager, just choose bspwm before logging in. + +### Configure bspwm + +Once you are logged in, you'll see a whole lot of nothing on the screen. That's not a sense of emptiness you feel. It's possibility! You are now ready to start fiddling with all the parts of a desktop environment that you have taken for granted all these years. Building from scratch is not easy, but it's very rewarding once you get the hang of it. + +The most difficult thing about any window manager is getting a handle on the shortcuts. You're going to be slow to start, but in a short time, you'll be flying around your system using your keyboard alone and looking like an ultimate hacker to your friends and family. + +You can tailor the system as much as you want by editing `~/.config/bspwm/bspwmrc` to add apps at launch, set up your desktops and monitors, and set rules for how your windows should behave. There are a few examples set by default to get you going. Keyboard shortcuts are all managed by the **sxkhdrc** file. + +There are plenty more open source projects to install to really get things looking nice—like [Feh][8] for desktop backgrounds, [Polybar][9] for that all-important status bar, [Rofi][10] to really help your app launcher pop, and [Compton][11] to give you the shadows and transparency to get things nice and shiny. + +Happy hacking! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/bspwm-linux + +作者:[Stephen Adams][a] +选题:[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/stevehnh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/baskerville/bspwm +[3]: https://opensource.com/sites/default/files/uploads/bspwm-desktop.png (bspwm desktop) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://i3wm.org/ +[6]: https://github.com/baskerville/sxhkd +[7]: https://linux.die.net/man/1/dmenu +[8]: https://github.com/derf/feh +[9]: https://github.com/polybar/polybar +[10]: https://github.com/davatorium/rofi +[11]: https://github.com/chjj/compton From 461e49c19897e663358126f7e571539cd52a16ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:03:25 +0800 Subject: [PATCH 042/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407=20?= =?UTF-8?q?What=20is=20Git=20cherry-picking=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 What is Git cherry-picking.md --- .../20210407 What is Git cherry-picking.md | 200 ++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 sources/tech/20210407 What is Git cherry-picking.md diff --git a/sources/tech/20210407 What is Git cherry-picking.md b/sources/tech/20210407 What is Git cherry-picking.md new file mode 100644 index 0000000000..99e809440b --- /dev/null +++ b/sources/tech/20210407 What is Git cherry-picking.md @@ -0,0 +1,200 @@ +[#]: subject: (What is Git cherry-picking?) +[#]: via: (https://opensource.com/article/21/4/cherry-picking-git) +[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What is Git cherry-picking? +====== +Learn the what, why, and how of the git cherry-pick command. +![Measuring and baking a cherry pie recipe][1] + +Whenever you're working with a group of programmers on a project, whether small or large, handling changes between multiple Git branches can become difficult. Sometimes, instead of combining an entire Git branch into a different one, you want to select and move a couple of specific commits. This procedure is known as "cherry-picking." + +This article will cover the what, why, and how of cherry-picking. + +So let's start. + +### What is cherry-pick? + +With the `cherry-pick` command, Git lets you incorporate selected individual commits from any branch into your current [Git HEAD][2] branch. + +When performing a `git merge` or `git rebase`, all the commits from a branch are combined. The `cherry-pick` command allows you to select individual commits for integration. + +### Benefits of cherry-pick + +The following situation might make it easier to comprehend the way cherry-picking functions. + +Imagine you are implementing new features for your upcoming weekly sprint. When your code is ready, you will push it into the remote branch, ready for testing. + +However, the customer is not delighted with all of the modifications and requests that you present only certain ones. Because the client hasn't approved all changes for the next launch, `git rebase` wouldn't create the desired results. Why? Because `git rebase` or `git merge` will incorporate every adjustment from the last sprint. + +Cherry-picking is the answer! Because it focuses only on the changes added in the commit, cherry-picking brings in only the approved changes without adding other commits. + +There are several other reasons to use cherry-picking: + + * It is essential for bug fixing because bugs are set in the development branch using their commits. + * You can avoid unnecessary battles by using `git cherry-pick` instead of other options that apply changes in the specified commits, e.g., `git diff`. + * It is a useful tool if a full branch unite is impossible because of incompatible versions in the various Git branches. + + + +### Using the cherry-pick command + +In the `cherry-pick` command's simplest form, you can just use the [SHA][3] identifier for the commit you want to integrate into your current HEAD branch. + +To get the commit hash, you can use the `git log` command: + + +``` +`$ git log --oneline` +``` + +Once you know the commit hash, you can use the `cherry-pick` command. + +The syntax is: + + +``` +`$ git cherry-pick ` +``` + +For example: + + +``` +`$ git cherry-pick 65be1e5` +``` + +This will dedicate the specified change to your currently checked-out branch. + +If you'd like to make further modifications, you can also instruct Git to add commit changes to your working copy. + +The syntax is: + + +``` +`$ git cherry-pick --no-commit` +``` + +For example: + + +``` +`$ git cherry-pick 65be1e5 --no-commit` +``` + +If you would like to select more than one commit simultaneously, add their commit hashes separated by a space: + + +``` +`$ git cherry-pick hash1 hash3` +``` + +When cherry-picking commits, you can't use the `git pull` command because it fetches _and_ automatically merges commits from one repository into another. The `cherry-pick` command is a tool you use to specifically not do that; instead, use `git fetch`, which fetches commits but does not apply them. There's no doubt that `git pull` is convenient, but it's imprecise. + +### Try it yourself + +To try the process, launch a terminal and generate a sample project: + + +``` +$ mkdir fruit.git +$ cd fruit.git +$ git init . +``` + +Create some data and commit it: + + +``` +$ echo "Kiwifruit" > fruit.txt +$ git add fruit.txt +$ git commit -m 'First commit' +``` + +Now, represent a remote developer by creating a fork of your project: + + +``` +$ mkdir ~/fruit.fork +$ cd !$ +$ echo "Strawberry" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a fruit" +``` + +That's a valid commit. Now, create a bad commit to represent something you wouldn't want to merge into your project: + + +``` +$ echo "Rhubarb" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a vegetable that tastes like a fruit" +``` + +Return to your authoritative repo and fetch the commits from your imaginary developer: + + +``` +$ cd ~/fruit.git +$ git remote add dev ~/fruit.fork +$ git fetch dev +remote: Counting objects: 6, done. +remote: Compressing objects: 100% (2/2), done. +remote: Total 6 (delta 0), reused 0 (delta 0) +Unpacking objects: 100% (6/6), done... + +[/code] [code] + +$ git log –oneline dev/master +e858ab2 Added a vegetable that tastes like a fruit +0664292 Added a fruit +b56e0f8 First commit +``` + +You've fetched the commits from your imaginary developer, but you haven't merged them into your repository yet. You want to accept the second commit but not the third, so use `cherry-pick`: + + +``` +`$ git cherry-pick 0664292` +``` + +The second commit is now in your repository: + + +``` +$ cat fruit.txt +Kiwifruit +Strawberry +``` + +Push your changes to your remote server, and you're done! + +### Reasons to avoid cherry-picking + +Cherry-picking is usually discouraged in the developer community. The primary reason is that it creates duplicate commits, but you also lose the ability to track your commit history. + +If you're cherry-picking a lot of commits out of order, those commits will be recorded in your branch, and it might lead to undesirable results in your Git branch. + +Cherry-picking is a powerful command that might cause problems if it's used without a proper understanding of what might occur. However, it may save your life (or at least your day job) when you mess up and make commits to the wrong branches. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cherry-picking-git + +作者:[Rajeev Bera][a] +选题:[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/acompiler +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://acompiler.com/git-head/ +[3]: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms From b88994792dcb966ebef5a431398cc792a7b3d22d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 8 Apr 2021 05:03:40 +0800 Subject: [PATCH 043/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210407=20?= =?UTF-8?q?Get=20started=20with=20batch=20files=20in=20FreeDOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210407 Get started with batch files in FreeDOS.md --- ...Get started with batch files in FreeDOS.md | 225 ++++++++++++++++++ 1 file changed, 225 insertions(+) create mode 100644 sources/tech/20210407 Get started with batch files in FreeDOS.md diff --git a/sources/tech/20210407 Get started with batch files in FreeDOS.md b/sources/tech/20210407 Get started with batch files in FreeDOS.md new file mode 100644 index 0000000000..35773d3a1c --- /dev/null +++ b/sources/tech/20210407 Get started with batch files in FreeDOS.md @@ -0,0 +1,225 @@ +[#]: subject: (Get started with batch files in FreeDOS) +[#]: via: (https://opensource.com/article/21/3/batch-files-freedos) +[#]: author: (Kevin O'Brien https://opensource.com/users/ahuka) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Get started with batch files in FreeDOS +====== +Batch files are a great way to write your own simple programs and +automate tasks that normally require lots of typing. +![Computer screen with files or windows open][1] + +On Linux, it's common to create _shell scripts_ to automate repetitive tasks. Similarly, on [FreeDOS][2], the open source implementation of old DOS operating systems, you can create a _batch file_ containing several FreeDOS commands. Then you can run your batch file to execute each command in order. + +You create a batch file by using an ASCII text editor, such as the FreeDOS Edit application. Once you create a batch file, you save it with a file name and the extension `.bat`. The file name should be unique. If you use a FreeDOS command name as your own file name, the FreeDOS command probably will execute instead of your batch file. + +Virtually all internal and external FreeDOS commands can be used in a batch file. When you create a batch file, you are essentially writing a program. FreeDOS batch files may not have the power of a structured programming language, but they can be very handy for quick but repetitive tasks. + +### Commenting your code + +The No. 1 good habit for any programmer to learn is to put comments in a program to explain what the code is doing. This is a very good thing to do, but you need to be careful not to fool the operating system into executing your comments. The way to avoid this is to place `REM` (short for "remark") at the beginning of a comment line. + +FreeDOS ignores lines starting with `REM`. But anyone who looks at the source code (the text you've written in your batch file) can read your comments and understand what it's doing. This is also a way to temporarily disable a command without deleting it. Just open your batch file for editing, place `REM` at the beginning of the line you want to disable, and save it. When you want to re-enable that command, just open the file for editing and remove `REM`. This technique is sometimes referred to as "commenting out" a command. + +### Get set up + +Before you start writing your own batch files, I suggest creating a temporary directory in FreeDOS. This can be a safe space for you to play around with batch files without accidentally deleting, moving, or renaming important system files or directories. On FreeDOS, you [create a directory][3] with the `MD` command: + + +``` +C:\>MD TEMP +C:\>CD TEMP +C:\TEMP> +``` + +The `ECHO` FreeDOS command controls what is shown on the screen when you run a batch file. For instance, here is a simple one-line batch file: + + +``` +`ECHO Hello world` +``` + +If you create this file and run it, you will see the sentence displayed on the screen. The quickest way to do this is from the command line: Use the `COPY` command to take the input from your keyboard (`CON`) and place it into the file `TEST1.BAT`. Then press **Ctrl**+**Z** to stop the copy process, and press Return or Enter on your keyboard to return to a prompt. + +Try creating this file as `TEST1.BAT` in your temporary directory, and then run it: + + +``` +C:\TEMP>COPY CON TEST1.BAT +CON => TEST1.BAT +ECHO Hello world +^Z + +C:\TEMP>TEST1 +Hello world +``` + +This can be useful when you want to display a piece of text. For instance, you might see a message on your screen telling you to wait while a program finishes its task, or in a networked environment, you might see a login message. + +What if you want to display a blank line? You might think that the `ECHO` command all by itself would do the trick, but the `ECHO` command alone asks FreeDOS to respond whether `ECHO` is on or off: + + +``` +C:\TEMP>ECHO +ECHO is on +``` + +The way to get a blank line is to use a `+` sign immediately after `ECHO`: + + +``` +C:\TEMP>ECHO+ + +C:\TEMP> +``` + +### Batch file variables + +A variable is a holding place for information you need your batch file to remember temporarily. This is a vital function of programming because you don't always know what data you want your batch file to use. Here's a simple example to demonstrate. + +Create `TEST3.BAT`: + + +``` +@MD BACKUPS +COPY %1 BACKUPS\%1 +``` + +Variables are signified by the use of the percentage symbol followed by a number, so this batch file creates a `BACKUPS` subdirectory in your current directory and then copies a variable `%1` into a `BACKUPS` folder. What is this variable? That's up to you to decide when you run the batch file: + + +``` +C:\TEMP>TEST3 TEMP1.BAT +TEST1.BAT => BACKUPS\TEST1.BAT +``` + +Your batch file has copied `TEST1.BAT` into a subdirectory called `BACKUPS` because you identified that file as an argument when running your batch file. Your batch file substituted `TEST1.BAT` for `%1`. + +Variables are positional. The variable `%1` is the first argument you provide to your command, while `%2` is the second, and so on. Suppose you create a batch file to list the contents of a directory: + + +``` +`DIR %1` +``` + +Try running it: + + +``` +C:\TEMP>TEST4.BAT C:\HOME +ARTICLES +BIN +CHEATSHEETS +GAMES +DND +``` + +That works as expected. But this fails: + + +``` +C:\TEMP>TEST4.BAT C:\HOME C:\DOCS +ARTICLES +BIN +CHEATSHEETS +GAMES +DND +``` + +If you try that, you get the listing of the first argument (`C:\HOME`) but not of the second (`C:\DOCS`). This is because your batch file is only looking for one variable (`%1`), and besides, the `DIR` command can take only one directory. + +Also, you don't really need to specify a batch file's extension when you run it—unless you are unlucky enough to pick a name for the batch file that matches one of the FreeDOS external commands or something similar. When FreeDOS executes commands, it goes in the following order: + + 1. Internal commands + 2. External commands with the *.COM extension + 3. External commands with the *.EXE extension + 4. Batch files + + + +### Multiple arguments + +OK, now rewrite the `TEST4.BAT` file to use a command that takes two arguments so that you can see how this works. First, create a simple text file called `FILE1.TXT` using the `EDIT` application. Put a sentence of some kind inside (e.g., "Hello world"), and save the file in your `TEMP` working directory. + +Next, use `EDIT` to change your `TEST4.BAT` file: + + +``` +COPY %1 %2   +DIR +``` + +Save it, then execute the command: + + +``` +`C:\TEMP\>TEST4 FILE1.TXT FILE2.TXT` +``` + +Upon running your batch file, you see a directory listing of your `TEMP` directory. Among the files listed, you have `FILE1.TXT` and `FILE2.TXT`, which were created by your batch file. + +### Nested batch files + +Another feature of batch files is that they can be "nested," meaning that one batch file can be called and run inside another batch file. To see how this works, start with a simple pair of batch files. + +The first file is called `NBATCH1.BAT`: + + +``` +@ECHO OFF +ECHO Hello +CALL NBATCH2.BAT   +ECHO world +``` + +The first line (`@ECHO OFF`) quietly tells the batch file to show only the output of the commands (not the commands themselves) when you run it. You probably noticed in previous examples that there was a lot of feedback about what the batch file was doing; in this case, you're permitting your batch file to display only the results. + +The second batch file is called NBATCH2.BAT: + + +``` +`echo from FreeDOS` +``` + +Create both of these files using `EDIT`, and save them in your TEMP subdirectory. Run `NBATCH1.BAT` to see what happens: + + +``` +C:\TEMP\>NBATCH1.BAT   +Hello +from FreeDOS +world +``` + +Your second batch file was executed from within the first by the `CALL` command, which provided the string "from FreeDOS" in the middle of your "Hello world" message. + +### FreeDOS scripting + +Batch files are a great way to write your own simple programs and automate tasks that normally require lots of typing. The more you use FreeDOS, the more familiar you'll become with its commands, and once you know the commands, it's just a matter of listing them in a batch file to make your FreeDOS system make your life easier. Give it a try! + +* * * + +_Some of the information in this article was previously published in [DOS lesson 15: Introduction to batch files][4] and [DOS lesson 17: Batch file variables; nested batch files][5] (both CC BY-SA 4.0)._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/batch-files-freedos + +作者:[Kevin O'Brien][a] +选题:[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/ahuka +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://www.freedos.org/ +[3]: https://opensource.com/article/21/2/freedos-commands-you-need-know +[4]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-15-introduction-to-batch-files/ +[5]: https://www.ahuka.com/dos-lessons-for-self-study-purposes/dos-lesson-17-batch-file-variables-nested-batch-files/ From ae2d18b6f7ad9b33949febdf1e59563e14ae4730 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 8 Apr 2021 08:45:45 +0800 Subject: [PATCH 044/307] translated --- ...the IPython shell and Jupyter notebooks.md | 190 ----------------- ...the IPython shell and Jupyter notebooks.md | 191 ++++++++++++++++++ 2 files changed, 191 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md create mode 100644 translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md diff --git a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md deleted file mode 100644 index 50f09539f1..0000000000 --- a/sources/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: subject: (Why I love using the IPython shell and Jupyter notebooks) -[#]: via: (https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks) -[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why I love using the IPython shell and Jupyter notebooks -====== -Jupyter notebooks take the IPython shell to the next level. -![Computer laptop in space][1] - -The Jupyter project started out as IPython and the IPython Notebook. It was originally a Python-specific interactive shell and notebook environment, which later branched out to become language-agnostic, supporting Julia, Python, and R—and potentially anything else. - -![Jupyter][2] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -IPython is a Python shell—similar to what you get when you type `python` or `python3` at the command line—but it's more clever and more helpful. If you've ever typed a multi-line command into the Python shell and wanted to repeat it, you'll understand the frustration of having to scroll through your history one line at a time. With IPython, you can scroll back through whole blocks at a time while still being able to navigate line-by-line and edit parts of those blocks. - -![iPython][4] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It has autocompletion and provides context-aware suggestions: - -![iPython offers suggestions][5] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It pretty-prints by default: - -![iPython pretty prints][6] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It even allows you to run shell commands: - -![IPython shell commands][7] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -It also provides helpful features like adding `?` to an object as a shortcut for running `help()` without breaking your flow: - -![IPython help][8] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -If you're using a virtual environment (see my post on [virtualenvwrapper][9], install it with pip in the environment): - - -``` -`pip install ipython` -``` - -To install it system-wide, you can use apt on Debian, Ubuntu, or Raspberry Pi: - - -``` -`sudo apt install ipython3` -``` - -or with pip: - - -``` -`sudo pip3 install ipython` -``` - -### Jupyter notebooks - -Jupyter notebooks take the IPython shell to the next level. First of all, they're browser-based, not terminal-based. To get started, install `jupyter`. - -If you're using a virtual environment, install it with pip in the environment: - - -``` -`pip install jupyter` -``` - -To install it system-wide, you can use apt on Debian, Ubuntu, or Raspberry Pi: - - -``` -`sudo apt install jupyter-notebook` -``` - -or with pip: - - -``` -`sudo pip3 install jupyter` -``` - -Launch the notebook with: - - -``` -`jupyter notebook` -``` - -This will open in your browser: - -![Jupyter Notebook][10] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can create a new Python 3 notebook using the **New** dropdown: - -![Python 3 in Jupyter Notebook][11] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -Now you can write and execute commands in the `In[ ]` fields. Use **Enter** for a newline within the block and **Shift+Enter** to execute: - -![Executing commands in Jupyter][12] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can edit and rerun blocks. You can reorder them, delete them, copy/paste, and so on. You can run blocks in any order—but be aware that any variables created will be in scope according to the time of execution, rather than the order they appear within the notebook. You can restart and clear output or restart and run all blocks from within the **Kernel** menu. - -Using the `print` function will output every time. But if you only have a single statement that's not assigned or your last statement is unassigned, it will be output anyway: - -![Jupyter output][13] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can even refer to `In` and `Out` as indexable objects: - -![Jupyter output][14] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -All the IPython features are available and are often presented a little nicer, too: - -![Jupyter supports IPython features][15] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -You can even do inline plots using [Matplotlib][16]: - -![Graphing in Jupyter Notebook][17] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -Finally, you can save your notebooks and include them in Git repositories, and if you push to GitHub, they will render as completed notebooks—outputs, graphs, and all (as in [this example][18]): - -![Saving Notebook to GitHub][19] - -(Ben Nuttall, [CC BY-SA 4.0][3]) - -* * * - -_This article originally appeared on Ben Nuttall's [Tooling Tuesday blog][20] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks - -作者:[Ben Nuttall][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bennuttall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) -[2]: https://opensource.com/sites/default/files/uploads/jupyterpreview.png (Jupyter) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/uploads/ipython-loop.png (iPython) -[5]: https://opensource.com/sites/default/files/uploads/ipython-suggest.png (iPython offers suggestions) -[6]: https://opensource.com/sites/default/files/uploads/ipython-pprint.png (iPython pretty prints) -[7]: https://opensource.com/sites/default/files/uploads/ipython-ls.png (IPython shell commands) -[8]: https://opensource.com/sites/default/files/uploads/ipython-help.png (IPython help) -[9]: https://opensource.com/article/21/2/python-virtualenvwrapper -[10]: https://opensource.com/sites/default/files/uploads/jupyter-notebook-1.png (Jupyter Notebook) -[11]: https://opensource.com/sites/default/files/uploads/jupyter-python-notebook.png (Python 3 in Jupyter Notebook) -[12]: https://opensource.com/sites/default/files/uploads/jupyter-loop.png (Executing commands in Jupyter) -[13]: https://opensource.com/sites/default/files/uploads/jupyter-cells.png (Jupyter output) -[14]: https://opensource.com/sites/default/files/uploads/jupyter-cells-2.png (Jupyter output) -[15]: https://opensource.com/sites/default/files/uploads/jupyter-help.png (Jupyter supports IPython features) -[16]: https://matplotlib.org/ -[17]: https://opensource.com/sites/default/files/uploads/jupyter-graph.png (Graphing in Jupyter Notebook) -[18]: https://github.com/piwheels/stats/blob/master/2020.ipynb -[19]: https://opensource.com/sites/default/files/uploads/savenotebooks.png (Saving Notebook to GitHub) -[20]: https://tooling.bennuttall.com/the-ipython-shell-and-jupyter-notebooks/ diff --git a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md new file mode 100644 index 0000000000..4a4b4cbbd6 --- /dev/null +++ b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -0,0 +1,191 @@ +[#]: subject: (Why I love using the IPython shell and Jupyter notebooks) +[#]: via: (https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks) +[#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +为什么我喜欢使用 IPython shell 和 Jupyter Notebook +====== +Jupyter Notebook 将IPython shell 提升到一个新的高度。 +![Computer laptop in space][1] + +Jupyter 项目最初是以 IPython 和 IPython Notebook 的形式出现的。它最初是一个专门针对 Python 的交互式 shell 和笔记本环境,后来扩展为不分语言的环境,支持 Julia、Python 和 R,以及其他任何语言。 + +![Jupyter][2] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +IPython 是一个 Python shell,类似于你在命令行输入 `python` 或者 `python3` 时看到的,但它更聪明,更有用。如果你曾经在 Python shell 中输入过多行命令,并且想重复它,你就会理解每次都要一行一行地滚动浏览历史记录的挫败感。有了 IPython,你可以一次滚动浏览整个块,同时还可以逐行浏览和编辑这些块的部分内容。 + +![iPython][4] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它具有自动补全,并提供上下文感知的建议: + +![iPython offers suggestions][5] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它默认漂亮输出: + +![iPython pretty prints][6] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它甚至允许你运行 shell 命令: + +![IPython shell commands][7] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +它还提供了一些有用的功能,比如将 `?` 添加到对象中,作为运行 `help()` 的快捷方式,而不会破坏你的流程: + +![IPython help][8] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +如果你使用的是虚拟环境(参见我关于 [virtualenvwrapper][9] 的帖子),在环境中用 pip 安装: + + +``` +`pip install ipython` +``` + +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用apt: + + +``` +`sudo apt install ipython3` +``` + +或使用 pip: + + +``` +`sudo pip3 install ipython` +``` + +### Jupyter Notebook + +Jupyter Notebook 将 IPython shell 提升到了一个新的高度。首先,它们是基于浏览器的,而不是基于终端的。要开始使用,请安装 `jupyter`。 + +如果你使用的是虚拟环境,请在环境中使用 pip 进行安装: + + +``` +`pip install jupyter` +``` + +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 apt: + + +``` +`sudo apt install jupyter-notebook` +``` + +或使用 pip: + + +``` +`sudo pip3 install jupyter` +``` + +启动 Notebook: + + +``` +`jupyter notebook` +``` + +这将在你的浏览器中打开: + +![Jupyter Notebook][10] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你可以使用 **New** 下拉菜单创建一个新的 Python 3 Notebook: + +![Python 3 in Jupyter Notebook][11] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +现在你可以在 `In[ ]` 字段中编写和执行命令。使用**回车**在代码块中换行,使用 **Shift+回车**来执行: + +![Executing commands in Jupyter][12] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你可以编辑和重新运行代码块,你可以重新排序、删除,复制/粘贴,等等。你可以以任何顺序运行代码块,但是要注意的是,任何创建的变量的作用域都将根据执行的时间而不是它们在 Notebook 中出现的顺序。你可以在 **Kernel** 菜单中重启并清除输出或重启并运行所有的代码块。 + +使用 `print` 函数每次都会输出。但是如果你有一条没有分配的语句,或者最后一条语句没有分配,那么它总是会输出: + +![Jupyter output][13] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你甚至可以把 `In `和 `Out` 作为可索引对象: + +![Jupyter output][14] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +All the IPython features are available and are often presented a little nicer, too: +所有的 IPython 功能都可以使用,而且通常也会表现得更漂亮一些: + +![Jupyter supports IPython features][15] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +你甚至可以使用 [Matplotlib][16] 进行内联绘图: + +![Graphing in Jupyter Notebook][17] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +最后,你可以保存您的笔记本,并将其包含在 Git 仓库中,如果你将其推送到 GitHub,它们将作为已完成的 Notebook 被渲染:输出、图形和所有一切(如 [本例][18]): + +![Saving Notebook to GitHub][19] + +(Ben Nuttall, [CC BY-SA 4.0][3]) + +* * * + +_本文原载于 Ben Nuttall 的 [Tooling Tuesday 博客][20],经许可后重用。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks + +作者:[Ben Nuttall][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/bennuttall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://opensource.com/sites/default/files/uploads/jupyterpreview.png (Jupyter) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/uploads/ipython-loop.png (iPython) +[5]: https://opensource.com/sites/default/files/uploads/ipython-suggest.png (iPython offers suggestions) +[6]: https://opensource.com/sites/default/files/uploads/ipython-pprint.png (iPython pretty prints) +[7]: https://opensource.com/sites/default/files/uploads/ipython-ls.png (IPython shell commands) +[8]: https://opensource.com/sites/default/files/uploads/ipython-help.png (IPython help) +[9]: https://opensource.com/article/21/2/python-virtualenvwrapper +[10]: https://opensource.com/sites/default/files/uploads/jupyter-notebook-1.png (Jupyter Notebook) +[11]: https://opensource.com/sites/default/files/uploads/jupyter-python-notebook.png (Python 3 in Jupyter Notebook) +[12]: https://opensource.com/sites/default/files/uploads/jupyter-loop.png (Executing commands in Jupyter) +[13]: https://opensource.com/sites/default/files/uploads/jupyter-cells.png (Jupyter output) +[14]: https://opensource.com/sites/default/files/uploads/jupyter-cells-2.png (Jupyter output) +[15]: https://opensource.com/sites/default/files/uploads/jupyter-help.png (Jupyter supports IPython features) +[16]: https://matplotlib.org/ +[17]: https://opensource.com/sites/default/files/uploads/jupyter-graph.png (Graphing in Jupyter Notebook) +[18]: https://github.com/piwheels/stats/blob/master/2020.ipynb +[19]: https://opensource.com/sites/default/files/uploads/savenotebooks.png (Saving Notebook to GitHub) +[20]: https://tooling.bennuttall.com/the-ipython-shell-and-jupyter-notebooks/ From 95f295798d533e26663df3c2656d8c4b8386917e Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 8 Apr 2021 08:57:45 +0800 Subject: [PATCH 045/307] translating --- ...w CPU Details Beautifully in Linux Terminal With CPUFetch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md index 84413537f4..1c151112e0 100644 --- a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/cpufetch/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 01a5d2cb5313bcd3e90c5aace0afee83a5da40b6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 10:21:27 +0800 Subject: [PATCH 046/307] PRF @geekpi --- ...x Dual Boot Setup- Here-s How to Fix it.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md index ec01d190c1..77641d233a 100644 --- a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ b/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -3,16 +3,18 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Windows-Linux 双启动设置中显示时间错误?如何解决这个问题 +如何解决 Windows-Linux 双启动设置中显示时间错误的问题 ====== -如果你[双启动 Windows 和 Ubuntu][1] 或任何其他 Linux 发行版,你可能会注意到两个操作系统之间的时间差异。 +![](https://img.linux.net.cn/data/attachment/album/202104/08/102102xaup3iofozn2uvbf.jpg) -当你[使用 Linux][2] 时,它会显示正确的时间。但当你进入 Windows 时,它显示的时间是错误的。有时,情况正好相反,Linux 显示的是错误的时间,而 Windows 的时间是正确的。 +如果你 [双启动 Windows 和 Ubuntu][1] 或任何其他 Linux 发行版,你可能会注意到两个操作系统之间的时间差异。 + +当你 [使用 Linux][2] 时,它会显示正确的时间。但当你进入 Windows 时,它显示的时间是错误的。有时,情况正好相反,Linux 显示的是错误的时间,而 Windows 的时间是正确的。 特别奇怪的是,因为你已连接到互联网,并且已将日期和时间设置为自动使用。 @@ -38,7 +40,7 @@ timedatectl set-local-rtc 1 让我用例子来解释一下。 -你看我在加尔各答 UTC+5:30 时区。安装后,当我把 [Ubuntu 中的时区][4]]设置为加尔各答时区时,Ubuntu 会把这个时间信息同步到硬件时钟上,但会有 5:30 的偏移,因为对于 Linux 来说它必须是 UTC。 +你看我在加尔各答 UTC+5:30 时区。安装后,当我把 [Ubuntu 中的时区][4] 设置为加尔各答时区时,Ubuntu 会把这个时间信息同步到硬件时钟上,但会有 5:30 的偏移,因为对于 Linux 来说它必须是 UTC。 假设加尔各答时区的当前时间是 15:00,这意味着 UTC 时间是 09:30。 @@ -46,7 +48,7 @@ timedatectl set-local-rtc 1 ![][5] -同样,如果我在 Windows 中通过自动时区和时间按钮来设置正确的时间,你知道会发生什么吗?现在它将在系统上显示正确的时间(15:00),并将此信息(注意图片中的”同步你的时钟“选项)同步到硬件时钟。 +同样,如果我在 Windows 中通过自动时区和时间按钮来设置正确的时间,你知道会发生什么吗?现在它将在系统上显示正确的时间(15:00),并将此信息(注意图片中的“同步你的时钟”选项)同步到硬件时钟。 如果你启动到 Linux,它会从硬件时钟读取时间,而硬件时钟是当地时间(15:00),但由于 Linux 认为它是 UTC 时间,所以它在系统时钟上增加了 5:30 的偏移。现在 Linux 显示的时间是 20:30,比实际时间超出晚了 5:30。 @@ -59,11 +61,9 @@ timedatectl set-local-rtc 1 * 让 Windows 将硬件时钟作为 UTC 时间 * 让 Linux 将硬件时钟作为本地时间 - - 在 Linux 中进行修改是比较容易的,因此我推荐使用第二种方法。 -现在 Ubuntu 和大多数其他 Linux 发行版都使用 systemd,因此你可以使用 timedatectl 命令来更改设置。 +现在 Ubuntu 和大多数其他 Linux 发行版都使用 systemd,因此你可以使用 `timedatectl` 命令来更改设置。 你要做的是告诉你的 Linux 系统将硬件时钟(RTC)作为本地时间。你可以通过 `set-local-rtc` (为 RTC 设置本地时间)选项来实现: @@ -90,7 +90,7 @@ via: https://itsfoss.com/wrong-time-dual-boot/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e2e4701675065589884d32fe229742f7c715bb27 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 10:24:24 +0800 Subject: [PATCH 047/307] PUB @geekpi https://linux.cn/article-13276-1.html --- ... in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md (98%) diff --git a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md b/published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md similarity index 98% rename from translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md rename to published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md index 77641d233a..625e7d9362 100644 --- a/translated/tech/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md +++ b/published/20210401 Wrong Time Displayed in Windows-Linux Dual Boot Setup- Here-s How to Fix it.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13276-1.html) 如何解决 Windows-Linux 双启动设置中显示时间错误的问题 ====== From 69b6af15c80ffe3525e8499f57896a46a1967e10 Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Thu, 8 Apr 2021 11:09:31 +0800 Subject: [PATCH 048/307] =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 4bce68f512..0a6589a01b 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (max27149) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[max27149](https://github.com/max27149) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 366f1e7c34003bf7d5fec9f39436124e67e73930 Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Thu, 8 Apr 2021 11:15:49 +0800 Subject: [PATCH 049/307] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210218 Not an engineer- Find out where you belong.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index 0a6589a01b..fee015d8b3 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (max27149) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[max27149](https://github.com/imax27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c5e9029b2afba4a1e2144e69f10c5d46e6a1eb28 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 12:52:58 +0800 Subject: [PATCH 050/307] PRF @geekpi --- ...the IPython shell and Jupyter notebooks.md | 98 ++++++------------- 1 file changed, 32 insertions(+), 66 deletions(-) diff --git a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md index 4a4b4cbbd6..56b05f8082 100644 --- a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ b/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -3,158 +3,124 @@ [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -为什么我喜欢使用 IPython shell 和 Jupyter Notebook +为什么我喜欢使用 IPython shell 和 Jupyter 笔记本 ====== -Jupyter Notebook 将IPython shell 提升到一个新的高度。 -![Computer laptop in space][1] -Jupyter 项目最初是以 IPython 和 IPython Notebook 的形式出现的。它最初是一个专门针对 Python 的交互式 shell 和笔记本环境,后来扩展为不分语言的环境,支持 Julia、Python 和 R,以及其他任何语言。 +> Jupyter 笔记本将 IPython shell 提升到一个新的高度。 + +![](https://img.linux.net.cn/data/attachment/album/202104/08/125206uvglkoqzukhfk3uv.jpg) + +Jupyter 项目最初是以 IPython 和 IPython 笔记本的形式出现的。它最初是一个专门针对 Python 的交互式 shell 和笔记本环境,后来扩展为不分语言的环境,支持 Julia、Python 和 R 以及其他任何语言。 ![Jupyter][2] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -IPython 是一个 Python shell,类似于你在命令行输入 `python` 或者 `python3` 时看到的,但它更聪明,更有用。如果你曾经在 Python shell 中输入过多行命令,并且想重复它,你就会理解每次都要一行一行地滚动浏览历史记录的挫败感。有了 IPython,你可以一次滚动浏览整个块,同时还可以逐行浏览和编辑这些块的部分内容。 +IPython 是一个 Python shell,类似于你在命令行输入 `python` 或者 `python3` 时看到的,但它更聪明、更有用。如果你曾经在 Python shell 中输入过多行命令,并且想重复它,你就会理解每次都要一行一行地滚动浏览历史记录的挫败感。有了 IPython,你可以一次滚动浏览整个块,同时还可以逐行浏览和编辑这些块的部分内容。 ![iPython][4] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 它具有自动补全,并提供上下文感知的建议: ![iPython offers suggestions][5] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -它默认漂亮输出: +它默认会整理输出: ![iPython pretty prints][6] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 它甚至允许你运行 shell 命令: ![IPython shell commands][7] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 它还提供了一些有用的功能,比如将 `?` 添加到对象中,作为运行 `help()` 的快捷方式,而不会破坏你的流程: ![IPython help][8] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -如果你使用的是虚拟环境(参见我关于 [virtualenvwrapper][9] 的帖子),在环境中用 pip 安装: - +如果你使用的是虚拟环境(参见我关于 [virtualenvwrapper][9] 的帖子),可以在环境中用 `pip` 安装: ``` -`pip install ipython` +pip install ipython ``` -要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用apt: - +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 `apt`: ``` -`sudo apt install ipython3` +sudo apt install ipython3 ``` -或使用 pip: - +或使用 `pip`: ``` -`sudo pip3 install ipython` +sudo pip3 install ipython ``` -### Jupyter Notebook +### Jupyter 笔记本 -Jupyter Notebook 将 IPython shell 提升到了一个新的高度。首先,它们是基于浏览器的,而不是基于终端的。要开始使用,请安装 `jupyter`。 - -如果你使用的是虚拟环境,请在环境中使用 pip 进行安装: +Jupyter 笔记本将 IPython shell 提升到了一个新的高度。首先,它们是基于浏览器的,而不是基于终端的。要开始使用,请安装 `jupyter`。 +如果你使用的是虚拟环境,请在环境中使用 `pip` 进行安装: ``` -`pip install jupyter` +pip install jupyter ``` -要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 apt: - +要在全系统范围内安装,你可以在 Debian、Ubuntu 或树莓派上使用 `apt`: ``` -`sudo apt install jupyter-notebook` +sudo apt install jupyter-notebook ``` -或使用 pip: - +或使用 `pip`: ``` -`sudo pip3 install jupyter` +sudo pip3 install jupyter ``` -启动 Notebook: - +启动笔记本: ``` -`jupyter notebook` +jupyter notebook ``` 这将在你的浏览器中打开: ![Jupyter Notebook][10] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -你可以使用 **New** 下拉菜单创建一个新的 Python 3 Notebook: +你可以使用 “New” 下拉菜单创建一个新的 Python 3 笔记本: ![Python 3 in Jupyter Notebook][11] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -现在你可以在 `In[ ]` 字段中编写和执行命令。使用**回车**在代码块中换行,使用 **Shift+回车**来执行: +现在你可以在 `In[ ]` 字段中编写和执行命令。使用 `Enter` 在代码块中换行,使用 `Shift+Enter` 来执行: ![Executing commands in Jupyter][12] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -你可以编辑和重新运行代码块,你可以重新排序、删除,复制/粘贴,等等。你可以以任何顺序运行代码块,但是要注意的是,任何创建的变量的作用域都将根据执行的时间而不是它们在 Notebook 中出现的顺序。你可以在 **Kernel** 菜单中重启并清除输出或重启并运行所有的代码块。 +你可以编辑和重新运行代码块,你可以重新排序、删除,复制/粘贴,等等。你可以以任何顺序运行代码块,但是要注意的是,任何创建的变量的作用域都将根据执行的时间而不是它们在笔记本中出现的顺序。你可以在 “Kernel” 菜单中重启并清除输出或重启并运行所有的代码块。 使用 `print` 函数每次都会输出。但是如果你有一条没有分配的语句,或者最后一条语句没有分配,那么它总是会输出: ![Jupyter output][13] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -你甚至可以把 `In `和 `Out` 作为可索引对象: +你甚至可以把 `In` 和 `Out` 作为可索引对象: ![Jupyter output][14] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -All the IPython features are available and are often presented a little nicer, too: 所有的 IPython 功能都可以使用,而且通常也会表现得更漂亮一些: ![Jupyter supports IPython features][15] -(Ben Nuttall, [CC BY-SA 4.0][3]) - 你甚至可以使用 [Matplotlib][16] 进行内联绘图: ![Graphing in Jupyter Notebook][17] -(Ben Nuttall, [CC BY-SA 4.0][3]) - -最后,你可以保存您的笔记本,并将其包含在 Git 仓库中,如果你将其推送到 GitHub,它们将作为已完成的 Notebook 被渲染:输出、图形和所有一切(如 [本例][18]): +最后,你可以保存你的笔记本,并将其包含在 Git 仓库中,如果你将其推送到 GitHub,它们将作为已完成的笔记本被渲染:输出、图形和所有一切(如 [本例][18]): ![Saving Notebook to GitHub][19] -(Ben Nuttall, [CC BY-SA 4.0][3]) - * * * -_本文原载于 Ben Nuttall 的 [Tooling Tuesday 博客][20],经许可后重用。_ +本文原载于 Ben Nuttall 的 [Tooling Tuesday 博客][20],经许可后重用。 -------------------------------------------------------------------------------- @@ -163,7 +129,7 @@ via: https://opensource.com/article/21/3/ipython-shell-jupyter-notebooks 作者:[Ben Nuttall][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 92c0391f238b13553f1620dd7746800274738322 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 12:54:04 +0800 Subject: [PATCH 051/307] PUB @geekpi https://linux.cn/article-13277-1.html --- ...hy I love using the IPython shell and Jupyter notebooks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210329 Why I love using the IPython shell and Jupyter notebooks.md (98%) diff --git a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md b/published/20210329 Why I love using the IPython shell and Jupyter notebooks.md similarity index 98% rename from translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md rename to published/20210329 Why I love using the IPython shell and Jupyter notebooks.md index 56b05f8082..269735322f 100644 --- a/translated/tech/20210329 Why I love using the IPython shell and Jupyter notebooks.md +++ b/published/20210329 Why I love using the IPython shell and Jupyter notebooks.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13277-1.html) 为什么我喜欢使用 IPython shell 和 Jupyter 笔记本 ====== From 8b4bc1043f9c823e7032d774aaf3b6cc697c4fcd Mon Sep 17 00:00:00 2001 From: max27149 <1478026873@qq.com> Date: Thu, 8 Apr 2021 14:07:04 +0800 Subject: [PATCH 052/307] =?UTF-8?q?=E5=8E=9F=E6=96=87=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talk/20210218 Not an engineer- Find out where you belong.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210218 Not an engineer- Find out where you belong.md b/sources/talk/20210218 Not an engineer- Find out where you belong.md index fee015d8b3..4bce68f512 100644 --- a/sources/talk/20210218 Not an engineer- Find out where you belong.md +++ b/sources/talk/20210218 Not an engineer- Find out where you belong.md @@ -85,7 +85,7 @@ via: https://opensource.com/article/21/2/advice-non-technical 作者:[Dawn Parzych][a] 选题:[lujun9972][b] -译者:[max27149](https://github.com/imax27149) +译者:[max27149](https://github.com/max27149) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 08eb0b0d40c9dddcaaa7d35b493654e5636a12d2 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Thu, 8 Apr 2021 21:28:11 +0800 Subject: [PATCH 053/307] translation completed Find what changed in a Git commit translation is completed --- ...10401 Find what changed in a Git commit.md | 136 ------------------ ...10401 Find what changed in a Git commit.md | 136 ++++++++++++++++++ 2 files changed, 136 insertions(+), 136 deletions(-) delete mode 100644 sources/tech/20210401 Find what changed in a Git commit.md create mode 100644 translated/tech/20210401 Find what changed in a Git commit.md diff --git a/sources/tech/20210401 Find what changed in a Git commit.md b/sources/tech/20210401 Find what changed in a Git commit.md deleted file mode 100644 index 19b5308d88..0000000000 --- a/sources/tech/20210401 Find what changed in a Git commit.md +++ /dev/null @@ -1,136 +0,0 @@ -[#]: subject: (Find what changed in a Git commit) -[#]: via: (https://opensource.com/article/21/4/git-whatchanged) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Find what changed in a Git commit -====== -Git offers several ways you can quickly see which files changed in a -commit. -![Code going into a computer.][1] - -If you use Git every day, you probably make a lot of commits. If you're using Git every day in a project with other people, it's safe to assume that _everyone_ is making lots of commits. Every day. And this means you're aware of how disorienting a Git log can become, with a seemingly eternal scroll of changes and no sign of what's been changed. - -So how do you find out what file changed in a specific commit? It's easier than you think. - -### Find what file changed in a commit - -To find out which files changed in a given commit, use the `git log --raw` command. It's the fastest and simplest way to get insight into which files a commit affects. The `git log` command is underutilized in general, largely because it has so many formatting options, and many users get overwhelmed by too many choices and, in some cases, unclear documentation. - -The log mechanism in Git is surprisingly flexible, though, and the `--raw` option provides a log of commits in your current branch, plus a list of each file that had changes made to it. - -Here's the output of a standard `git log`: - - -``` -$ git log -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 - -    exit immediately from failed download - -commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 - -    export makeopts from etc/example.conf - -commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 - -    fix typo in help message -``` - -Even when the author helpfully specifies in the commit message which files changed, the log is fairly terse. - -Here's the output of `git log --raw`: - - -``` -$ git log --raw -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 - -    exit immediately from failed download - -:100755 100755 cbcf1f3 4cac92f M        src/example.lua - -commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 - -    export makeopts from etc/example.conf -    -:100755 100755 4c815c0 cbcf1f3 M     src/example.lua -:100755 100755 71653e1 8f5d5a6 M     src/example.spec -:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default - -commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 - -    fix typo in help message - -:100755 100755 e253aaf 4c815c0 M        src/example.lua -``` - -This tells you exactly which file was added to the commit and how the file was changed (`A` for added, `M` for modified, `R` for renamed, and `D` for deleted). - -### Git whatchanged - -The `git whatchanged` command is a legacy command that predates the log function. Its documentation says you're not meant to use it in favor of `git log --raw` and implies it's essentially deprecated. However, I still find it a useful shortcut to (mostly) the same output (although merge commits are excluded), and I anticipate creating an alias for it should it ever be removed. If you don't need to merge commits in your log (and you probably don't, if you're only looking to see files that changed), try `git whatchanged` as an easy mnemonic. - -### View changes - -Not only can you see which files changed, but you can also make `git log` display exactly what changed in the files. Your Git log can produce an inline diff, a line-by-line display of all changes for each file, with the `--patch` option: - - -``` -commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) -Author: Tux <[Tux@example.com][3]> -Date:   Wed Mar 10 06:46:58 2021 +1300 - -    commit - -diff --git a/hello.txt b/hello.txt -index 65a56c3..36a0a7d 100644 -\--- a/hello.txt -+++ b/hello.txt -@@ -1,2 +1,2 @@ - Hello --world -+opensource.com -``` - -In this example, the one-word line "world" was removed from `hello.txt` and the new line "opensource.com" was added. - -These patches can be used with common Unix utilities like [diff and patch][4], should you need to make the same changes manually elsewhere. The patches are also a good way to summarize the important parts of what new information a specific commit introduces. This is an invaluable overview when you've introduced a bug during a sprint. To find the cause of the error faster, you can ignore the parts of a file that didn't change and review just the new code. - -### Simple commands for complex results - -You don't have to understand refs and branches and commit hashes to view what files changed in a commit. Your Git log was designed to report Git activity to you, and if you want to format it in a specific way or extract specific information, it's often a matter of wading through many screens of documentation to put together the right command. Luckily, one of the most common requests about Git history is available with just one or two options: `--raw` and `--patch`. And if you can't remember `--raw`, just think, "Git, what changed?" and type `git whatchanged`. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-whatchanged - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) -[2]: mailto:tux@example.com -[3]: mailto:Tux@example.com -[4]: https://opensource.com/article/18/8/diffs-patches diff --git a/translated/tech/20210401 Find what changed in a Git commit.md b/translated/tech/20210401 Find what changed in a Git commit.md new file mode 100644 index 0000000000..f95ac5cb4b --- /dev/null +++ b/translated/tech/20210401 Find what changed in a Git commit.md @@ -0,0 +1,136 @@ +[#]: subject: (Find what changed in a Git commit) +[#]: via: (https://opensource.com/article/21/4/git-whatchanged) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +查看 Git 提交中发生了什么变化 +====== +Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 +![运行在电脑中的代码][1] + +如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 _每个人_ 每天的提交都是安全的,你会意识到 Git 日志会变得多么混乱,看似不停地滚动变化,却没有任何改变的迹象。 + +那么,你该怎样查看指定提交中文件发生哪些变化?这比你想的容易。 + +### 查看提交中文件发生的变化 + +为了发现指定提交中哪些文件发生变化,可以使用 `git log --raw` 命令。这是发现提交影响哪些文件的最快速、最方便的方法。`git log` 命令不常用,主要是因为它有太多的格式选项,许多用户在面对很多选择以及在一些情况下不明所以的文档时,会望而却步。 + +然而,Git 的日志机制非常灵活,`--raw` 选项提供了当前分支中的提交日志,以及更改的文件列表。 + +以下是标准的 `git log` 输出: + + +``` +$ git log +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux <[tux@example.com][2]> +Date:   Sun Nov 5 21:40:37 2020 +1300 + +    exit immediately from failed download + +commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) +Author: Tux <[tux@example.com][2]> +Date:   Fri Aug 5 02:05:19 2020 +1200 + +    export makeopts from etc/example.conf + +commit 76b7b46dc53ec13316abb49cc7b37914215acd47 +Author: Tux <[tux@example.com][2]> +Date:   Sun Jul 31 21:45:24 2020 +1200 + +    fix typo in help message +``` + +即使作者在提交消息中指定了哪些文件发生变化,日志也相当简洁。 + +以下是 `git log --raw` 输出: + + +``` +$ git log --raw +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux <[tux@example.com][2]> +Date:   Sun Nov 5 21:40:37 2020 +1300 + +    exit immediately from failed download + +:100755 100755 cbcf1f3 4cac92f M        src/example.lua + +commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) +Author: Tux <[tux@example.com][2]> +Date:   Fri Aug 5 02:05:19 2020 +1200 + +    export makeopts from etc/example.conf +    +:100755 100755 4c815c0 cbcf1f3 M     src/example.lua +:100755 100755 71653e1 8f5d5a6 M     src/example.spec +:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default + +commit 76b7b46dc53ec13316abb49cc7b37914215acd47 +Author: Tux <[tux@example.com][2]> +Date:   Sun Jul 31 21:45:24 2020 +1200 + +    fix typo in help message + +:100755 100755 e253aaf 4c815c0 M        src/example.lua +``` + +这会准确告诉你哪个文件被添加到提交中,哪些文件发生改变(`A` 是添加,`M` 是修改,`R` 是重命名,`D` 是删除)。 + +### Git whatchanged + +`git whatchanged` 命令是日志功能之前的遗留命令。文档说用户不应该用该命令支持 `git log --raw`,并且暗示它本质上已经被否决了。除了合并提交,我仍然发现它的输出与 `git log --raw` 的输出大部分相同,它是一个有用的快捷方式。如果它被删除的话,我期望为他创建一个别名。如果你只想查看已更改的文件,不需要在日志中合并提交,可以尝试 `git whatchanged` 作为简单的助记符。 + +### 查看变化 + +你不仅可以看到哪些文件发生更改,还可以使用 `git log` 显示文件中发生了哪些变化。你的 Git 日志可以生成一个内联比较,用 `--patch` 选项可以逐行显示每个文件的所有更改: + + +``` +commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) +Author: Tux <[Tux@example.com][3]> +Date:   Wed Mar 10 06:46:58 2021 +1300 + +    commit + +diff --git a/hello.txt b/hello.txt +index 65a56c3..36a0a7d 100644 +\--- a/hello.txt ++++ b/hello.txt +@@ -1,2 +1,2 @@ + Hello +-world ++opensource.com +``` + +在这个例子中,"world" 这行字从 `hello.txt` 中删掉,"opensource.com" 这行字则添加进去。 + +如果你需要在其他地方手动进行相同的修改,这些补丁patch可以与常见的 Unix 命令一起使用,例如 [diff 与 patch][4]。补丁也是一个好方法,可以总结指定提交中引入新信息的重要部分内容。当你在冲刺阶段引入一个 bug 时,你会发现这里的内容就是非常有价值的概述。为了更快地找到错误的原因,你可以忽略文件中没有更改的部分,只检查新代码。 + + +### 得到复杂结果的简单命令 + +你不必理解引用、分支和提交哈希,就可以查看提交中更改了哪些文件。你的 Git 日志旨在向你报告 Git 活动,如果你想以特定方式格式化它或者提取特定的信息,通常需要费力地浏览许多文档来组合出正确的命令。幸运的是,Git 历史上最常用的请求之一只有一两个选项:`--raw` 与 `--patch`。如果你不记得 `--raw`,就想想“Git,改变什么了?”,然后输入 `git whatchanged`。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-whatchanged + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: mailto:tux@example.com +[3]: mailto:Tux@example.com +[4]: https://opensource.com/article/18/8/diffs-patches From a18038b3ca62efaab68b17d5a12f21df61d1e391 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 21:30:08 +0800 Subject: [PATCH 054/307] APL --- ...20210406 Experiment on your code freely with Git worktree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210406 Experiment on your code freely with Git worktree.md b/sources/tech/20210406 Experiment on your code freely with Git worktree.md index 57f7d57f6b..b4ef73f024 100644 --- a/sources/tech/20210406 Experiment on your code freely with Git worktree.md +++ b/sources/tech/20210406 Experiment on your code freely with Git worktree.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-worktree) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3f31ea578401ee930f7ded8087a889abb37253bd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 22:43:36 +0800 Subject: [PATCH 055/307] TSL&PRF --- ...t on your code freely with Git worktree.md | 144 ------------------ ...t on your code freely with Git worktree.md | 135 ++++++++++++++++ 2 files changed, 135 insertions(+), 144 deletions(-) delete mode 100644 sources/tech/20210406 Experiment on your code freely with Git worktree.md create mode 100644 translated/tech/20210406 Experiment on your code freely with Git worktree.md diff --git a/sources/tech/20210406 Experiment on your code freely with Git worktree.md b/sources/tech/20210406 Experiment on your code freely with Git worktree.md deleted file mode 100644 index b4ef73f024..0000000000 --- a/sources/tech/20210406 Experiment on your code freely with Git worktree.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: subject: (Experiment on your code freely with Git worktree) -[#]: via: (https://opensource.com/article/21/4/git-worktree) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Experiment on your code freely with Git worktree -====== -Get freedom to try things out alongside the security of having a new, -linked clone of your repository if your experiment goes wrong. -![Science lab with beakers][1] - -Git is designed in part to enable experimentation. Once you know that your work is safely being tracked and safe states exist for you to fall back upon if something goes horribly wrong, you're not afraid to try new ideas. Part of the price of innovation, though, is that you're likely to make a mess along the way. Files get renamed, moved, removed, changed, and cut into pieces. New files are introduced. Temporary files that you don't intend to track take up residence in your working directory. - -In short, your workspace becomes a house of cards, balancing precariously between _"it's almost working!"_ and _"oh no, what have I done?"_. So what happens when you need to get your repository back to a known state for an afternoon so that you can get some _real_ work done? The classic commands git branch and [git stash][2] come immediately to mind, but neither is designed to deal, one way or another, with untracked files, and changed file paths and other major shifts can make it confusing to just stash your work away for later. The answer is Git worktree. - -### What is a Git worktree - -A Git worktree is a linked copy of your Git repository, allowing you to have multiple branches checked out at a time. A worktree has a separate path from your main working copy, but it can be in a different state and on a different branch. The advantage of a new worktree in Git is that you can make a change unrelated to your current task, commit the change, and then merge it at a later date, all without disturbing your current work environment. - -The canonical example, straight from the `git-worktree` man page, is that you're working on an exciting new feature for a project when your project manager tells you there's an urgent fix required. The problem is that your working repository (your "worktree") is in disarray because you're developing a major new feature. You don't want to "sneak" the fix into your current sprint, and you don't feel comfortable stashing changes to create a new branch for the fix. Instead, you decide to create a fresh worktree so that you can make the fix there: - - -``` -$ git branch | tee -* dev -trunk -$ git worktree add -b hotfix ~/code/hotfix trunk -Preparing ../hotfix (identifier hotfix) -HEAD is now at 62a2daf commit -``` - -In your `code` directory, you now have a new directory called `hotfix`, which is a Git worktree linked to your main project repository, with its `HEAD` parked at the branch called `trunk`. You can now treat this worktree as if it were your main workspace. You can change directory into it, make the urgent fix, commit it, and eventually remove the worktree: - - -``` -$ cd ~/code/hotfix -$ sed -i 's/teh/the/' hello.txt -$ git commit --all --message 'urgent hot fix' -``` - -Once you've finished your urgent work, you can return to your previous task. You're in control of when your hotfix gets integrated into the main project. For instance, you can push the change directly from its worktree to the project's remote repo: - - -``` -$ git push origin HEAD -$ cd ~/code/myproject -``` - -Or you can archive the worktree as a TAR or ZIP file: - - -``` -$ cd ~/code/myproject -$ git archive --format tar --output hotfix.tar master -``` - -Or you can fetch the changes locally from the separate worktree: - - -``` -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -/home/seth/code/hotfix     09e585d [master] -``` - -From there, you can merge your changes using whatever strategy works best for you and your team. - -### Listing active worktrees - -You can get a list of the worktrees and see what branch each has checked out using the `git worktree list` command: - - -``` -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -/home/seth/code/hotfix     09e585d [master] -``` - -You can use this from within either worktree. Worktrees are always linked (unless you manually move them, breaking Git's ability to locate a worktree, and therefore severing the link). - -### Moving a worktree - -Git tracks the locations and states of a worktree in your project's `.git` directory: - - -``` -$ cat ~/code/myproject/.git/worktrees/hotfix/gitdir -/home/seth/code/hotfix/.git -``` - -If you need to relocate a worktree, you must do that using `git worktree move`; otherwise, when Git tries to update the worktree's status, it fails: - - -``` -$ mkdir ~/Temp -$ git worktree move hotfix ~/Temp -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -/home/seth/Temp/hotfix     09e585d [master] -``` - -### Removing a worktree - -When you're finished with your work, you can remove it with the `remove` subcommand: - - -``` -$ git worktree remove hotfix -$ git worktree list -/home/seth/code/myproject  15fca84 [dev] -``` - -To ensure your `.git` directory is clean, use the `prune` subcommand after removing a worktree: - - -``` -`$ git worktree remove prune` -``` - -### When to use worktrees - -As with many options, whether it's tabs or bookmarks or automatic backups, it's up to you to keep track of the data you generate, or it could get overwhelming. Don't use worktrees so often that you end up with 20 copies of your repo, each in a slightly different state. I find it best to create a worktree, do the task that requires it, commit the work, and then remove the tree. Keep it simple and focused. - -The important thing is that worktrees provide improved flexibility for how you manage a Git repository. Use them when you need them, and never again scramble to preserve your working state just to check something on another branch. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-worktree - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) -[2]: https://opensource.com/article/21/4/git-stash diff --git a/translated/tech/20210406 Experiment on your code freely with Git worktree.md b/translated/tech/20210406 Experiment on your code freely with Git worktree.md new file mode 100644 index 0000000000..ffffba7845 --- /dev/null +++ b/translated/tech/20210406 Experiment on your code freely with Git worktree.md @@ -0,0 +1,135 @@ +[#]: subject: (Experiment on your code freely with Git worktree) +[#]: via: (https://opensource.com/article/21/4/git-worktree) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 Git 工作树对你的代码进行自由实验 +====== + +> 获得自由尝试的权利,同时在你的实验出错时可以安全地拥有一个新的、链接的克隆存储库。 + +![带烧杯的科学实验室][1] + +Git 的设计部分是为了进行实验。如果你知道你的工作会被安全地跟踪,并且在出现严重错误时有安全状态存在,你就不会害怕尝试新的想法。不过,创新的部分代价是,你很可能会在过程中弄得一团糟。文件会被重新命名、移动、删除、更改、切割成碎片;新的文件被引入;你不打算跟踪的临时文件会在你的工作目录中占据一席之地等等。 + +简而言之,你的工作空间变成了纸牌屋,在“快好了!”和“哦,不,我做了什么?”之间岌岌可危地平衡着。那么,当你需要把仓库恢复到下午的一个已知状态,以便完成一些真正的工作时,该怎么办?我立刻想到了 `git branch` 和 [git stash][2] 这两个经典命令,但这两个命令都不是用来处理未被跟踪的文件的,而且文件路径的改变和其他重大的转变也会让人困惑,它们只能把工作藏(`stash`)起来以备后用。解决这个需求的答案是 Git 工作树。 + +### 什么是 Git 工作树 + +Git 工作树是 Git 仓库的一个链接副本,允许你同时签出多个分支。工作树与主工作副本的路径是分开的,它可以处于不同的状态和不同的分支上。在 Git 中新建工作树的好处是,你可以在不干扰当前工作环境的情况下,做出与当前任务无关的修改,提交修改,然后在以后再合并。 + +直接从 `git-worktree` 手册中找到了一个典型的例子:当你正在为一个项目做一个令人兴奋的新功能时,你的项目经理告诉你有一个紧急的修复工作。问题是你的工作仓库(你的“工作树”)处于混乱状态,因为你正在开发一个重要的新功能。你不想在当前的冲刺中“偷偷地”进行修复,而且你也不愿意把变更藏(`stash`)起来,为修复创建一个新的分支。相反,你决定创建一个新的工作树,这样你就可以在那里进行修复: + +``` +$ git branch | tee +* dev +trunk +$ git worktree add -b hotfix ~/code/hotfix trunk +Preparing ../hotfix (identifier hotfix) +HEAD is now at 62a2daf commit +``` + +在你的 `code` 目录中,你现在有一个新的目录叫做 `hotfix`,它是一个与你的主项目仓库相连的 Git 工作树,它的 `HEAD` 停在叫做 `trunk` 的分支上。现在你可以把这个工作树当作你的主工作区来对待。你可以把目录切换到它里面,进行紧急修复、提交、并最终删除这个工作树: + +``` +$ cd ~/code/hotfix +$ sed -i 's/teh/the/' hello.txt +$ git commit --all --message 'urgent hot fix' +``` + +一旦你完成了你的紧急工作,你就可以回到你之前的任务。你可以控制你的热修复何时被集成到主项目中。例如,你可以直接将变更从其工作树推送到项目的远程存储库中: + +``` +$ git push origin HEAD +$ cd ~/code/myproject +``` + +或者你可以将工作树存档为 TAR 或 ZIP 文件: + +``` +$ cd ~/code/myproject +$ git archive --format tar --output hotfix.tar master +``` + +或者你可以从单独的工作树中获取本地的变化: + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +从那里,你可以使用任何最适合你和你的团队的策略合并你的变化。 + +### 列出活动工作树 + +你可以使用 `git worktree list` 命令获得工作树的列表,并查看每个工作树签出的分支: + +``` +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/code/hotfix     09e585d [master] +``` + +你可以在任何一个工作树中使用这个功能。工作树始终是链接的(除非你手动移动它们,破坏 Git 定位工作树的能力,从而切断链接)。 + +### 移动工作树 + +Git 会跟踪项目 `.git` 目录下工作树的位置和状态: + +``` +$ cat ~/code/myproject/.git/worktrees/hotfix/gitdir +/home/seth/code/hotfix/.git +``` + +如果你需要重定位一个工作树,必须使用 `git worktree move`;否则,当 Git 试图更新工作树的状态时,就会失败: + +``` +$ mkdir ~/Temp +$ git worktree move hotfix ~/Temp +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +/home/seth/Temp/hotfix     09e585d [master] +``` + +### 移除工作树 + +当你完成你的工作时,你可以用 `remove` 子命令删除它: + +``` +$ git worktree remove hotfix +$ git worktree list +/home/seth/code/myproject  15fca84 [dev] +``` + +为了确保你的 `.git` 目录是干净的,在删除工作树后使用 `prune` 子命令: + +``` +$ git worktree remove prune +``` + +### 何时使用工作树 + +与许多选项一样,无论是标签还是书签还是自动备份,都要靠你来跟踪你产生的数据,否则可能会变得不堪重负。不要经常使用工作树,要不你最终会有 20 份存储库的副本,每份副本的状态都略有不同。我发现最好是创建一个工作树,做需要它的任务,提交工作,然后删除树。保持简单和专注。 + +重要的是,工作树为你管理 Git 存储库的方式提供了更好的灵活性。在需要的时候使用它们,再也不用为了检查另一个分支上的内容而争先恐后地保存工作状态了。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-worktree + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) +[2]: https://opensource.com/article/21/4/git-stash From 116544e71597ab8ad6a1818c29f1ca14404786b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:16:39 +0800 Subject: [PATCH 056/307] PRF @geekpi --- ...rce tool to monitor variables in Python.md | 72 ++++++++----------- 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md index a2be6f4c97..e4affaa8e8 100644 --- a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md +++ b/translated/tech/20210331 Use this open source tool to monitor variables in Python.md @@ -3,34 +3,34 @@ [#]: author: (Tian Gao https://opensource.com/users/gaogaotiantian) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用这个开源工具来监控 Python 中的变量 ====== -Watchpoints 是一个简单但功能强大的工具,可以帮助你在调试 Python 时监控变量。 -![Looking back with binoculars][1] + +> Watchpoints 是一个简单但功能强大的工具,可以帮助你在调试 Python 时监控变量。 + +![](https://img.linux.net.cn/data/attachment/album/202104/08/231614imw8zqfncz5qwwow.jpg) 在调试代码时,你经常面临着要弄清楚一个变量何时发生变化。如果没有任何高级工具,那么可以选择使用打印语句在期望它们更改时输出变量。然而,这是一种非常低效的方法,因为变量可能在很多地方发生变化,并且不断地将其打印到终端上会产生很大的干扰,而将它们打印到日志文件中则变得很麻烦。 这是一个常见的问题,但现在有一个简单而强大的工具可以帮助你监控变量:[watchpoints][2]。 -[watchpoint 的概念在 C 和 C++ 调试器中很常见][3],用于监控内存,但在 Python 中缺乏相应的工具。`watchpoints` 填补了这个空白。 +[“监视点”的概念在 C 和 C++ 调试器中很常见][3],用于监控内存,但在 Python 中缺乏相应的工具。`watchpoints` 填补了这个空白。 ### 安装 要使用它,你必须先用 `pip` 安装它: - ``` -`$ python3 -m pip install watchpoints` +$ python3 -m pip install watchpoints ``` ### 在Python中使用 watchpoints -对于任何一个你想监控的变量,使用 **watch** 函数对其进行监控。 - +对于任何一个你想监控的变量,使用 `watch` 函数对其进行监控。 ``` from watchpoints import watch @@ -42,16 +42,15 @@ a = 1 当变量发生变化时,它的值就会被打印到**标准输出**: - ``` ====== Watchpoints Triggered ====== Call Stack (most recent call last): -  <module> (my_script.py:5): -> a = 1 + (my_script.py:5): +> a = 1 a: 0 --> +-> 1 ``` @@ -61,25 +60,21 @@ a: * 调用栈。 * 变量的先前值/当前值。 - - 它不仅适用于变量本身,也适用于对象的变化: - ``` from watchpoints import watch a = [] watch(a) -a = {} # Trigger -a["a"] = 2 # Trigger +a = {} # 触发 +a["a"] = 2 # 触发 ``` -当变量 **a** 被重新分配时,回调会被触发,同时当分配给 a 的对象发生变化时也会被触发。 +当变量 `a` 被重新分配时,回调会被触发,同时当分配给 `a` 的对象发生变化时也会被触发。 更有趣的是,监控不受作用域的限制。你可以在任何地方观察变量/对象,而且无论程序在执行什么函数,回调都会被触发。 - ``` from watchpoints import watch @@ -91,26 +86,24 @@ watch(a) func(a) ``` -例如,这段代码打印: - +例如,这段代码打印出: ``` ====== Watchpoints Triggered ====== Call Stack (most recent call last): -  <module> (my_script.py:8): -> func(a) -  func (my_script.py:4): -> var["a"] = 1 + (my_script.py:8): +> func(a) + func (my_script.py:4): +> var["a"] = 1 a: {} --> +-> {'a': 1} ``` -**watch** 函数不仅可以监视一个变量,它也可以监视一个字典或列表的属性和元素。 - +`watch` 函数不仅可以监视一个变量,它也可以监视一个字典或列表的属性和元素。 ``` from watchpoints import watch @@ -121,16 +114,15 @@ class MyObj: obj = MyObj() d = {"a": 0} -watch(obj.a, d["a"]) # Yes you can do this -obj.a = 1 # Trigger -d["a"] = 1 # Trigger +watch(obj.a, d["a"]) # 是的,你可以这样做 +obj.a = 1 # 触发 +d["a"] = 1 # 触发 ``` 这可以帮助你缩小到一些你感兴趣的特定对象。 如果你对输出格式不满意,你可以自定义它。只需定义你自己的回调函数: - ``` watch(a, callback=my_callback) @@ -139,23 +131,21 @@ watch(a, callback=my_callback) watch.config(callback=my_callback) ``` -当触发时,你甚至可以使用 **pdb**: - +当触发时,你甚至可以使用 `pdb`: ``` -`watch.config(pdb=True)` +watch.config(pdb=True) ``` -这与 **breakpoint()** 的行为类似,会给你带来类似调试器的体验。 - -如果你不想在每个文件中都导入这个函数,你可以通过 **install** 函数使其成为全局: +这与 `breakpoint()` 的行为类似,会给你带来类似调试器的体验。 +如果你不想在每个文件中都导入这个函数,你可以通过 `install` 函数使其成为全局: ``` -`watch.install() # or watch.install("func_name") and use it as func_name()` +watch.install() # 或 watch.install("func_name") ,然后以 func_name() 方式使用 ``` -我个人认为,watchpoints 最酷的地方就是使用直观。你对一些数据感兴趣吗?只要”观察“它,你就会知道你的变量何时发生变化。 +我个人认为,`watchpoints` 最酷的地方就是使用直观。你对一些数据感兴趣吗?只要“观察”它,你就会知道你的变量何时发生变化。 ### 尝试 watchpoints @@ -168,7 +158,7 @@ via: https://opensource.com/article/21/4/monitor-debug-python 作者:[Tian Gao][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1fd8fda8494553032a227c629970c80bbeaad4b4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:17:20 +0800 Subject: [PATCH 057/307] PUB @geekpi https://linux.cn/article-13279-1.html --- ...se this open source tool to monitor variables in Python.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210331 Use this open source tool to monitor variables in Python.md (98%) diff --git a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md b/published/20210331 Use this open source tool to monitor variables in Python.md similarity index 98% rename from translated/tech/20210331 Use this open source tool to monitor variables in Python.md rename to published/20210331 Use this open source tool to monitor variables in Python.md index e4affaa8e8..6349b1fe3c 100644 --- a/translated/tech/20210331 Use this open source tool to monitor variables in Python.md +++ b/published/20210331 Use this open source tool to monitor variables in Python.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13279-1.html) 使用这个开源工具来监控 Python 中的变量 ====== From 44040439a858f419894c270b363480a35bede0cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:32:58 +0800 Subject: [PATCH 058/307] PRF @wxy --- ... 5 signs you might be a Rust programmer.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20210303 5 signs you might be a Rust programmer.md b/translated/tech/20210303 5 signs you might be a Rust programmer.md index 582bac6d3e..835b05c6e9 100644 --- a/translated/tech/20210303 5 signs you might be a Rust programmer.md +++ b/translated/tech/20210303 5 signs you might be a Rust programmer.md @@ -3,7 +3,7 @@ [#]: author: (Mike Bursell https://opensource.com/users/mikecamel) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,37 +12,37 @@ > 在我学习 Rust 的过程中,我注意到了 Rust 一族的一些常见行为。 -![name tag that says hello my name is open source][1] +![](https://img.linux.net.cn/data/attachment/album/202104/08/233233asbjasbfuiuosiha.jpg) -我是最近才 [皈依 Rust][2] 的,我大约在 2020 年 4 月底开始学习。但是,像许多皈依者一样,我还是一个热情的布道者。说实话,我也不是一个很好的 Rust 人,因为我的编码风格不是很好,我写的也不是特别符合 Rust 习惯。我猜想这一方面是因为我在写大量代码之前还没有没有真正学完 Rust(其中一些代码又困扰了我),另一方面是因为我并不是那么优秀的程序员。 +我是最近才 [皈依 Rust][2] 的,我大约在是 2020 年 4 月底开始学习的。但是,像许多皈依者一样,我还是一个热情的布道者。说实话,我也不是一个很好的 Rust 人,因为我的编码风格不是很好,我写的也不是特别符合 Rust 习惯。我猜想这一方面是因为我在写大量代码之前还没有没有真正学完 Rust(其中一些代码又困扰了我),另一方面是因为我并不是那么优秀的程序员。 -但我喜欢 Rust,你也应该喜欢。它很友好,比 C 或 C++ 更友好;它为低级系统任务做好了准备,这比 Python 做的更好;而且结构良好,这要超过 Perl;而且,最重要的是,它从设计层面开始,它就是完全开源的,这要比 Java 那些语言好得多。 +但我喜欢 Rust,你也应该喜欢吧。它很友好,比 C 或 C++ 更友好;它为低级系统任务做好了准备,这比 Python 做的更好;而且结构良好,这要超过 Perl;而且,最重要的是,从设计层面开始,它就是完全开源的,这要比 Java 那些语言好得多。 -尽管我缺乏专业知识,但我注意到了一些我认为是许多 Rust 爱好者和程序员的共同点。如果你对以下五个迹象说“是”(其中第一个迹象是由最近的一些令人兴奋的新闻引发的),那么你也可能是一个 Rust 程序员。 +尽管我缺乏专业知识,但我注意到了一些我认为是许多 Rust 爱好者和程序员的共同点。如果你对以下五个迹象点头(其中第一个迹象是由最近的一些令人兴奋的新闻引发的),那么你也可能是一个 Rust 程序员。 ### 1、“基金会”一词会使你兴奋 -对于 Rust 程序员来说,“基金会”一词将不再与艾萨克·阿西莫夫Isaac Asimov关联在一起,而是与新成立的 [Rust 基金会][3] 关联。微软、华为、谷歌、AWS 和Mozilla 正在为该基金会提供了董事(大概也是大部分初始资金),该基金会将负责该语言的各个方面,“预示着 Rust 成为企业生产级技术的到来”,[根据临时执行董事][4] Ashley Williams 说。(顺便说一句,很高兴看到一位女士领导这样一项重大的行业计划。) +对于 Rust 程序员来说,“基金会”一词将不再与艾萨克·阿西莫夫Isaac Asimov关联在一起,而是与新成立的 [Rust 基金会][3] 关联。微软、华为、谷歌、AWS 和Mozilla 为该基金会提供了董事(大概也提供了大部分初始资金),该基金会将负责该语言的各个方面,“预示着 Rust 成为企业生产级技术的到来”,[根据临时执行董事][4] Ashley Williams 说。(顺便说一句,很高兴看到一位女士领导这样一项重大的行业计划。) -该基金会似乎致力于维护 Rust 的理念,并确保每个人都有参与的机会。在许多方面,Rust 都是开源项目的典型示例。并不是说它是完美的(无论是语言还是社区),而是因为似乎有足够的爱好者致力于维护高参与度、低门槛的社区方法,我认为这是许多开源项目的核心。我强烈欢迎此举,我认为此举只会帮助促进 Rust 在未来数年和数月内的采用和成熟。 +该基金会似乎致力于维护 Rust 的理念,并确保每个人都有参与的机会。在许多方面,Rust 都是开源项目的典型示例。并不是说它是完美的(无论是语言还是社区),而是因为似乎有足够的爱好者致力于维护高参与度、低门槛的社区方式,我认为这是许多开源项目的核心。我强烈欢迎此举,我认为这只会帮助促进 Rust 在未来数年和数月内的采用和成熟。 ### 2、你会因为新闻源中提到 Rust 游戏而感到沮丧 -还有一款和电脑有关的东西,也叫做“Rust”,它是一款“只限多玩家的生存电子游戏”。它比 Rust 这个语言更新一些(2013 年宣布,2018 年发布),但我曾经在搜索 Rust 相关的内容时,犯了一个错误,这个名字搜索了游戏。互联网络就是这样的,这意味着我的新闻源现在被这个另类的 Rust 野兽感染了,我现在会从它的影迷和公关人员那里随机得到一些更新消息。这是个低调的烦恼,但我很确定在 Rust(语言)社区中并不是就我一个人这样。我强烈建议,如果你确实想了解更多关于这个计算世界的后起之秀的信息,你可以使用一个提高隐私(我拒绝说 "保护隐私")的 [开源浏览器][5] 来进行研究。 +还有一款和电脑有关的东西,也叫做“Rust”,它是一款“只限多玩家生存类的电子游戏”。它比 Rust 这个语言更新一些(2013 年宣布,2018 年发布),但我曾经在搜索 Rust 相关的内容时,犯了一个错误,用这个名字搜索了游戏。互联网络就是这样的,这意味着我的新闻源现在被这个另类的 Rust 野兽感染了,我现在会从它的影迷和公关人员那里随机得到一些更新消息。这是个低调的烦恼,但我很确定在 Rust(语言)社区中并不是就我一个人这样。我强烈建议,如果你确实想了解更多关于这个计算世界的后起之秀的信息,你可以使用一个提高隐私(我拒绝说 "保护隐私")的 [开源浏览器][5] 来进行研究。 ### 3、“不安全”这个词会让你感到恐惧。 -Rust(语言,再次强调)在帮助你做**正确的事情**™方面做得非常好,当然,在内存安全方面,这是 C 和 C++ 内部的主要关注点(不是因为不可能做到,而是因为真的很难持续正确)。Dave Herman 在 2016 年写了一篇文章,讲述了为什么安全是 Rust 语言的一个积极属性:《[Safety is Rust's fireflower][6]》。安全性(内存、类型安全)可能并不赏心悦目,但随着你写的 Rust 越多,你就会习惯并感激它,尤其是当你参与任何系统编程时,这也是 Rust 经常擅长的地方。 +Rust(语言,再次强调)在帮助你做**正确的事情**™方面做得非常好,当然,在内存安全方面,这是 C 和 C++ 内部的主要关注点(不是因为不可能做到,而是因为真的很难持续正确)。Dave Herman 在 2016 年写了一篇文章《[Safety is Rust's fireflower][6]》,讲述了为什么安全是 Rust 语言的一个积极属性。安全性(内存、类型安全)可能并不赏心悦目,但随着你写的 Rust 越多,你就会习惯并感激它,尤其是当你参与任何系统编程时,这也是 Rust 经常擅长的地方。 -现在,Rust 并不能阻止你做**错误的事情**™,但它确实通过让你使用 `unsafe` 关键字,让你在希望超出安全范围的时候做出一个明智的决定。这不仅对你有好处,因为它(希望)会让你非常、非常仔细地思考你在任何使用它的代码块中放入了什么;它对任何阅读你的代码的人也有好处,这是一个触发词,它能让任何不太清醒的 Rust 人至少微微打起精神,在椅子上坐直,然后想:“嗯,这里发生了什么?我需要特别注意。”如果幸运的话,读你代码的人也许能想到重写它的方法,使它利用到 Rust 的安全特性,或者至少减少了提交和发布的不安全代码的数量。 +现在,Rust 并不能阻止你做**错误的事情**™,但它确实通过让你使用 `unsafe` 关键字,让你在希望超出安全边界的时候做出一个明智的决定。这不仅对你有好处,因为它(希望)会让你非常、非常仔细地思考你在任何使用它的代码块中放入了什么;它对任何阅读你的代码的人也有好处,这是一个触发词,它能让任何不太清醒的 Rust 人至少可以稍微打起精神,在椅子上坐直,然后想:“嗯,这里发生了什么?我需要特别注意。”如果幸运的话,读你代码的人也许能想到重写它的方法,使它利用到 Rust 的安全特性,或者至少减少提交和发布的不安全代码的数量。 ### 4、你想知道为什么没有 `?;`、`{:?}` 、`::<>` 这样的表情符号 -人们喜欢(或讨厌)涡轮鱼(`::<>`),但在 Rust 代码中你经常还会看到其他的语义结构。特别是 `{:?}` (用于字符串格式化)和 `?;`(`?` 是向调用栈传播错误的一种方式,`;` 则是行/块的结束符,所以你经常会看到它们在一起)。它们在 Rust 代码中很常见,你只需边走边学,边走边解析,而且它们也很有用,我有时会想,为什么它们没有被纳入到正常对话中,至少作为表情符号。可能还有其他的。你有什么建议? +人们喜欢(或讨厌)涡轮鱼(`::<>`),但在 Rust 代码中你经常还会看到其他的语义结构。特别是 `{:?}` (用于字符串格式化)和 `?;`(`?` 是向调用栈传播错误的一种方式,`;` 则是行/块的结束符,所以你经常会看到它们在一起)。它们在 Rust 代码中很常见,你只需边走边学,边走边解析,而且它们也很有用,我有时会想,为什么它们没有被纳入到正常对话中,至少可以作为表情符号。可能还有其他的。你有什么建议? ### 5、Clippy 是你的朋友(而不是一个动画回形针) -微软的动画回形针 Clippy 可能是 Office 用户很快就觉得讨厌的“功能”,并成为许多 [模因][7] 的起点。另一方面,`cargo clippy` 是那些 [很棒的 Cargo 命令][8] 之一,应该成为每个 Rust 程序员工具箱的一部分。Clippy 是一个语言整洁器,它可以帮助改进你的代码,使它更干净、更整洁、更易读、更惯用,让你与同事或其他人分享 Rust 代码时,不会感到尴尬。Cargo 可以说是让 “Clippy” 这个名字恢复了声誉,虽然我不会选择给我的孩子起这个名字,但现在每当我在网络上遇到这个词的时候,我不会再有一种不安的感觉。 +微软的动画回形针 Clippy 可能是 Office 用户很快就觉得讨厌的“功能”,并成为许多 [模因][7] 的起点。另一方面,`cargo clippy` 是那些 [很棒的 Cargo 命令][8] 之一,应该成为每个 Rust 程序员工具箱的一部分。Clippy 是一个语言整洁器Linter,它可以帮助改进你的代码,使它更干净、更整洁、更易读、更惯用,让你与同事或其他人分享 Rust 代码时,不会感到尴尬。Cargo 可以说是让 “Clippy” 这个名字恢复了声誉,虽然我不会选择给我的孩子起这个名字,但现在每当我在网络上遇到这个词的时候,我不会再有一种不安的感觉。 * * * @@ -56,7 +56,7 @@ via: https://opensource.com/article/21/3/rust-programmer 作者:[Mike Bursell][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bfa85a6877e8a2a29c15a942a37315d9c51646ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 8 Apr 2021 23:33:35 +0800 Subject: [PATCH 059/307] PUB @wxy https://linux.cn/article-13280-1.html --- .../20210303 5 signs you might be a Rust programmer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210303 5 signs you might be a Rust programmer.md (99%) diff --git a/translated/tech/20210303 5 signs you might be a Rust programmer.md b/published/20210303 5 signs you might be a Rust programmer.md similarity index 99% rename from translated/tech/20210303 5 signs you might be a Rust programmer.md rename to published/20210303 5 signs you might be a Rust programmer.md index 835b05c6e9..a2e2de6079 100644 --- a/translated/tech/20210303 5 signs you might be a Rust programmer.md +++ b/published/20210303 5 signs you might be a Rust programmer.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13280-1.html) 你可能是 Rust 程序员的五个迹象 ====== From 210dcdd4e5740662b0a654517ab20b38e94fb26f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Apr 2021 05:02:38 +0800 Subject: [PATCH 060/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210408=20?= =?UTF-8?q?5=20commands=20to=20level-up=20your=20Git=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210408 5 commands to level-up your Git game.md --- ...08 5 commands to level-up your Git game.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20210408 5 commands to level-up your Git game.md diff --git a/sources/tech/20210408 5 commands to level-up your Git game.md b/sources/tech/20210408 5 commands to level-up your Git game.md new file mode 100644 index 0000000000..50c6eb383b --- /dev/null +++ b/sources/tech/20210408 5 commands to level-up your Git game.md @@ -0,0 +1,67 @@ +[#]: subject: (5 commands to level-up your Git game) +[#]: via: (https://opensource.com/article/21/4/git-commands) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 commands to level-up your Git game +====== +Get more use out of Git by adding these commands to your repertoire. +![Business woman on laptop sitting in front of window][1] + +If you use Git regularly, you might be aware that it has several reputations. It's probably the most popular version-control solution and is used by some of the [biggest software projects][2] around to [keep track of changes][3] to files. It provides a [robust interface][4] to review and incorporate experimental changes into existing documents. It's well-known for its flexibility, thanks to [Git hooks][5]. And partly because of its great power, it has earned its reputation for being complex. + +You don't have to use all of Git's many features, but if you're looking to delve deeper into Git's subcommands, here are some that you might find useful. + +### 1\. Finding out what changed + +If you're familiar with Git's basics (`fetch`, `add`, `commit`, `push`, `log`, and so on) but you want to learn more, Git subcommands that query are a great, safe place to start. Querying your Git repository (your _work tree_) doesn't make any changes; it's only a reporting mechanism. You're not risking the integrity of your Git checkout; you're only asking Git about its status and history. + +The [git whatchanged][6] command (almost a mnemonic itself) is an easy way to see what changed in a commit. A remarkably user-friendly command, it squashes the best features of `show` and `diff-tree` and `log` into one easy-to-remember command. + +### 2\. Managing changes with git stash + +The more you use Git, the more you use Git. That is, once you've become comfortable with the power of Git, the more often you use its powerful features. Sometimes, you may find yourself in the middle of working with a batch of files when you realize some other task is more urgent. With [git stash][7], you can gather up all the pieces of your work in progress and stash them away for safekeeping. With your workspace decluttered, you can turn your attention to some other task and then reapply stashed files to your work tree later to resume work. + +### 3\. Making a linked copy with git worktree + +When `git stash` isn't enough, Git also provides the powerful [git worktree][8] command. With it, you can create a new but _linked_ clone of your repository, forming a new branch and setting `HEAD` to whatever commit you want to base your new work on. In this linked clone, you can work on a task unrelated to what your primary clone is focused on. It's a good way to keep your work in progress safe from unintended changes. When you're finished with your new work tree, you can push your new branch to a remote, bundle the changes into an archive for later, or just fetch the changes from your other tree. Whatever you decide, your workspaces are kept separate, and the changes in one don't have to affect changes in the other until you are ready to merge. + +### 4\. Selecting merges with git cherry-pick + +It may seem counterintuitive, but the better at Git you get, the more merge conflicts you're likely to encounter. That's because merge conflicts aren't necessarily signs of errors but signs of activity. Getting comfortable with merge conflicts and how to resolve them is an important step in learning Git. The usual methods work well, but sometimes you need greater flexibility in how you merge, and for that, there's [git cherry-pick][9]. Cherry-picking merges allows you to be selective in what parts of commits you merge, so you never have to reject a merge request based on a trivial incongruity. + +### 5\. Managing $HOME with Git + +Managing your home directory with Git has never been easier, and thanks to Git's ability to be selective in what it manages, it's a realistic option for keeping your computers in sync. To work well, though, you must do it judiciously. To get started, read my tips on [managing $HOME with Git][10]. + +### Getting better at Git + +Git is a powerful version-control system, and the more comfortable you become with it, the easier it becomes to use it for complex tasks. Try some new Git commands today, and share your favorites in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-commands + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/19/10/how-gnome-uses-git +[3]: https://opensource.com/article/18/2/how-clone-modify-add-delete-git-files +[4]: https://opensource.com/article/18/5/git-branching +[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[6]: https://opensource.com/article/21/3/git-whatchanged +[7]: https://opensource.com/article/21/3/git-stash +[8]: https://opensource.com/article/21/3/git-worktree +[9]: https://opensource.com/article/21/3/reasons-use-cherry-picking +[10]: https://opensource.com/article/21/3/git-your-home From 88135459a69c66d2aa7d2f1032040c25f4447b97 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 9 Apr 2021 05:02:52 +0800 Subject: [PATCH 061/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210408=20?= =?UTF-8?q?Protect=20external=20storage=20with=20this=20Linux=20encryption?= =?UTF-8?q?=20system?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210408 Protect external storage with this Linux encryption system.md --- ...orage with this Linux encryption system.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20210408 Protect external storage with this Linux encryption system.md diff --git a/sources/tech/20210408 Protect external storage with this Linux encryption system.md b/sources/tech/20210408 Protect external storage with this Linux encryption system.md new file mode 100644 index 0000000000..6c3725e1bc --- /dev/null +++ b/sources/tech/20210408 Protect external storage with this Linux encryption system.md @@ -0,0 +1,174 @@ +[#]: subject: (Protect external storage with this Linux encryption system) +[#]: via: (https://opensource.com/article/21/3/encryption-luks) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Protect external storage with this Linux encryption system +====== +Use Linux Unified Key Setup to encrypt your thumb drives, external hard +drives, and other storage from prying eyes. +![A keyboard with privacy written on it.][1] + +Many people consider hard drives secure because they physically own them. It's difficult to read the data on a hard drive that you don't have, and many people think that protecting their computer with a passphrase makes the data on the drive unreadable. + +This isn't always the case, partly because, in some cases, a passphrase serves only to unlock a user session. In other words, you can power on a computer, but because you don't have its passphrase, you can't get to the desktop, and so you have no way to open files to look at them. + +The problem, as many a computer technician understands, is that hard drives can be extracted from computers, and some drives are already external by design (USB thumb drives, for instance), so they can be attached to any computer for full access to the data on them. You don't have to physically separate a drive from its computer host for this trick to work, either. Computers can be [booted from a portable boot drive][2], which separates a drive from its host operating system and turns it into, virtually, an external drive available for reading. + +The answer is to place the data on a drive into a digital vault that can't be opened without information that only you have access to. + +Linux Unified Key Setup ([LUKS][3]) is a disk-encryption system. It provides a generic key store (and associated metadata and recovery aids) in a dedicated area on a disk with the ability to use multiple passphrases (or key files) to unlock a stored key. It's designed to be flexible and can even store metadata externally so that it can be integrated with other tools. The result is full-drive encryption, so you can store all of your data confident that it's safe—even if your drive is separated, either physically or through software, from your computer. + +### Encrypting during installation + +The easiest way to implement full-drive encryption is to select the option during installation. Most modern Linux distributions offer this as an option, so it's usually a trivial process. + +![Encrypt during installation][4] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +This establishes everything you need: an encrypted drive requiring a passphrase before your system can boot. If the drive is extracted from your computer or accessed from another operating system running on your computer, the drive must be decrypted by LUKS before it can be mounted. + +### Encrypting external drives + +It's not common to separate an internal hard drive from its computer, but external drives are designed to travel. As technology gets smaller and smaller, it's easier to put a portable drive on your keychain and carry it around with you every day. The obvious danger, however, is that these are also pretty easy to misplace. I've found abandoned drives in the USB ports of hotel lobby computers, business center printers, classrooms, and even a laundromat. Most of these didn't include personal information, but it's an easy mistake to make. + +You can mitigate against misplacing important data by encrypting your external drives. + +LUKS and its frontend `cryptsetup` provide a way to do this on Linux. As Linux does during installation, you can encrypt the entire drive so that it requires a passphrase to mount it. + +### How to encrypt an external drive with LUKS + +First, you need an empty external drive (or a drive with contents you're willing to erase). This process overwrites all the data on a drive, so if you have data that you want to keep on the drive, _back it up first_. + +#### 1\. Find your drive + +I used a small USB thumb drive. To protect you from accidentally erasing data, the drive referenced in this article is located at the imaginary location `/dev/sdX`. Attach your drive and find its location: + + +``` +$ lsblk +sda    8:0    0 111.8G  0 disk +sda1   8:1    0 111.8G  0 part / +sdb    8:112  1  57.6G  0 disk +sdb1   8:113  1  57.6G  0 part /mydrive +sdX    8:128  1   1.8G  0 disk +sdX1   8:129  1   1.8G  0 part +``` + +I know that my demo drive is located at `/dev/sdX` because I recognize its size (1.8GB), and it's also the last drive I attached (with `sda` being the first, `sdb` the second, `sdc` the third, and so on). The `/dev/sdX1` designator means the drive has 1 partition. + +If you're unsure, remove your drive, look at the output of `lsblk`, and then attach your drive and look at `lsblk` again. + +Make sure you identify the correct drive because encrypting it overwrites _everything on it_. My drive is not empty, but it contains copies of documents I have copies of elsewhere, so losing this data isn't significant to me. + +#### 2\. Clear the drive + +To proceed, destroy the drive's partition table by overwriting the drive's head with zeros: + + +``` +`$ sudo dd if=/dev/zero of=/dev/sdX count=4096` +``` + +This step isn't strictly necessary, but I like to start with a clean slate. + +#### 3\. Format your drive for LUKS + +The `cryptsetup` command is a frontend for managing LUKS volumes. The `luksFormat` subcommand creates a sort of LUKS vault that's password-protected and can house a secured filesystem. + +When you create a LUKS partition, you're warned about overwriting data and then prompted to create a passphrase for your drive: + + +``` +$ sudo cryptsetup luksFormat /dev/sdX +WARNING! +======== +This will overwrite data on /dev/sdX irrevocably. + +Are you sure? (Type uppercase yes): YES +Enter passphrase: +Verify passphrase: +``` + +#### 4\. Open the LUKS volume + +Now you have a fully encrypted vault on your drive. Prying eyes, including your own right now, are kept out of this LUKS partition. So to use it, you must open it with your passphrase. Open the LUKS vault with `cryptsetup open` along with the device location (`/dev/sdX`, in my example) and an arbitrary name for your opened vault: + + +``` +`$ cryptsetup open /dev/sdX vaultdrive` +``` + +I use `vaultdrive` in this example, but you can name your vault anything you want, and you can give it a different name every time you open it. + +LUKS volumes are opened in a special device location called `/dev/mapper`. You can list the files there to check that your vault was added: + + +``` +$ ls /dev/mapper +control  vaultdrive +``` + +You can close a LUKS volume at any time using the `close` subcommand: + + +``` +`$ cryptsetup close vaultdrive` +``` + +This removes the volume from `/dev/mapper`. + +#### 5\. Create a filesystem + +Now that you have your LUKS volume decrypted and open, you must create a filesystem there to store data in it. In my example, I use XFS, but you can use ext4 or JFS or any filesystem you want: + + +``` +`$ sudo mkfs.xfs -f -L myvault /dev/mapper/vaultdrive` +``` + +### Mount and unmount a LUKS volume + +You can mount a LUKS volume from a terminal with the `mount` command. Assume you have a directory called `/mnt/hd` and want to mount your LUKS volume there: + + +``` +$ sudo cryptsetup open /dev/sdX vaultdrive +$ sudo mount /dev/mapper/vaultdrive /mnt/hd +``` + +LUKS also integrates into popular Linux desktops. For instance, when I attach an encrypted drive to my workstation running KDE or my laptop running GNOME, my file manager prompts me for a passphrase before it mounts the drive. + +![LUKS requesting passcode to mount drive][6] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +### Encryption is protection + +Linux makes encryption easier than ever. It's so easy, in fact, that it's nearly unnoticeable. The next time you [format an external drive for Linux][7], consider using LUKS first. It integrates seamlessly with your Linux desktop and protects your important data from accidental exposure. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/encryption-luks + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/privacy_keyboard_security.jpg?itok=vZ9jFdK_ (A keyboard with privacy written on it.) +[2]: https://opensource.com/article/19/6/linux-distros-to-try +[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md +[4]: https://opensource.com/sites/default/files/uploads/centos8-install-encrypt.jpg (Encrypt during installation) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/luks-mount-gui.png (LUKS requesting passcode to mount drive) +[7]: https://opensource.com/article/18/11/partition-format-drive-linux From cf7daa4ccf474e9ae0e871ced87e36744dc7ecf0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 9 Apr 2021 08:44:04 +0800 Subject: [PATCH 062/307] translated --- ...cy-Focused Google Analytics Alternative.md | 92 ------------------- ...cy-Focused Google Analytics Alternative.md | 92 +++++++++++++++++++ 2 files changed, 92 insertions(+), 92 deletions(-) delete mode 100644 sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md create mode 100644 translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md diff --git a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md deleted file mode 100644 index 51938e2449..0000000000 --- a/sources/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: subject: (Plausible: Privacy-Focused Google Analytics Alternative) -[#]: via: (https://itsfoss.com/plausible/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Plausible: Privacy-Focused Google Analytics Alternative -====== - -[Plausible][1] is a simple, privacy-friendly analytics tool. It helps you analyze the number of unique visitors, pageviews, bounce rate and visit duration. - -If you have a website you would probably understand those terms. As a website owner, it helps you know if your site is getting more visitors over the time, from where the traffic is coming and if you have some knowledge on these things, you can work on improving your website for more visits. - -When it comes to website analytics, the one service that rules this domain is the Google’s free tool Google Analytics. Just like Google is the de-facto search engine, Google Analytics is the de-facto analytics tool. But you don’t have to live with it specially if you cannot trust Big tech with your and your site visitor’s data. - -Plausible gives you the freedom from Google Analytics and I am going to discuss this open source project in this article. - -Please mind that some technical terms in the article could be unknown to you if you have never managed a website or bothered about analytics. - -### Plausible for privacy friendly website analytics - -The script used by Plausible for analytics is extremely lightweight with less than 1 KB in size. - -The focus is on preserving the privacy so you get valuable and actionable stats without compromising on the privacy of your visitors. Plausible is one of the rare few analytics tool that doesn’t require cookie banner or GDP consent because it is already [GDPR-compliant][2] on privacy front. That’s super cool. - -In terms of features, it doesn’t have the same level of granularity and details of Google Analytics. Plausible banks on simplicity. It shows a graph of your traffic stats for past 30 days. You may also switch to real time view. - -![][3] - -You can also see where your traffic is coming from and which pages on your website gets the most visits. The sources can also show UTM campaigns. - -![][4] - -You also have the option to enable GeoIP to get some insights about the geographical location of your website visitors. You can also check how many visitors use desktop or mobile device to visit your website. There is also an option for operating system and as you can see, [Linux Handbook][5] gets 48% of its visitors from Windows devices. Pretty strange, right? - -![][6] - -Clearly, the data provided is nowhere close to what Google Analytics can do, but that’s intentional. Plausible intends to provide you simple matrix. - -### Using Plausible: Opt for paid managed hosting or self-host it on your server - -There are two ways you can start using Plausible. Sign up for their official managed hosting. You’ll have to pay for the service and this eventually helps the development of the Plausible project. They do have 30-days trial period and it doesn’t even require any payment information from your side. - -The pricing starts at $6 per month for 10k monthly pageviews. Pricing increases with the number of pageviews. You can calculate the pricing on Plausible website. - -[Plausible Pricing][7] - -You can try it for 30 days and see if you would like to pay to Plausible developers for the service and own your data. - -If you think the pricing is not affordable, you can take the advantage of the fact that Plausible is open source and deploy it yourself. If you are interested, read our [in-depth guide on self-hosting a Plausible instance with Docker][8]. - -At It’s FOSS, we self-host Plausible. Our Plausible instance has three of our websites added. - -![Plausble dashboard for It’s FOSS websites][9] - -If you maintain the website of an open source project and would like to use Plausible, you can contact us through our [High on Cloud project][10]. With High on Cloud, we help small businesses host and use open source software on their servers. - -### Conclusion - -If you are not super obsessed with data and just want a quick glance on how your website is performing, Plausible is a decent choice. I like it because it is lightweight and privacy compliant. That’s the main reason why I use it on Linux Handbook, our [ethical web portal for teaching Linux server related stuff][11]. - -Overall, I am pretty content with Plausible and recommend it to other website owners. - -Do you run or manage a website as well? What tool do you use for the analytics or do you not care about that at all? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/plausible/ - -作者:[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://plausible.io/ -[2]: https://gdpr.eu/compliance/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-graph-lhb.png?resize=800%2C395&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-stats-lhb-2.png?resize=800%2C333&ssl=1 -[5]: https://linuxhandbook.com/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-geo-ip-stats.png?resize=800%2C331&ssl=1 -[7]: https://plausible.io/#pricing -[8]: https://linuxhandbook.com/plausible-deployment-guide/ -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-analytics-for-itsfoss.png?resize=800%2C231&ssl=1 -[10]: https://highoncloud.com/ -[11]: https://linuxhandbook.com/about/#ethical-web-portal diff --git a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md new file mode 100644 index 0000000000..a08e2eac7c --- /dev/null +++ b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -0,0 +1,92 @@ +[#]: subject: (Plausible: Privacy-Focused Google Analytics Alternative) +[#]: via: (https://itsfoss.com/plausible/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Plausible:关注隐私的 Google Analytics 替代方案 +====== + +[Plausible][1]是一款简单的、对隐私友好的分析工具。它可以帮助你分析独立访客数量、页面浏览量、跳出率和访问时间。 + +如果你有一个网站,你可能会理解这些术语。作为一个网站所有者,它可以帮助你知道你的网站是否随着时间的推移获得更多的访问者,流量来自哪里,如果你对这些事情有一定的了解,你可以努力改进你的网站,以获得更多的访问量。 + +说到网站分析,统治这个领域的一个服务就是谷歌的免费工具 Google Analytics。就像 Google 是事实上的搜索引擎一样,Google Analytics 是事实上的分析工具。但你不必再忍受它,尤其是当你无法信任大科技公司使用你和你的网站访问者的数据的时候。 + +Plausible 让你摆脱 Google Analytics 的束缚,我将在本文中讨论这个开源项目。 + +请注意,如果你从来没有管理过网站或对分析感兴趣,文章中的一些技术术语可能对你来说是未知的。 + +### Plausible 是隐私友好的网站分析工具 + +Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 + +其重点在于保护隐私,因此你可以在不影响访客隐私的情况下获得有价值且可操作的统计数据。Plausible 是为数不多的不需要 cookie 横幅或 GDP 同意的分析工具之一,因为它在隐私方面已经符合 [GDPR 标准][2]。这是超级酷的。 + +在功能上,它没有 Google Analytics 那样的粒度和细节。Plausible 靠的是简单。它显示的是你过去 30 天的流量统计图。你也可以切换到实时试图。 + +![][3] + +你还可以看到你的流量来自哪里,以及你网站上的哪些页面访问量最大。来源也可以显示 UTM 活动。 + +![][4] + +你还可以选择启用 GeoIP 来了解网站访问者的地理位置。你还可以检查有多少访问者使用桌面或移动设备访问你的网站。还有一个操作系统的选项,正如你所看到的,[Linux Handbook][5] 有 48% 的访问者来自 Windows 设备。很奇怪,对吧? + +![][6] + +显然,提供的数据与 Google Analytics 的数据相差甚远,但这是有意为之。Plausible 打算为你提供简单的矩阵。 + +### 使用 Plausible:选择付费托管或在你的服务器上自行托管 + +有两种方式可以让你开始使用 Plausible。注册他们的官方托管服务。你必须为这项服务付费,这最终会帮助 Plausible 项目的发展。它们有 30 天的试用期,甚至不需要你这边提供任何支付信息。 + +定价从每月 1 万页浏览量 6 美元开始。价格会随着页面浏览量的增加而增加。你可以在 Plausible 网站上计算价格。 + +[Plausible Pricing][7] + +你可以试用 30 天,看看你是否愿意向 Plausible 开发者支付服务费用,并拥有你的数据。 + +如果你觉得定价不合理,你可以利用 Plausible 是开源的优势,自己部署。如果你有兴趣,请阅读我们的[使用 Docker 自助托管 Plausible 实例的深度指南][8]。 + +在 It's FOSS,我们自行托管 Plausible。我们的 Plausible 实例添加了我们的三个网站。 + +![Plausble dashboard for It’s FOSS websites][9] + +如果你维护一个开源项目的网站,并且想使用 Plausible,你可以通过我们的 [High on Cloud 项目][10]联系我们。通过 High on Cloud,我们帮助小企业在其服务器上托管和使用开源软件。 + +### 总结 + +如果你不是超级痴迷于数据,只是想快速了解网站的表现,Plausible 是一个不错的选择。我喜欢它,因为它是轻量级的,而且遵守隐私。这也是我在 Linux Handbook,我们[教授 Linux 服务器相关的门户网站][11]上使用它的主要原因。 + +总的来说,我对 Plausible 相当满意,并向其他网站所有者推荐它。 + +你也经营或管理一个网站吗?你是用什么工具来做分析,还是根本不关心这个? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/plausible/ + +作者:[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://plausible.io/ +[2]: https://gdpr.eu/compliance/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-graph-lhb.png?resize=800%2C395&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-stats-lhb-2.png?resize=800%2C333&ssl=1 +[5]: https://linuxhandbook.com/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-geo-ip-stats.png?resize=800%2C331&ssl=1 +[7]: https://plausible.io/#pricing +[8]: https://linuxhandbook.com/plausible-deployment-guide/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/plausible-analytics-for-itsfoss.png?resize=800%2C231&ssl=1 +[10]: https://highoncloud.com/ +[11]: https://linuxhandbook.com/about/#ethical-web-portal From 7959c5565dd6e4f0fbb7fcf107b58795c4ce1591 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 9 Apr 2021 08:49:31 +0800 Subject: [PATCH 063/307] translating --- sources/tech/20210407 What is Git cherry-picking.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 What is Git cherry-picking.md b/sources/tech/20210407 What is Git cherry-picking.md index 99e809440b..eede7de952 100644 --- a/sources/tech/20210407 What is Git cherry-picking.md +++ b/sources/tech/20210407 What is Git cherry-picking.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/cherry-picking-git) [#]: author: (Rajeev Bera https://opensource.com/users/acompiler) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 09721a3d806122e6cbf5c5f20466076b0f2409b6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 9 Apr 2021 19:53:45 +0800 Subject: [PATCH 064/307] APL --- ...20210402 A practical guide to using the git stash command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210402 A practical guide to using the git stash command.md b/sources/tech/20210402 A practical guide to using the git stash command.md index 804a6bac81..f50b107c41 100644 --- a/sources/tech/20210402 A practical guide to using the git stash command.md +++ b/sources/tech/20210402 A practical guide to using the git stash command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-stash) [#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1ac1c5307fd6a7498d277663c0ccb38a01fedee9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 9 Apr 2021 21:52:31 +0800 Subject: [PATCH 065/307] TSL --- ...al guide to using the git stash command.md | 240 ------------------ ...al guide to using the git stash command.md | 223 ++++++++++++++++ 2 files changed, 223 insertions(+), 240 deletions(-) delete mode 100644 sources/tech/20210402 A practical guide to using the git stash command.md create mode 100644 translated/tech/20210402 A practical guide to using the git stash command.md diff --git a/sources/tech/20210402 A practical guide to using the git stash command.md b/sources/tech/20210402 A practical guide to using the git stash command.md deleted file mode 100644 index f50b107c41..0000000000 --- a/sources/tech/20210402 A practical guide to using the git stash command.md +++ /dev/null @@ -1,240 +0,0 @@ -[#]: subject: (A practical guide to using the git stash command) -[#]: via: (https://opensource.com/article/21/4/git-stash) -[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -A practical guide to using the git stash command -====== -Learn how to use the git stash command and when you should use it. -![woman on laptop sitting at the window][1] - -Version control is an inseparable part of software developers' daily lives. It's hard to imagine any team developing software without using a version control tool. It's equally difficult to envision any developer who hasn't worked with (or at least heard of) Git. In the 2018 Stackoverflow Developer Survey, 87.2% of the 74,298 participants [use Git][2] for version control. - -Linus Torvalds created git in 2005 for developing the Linux kernel. This article walks through the `git stash` command and explores some useful options for stashing changes. It assumes you have basic familiarity with [Git concepts][3] and a good understanding of the working tree, staging area, and associated commands. - -### Why is git stash important? - -The first thing to understand is why stashing changes in Git is important. Assume for a moment that Git doesn't have a command to stash changes. Suppose you are working on a repository with two branches, A and B. The A and B branches have diverged from each other for quite some time and have different heads. While working on some files in branch A, your team asks you to fix a bug in branch B. You quickly save your changes to A and try to check out branch B with `git checkout B`. Git immediately aborts the operation and throws the error, "Your local changes to the following files would be overwritten by checkout … Please commit your changes or stash them before you switch branches." - -There are few ways to enable branch switching in this case: - - * Create a commit at that point in branch A, commit and push your changes to fix the bug in B, then check out A again and run `git reset HEAD^` to get your changes back. - * Manually keep the changes in files not tracked by Git. - - - -The second method is a bad idea. The first method, although appearing conventional, is less flexible because the unfinished saved changes are treated as a checkpoint rather than a patch that's still a work in progress. This is exactly the kind of scenario git stash is designed for. - -Git stash saves the uncommitted changes locally, allowing you to make changes, switch branches, and perform other Git operations. You can then reapply the stashed changes when you need them. A stash is locally scoped and is not pushed to the remote by `git push`. - -### How to use git stash - -Here's the sequence to follow when using git stash: - - 1. Save changes to branch A. - 2. Run `git stash`. - 3. Check out branch B. - 4. Fix the bug in branch B. - 5. Commit and (optionally) push to remote. - 6. Check out branch A - 7. Run `git stash pop` to get your stashed changes back. - - - -Git stash stores the changes you made to the working directory locally (inside your project's .git directory; `/.git/refs/stash`, to be precise) and allows you to retrieve the changes when you need them. It's handy when you need to switch between contexts. It allows you to save changes that you might need at a later stage and is the fastest way to get your working directory clean while keeping changes intact. - -### How to create a stash - -The simplest command to stash your changes is `git stash`: - - -``` -$ git stash -Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint -``` - -By default, `git stash` stores (or "stashes") the uncommitted changes (staged and unstaged files) and overlooks untracked and ignored files. Usually, you don't need to stash untracked and ignored files, but sometimes they might interfere with other things you want to do in your codebase. - -You can use additional options to let `git stash` take care of untracked and ignored files: - - * `git stash -u` or `git stash --include-untracked` stash untracked files. - * `git stash -a` or `git stash --all` stash untracked files and ignored files. - - - -To stash specific files, you can use the command `git stash -p` or `git stash –patch`: - - -``` -$ git stash --patch -diff --git a/.gitignore b/.gitignore -index 32174593..8d81be6e 100644 -\--- a/.gitignore -+++ b/.gitignore -@@ -3,6 +3,7 @@ - # dependencies - node_modules/ - /.pnp -+f,fmfm - .pnp.js - - # testing -(1/1) Stash this hunk [y,n,q,a,d,e,?]? -``` - -### Listing your stashes - -You can view your stashes with the command `git stash list`. Stashes are saved in a last-in-first-out (LIFO) approach: - - -``` -$ git stash list -stash@{0}: WIP on master: d7435644 Feat: configure graphql endpoint -``` - -By default, stashes are marked as WIP on top of the branch and commit that you created the stash from. However, this limited amount of information isn't helpful when you have multiple stashes, as it becomes difficult to remember or individually check their contents. To add a description to the stash, you can use the command `git stash save `: - - -``` -$ git stash save "remove semi-colon from schema" -Saved working directory and index state On master: remove semi-colon from schema - -$ git stash list -stash@{0}: On master: remove semi-colon from schema -stash@{1}: WIP on master: d7435644 Feat: configure graphql endpoint -``` - -### Retrieving stashed changes - -You can reapply stashed changes with the commands `git stash apply` and `git stash pop`. Both commands reapply the changes stashed in the latest stash (that is, `stash@{0}`). A `stash` reapplies the changes while `pop` removes the changes from the stash and reapplies them to the working copy. Popping is preferred if you don't need the stashed changes to be reapplied more than once. - -You can choose which stash you want to pop or apply by passing the identifier as the last argument: - - -``` -`$ git stash pop stash@{1}` -``` - -or - - -``` -`$ git stash apply stash@{1}` -``` - -### Cleaning up the stash - -It is good practice to remove stashes that are no longer needed. You must do this manually with the following commands: - - * `git stash clear` empties the stash list by removing all the stashes. - * `git stash drop ` deletes a particular stash from the stash list. - - - -### Checking stash diffs - -The command `git stash show ` allows you to view the diff of a stash: - - -``` -$ git stash show stash@{1} -console/console-init/ui/.graphqlrc.yml        |   4 +- -console/console-init/ui/generated-frontend.ts | 742 +++++++++--------- -console/console-init/ui/package.json          |   2 +- -``` - -To get a more detailed diff, pass the `--patch` or `-p` flag: - - -``` -$ git stash show stash@{0} --patch -diff --git a/console/console-init/ui/package.json b/console/console-init/ui/package.json -index 755912b97..5b5af1bd6 100644 -\--- a/console/console-init/ui/package.json -+++ b/console/console-init/ui/package.json -@@ -1,5 +1,5 @@ - { -\- "name": "my-usepatternfly", -\+ "name": "my-usepatternfly-2", -  "version": "0.1.0", -  "private": true, -  "proxy": "" -diff --git a/console/console-init/ui/src/AppNavHeader.tsx b/console/console-init/ui/src/AppNavHeader.tsx -index a4764d2f3..da72b7e2b 100644 -\--- a/console/console-init/ui/src/AppNavHeader.tsx -+++ b/console/console-init/ui/src/AppNavHeader.tsx -@@ -9,8 +9,8 @@ import { css } from "@patternfly/react-styles"; - -interface IAppNavHeaderProps extends PageHeaderProps { -\- toolbar?: React.ReactNode; -\- avatar?: React.ReactNode; -\+ toolbar?: React.ReactNode; -\+ avatar?: React.ReactNode; -} - -export class AppNavHeader extends React.Component<IAppNavHeaderProps>{ -  render() -``` - -### Checking out to a new branch - -You might come across a situation where the changes in a branch and your stash diverge, causing a conflict when you attempt to reapply the stash. A clean fix for this is to use the command `git stash branch `, which creates a new branch based on the commit the stash was created _from_ and pops the stashed changes to it: - - -``` -$ git stash branch test_2 stash@{0} -Switched to a new branch 'test_2' -On branch test_2 -Changes not staged for commit: -(use "git add <file>..." to update what will be committed) -(use "git restore <file>..." to discard changes in working directory) -modified: .graphqlrc.yml -modified: generated-frontend.ts -modified: package.json -no changes added to commit (use "git add" and/or "git commit -a") -Dropped stash@{0} (fe4bf8f79175b8fbd3df3c4558249834ecb75cd1) -``` - -### Stashing without disturbing the stash reflog - -In rare cases, you might need to create a stash while keeping the stash reference log (reflog) intact. These cases might arise when you need a script to stash as an implementation detail. This is achieved by the `git stash create` command; it creates a stash entry and returns its object name without pushing it to the stash reflog: - - -``` -$ git stash create "sample stash" -63a711cd3c7f8047662007490723e26ae9d4acf9 -``` - -Sometimes, you might decide to push the stash entry created via `git stash create` to the stash reflog: - - -``` -$ git stash store -m "sample stash testing.." "63a711cd3c7f8047662007490723e26ae9d4acf9" -$ git stash list -stash @{0}: sample stash testing.. -``` - -### Conclusion - -I hope you found this article useful and learned something new. If I missed any useful options for using stash, please let me know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/git-stash - -作者:[Ramakrishna Pattnaik][a] -选题:[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/rkpattnaik780 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: https://insights.stackoverflow.com/survey/2018#work-_-version-control -[3]: https://opensource.com/downloads/cheat-sheet-git diff --git a/translated/tech/20210402 A practical guide to using the git stash command.md b/translated/tech/20210402 A practical guide to using the git stash command.md new file mode 100644 index 0000000000..ddd8a761dd --- /dev/null +++ b/translated/tech/20210402 A practical guide to using the git stash command.md @@ -0,0 +1,223 @@ +[#]: subject: (A practical guide to using the git stash command) +[#]: via: (https://opensource.com/article/21/4/git-stash) +[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +git stash 命令实用指南 +====== + +> 学习如何使用 `git stash` 命令,以及何时应该使用它。 + +![女人在笔记本上坐在窗口][1] + +版本控制是软件开发人员日常生活中不可分割的一部分。很难想象有哪个团队在开发软件时不使用版本控制工具。同样也很难想象有哪个开发者没有使用过(或没有听说过)Git。在 2018 年 Stackoverflow 开发者调查中,74298 名参与者中 87.2% 的人 [使用 Git][2] 进行版本控制。 + +Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将介绍 `git stash` 命令,并探讨一些有用的暂存修改的选项。本文假定你对 [Git 概念][3] 有基本的了解,并对工作树、暂存区和相关命令有良好的理解。 + +### 为什么 git stash 很重要? + +首先要明白为什么在 Git 中暂存变更很重要。假设 Git 没有暂存变更的命令。当你正在一个有两个分支(A 和 B)的仓库上工作时,这两个分支已经分叉了一段时间,并且有不同的头。当你正在处理 A 分支的一些文件时,你的团队要求你修复 B 分支的一个错误。你迅速将你的修改保存到 A 分支,并尝试用 `git checkout B` 来签出 B 分支。Git 立即中止了这个操作,并抛出错误:“你对以下文件的本地修改会被该签出覆盖……请在切换分支之前提交你的修改或将它们暂存起来。” + +在这种情况下,有几种方法可以启用分支切换: + + * 在分支 A 中创建一个提交,提交并推送你的修改,以修复 B 中的错误,然后再次签出 A,并运行 `git reset HEAD^` 来恢复你的修改。 + * 手动保留不被 Git 跟踪的文件中的改动。 + +第二种方法是个馊主意。第一种方法虽然看起来很传统,但却不太灵活,因为保存未完成工作的修改会被当作一个检查点,而不是一个仍在进行中的补丁。这正是设计 `git stash` 的场景。 + +`git stash` 将未提交的改动保存在本地,让你可以进行修改、切换分支以及其他 Git 操作。然后,当你需要的时候,你可以重新应用这些存储的改动。暂存是本地范围的,不会被 `git push` 推送到远程。 + +### 如何使用git stash + +下面是使用 `git stash` 时要遵循的顺序: + + 1. 将修改保存到分支 A。 + 2. 运行 `git stash`。 + 3. 签出分支 B。 + 4. 修正 B 分支的错误。 + 5. 提交并(可选)推送到远程。 + 6. 查看分支 A + 7. 运行 `git stash pop` 来取回你的暂存的改动。 + +`git stash` 将你对工作目录的修改存储在本地(在你的项目的 `.git` 目录内,准确的说是 `/.git/refs/stash`),并允许你在需要时检索这些修改。当你需要在不同的上下文之间切换时,它很方便。它允许你保存以后可能需要的更改,是让你的工作目录干净同时保持更改完整的最快方法。 + +### 如何创建一个暂存 + +暂存你的变化的最简单的命令是 `git stash`: + +``` +$ git stash +Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint +``` + +默认情况下,`git stash` 存储(或“暂存”)未提交的更改(已暂存和未暂存的文件),并忽略未跟踪和忽略的文件。通常情况下,你不需要暂存未跟踪和忽略的文件,但有时它们可能会干扰你在代码库中要做的其他事情。 + +你可以使用附加选项让 `git stash` 来处理未跟踪和忽略的文件: + + * `git stash -u` 或 `git stash --includ-untracked` 储存未追踪的文件。 + * `git stash -a` 或 `git stash --all` 储存未跟踪的文件和忽略的文件。 + +要存储特定的文件,你可以使用 `git stash -p` 或 `git stash -patch` 命令: + +``` +$ git stash --patch +diff --git a/.gitignore b/.gitignore +index 32174593..8d81be6e 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -3,6 +3,7 @@ + # dependencies + node_modules/ + /.pnp ++f,fmfm + .pnp.js + + # testing +(1/1) Stash this hunk [y,n,q,a,d,e,?]? +``` + +### 列出你的暂存 + +你可以用 `git stash list` 命令查看你的暂存。暂存是后进先出(LIFO)方式保存的: + +``` +$ git stash list +stash@{0}: WIP on master: d7435644 Feat: configure graphql endpoint +``` + +默认情况下,暂存会显示在你创建它的分支和提交的顶部,被标记为 `WIP`。然而,当你有多个暂存时,这种有限的信息量并没有帮助,因为很难记住或单独检查它们的内容。要为暂存添加描述,可以使用命令 `git stash save `: + +``` +$ git stash save "remove semi-colon from schema" +Saved working directory and index state On master: remove semi-colon from schema + +$ git stash list +stash@{0}: On master: remove semi-colon from schema +stash@{1}: WIP on master: d7435644 Feat: configure graphql endpoint +``` + +### 检索暂存起来的变化 + +你可以用 `git stash apply` 和 `git stash pop` 这两个命令来重新应用暂存的变更。这两个命令都会重新应用最新的暂存(即 `stash@{0}`)中的改动。`apply` 会重新应用变更;而 `pop` 则会将暂存的变更重新应用到工作副本中,并从暂存中删除。如果你不需要再次重新应用被暂存的更改,则首选 `pop`。 + +你可以通过传递标识符作为最后一个参数来选择你想要弹出或应用的储藏: + +``` +$ git stash pop stash@{1} +``` + +或 + +``` +$ git stash apply stash@{1} +``` + +### 清理暂存 + +删除不再需要的暂存是好的习惯。你必须用以下命令手动完成: + + * `git stash clear` 通过删除所有的暂存库来清空该列表。 + * `git stash drop ` 从暂存列表中删除一个特定的暂存。 + +### 检查暂存的差异 + +命令 `git stash show ` 允许你查看一个暂存的差异: + +``` +$ git stash show stash@{1} +console/console-init/ui/.graphqlrc.yml        |   4 +- +console/console-init/ui/generated-frontend.ts | 742 +++++++++--------- +console/console-init/ui/package.json          |   2 +- +``` + +要获得更详细的差异,需要传递 `--patch` 或 `-p` 标志: + +``` +$ git stash show stash@{0} --patch +diff --git a/console/console-init/ui/package.json b/console/console-init/ui/package.json +index 755912b97..5b5af1bd6 100644 +--- a/console/console-init/ui/package.json ++++ b/console/console-init/ui/package.json +@@ -1,5 +1,5 @@ + { +- "name": "my-usepatternfly", ++ "name": "my-usepatternfly-2", +  "version": "0.1.0", +  "private": true, +  "proxy": "http://localhost:4000" +diff --git a/console/console-init/ui/src/AppNavHeader.tsx b/console/console-init/ui/src/AppNavHeader.tsx +index a4764d2f3..da72b7e2b 100644 +--- a/console/console-init/ui/src/AppNavHeader.tsx ++++ b/console/console-init/ui/src/AppNavHeader.tsx +@@ -9,8 +9,8 @@ import { css } from "@patternfly/react-styles"; + +interface IAppNavHeaderProps extends PageHeaderProps { +- toolbar?: React.ReactNode; +- avatar?: React.ReactNode; ++ toolbar?: React.ReactNode; ++ avatar?: React.ReactNode; +} + +export class AppNavHeader extends React.Component<IAppNavHeaderProps>{ +  render() +``` + +### 签出到新的分支 + +你可能会遇到这样的情况:一个分支和你的暂存中的变更有分歧,当你试图重新应用暂存时,会造成冲突。一个简单的解决方法是使用 `git stash branch ` 命令,它将根据创建暂存时的提交创建一个新分支,并将暂存中的修改弹出: + +``` +$ git stash branch test_2 stash@{0} +Switched to a new branch 'test_2' +On branch test_2 +Changes not staged for commit: +(use "git add ..." to update what will be committed) +(use "git restore ..." to discard changes in working directory) +modified: .graphqlrc.yml +modified: generated-frontend.ts +modified: package.json +no changes added to commit (use "git add" and/or "git commit -a") +Dropped stash@{0} (fe4bf8f79175b8fbd3df3c4558249834ecb75cd1) +``` + +### 在不打扰暂存参考日志的情况下进行暂存 + +在极少数情况下,你可能需要创建一个暂存,同时保持暂存参考日志(`reflog`)的完整性。这些情况可能出现在你需要一个脚本作为一个实现细节来暂存的时候。这可以通过 `git stash create` 命令来实现;它创建了一个暂存条目,并返回它的对象名,而不将其推送到暂存参考日志中: + +``` +$ git stash create "sample stash" +63a711cd3c7f8047662007490723e26ae9d4acf9 +``` + +有时,你可能会决定将通过 `git stash create` 创建的暂存条目推送到暂存参考日志: + +``` +$ git stash store -m "sample stash testing.." "63a711cd3c7f8047662007490723e26ae9d4acf9" +$ git stash list +stash @{0}: sample stash testing.. +``` + +### 结论 + +我希望你觉得这篇文章很有用,并学到了新的东西。如果我遗漏了任何有用的使用暂存的选项,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/git-stash + +作者:[Ramakrishna Pattnaik][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rkpattnaik780 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://insights.stackoverflow.com/survey/2018#work-_-version-control +[3]: https://opensource.com/downloads/cheat-sheet-git From befda05005b66ff37842faf7f0564fe349a54372 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Apr 2021 05:02:34 +0800 Subject: [PATCH 066/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210410=20?= =?UTF-8?q?How=20to=20Install=20Steam=20on=20Fedora=20[Beginner=E2=80=99s?= =?UTF-8?q?=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md --- ...Install Steam on Fedora -Beginner-s Tip.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md diff --git a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md new file mode 100644 index 0000000000..3315f1c000 --- /dev/null +++ b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -0,0 +1,117 @@ +[#]: subject: (How to Install Steam on Fedora [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/install-steam-fedora/) +[#]: author: (John Paul https://itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Install Steam on Fedora [Beginner’s Tip] +====== + +Steam is the best thing that could happen to Linux gamers. Thanks to Steam, you can play hundreds and thousands of games on Linux. + +If you are not already aware of it, Steam is the most popular PC gaming platform. In 2013, it became available for Linux. [Steam’s latest Proton project][1] allows you to play games created for Windows platform on Linux. This enhanced Linux gaming library many folds. + +![][2] + +Steam provides a desktop client and you can use it to download or purchase games from the Steam store, install the game and play it. + +We have discussed [installing Steam on Ubuntu][3] in the past. In this beginner’s tutorial, I am going to show you the steps for installing Steam on Fedora Linux. + +### Installing Steam on Fedora + +To get Steam on Fedora, you’ll have to use RMPFusion repository. [RPMFusion][4] is a series of third-party repos that contain software that Fedora chooses not to ship with their operating system. They offer both free (open source) and non-free (closed source) repos. Since Steam is in the non-free repo, you will only install that one. + +I shall go over both the terminal and graphical installation methods. + +#### Method 1: Install Steam via terminal + +This is the easiest method because it requires the fewest steps. Just enter the following command to enable the free repo: + +``` +sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +You will be asked to enter your password. You will then be asked to verify that you want to install these repos. Once you approve it, the installation of the repo will be completed. + +To install Steam, simply enter the following command: + +``` +sudo dnf install steam +``` + +![Install Steam via command line][5] + +Enter your password and press “Y” to accept. Once installed, open Steam and play some games. + +#### Method 2: Install Steam via GUI + +You can [enable the third-party repository on Fedora][6] from the Software Center. Open the Software Center application and click on the hamburger menu: + +![][7] + +In the Software Repositories window, you will see a section at the top that says “Third Party Repositories”. Click the Install button. Enter your password when you are prompted and you are done. + +![][8] + +Once you have installed RPM Fusion repository for Steam, update your system’s software cache (if needed) and search for Steam in the software center. + +![Steam in GNOME Software Center][9] + +Once that installation is complete, open up the GNOME Software Center and search for Steam. Once you locate the Steam page, click install. Enter your password when asked and you’re done. + +After installing Steam, start the application, enter your Steam account details or register for it and enjoy your games. + +### Using Steam as Flatpak + +Steam is also available as a Flatpak. Flatpak is installed by default on Fedora. Before we can install Steam using that method, we have to install the Flathub repo. + +![Install Flathub][10] + +First, open the [Flatpak site][11] in your browser. Now, click the blue button marked “Flathub repository file”. The browser will ask you if you want to open the file in GNOME Software Center. Click okay. Once GNOME Software Center open, click the install button. You will be prompted to enter your password. + +If you get an error when you try to install the Flathub repo, run this command in the terminal: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +With the Flathub repo installed, all you need to do is search for Steam in the GNOME Software Center. Once you find it, install it, and you are ready to go. + +![Fedora Repo Select][12] + +The Flathub version of Steam has several add-ons you can install, as well. These include a DOS compatibility tool and a couple of tools for [Vulkan][13] and Proton. + +![][14] + +I think this should help you with Steam on Fedora. Enjoy your games :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-steam-fedora/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/steam-play-proton/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/05/Steam-Store.jpg?resize=800%2C382&ssl=1 +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://rpmfusion.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-steam-fedora.png?resize=800%2C588&ssl=1 +[6]: https://itsfoss.com/fedora-third-party-repos/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/software-meni.png?resize=800%2C672&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repo-gui.png?resize=746%2C800&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gnome-store-steam.jpg?resize=800%2C434&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/flatpak-install-button.jpg?resize=800%2C434&ssl=1 +[11]: https://www.flatpak.org/setup/Fedora/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/fedora-repo-select.jpg?resize=800%2C434&ssl=1 +[13]: https://developer.nvidia.com/vulkan +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/steam-flatpak-addons.jpg?resize=800%2C434&ssl=1 From 82560e5d7d87262f2ac46afe0402ea2006b9838e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Apr 2021 05:02:53 +0800 Subject: [PATCH 067/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210409=20?= =?UTF-8?q?Stream=20event=20data=20with=20this=20open=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210409 Stream event data with this open source tool.md --- ...m event data with this open source tool.md | 274 ++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 sources/tech/20210409 Stream event data with this open source tool.md diff --git a/sources/tech/20210409 Stream event data with this open source tool.md b/sources/tech/20210409 Stream event data with this open source tool.md new file mode 100644 index 0000000000..62f8222089 --- /dev/null +++ b/sources/tech/20210409 Stream event data with this open source tool.md @@ -0,0 +1,274 @@ +[#]: subject: (Stream event data with this open source tool) +[#]: via: (https://opensource.com/article/21/4/event-streaming-rudderstack) +[#]: author: (Amey Varangaonkar https://opensource.com/users/ameypv) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Stream event data with this open source tool +====== +Route real-time events from web, mobile, and server-side app sources to +help build your customer data lake on your data warehouse. +![Net catching 1s and 0s or data in the clouds][1] + +In my [previous article][2], I introduced [RudderStack][3], an open source, warehouse-first customer data pipeline. In this article, I demonstrate how easy Rudderstack makes it to set up and use event streams. + +An event stream is a pipeline between a source you define and a destination of your choice. Rudderstack provides you with SDKs and plugins to help you ingest event data from your website, mobile apps, and server-side sources — including JavaScript, Gatsby, Android, iOS, Unity, ReactNative, Node.js, and many more. Similarly, Rudderstack's **Event Stream** module features over 80 destination and warehouse integrations, including Firebase, Google Analytics, Salesforce, Zendesk, Snowflake, BigQuery, RedShift, and more, making it easy to send event data to downstream tools that can use it as well as build a customer data lake on a data warehouse for analytical use cases. + +This tutorial shows how to track and route events using RudderStack. + +### How to set up an event stream + +Before you get started, make sure you understand these terms used in this tutorial: + + * **Source**: A source refers to a tool or a platform from which RudderStack ingests your event data. Your website, mobile app, or your back-end server are common examples of sources. + * **Destination**: A destination refers to a tool that receives your event data from RudderStack. These destination tools can then use this data for your activation use cases. Tools like Google Analytics, Salesforce, and HubSpot are common examples of destinations. + + + +The steps for setting up an event stream in RudderStack open source are: + + 1. Instrumenting an event stream source + 2. Configuring a warehouse destination + 3. Configuring a tool destination + 4. Sending events to verify the event stream + + + +### Step 1: Instrument an event stream source + +To set up an event stream source in RudderStack: + + 1. Log into your [RudderStack dashboard][4]. If you don't have a RudderStack account, please sign up. You can use the RudderStack open source control plane to [set up your event streams][5]. + +RudderStack's hosted control plane is an option to manage your event stream configurations. It is completely free, requires no setup, and has some more advanced features than the open source control plane. + + 2. Once you've logged into RudderStack, you should see the following dashboard: + +![RudderStack dashboard][6] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note:** Make sure to save the **Data Plane URL**. It is required in your RudderStack JavaScript SDK snippet to track events from your website. + + 3. To instrument the source, click **Add Source**. Optionally, you can also select the **Directory** option on the left navigation bar, and select **Event Streams** under **Sources**. This tutorial will set up a simple **JavaScript** source that allows you to track events from your website. + +![RudderStack event streams dashboard][8] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. Assign a name to your source, and click **Next**. + +![RudderStack Source Name][9] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 5. That's it! Your event source is now configured. + +![RudderStack source write key][10] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note:** Save the source **Write Key**. Your RudderStack JavaScript SDK snippet requires it to track events from your website. + + + + +Now you need to install the RudderStack JavaScript SDK on your website. To do this, you need to place either the minified or non-minified version of the snippet with your **Data Plane URL** and source **Write Key** in your website's `` section. Consult the docs for information on how to [install and use the RudderStack JavaScript SDK][11]. + +### Step 2: Configure a warehouse destination + +**Important**: Before you configure your data warehouse as a destination in RudderStack, you need to set up a new project in your warehouse and create a RudderStack user role with the relevant permissions. The docs provide [detailed, step-by-step instructions][12] on how to do this for the warehouse of your choice. + +This tutorial sets up a Google BigQuery warehouse destination. You don't have to configure a warehouse destination, but I recommend it. The docs provide [instructions on setting up][13] a Google BigQuery project and a service account with the required permissions. + +Then configure BigQuery as a warehouse destination in RudderStack by following these steps: + + 1. On the left navigation bar, click on **Directory**, and then click on **Google BigQuery** from the list of destinations: + +![RudderStack destination options][14] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 2. Assign a name to your destination, and click on **Next**. + + + + +![RudderStack naming the destination][15] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 3. Choose which source you want to use to send the events to your destination. Select the source that you created in the previous section. Then, click on **Next**. + + + +![RudderStack selecting data source][16] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. Specify the required connection credentials. For this destination, enter the **BigQuery Project ID** and the **staging bucket name**; information on [how to get this information][17] is in the docs. + + + +![RudderStack connection credentials][18] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 5. Copy the contents of the private JSON file you created, as [the docs][19] explain. + + + +That's it! You have configured your BigQuery warehouse as a destination in RudderStack. Once you start sending events from your source (a website in this case), RudderStack will automatically route them into your BigQuery and build your identity graph there as well. + +### Step 3: Configure a tool destination + +Once you've added a source, follow these steps to configure a destination in the RudderStack dashboard: + + 1. To add a new destination, click on the **Add Destination** button as shown: + +![RudderStack adding the destination][20] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note:** If you have configured a destination before, use the **Connect Destinations** option to connect it to any source. + + 2. RudderStack supports over 80 destinations to which you can send your event data. Choose your preferred destination platform from the list. This example configures **Google Analytics** as a destination. + + + + +![RudderStack selecting destination platform][21] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 3. Add a name to your destination, and click **Next**. + + + +![RudderStack naming the destination][22] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. Next, choose the preferred source. If you're following along with this tutorial, choose the source you configured above. + + + +![RudderStack choosing source][23] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 5. In this step, you must add the relevant **Connection Settings**. Enter the **Tracking ID** for this destination (Google Analytics). You can also configure other optional settings per your requirements. Once you've added the required settings, click **Next**. + +![RudderStack connection settings][24] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +**Note**: RudderStack also gives you the option of transforming the events before sending them to your destination. Read more about [user transformations][25] in RudderStack in the docs. + + 6. That's it! The destination is now configured. You should now see it connected to your source. + + + + +![RudderStack connection configured][26] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +### Step 4: Send test events to verify the event stream + +This tutorial set up a JavaScript source to track events from your website. Once you have placed the JavaScript code snippet in your website's `` section, RudderStack will automatically track and collect user events from the website in real time. + +However, to quickly test if your event stream is set up correctly, you can send some test events. To do so, follow these steps: + +**Note**: Before you get started, you will need to clone the [rudder-server][27] repo and have a RudderStack server installed in your environment. Follow [this tutorial][28] to set up a RudderStack server. + + 1. Make sure you have set up a source and destination by following the steps in the previous sections and have your **Data Plane URL** and source **Write Key** available. + + 2. Start the RudderStack server. + + 3. The **rudder-server** repo includes a shell script that generates test events. Get the source **Write Key** from step 2, and run the following command: + + +``` +`./scripts/generate-event /v1/batch` +``` + + + + +![RudderStack event testing code][29] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + + 4. To check if the test events are delivered, go to your Google Analytics dashboard, navigate to **Realtime** under Reports, and click **Events**. + +**Note**: Make sure you check the events associated with the same Tracking ID you provided while instrumenting the destination. + + + + +You should now be able to see the test event received in Google Analytics and BigQuery. + +![RudderStack event test][30] + +(Gavin Johnson, [CC BY-SA 4.0][7]) + +If you come across any issues while setting up or configuring RudderStack open source, join our [Slack][31] and start a conversation in our #open-source channel. We will be happy to help. + +If you want to try RudderStack but don't want to host your own, sign up for our free, hosted offering, [RudderStack Cloud Free][32]. Explore our open source repos on [GitHub][33], subscribe to [our blog][34], and follow us on our socials: [Twitter][35], [LinkedIn][36], [dev.to][37], [Medium][38], and [YouTube][39]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/event-streaming-rudderstack + +作者:[Amey Varangaonkar][a] +选题:[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/ameypv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_analytics_cloud.png?itok=eE4uIoaB (Net catching 1s and 0s or data in the clouds) +[2]: https://opensource.com/article/21/3/rudderstack-customer-data-platform +[3]: https://rudderstack.com/ +[4]: https://app.rudderstack.com/ +[5]: https://docs.rudderstack.com/how-to-guides/rudderstack-config-generator +[6]: https://opensource.com/sites/default/files/uploads/rudderstack_dashboard.png (RudderStack dashboard) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/rudderstack_eventstreamsdash.png (RudderStack event streams dashboard) +[9]: https://opensource.com/sites/default/files/uploads/rudderstack_namesource.png (RudderStack Source Name) +[10]: https://opensource.com/sites/default/files/uploads/rudderstack_writekey.png (RudderStack Source Name) +[11]: https://docs.rudderstack.com/rudderstack-sdk-integration-guides/rudderstack-javascript-sdk +[12]: https://docs.rudderstack.com/data-warehouse-integrations +[13]: https://docs.rudderstack.com/data-warehouse-integrations/google-bigquery +[14]: https://opensource.com/sites/default/files/uploads/rudderstack_destinations.png (RudderStack destination options) +[15]: https://opensource.com/sites/default/files/uploads/rudderstack_namedestination.png (RudderStack naming the destination) +[16]: https://opensource.com/sites/default/files/uploads/rudderstack_adddestination.png (RudderStack selecting data source) +[17]: https://docs.rudderstack.com/data-warehouse-integrations/google-bigquery#setting-up-google-bigquery +[18]: https://opensource.com/sites/default/files/uploads/rudderstack_connectioncredentials.png (RudderStack connection credentials) +[19]: https://docs.rudderstack.com/data-warehouse-integrations/google-bigquery#setting-up-the-service-account-for-rudderstack +[20]: https://opensource.com/sites/default/files/uploads/rudderstack_addnewdestination.png (RudderStack adding the destination) +[21]: https://opensource.com/sites/default/files/uploads/rudderstack_googleanalyticsdestination.png (RudderStack selecting destination platform) +[22]: https://opensource.com/sites/default/files/uploads/rudderstack_namenewdestination.png (RudderStack naming the destination) +[23]: https://opensource.com/sites/default/files/uploads/rudderstack_choosepreferredsource.png (RudderStack choosing source) +[24]: https://opensource.com/sites/default/files/uploads/rudderstack_connectionsettings.png (RudderStack connection settings) +[25]: https://docs.rudderstack.com/adding-a-new-user-transformation-in-rudderstack +[26]: https://opensource.com/sites/default/files/uploads/rudderstack_destinationconfigured.png (RudderStack connection configured) +[27]: https://github.com/rudderlabs/rudder-server +[28]: https://docs.rudderstack.com/installing-and-setting-up-rudderstack/docker +[29]: https://opensource.com/sites/default/files/uploads/rudderstack_testevents.jpg (RudderStack event testing code) +[30]: https://opensource.com/sites/default/files/uploads/rudderstack_testeventoutput.png (RudderStack event test) +[31]: https://resources.rudderstack.com/join-rudderstack-slack +[32]: https://app.rudderlabs.com/signup?type=freetrial +[33]: https://github.com/rudderlabs +[34]: https://rudderstack.com/blog/ +[35]: https://twitter.com/RudderStack +[36]: https://www.linkedin.com/company/rudderlabs/ +[37]: https://dev.to/rudderstack +[38]: https://rudderstack.medium.com/ +[39]: https://www.youtube.com/channel/UCgV-B77bV_-LOmKYHw8jvBw From 5afef8cda2171681d44fec71439e1e4dbd2a9d10 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 10 Apr 2021 05:03:05 +0800 Subject: [PATCH 068/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210409=20?= =?UTF-8?q?4=20ways=20open=20source=20gives=20you=20a=20competitive=20edge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210409 4 ways open source gives you a competitive edge.md --- ...pen source gives you a competitive edge.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210409 4 ways open source gives you a competitive edge.md diff --git a/sources/tech/20210409 4 ways open source gives you a competitive edge.md b/sources/tech/20210409 4 ways open source gives you a competitive edge.md new file mode 100644 index 0000000000..56bb2cb7db --- /dev/null +++ b/sources/tech/20210409 4 ways open source gives you a competitive edge.md @@ -0,0 +1,83 @@ +[#]: subject: (4 ways open source gives you a competitive edge) +[#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) +[#]: author: (Jason Blais https://opensource.com/users/jasonblais) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 ways open source gives you a competitive edge +====== +Using open source technology can help organizations drive better +business outcomes. +![Open ethernet cords.][1] + +Building a tech stack is a major decision for every organization. While picking the right tools will set your team up for success, picking the wrong solutions or platforms can have devastating effects on productivity and profitability. To succeed in today's fast-paced world, organizations must make smart investments in digital solutions that enable them to move faster and increase operational agility. + +This is precisely why more and more organizations of all sizes and across all industries are embracing open source solutions. According to a recent [McKinsey][2] report, open source adoption is the biggest differentiator for top-performing organizations. + +Here are four reasons why adopting open source technology can help organizations drive competitive advantage and experience better business outcomes. + +### 1\. Extensibility and flexibility + +Suffice it to say the world of technology moves quickly. For example, Kubernetes didn't exist before 2014, but today, it's impressively ubiquitous. According to the CNCF's [2020 Cloud Native Survey][3], 91% of teams are using Kubernetes in some form. + +One of the main reasons organizations are investing in open source is because it enables them to operate with agility and rapidly integrate new technologies into their stack. That's compared to the more traditional approach, where teams would take quarters or even years to vet, implement, and adopt software—making it impossible for them to pivot with any sense of urgency. + +Since open source solutions offer complete access to source code, teams can easily connect the software to the other tools they use every day. + +Simply put, open source enables development teams to build the perfect tool for what is at hand instead of being forced to change how they work to fit into how inflexible proprietary tools are designed. + +### 2\. Security and high-trust collaboration + +In the age of high-profile data breaches, organizations need highly secure tools that enable them to keep sensitive data secure. + +When vulnerabilities exist in proprietary solutions, they're often undiscovered until it's too late. Unfortunately for the teams using these platforms, the lack of visibility into source code means they're essentially outsourcing security to the specific vendor and hoping for the best. + +Another main driver of open source adoption is that open source tools enable organizations to take control over their own security. For example, open source projects—particularly those with large communities—tend to receive more responsible vulnerability disclosures because everyone using the product can thoroughly inspect the source code. + +Since the source code is freely available, such disclosures often come with detailed proposed solutions for fixing bugs. This enables dev teams to remedy issues faster, continuously strengthening the software. + +In the age of remote work, it's more important than ever for distributed teams to collaborate while knowing that sensitive data stays protected. Since open source solutions allow organizations to audit security while maintaining complete control over their data, they can facilitate the high-trust collaboration needed to thrive in remote environments. + +### 3\. Freedom from vendor lock-in + +According to a [recent study][4], 68% of CIOs are concerned about vendor lock-in. They should be. When you're locked into a piece of technology, you're forced to live with someone else's conclusions instead of making your own. + +Proprietary solutions often make it [challenging to take data with you][5] when an organization switches vendors. On the other hand, open source tools offer the freedom and flexibility needed to avoid vendor lock-in and take data wherever an organization wants to go. + +### 4\. Top talent and community + +As more and more companies [embrace remote work][6], the war for talent is becoming even more competitive. + +In the world of software development, landing top talent starts with giving engineers access to modern tools that enable them to reach their full potential at work. Since developers increasingly [prefer open source solutions][7] to proprietary counterparts, organizations should strongly consider open source alternatives to their commercial solutions to attract the best developers on the market. + +In addition to making it easier to hire and retain top talent, open source platforms also enable companies to tap into a community of contributors for advice on how to walk through problems and get the most out of the platform. Plus, members of the community also [contribute to open source projects directly][8]. + +### Open source offers freedom + +Open source software is increasingly popular among enterprise teams—[for good reason][9]. It gives teams the flexibility needed to build the perfect tool for the job while enabling them to maintain a highly secure environment. At the same time, an open source approach allows teams to maintain control of their future, rather than being locked into one vendor's roadmap. And it also gives companies access to talented engineers and members of the open source community. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-competitive-advantage + +作者:[Jason Blais][a] +选题:[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/jasonblais +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) +[2]: https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/developer-velocity-how-software-excellence-fuels-business-performance# +[3]: https://www.cncf.io/blog/2020/11/17/cloud-native-survey-2020-containers-in-production-jump-300-from-our-first-survey/ +[4]: https://solutionsreview.com/cloud-platforms/flexera-68-percent-of-cios-worry-about-vendor-lock-in-with-public-cloud/ +[5]: https://www.computerworld.com/article/3428679/mattermost-makes-case-for-open-source-as-team-messaging-market-booms.html +[6]: https://mattermost.com/blog/tips-for-working-remotely/ +[7]: https://opensource.com/article/20/6/open-source-developers-survey +[8]: https://mattermost.com/blog/100-most-popular-mattermost-features-invented-and-contributed-by-our-amazing-open-source-community/ +[9]: https://mattermost.com/open-source-advantage/ From 83a04a1909c32ff65289ece46b8e6c2809527fd1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 11:07:50 +0800 Subject: [PATCH 069/307] PRF @geekpi --- ...cy-Focused Google Analytics Alternative.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index a08e2eac7c..5dac71e10e 100644 --- a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -3,22 +3,24 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Plausible:关注隐私的 Google Analytics 替代方案 +Plausible:注重隐私的 Google Analytics 替代方案 ====== +![](https://img.linux.net.cn/data/attachment/album/202104/10/110720jc8hckngaqr6wch1.jpg) + [Plausible][1]是一款简单的、对隐私友好的分析工具。它可以帮助你分析独立访客数量、页面浏览量、跳出率和访问时间。 -如果你有一个网站,你可能会理解这些术语。作为一个网站所有者,它可以帮助你知道你的网站是否随着时间的推移获得更多的访问者,流量来自哪里,如果你对这些事情有一定的了解,你可以努力改进你的网站,以获得更多的访问量。 +如果你有一个网站,你可能会理解这些术语。作为一个网站所有者,它可以帮助你了解你的网站是否随着时间的推移获得更多的访问者,流量来自哪里,如果你对这些事情有一定的了解,你可以努力改进你的网站,以获得更多的访问量。 说到网站分析,统治这个领域的一个服务就是谷歌的免费工具 Google Analytics。就像 Google 是事实上的搜索引擎一样,Google Analytics 是事实上的分析工具。但你不必再忍受它,尤其是当你无法信任大科技公司使用你和你的网站访问者的数据的时候。 Plausible 让你摆脱 Google Analytics 的束缚,我将在本文中讨论这个开源项目。 -请注意,如果你从来没有管理过网站或对分析感兴趣,文章中的一些技术术语可能对你来说是未知的。 +请注意,如果你从来没有管理过网站或对分析感兴趣,文章中的一些技术术语可能对你来说是陌生的。 ### Plausible 是隐私友好的网站分析工具 @@ -26,7 +28,7 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 其重点在于保护隐私,因此你可以在不影响访客隐私的情况下获得有价值且可操作的统计数据。Plausible 是为数不多的不需要 cookie 横幅或 GDP 同意的分析工具之一,因为它在隐私方面已经符合 [GDPR 标准][2]。这是超级酷的。 -在功能上,它没有 Google Analytics 那样的粒度和细节。Plausible 靠的是简单。它显示的是你过去 30 天的流量统计图。你也可以切换到实时试图。 +在功能上,它没有 Google Analytics 那样的粒度和细节。Plausible 靠的是简单。它显示的是你过去 30 天的流量统计图。你也可以切换到实时视图。 ![][3] @@ -38,11 +40,11 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 ![][6] -显然,提供的数据与 Google Analytics 的数据相差甚远,但这是有意为之。Plausible 打算为你提供简单的矩阵。 +显然,提供的数据与 Google Analytics 的数据相差甚远,但这是有意为之。Plausible 意图是为你提供简单的模式。 ### 使用 Plausible:选择付费托管或在你的服务器上自行托管 -有两种方式可以让你开始使用 Plausible。注册他们的官方托管服务。你必须为这项服务付费,这最终会帮助 Plausible 项目的发展。它们有 30 天的试用期,甚至不需要你这边提供任何支付信息。 +使用 Plausible 有两种方式:注册他们的官方托管服务。你必须为这项服务付费,这最终会帮助 Plausible 项目的发展。它们有 30 天的试用期,甚至不需要你这边提供任何支付信息。 定价从每月 1 万页浏览量 6 美元开始。价格会随着页面浏览量的增加而增加。你可以在 Plausible 网站上计算价格。 @@ -50,17 +52,17 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 你可以试用 30 天,看看你是否愿意向 Plausible 开发者支付服务费用,并拥有你的数据。 -如果你觉得定价不合理,你可以利用 Plausible 是开源的优势,自己部署。如果你有兴趣,请阅读我们的[使用 Docker 自助托管 Plausible 实例的深度指南][8]。 +如果你觉得定价不合理,你可以利用 Plausible 是开源的优势,自己部署。如果你有兴趣,请阅读我们的 [使用 Docker 自助托管 Plausible 实例的深度指南][8]。 -在 It's FOSS,我们自行托管 Plausible。我们的 Plausible 实例添加了我们的三个网站。 +我们自行托管 Plausible。我们的 Plausible 实例添加了我们的三个网站。 ![Plausble dashboard for It’s FOSS websites][9] -如果你维护一个开源项目的网站,并且想使用 Plausible,你可以通过我们的 [High on Cloud 项目][10]联系我们。通过 High on Cloud,我们帮助小企业在其服务器上托管和使用开源软件。 +如果你维护一个开源项目的网站,并且想使用 Plausible,你可以通过我们的 [High on Cloud 项目][10] 联系我们。通过 High on Cloud,我们帮助小企业在其服务器上托管和使用开源软件。 ### 总结 -如果你不是超级痴迷于数据,只是想快速了解网站的表现,Plausible 是一个不错的选择。我喜欢它,因为它是轻量级的,而且遵守隐私。这也是我在 Linux Handbook,我们[教授 Linux 服务器相关的门户网站][11]上使用它的主要原因。 +如果你不是超级痴迷于数据,只是想快速了解网站的表现,Plausible 是一个不错的选择。我喜欢它,因为它是轻量级的,而且遵守隐私。这也是我在 Linux Handbook,我们 [教授 Linux 服务器相关的门户网站][11] 上使用它的主要原因。 总的来说,我对 Plausible 相当满意,并向其他网站所有者推荐它。 @@ -73,7 +75,7 @@ via: https://itsfoss.com/plausible/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3d5c291fb50f83a79eb6e54d51ef298e0713dc81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 11:08:34 +0800 Subject: [PATCH 070/307] PUB @geekpi https://linux.cn/article-13283-1.html --- ...Plausible- Privacy-Focused Google Analytics Alternative.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md (98%) diff --git a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md similarity index 98% rename from translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md rename to published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index 5dac71e10e..aa8ad197f2 100644 --- a/translated/tech/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13283-1.html) Plausible:注重隐私的 Google Analytics 替代方案 ====== From 735df18ed81c57cca236adab17f763b43eb8f6d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 11:11:04 +0800 Subject: [PATCH 071/307] PRF --- ...5 Plausible- Privacy-Focused Google Analytics Alternative.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md index aa8ad197f2..7b97f5144e 100644 --- a/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md +++ b/published/20210325 Plausible- Privacy-Focused Google Analytics Alternative.md @@ -48,7 +48,7 @@ Plausible 使用的分析脚本是非常轻量级的,大小不到 1KB。 定价从每月 1 万页浏览量 6 美元开始。价格会随着页面浏览量的增加而增加。你可以在 Plausible 网站上计算价格。 -[Plausible Pricing][7] +- [Plausible 价格][7] 你可以试用 30 天,看看你是否愿意向 Plausible 开发者支付服务费用,并拥有你的数据。 From a7256192bd129de6c6b5de7b5c0f806a43f13416 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 13:13:49 +0800 Subject: [PATCH 072/307] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @max27149 翻译的不错 --- .../20210222 5 benefits of choosing Linux.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210222 5 benefits of choosing Linux.md b/translated/tech/20210222 5 benefits of choosing Linux.md index f56e7b4566..dc3f911df9 100644 --- a/translated/tech/20210222 5 benefits of choosing Linux.md +++ b/translated/tech/20210222 5 benefits of choosing Linux.md @@ -1,53 +1,54 @@ [#]: collector: (lujun9972) [#]: translator: (max27149) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 benefits of choosing Linux) [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) -# 选择 Linux 的5大好处 +选择 Linux 的五大好处 +====== -Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? +> Linux 的一大优点是多样化选择,选择激发了用户之间自由分享想法和解决方案。Linux 将如何激发你为这个社区做出贡献呢? -![Hand putting a Linux file folder into a drawer][1] +![](https://img.linux.net.cn/data/attachment/album/202104/10/131305ei6yyuyujui9fkkr.jpg) -到了2021年,人​​们比以往任何时候都更有理由喜欢 Linux。在本系列中,我将分享21个使用 Linux 的理由。本文讨论选择 Linux 带来的好处。 +到了 2021 年,人​​们比以往任何时候都更有理由喜欢 Linux。在本系列中,我将分享 21 个使用 Linux 的理由。本文讨论选择 Linux 带来的好处。 -_选择_ 是 Linux 中被误解最深的特性之一。这种误解从可被选择的 Linux 发行版数量就开始了。Distrowatch.org 报告了数百种可用的和活跃的 Linux 发行版。当然,在这些发行版当中,许多都是业余爱好项目或者对于某些晦涩需求的特别版。因为它是开源的,所以实际上,任何人都可以“重新设计”或“重新混搭”现有的Linux发行版,赋予一个新名称,提供一个新的默认墙纸,然后称其为自己的作品。尽管这些修改似乎微不足道,但我认为这显示了 Linux 的一些特别之处。 +_选择_ 是 Linux 中被误解最深的特性之一。这种误解从可被选择的 Linux 发行版数量就开始了。Distrowatch.org 报告了数百种可用的和活跃的 Linux 发行版。当然,在这些发行版当中,许多都是业余爱好项目或者针对某些晦涩需求的特别版。因为是开源的,所以实际上,任何人都可以“重新设计”或“重新混搭”现有的 Linux 发行版,赋予一个新名称,提供一个新的默认墙纸,然后称其为自己的作品。尽管这些修改似乎微不足道,但我认为这显示了 Linux 的一些特别之处。 ### 灵感 Linux 似乎一直在启迪着人们,从了解它的那一刻起,到创造出自己的版本。 -有数十家公司花费数百万美元来从他们自己的产品中获取灵感。商业技术广告试着强硬地说服你,只要你购买某种产品,你就会与所关心的人建立更多的联系,更具创造力,更加充满活力。这些广告以柔和的焦点拍摄4k视频,并使用愉悦而振奋的背景音乐,试图说服人们不仅购买而且还要支持和宣传该公司的产品。 +有数十家公司花费数百万美元来从他们自己的产品中获取灵感。商业技术广告试着强硬地说服你,只要你购买某种产品,你就会与所关心的人建立更多的联系,更具创造力、更加充满活力。这些广告用 4k 视频拍摄,焦点柔和,并在欢快振奋的音乐节奏下播放,试图说服人们不仅购买而且还要支持和宣传该公司的产品。 当然,Linux 基本没有营销预算,因为 Linux 是个形形色色的大集合,*没有固定实体*。然而,当人们发现它的存在时候,他们似乎就被启发着去构建属于自己的版本。 -量化灵感的数量是件难事,但是它显然很有价值,要不然那些公司不会花钱来尝试创造灵感。 +灵感的数量很难量化,但是它显然很有价值,要不然那些公司不会花钱来尝试创造灵感。 ### 革新 -灵感,无论给它标价有多难,它都因它的生产创造而有价值。许多 Linux 用户受启发来为各种奇怪问题定制解决方案。大多数由我们各自解决的问题,对于其他大部分人而言,似乎微不足道:也许你使用 [Seeed微控制器][2] 来监控番茄植株土壤的水分含量;或者你使用脚本来搜索 Python 软件包的索引,因为你会忘记每天导入的库的名称;或者设置了自动清理下载文件夹,因为将文件图标拖进回收站这个活儿干太多了。不管你在使用 Linux 的过程中,为自己解决过什么问题,都是这个平台包含的特性之一,你被这个正在运行中的开放的技术所启发,使其更好地服务于你自己。 +灵感,无论给它标价有多难,它都因它的生产创造而有价值。许多 Linux 用户受启发来为各种奇怪问题定制解决方案。我们解决的大多数问题,对于其他大部分人而言,似乎微不足道:也许你使用 [Seeed 微控制器][2] 来监控番茄植株土壤的水分含量;或者你使用脚本来搜索 Python 软件包的索引,因为你总是会忘记每天导入的库的名称;或者设置了自动清理下载文件夹,因为将文件图标拖进回收站这个活儿干太多了。不管你在使用 Linux 的过程中,为自己解决过什么问题,都是这个平台包含的特性之一,你被这个正在运行中的开放的技术所启发,使其更好地服务于你自己。 ### 开放策略 -诚然,不论是灵感,还是创新,都不能算 Linux 独有的属性。其他平台也确实让我们激发灵感,我们也以或大或小大的方式进行创新。运算能力已在很大程度上拉平了操作系统的竞争领域,你在一个操作系统上可以完成的任何事,在另一个操作系统上或许都能找到对应的方法来完成。 +诚然,不论是灵感,还是创新,都不能算 Linux 独有的属性。其他平台也确实让我们激发灵感,我们也以或大或小的方式进行创新。运算能力已在很大程度上拉平了操作系统的竞争领域,你在一个操作系统上可以完成的任何事,在另一个操作系统上或许都能找到对应的方法来完成。 -但是,许多用户发现,Linux 操作系统保留了坚定的开放策略,即当你尝试可能无人想到过的尝试时,Linux 不会阻挡你。这在闭源操作系统上不会发生,而且不可能发生,因为无法进入系统层级的某些区域,因为它们本身就是被设计为不开放源码的。有任意的封锁。当你完全按照操作系统的期望进行操作时,你不会碰到那些看不见的墙,但是当你明知要执行的操作只对你自己有意义的时候,你的系统环境可能变得无从适应。 +但是,许多用户发现,Linux 操作系统保留了坚定的开放策略,当你尝试可能无人想到过的尝试时,Linux 不会阻挡你。这种情况不会也不可能发生在专有的操作系统上,因为无法进入系统层级的某些区域,因为它们本身就是被设计为不开放源码的。有各种独断的封锁。当你完全按照操作系统的期望进行操作时,你不会碰到那些看不见的墙,但是当你心里想着要做一些只对你有意义的事情的时候,你的系统环境可能变得无从适应。 ### 小小的选择,大大的意义 -并非所有创新都是大的或重要的,但总的来说,它们带来的变化并不小。如今,数百万用户的那些疯狂想法在 Linux 的各个部分中愈发显现。它们存在于 KDE 或 GNOME 桌面的工作方式中,存在于 [31种不同的文本编辑器][3] 中——每一种都有人喜爱,存在于不计其数的浏览器插件和多媒体应用程序中,存在于文件系统和扩展属性中,以及数以百万计的 Linux 内核代码中。而且,如果上述功能中的哪怕仅其中一项,能让你每天额外节省下一小时时间,陪家人、朋友或用在自己的业余爱好上,那么按照定义,套用一句老话就是,“改变生活”。 +并非所有创新都是大的或重要的,但总的来说,它们带来的变化并不小。如今,数百万用户的那些疯狂想法在 Linux 的各个部分中愈发显现。它们存在于 KDE 或 GNOME 桌面的工作方式中,存在于 [31 种不同的文本编辑器][3] 中 —— 每一种都有人喜爱,存在于不计其数的浏览器插件和多媒体应用程序中,存在于文件系统和扩展属性中,以及数以百万行计的 Linux 内核代码中。而且,如果上述功能中的哪怕仅其中一项,能让你每天额外节省下一小时时间,陪家人、朋友或用在自己的业余爱好上,那么按照定义,套用一句老话就是,“改变生活”。 ### 在社区中交流 -开源行动的重要组成部分之一是共享工作。共享代码是开源软件中显而易见的、普遍流行的事务,但我认为,分享,可不仅仅是在 Gitlab 做一次提交那么简单。当人们彼此分享着自己的奇思妙想,除了获得有用的代码贡献作为回报外,再无其他动机,我们一致认为这是一种馈赠。这与你花钱从某公司购买软件时的感觉非常不同,甚至与得到某公司对外分享他们自己生产的开源代码时的感觉也有很大不同。开源的实质是,由全人类创造,服务于全人类。当知识和灵感可以被自由地分享时,人与人之间就建立了连接,这是市场营销学无法复制的东西,我认为我们都认同这一点。 +开源的重要组成部分之一是共享工作。共享代码是开源软件中显而易见的、普遍流行的事务,但我认为,分享,可不仅仅是在 Gitlab 做一次提交那么简单。当人们彼此分享着自己的奇思妙想,除了获得有用的代码贡献作为回报外,再无其他动机,我们都认为这是一种馈赠。这与你花钱从某公司购买软件时的感觉非常不同,甚至与得到某公司对外分享他们自己生产的开源代码时的感觉也有很大不同。开源的实质是,由全人类创造,服务于全人类。当知识和灵感可以被自由地分享时,人与人之间就建立了连接,这是市场营销活动无法复制的东西,我认为我们都认同这一点。 ### 选择 -Linux 并不是唯一拥有很多选择的平台。无论使用哪种操作系统,你都可以找到针对同一问题的多种解决方案,尤其是在深入研究开源软件的时候。但是,Linux 明显的决策水准指示了推动 Linux 前进的因素:诚邀协作。在 Linux 上,有些创造会很快消失,有些会在你家用电脑中保留数年——即便只是执行一些不起眼的自动化任务,然而有一些则非常成功,以至于被其他系统平台借鉴并变得司空见惯。没关系,无论你在 Linux 上创作出什么,都请毫不犹豫地把它加入千奇百怪的选择之中,你永远都不知道它可能会激发到谁的灵感。 +Linux 并不是唯一拥有很多选择的平台。无论使用哪种操作系统,你都可以找到针对同一问题的多种解决方案,尤其是在深入研究开源软件的时候。但是,Linux 明显的选择水准指示了推动 Linux 前进的因素:诚邀协作。在 Linux 上,有些创造会很快消失,有些会在你家用电脑中保留数年 —— 即便只是执行一些不起眼的自动化任务,然而有一些则非常成功,以至于被其他系统平台借鉴并变得司空见惯。没关系,无论你在 Linux 上创作出什么,都请毫不犹豫地把它加入千奇百怪的选择之中,你永远都不知道它可能会激发到谁的灵感。 --- @@ -56,7 +57,7 @@ via: https://opensource.com/article/21/2/linux-choice 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[max27149](https://github.com/max27149) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3843c073923f9ec5dfc3a63d2196a39053af797c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 10 Apr 2021 13:16:21 +0800 Subject: [PATCH 073/307] PUB @max27149 https://linux.cn/article-13284-1.html --- .../20210222 5 benefits of choosing Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210222 5 benefits of choosing Linux.md (98%) diff --git a/translated/tech/20210222 5 benefits of choosing Linux.md b/published/20210222 5 benefits of choosing Linux.md similarity index 98% rename from translated/tech/20210222 5 benefits of choosing Linux.md rename to published/20210222 5 benefits of choosing Linux.md index dc3f911df9..df05f65e43 100644 --- a/translated/tech/20210222 5 benefits of choosing Linux.md +++ b/published/20210222 5 benefits of choosing Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (max27149) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13284-1.html) [#]: subject: (5 benefits of choosing Linux) [#]: via: (https://opensource.com/article/21/2/linux-choice) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 5dae1480fff01769c314cd469655a2be57d70ba4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 11 Apr 2021 05:03:33 +0800 Subject: [PATCH 074/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210411=20?= =?UTF-8?q?GNOME=E2=80=99s=20Very=20Own=20=E2=80=9CGNOME=20OS=E2=80=9D=20i?= =?UTF-8?q?s=20Not=20a=20Linux=20Distro=20for=20Everyone=20[Review]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md --- ...Not a Linux Distro for Everyone -Review.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md diff --git a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md new file mode 100644 index 0000000000..cfe341cedd --- /dev/null +++ b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -0,0 +1,133 @@ +[#]: subject: (GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review]) +[#]: via: (https://itsfoss.com/gnome-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review] +====== + +Whenever a major release for GNOME arrives, it is always tempting to try it out as soon as possible. But, to get your hands on it first to test it, you had to mostly rely on [Fedora Rawhide][1] (development branch). + +However, a development branch isn’t always hassle-free. So, it wasn’t the most convenient solution to try the latest GNOME. Now, by testing, I don’t mean just for users but also being able to test design changes for the developers as well. + +So, GNOME OS recently came to the rescue to ease the process of testing. But, what exactly is it and how to get it installed? Let us take a look. + +### What is GNOME OS? + +GNOME OS is not a separate full-fledged Linux distribution. In fact, it isn’t based on anything at all. It’s an incomplete reference system just to make GNOME desktop work. **It is just a bootable VM (Virtual Machine) image tailored for debugging and testing features before it hits any distribution’s repository.** + +One of the GNOME blogs mention it as: + +> GNOME OS aims to better facilitate development of GNOME by providing a working system for development, design, and user testing purposes. + +If you’re curious, you may want to check out a [blog post][2] on Planet GNOME to know more about GNOME OS. + +### If it’s not a full-fledged Linux distribution then what is it used for? + +![][3] + +It is interesting to note that a new GNOME OS image can be created for every new commit made, so it should make the testing process efficient and help you test/find issues early in the development cycle. + +Not to forget, designers no longer have to build the software themselves to test the GNOME Shell or any other core modules. It saves them time and the whole GNOME development cycle. + +Of course, not just limited to developers and technical testers, it also lets journalists to get their hands on the latest and greatest to cover a story about GNOME’s next release or how it’s being shaped. + +The media and the GNOME team also gets a good opportunity to prepare visual materials to promote the release in both video/picture format thanks to GNOME OS. + +### How to install GNOME OS? + +To easily install GNOME OS, you will need to install GNOME Boxes application first. + +#### Installing GNOME Boxes + +‘**Boxes**‘ is a simple virtualization software that does not offer any advanced options but lets you easily install an operating system image to test quickly. It is targeted specially for desktop end-users, so it is easy to use as well. + +To install it on any Linux distribution, you can utilize the [Flatpak][4] package from [Flathub][5]. In case you don’t know about a Flatpak, you might want to read our guide on [installing and using Flatpak in Linux][6]. + +You may also directly install it from the terminal on any Ubuntu-based distro by typing this: + +``` +sudo apt install gnome-boxes +``` + +Once you get Boxes installed, it is fairly easy to install GNOME OS from here. + +#### Install GNOME OS + +After you have Boxes installed, you need to launch the program. Next, click on the “**+**” sign that you see in the upper-left corner of the window and then click on “**Operating System Download**” as shown in the image below. + +![][7] + +This option lets you directly download the image file and then you can proceed to install it. + +All you need to do is search for “GNOME” and you should find the Nightly build available. This will ensure that you are trying the latest and greatest GNOME version in development. + +Alternatively, you can head to the [GNOME OS Nightly website][8] and download the system image and choose the “**Operating System Image File**” in the Boxes app to select the ISO as shown in the screenshot above to proceed installing it. + +![][9] + +Considering you didn’t download the image separately. When you click on it, the download should start and a progress bar will appear: + +![][10] + +Once it is done, it will ask you to customize the configuration if needed and let you create the VM as shown below: + +![][11] + +You can customize the resource allocation depending on your available system resources, but you should be good to go with the default settings. + +Click on “**Create**” and it will directly start GNOME OS installation: + +![][12] + +Select the existing version and proceed. Next, you will have to select the disk (keep it as is) and then agree to erasing all your files and apps (it won’t delete anything from your local computer). + +![][13] + +Now, it will simply reformat and install it. And, you’re done. It will prompt you to restart it and when you do, you will find GNOME OS installed. + +It will simply boot up as any Linux distro would and will ask you to set up a few things, including the username and a password. And, you’re good to explore! + +If you are curious what it looks like, it’s basically the latest GNOME desktop environment. I used GNOME OS to make an overview video of GNOME 40 before the official release. + +### Closing Thoughts + +GNOME OS is definitely something useful for developers, designers, and the media. It makes it easy to test the latest development version of GNOME without investing a lot of time. + +I could test [GNOME 40][14] quickly just because of this. Of course, you will have to keep in mind that this isn’t a fully functional OS that you should install on a physical device. There are plans to make one available to run on a physical machine, but as it stands now, it is only tailored for virtual machines, especially using GNOME Boxes. + +GNOME Boxes does not offer any advanced options, so it becomes quite easy to set it up and use it. You might want to tweak the resources if the experience is too slow, but it was a good experience overall in my case. + +Have you tried GNOME OS yet? Feel free to let me know your thoughts in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://fedoraproject.org/wiki/Releases/Rawhide +[2]: https://blogs.gnome.org/alatiera/2020/10/07/what-is-gnome-os/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-OS-distro-review.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://flathub.org/apps/details/org.gnome.Boxes +[6]: https://itsfoss.com/flatpak-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-search.jpg?resize=800%2C729&ssl=1 +[8]: https://os.gnome.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-boxes.jpg?resize=800%2C694&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-download.jpg?resize=798%2C360&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-boxes-vm-setup.png?resize=800%2C301&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-nightly-install.jpg?resize=800%2C636&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-installation.jpg?resize=800%2C619&ssl=1 +[14]: https://news.itsfoss.com/gnome-40-release/ From 15012eed7c0c047c69dd2cdb6ab3e82900820ff1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 11 Apr 2021 05:03:52 +0800 Subject: [PATCH 075/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210410=20?= =?UTF-8?q?5=20signs=20you're=20a=20groff=20programmer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210410 5 signs you-re a groff programmer.md --- ...10410 5 signs you-re a groff programmer.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20210410 5 signs you-re a groff programmer.md diff --git a/sources/tech/20210410 5 signs you-re a groff programmer.md b/sources/tech/20210410 5 signs you-re a groff programmer.md new file mode 100644 index 0000000000..6708800e7e --- /dev/null +++ b/sources/tech/20210410 5 signs you-re a groff programmer.md @@ -0,0 +1,77 @@ +[#]: subject: (5 signs you're a groff programmer) +[#]: via: (https://opensource.com/article/21/4/groff-programmer) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 signs you're a groff programmer +====== +Learning groff, an old-school text processor, is like learning to ride a +bicycle. +![Typewriter in the grass][1] + +I first discovered Unix systems in the early 1990s, when I was an undergraduate at university. I liked it so much that I replaced the MS-DOS system on my home computer with the Linux operating system. + +One thing that Linux didn't have in the early to mid-1990s was a word processor. A standard office application on other desktop operating systems, a word processor lets you edit text easily. I often used a word processor on DOS to write my papers for class. I wouldn't find a Linux-native word processor until the late 1990s. Until then, word processing was one of the rare reasons I maintained dual-boot on my first computer, so I could occasionally boot back into DOS to write papers. + +Then I discovered that Linux provided kind of a word processor. GNU troff, better known as [groff][2], is a modern implementation of a classic text processing system called troff, short for "typesetter roff," which is an improved version of the nroff system. And nroff was meant to be a new implementation of the original roff (which stood for "run off," as in to "run off" a document). + +With text processing, you edit text in a plain text editor, and you add formatting through macros or other processing commands. You then process that text file through a text-processing system such as groff to generate formatted output suitable for a printer. Another well-known text processing system is LaTeX, but groff was simple enough for my needs. + +With a little practice, I found I could write my class papers just as easily in groff as I could using a word processor on Linux. While I don't use groff to write documents today, I still remember the macros and commands to generate printed documents with it. And if you're the same and you learned how to write with groff all those years ago, you probably recognize these five signs that you're a groff writer. + +### 1\. You have a favorite macro set + +You format a document in groff by writing plain text interspersed with macros. A macro in groff is a short command that starts with a single period at the beginning of a line. For example: if you want to insert a few lines into your output, the `.sp 2` macro command adds two blank lines. groff supports other basic macros for all kinds of formatting. + +To make formatting a document easier for the writer, groff also provides different _macro sets_, collections of macros that let you format documents your own way. The first macro set I learned was the `-me` macro set. Really, the macro set is called the `e` macro set, and you specify the `e` macro set when you process a file using the `-me` option. + +groff includes other macro sets, too. For example, the `-man` macro set used to be the standard macro set to format the built-in _manual_ pages on Unix systems, and the `-ms` macro set is often used to format certain other technical documents. If you learned to write with groff, you probably have a favorite macro set. + +### 2\. You want to focus on your content, not the formatting + +One great feature of writing with groff is that you can focus on your _content_ and not worry too much about what it looks like. That is a handy feature for technical writers. groff is a great "distraction-free" environment for professional writers. At least, as long as you don't mind delivering your output in any of the formats that groff supports with the `-T` command-line option, including PDF, PostScript, HTML, and plain text. You can't generate a LibreOffice ODT file or Word DOC file directly from groff. + +Once you get comfortable writing in groff, the macros start to _disappear_. The formatting macros become part of the background, and you focus purely on the text in front of you. I've done enough writing in groff that I don't even see the macros anymore. Maybe it's like writing programming code, and your mind just switches gears, so you think like a computer and see the code as a set of instructions. For me, writing in groff is like that; I just see my text, and my mind interprets the macros automatically into formatting. + +### 3\. You like the old-school feel + +Sure, it might be _easier_ to write your documents with a more typical word processor like LibreOffice Writer or even Google Docs or Microsoft Word. And for certain kinds of documents, a desktop word processor is the right fit. But if you want the "old-school" feel, it's hard to beat writing in groff. + +I'll admit that I do most of my writing with LibreOffice Writer, which does an outstanding job. But when I get that itch to do it "old-school," I'll open an editor and write my document using groff. + +### 4\. You like that you can use it anywhere + +groff (and its cousins) are a standard package on almost any Unix system. And with groff, the macros don't change. For example, the `-me` macros should be the same from system to system. So once you've learned to use the macros on one system, you can use them on the next system. + +And because groff documents are just plain text, you can use any editor you like to edit your documents for groff. I like to use GNU Emacs to edit my groff documents, but you can use GNOME Gedit, Vim, or your [favorite text editor][3]. Most editors include some kind of "mode" that will highlight the groff macros in a different color from the rest of your text to help you spot errors before processing the file. + +### 5\. You wrote this article in -me + +When I decided to write this article, I thought the best way would be to use groff directly. I wanted to demonstrate how flexible groff was in preparing documents. So even though you're reading this on a website, the article was originally written using groff. + +I hope this has interested you in learning how to use groff to write documents. If you'd like to use more advanced functions in the `-me` macro set, refer to Eric Allman's _Writing papers with groff using -me_, which you should find on your system as **meintro.me** in groff's documentation. It's a great reference document that explains other ways to format papers using the `-me` macros. + +I've also included a copy of the original draft of my article that uses the `-me` macros. Save the file to your system as **five-signs-groff.me**, and run it through groff to view it. The `-T` option sets the output type, such as `-Tps` to generate PostScript output or `-Thtml` to create an HTML file. For example: + +groff -me -Thtml five-signs-groff.me > five-signs-groff.html + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/groff-programmer + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) +[2]: https://en.wikipedia.org/wiki/Groff_(software) +[3]: https://opensource.com/article/21/2/open-source-text-editors From a6513e5d11108074e607c413babb577ccb41ffcf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 09:34:50 +0800 Subject: [PATCH 076/307] PRF @DCOLIVERSUN --- ...10401 Find what changed in a Git commit.md | 92 +++++++++---------- 1 file changed, 45 insertions(+), 47 deletions(-) diff --git a/translated/tech/20210401 Find what changed in a Git commit.md b/translated/tech/20210401 Find what changed in a Git commit.md index f95ac5cb4b..82d093b12e 100644 --- a/translated/tech/20210401 Find what changed in a Git commit.md +++ b/translated/tech/20210401 Find what changed in a Git commit.md @@ -3,119 +3,117 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 查看 Git 提交中发生了什么变化 ====== -Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 -![运行在电脑中的代码][1] -如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 _每个人_ 每天的提交都是安全的,你会意识到 Git 日志会变得多么混乱,看似不停地滚动变化,却没有任何改变的迹象。 +> Git 提供了几种方式可以帮你快速查看提交中哪些文件被改变。 + +![](https://img.linux.net.cn/data/attachment/album/202104/11/093421yuololouo66woulu.jpg) + +如果你每天使用 Git,应该会提交不少改动。如果你每天和其他人在一个项目中使用 Git,假设 _每个人_ 每天的提交都是安全的,你会意识到 Git 日志会变得多么混乱,似乎永恒地滚动着变化,却没有任何迹象表明修改了什么。 那么,你该怎样查看指定提交中文件发生哪些变化?这比你想的容易。 ### 查看提交中文件发生的变化 -为了发现指定提交中哪些文件发生变化,可以使用 `git log --raw` 命令。这是发现提交影响哪些文件的最快速、最方便的方法。`git log` 命令不常用,主要是因为它有太多的格式选项,许多用户在面对很多选择以及在一些情况下不明所以的文档时,会望而却步。 +要想知道指定提交中哪些文件发生变化,可以使用 `git log --raw` 命令。这是发现一个提交影响了哪些文件的最快速、最方便的方法。`git log` 命令一般都没有被充分利用,主要是因为它有太多的格式化选项,许多用户在面对很多选择以及在一些情况下不明所以的文档时,会望而却步。 然而,Git 的日志机制非常灵活,`--raw` 选项提供了当前分支中的提交日志,以及更改的文件列表。 以下是标准的 `git log` 输出: - ``` $ git log -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux +Date: Sun Nov 5 21:40:37 2020 +1300 -    exit immediately from failed download + exit immediately from failed download commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 +Author: Tux +Date: Fri Aug 5 02:05:19 2020 +1200 -    export makeopts from etc/example.conf + export makeopts from etc/example.conf commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 +Author: Tux +Date: Sun Jul 31 21:45:24 2020 +1200 -    fix typo in help message + fix typo in help message ``` 即使作者在提交消息中指定了哪些文件发生变化,日志也相当简洁。 以下是 `git log --raw` 输出: - ``` $ git log --raw -commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) -Author: tux <[tux@example.com][2]> -Date:   Sun Nov 5 21:40:37 2020 +1300 +commit fbbbe083aed75b24f2c77b1825ecab10def0953c (HEAD -> dev, origin/dev) +Author: tux +Date: Sun Nov 5 21:40:37 2020 +1300 -    exit immediately from failed download + exit immediately from failed download -:100755 100755 cbcf1f3 4cac92f M        src/example.lua +:100755 100755 cbcf1f3 4cac92f M src/example.lua commit 094f9948cd995acfc331a6965032ea0d38e01f03 (origin/master, master) -Author: Tux <[tux@example.com][2]> -Date:   Fri Aug 5 02:05:19 2020 +1200 +Author: Tux +Date: Fri Aug 5 02:05:19 2020 +1200 -    export makeopts from etc/example.conf -    -:100755 100755 4c815c0 cbcf1f3 M     src/example.lua -:100755 100755 71653e1 8f5d5a6 M     src/example.spec -:100644 100644 9d21a6f e33caba R100  etc/example.conf  etc/example.conf-default + export makeopts from etc/example.conf + +:100755 100755 4c815c0 cbcf1f3 M src/example.lua +:100755 100755 71653e1 8f5d5a6 M src/example.spec +:100644 100644 9d21a6f e33caba R100 etc/example.conf etc/example.conf-default commit 76b7b46dc53ec13316abb49cc7b37914215acd47 -Author: Tux <[tux@example.com][2]> -Date:   Sun Jul 31 21:45:24 2020 +1200 +Author: Tux +Date: Sun Jul 31 21:45:24 2020 +1200 -    fix typo in help message + fix typo in help message -:100755 100755 e253aaf 4c815c0 M        src/example.lua +:100755 100755 e253aaf 4c815c0 M src/example.lua ``` 这会准确告诉你哪个文件被添加到提交中,哪些文件发生改变(`A` 是添加,`M` 是修改,`R` 是重命名,`D` 是删除)。 ### Git whatchanged -`git whatchanged` 命令是日志功能之前的遗留命令。文档说用户不应该用该命令支持 `git log --raw`,并且暗示它本质上已经被否决了。除了合并提交,我仍然发现它的输出与 `git log --raw` 的输出大部分相同,它是一个有用的快捷方式。如果它被删除的话,我期望为他创建一个别名。如果你只想查看已更改的文件,不需要在日志中合并提交,可以尝试 `git whatchanged` 作为简单的助记符。 +`git whatchanged` 命令是一个遗留命令,它的前身是日志功能。文档说用户不应该用该命令替代 `git log --raw`,并且暗示它实质上已经被废弃了。不过,我还是觉得它是一个很有用的捷径,可以得到同样的输出结果(尽管合并提交的内容不包括在内),如果它被删除的话,我打算为它创建一个别名。如果你只想查看已更改的文件,不想在日志中看到合并提交,可以尝试 `git whatchanged` 作为简单的助记符。 ### 查看变化 -你不仅可以看到哪些文件发生更改,还可以使用 `git log` 显示文件中发生了哪些变化。你的 Git 日志可以生成一个内联比较,用 `--patch` 选项可以逐行显示每个文件的所有更改: - +你不仅可以看到哪些文件发生更改,还可以使用 `git log` 显示文件中发生了哪些变化。你的 Git 日志可以生成一个内联差异,用 `--patch` 选项可以逐行显示每个文件的所有更改: ``` -commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) -Author: Tux <[Tux@example.com][3]> -Date:   Wed Mar 10 06:46:58 2021 +1300 +commit 62a2daf8411eccbec0af69e4736a0fcf0a469ab1 (HEAD -> master) +Author: Tux +Date: Wed Mar 10 06:46:58 2021 +1300 -    commit + commit diff --git a/hello.txt b/hello.txt index 65a56c3..36a0a7d 100644 -\--- a/hello.txt +--- a/hello.txt +++ b/hello.txt @@ -1,2 +1,2 @@ - Hello + Hello -world +opensource.com ``` -在这个例子中,"world" 这行字从 `hello.txt` 中删掉,"opensource.com" 这行字则添加进去。 +在这个例子中,“world” 这行字从 `hello.txt` 中删掉,“opensource.com” 这行字则添加进去。 如果你需要在其他地方手动进行相同的修改,这些补丁patch可以与常见的 Unix 命令一起使用,例如 [diff 与 patch][4]。补丁也是一个好方法,可以总结指定提交中引入新信息的重要部分内容。当你在冲刺阶段引入一个 bug 时,你会发现这里的内容就是非常有价值的概述。为了更快地找到错误的原因,你可以忽略文件中没有更改的部分,只检查新代码。 +### 用简单命令得到复杂的结果 -### 得到复杂结果的简单命令 - -你不必理解引用、分支和提交哈希,就可以查看提交中更改了哪些文件。你的 Git 日志旨在向你报告 Git 活动,如果你想以特定方式格式化它或者提取特定的信息,通常需要费力地浏览许多文档来组合出正确的命令。幸运的是,Git 历史上最常用的请求之一只有一两个选项:`--raw` 与 `--patch`。如果你不记得 `--raw`,就想想“Git,改变什么了?”,然后输入 `git whatchanged`。 +你不必理解引用、分支和提交哈希,就可以查看提交中更改了哪些文件。你的 Git 日志旨在向你报告 Git 的活动,如果你想以特定方式格式化它或者提取特定的信息,通常需要费力地浏览许多文档来组合出正确的命令。幸运的是,关于 Git 历史记录最常用的请求之一只需要一两个选项:`--raw` 与 `--patch`。如果你不记得 `--raw`,就想想“Git,什么改变了?”,然后输入 `git whatchanged`。 -------------------------------------------------------------------------------- @@ -124,7 +122,7 @@ via: https://opensource.com/article/21/4/git-whatchanged 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e53d5a6d388c3676c75c51bdb125fc54f2991c52 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 09:35:49 +0800 Subject: [PATCH 077/307] PUB @DCOLIVERSUN https://linux.cn/article-13286-1.html --- .../20210401 Find what changed in a Git commit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210401 Find what changed in a Git commit.md (98%) diff --git a/translated/tech/20210401 Find what changed in a Git commit.md b/published/20210401 Find what changed in a Git commit.md similarity index 98% rename from translated/tech/20210401 Find what changed in a Git commit.md rename to published/20210401 Find what changed in a Git commit.md index 82d093b12e..47202013ef 100644 --- a/translated/tech/20210401 Find what changed in a Git commit.md +++ b/published/20210401 Find what changed in a Git commit.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13286-1.html) 查看 Git 提交中发生了什么变化 ====== From e9f799e579a3eebf7b4e3ac4514bf3a71c99d8d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 09:48:58 +0800 Subject: [PATCH 078/307] APL --- ...Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md index cfe341cedd..57a5352e8f 100644 --- a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md +++ b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/gnome-os/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 84b674b2a70217da80d2e096ce323351c4abfb4b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 10:32:59 +0800 Subject: [PATCH 079/307] TSL&PRF --- ...Not a Linux Distro for Everyone -Review.md | 133 ----------------- ...Not a Linux Distro for Everyone -Review.md | 135 ++++++++++++++++++ 2 files changed, 135 insertions(+), 133 deletions(-) delete mode 100644 sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md create mode 100644 translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md diff --git a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md deleted file mode 100644 index 57a5352e8f..0000000000 --- a/sources/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md +++ /dev/null @@ -1,133 +0,0 @@ -[#]: subject: (GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review]) -[#]: via: (https://itsfoss.com/gnome-os/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review] -====== - -Whenever a major release for GNOME arrives, it is always tempting to try it out as soon as possible. But, to get your hands on it first to test it, you had to mostly rely on [Fedora Rawhide][1] (development branch). - -However, a development branch isn’t always hassle-free. So, it wasn’t the most convenient solution to try the latest GNOME. Now, by testing, I don’t mean just for users but also being able to test design changes for the developers as well. - -So, GNOME OS recently came to the rescue to ease the process of testing. But, what exactly is it and how to get it installed? Let us take a look. - -### What is GNOME OS? - -GNOME OS is not a separate full-fledged Linux distribution. In fact, it isn’t based on anything at all. It’s an incomplete reference system just to make GNOME desktop work. **It is just a bootable VM (Virtual Machine) image tailored for debugging and testing features before it hits any distribution’s repository.** - -One of the GNOME blogs mention it as: - -> GNOME OS aims to better facilitate development of GNOME by providing a working system for development, design, and user testing purposes. - -If you’re curious, you may want to check out a [blog post][2] on Planet GNOME to know more about GNOME OS. - -### If it’s not a full-fledged Linux distribution then what is it used for? - -![][3] - -It is interesting to note that a new GNOME OS image can be created for every new commit made, so it should make the testing process efficient and help you test/find issues early in the development cycle. - -Not to forget, designers no longer have to build the software themselves to test the GNOME Shell or any other core modules. It saves them time and the whole GNOME development cycle. - -Of course, not just limited to developers and technical testers, it also lets journalists to get their hands on the latest and greatest to cover a story about GNOME’s next release or how it’s being shaped. - -The media and the GNOME team also gets a good opportunity to prepare visual materials to promote the release in both video/picture format thanks to GNOME OS. - -### How to install GNOME OS? - -To easily install GNOME OS, you will need to install GNOME Boxes application first. - -#### Installing GNOME Boxes - -‘**Boxes**‘ is a simple virtualization software that does not offer any advanced options but lets you easily install an operating system image to test quickly. It is targeted specially for desktop end-users, so it is easy to use as well. - -To install it on any Linux distribution, you can utilize the [Flatpak][4] package from [Flathub][5]. In case you don’t know about a Flatpak, you might want to read our guide on [installing and using Flatpak in Linux][6]. - -You may also directly install it from the terminal on any Ubuntu-based distro by typing this: - -``` -sudo apt install gnome-boxes -``` - -Once you get Boxes installed, it is fairly easy to install GNOME OS from here. - -#### Install GNOME OS - -After you have Boxes installed, you need to launch the program. Next, click on the “**+**” sign that you see in the upper-left corner of the window and then click on “**Operating System Download**” as shown in the image below. - -![][7] - -This option lets you directly download the image file and then you can proceed to install it. - -All you need to do is search for “GNOME” and you should find the Nightly build available. This will ensure that you are trying the latest and greatest GNOME version in development. - -Alternatively, you can head to the [GNOME OS Nightly website][8] and download the system image and choose the “**Operating System Image File**” in the Boxes app to select the ISO as shown in the screenshot above to proceed installing it. - -![][9] - -Considering you didn’t download the image separately. When you click on it, the download should start and a progress bar will appear: - -![][10] - -Once it is done, it will ask you to customize the configuration if needed and let you create the VM as shown below: - -![][11] - -You can customize the resource allocation depending on your available system resources, but you should be good to go with the default settings. - -Click on “**Create**” and it will directly start GNOME OS installation: - -![][12] - -Select the existing version and proceed. Next, you will have to select the disk (keep it as is) and then agree to erasing all your files and apps (it won’t delete anything from your local computer). - -![][13] - -Now, it will simply reformat and install it. And, you’re done. It will prompt you to restart it and when you do, you will find GNOME OS installed. - -It will simply boot up as any Linux distro would and will ask you to set up a few things, including the username and a password. And, you’re good to explore! - -If you are curious what it looks like, it’s basically the latest GNOME desktop environment. I used GNOME OS to make an overview video of GNOME 40 before the official release. - -### Closing Thoughts - -GNOME OS is definitely something useful for developers, designers, and the media. It makes it easy to test the latest development version of GNOME without investing a lot of time. - -I could test [GNOME 40][14] quickly just because of this. Of course, you will have to keep in mind that this isn’t a fully functional OS that you should install on a physical device. There are plans to make one available to run on a physical machine, but as it stands now, it is only tailored for virtual machines, especially using GNOME Boxes. - -GNOME Boxes does not offer any advanced options, so it becomes quite easy to set it up and use it. You might want to tweak the resources if the experience is too slow, but it was a good experience overall in my case. - -Have you tried GNOME OS yet? Feel free to let me know your thoughts in the comments down below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gnome-os/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://fedoraproject.org/wiki/Releases/Rawhide -[2]: https://blogs.gnome.org/alatiera/2020/10/07/what-is-gnome-os/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-OS-distro-review.png?resize=800%2C450&ssl=1 -[4]: https://itsfoss.com/what-is-flatpak/ -[5]: https://flathub.org/apps/details/org.gnome.Boxes -[6]: https://itsfoss.com/flatpak-guide/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-search.jpg?resize=800%2C729&ssl=1 -[8]: https://os.gnome.org/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-boxes.jpg?resize=800%2C694&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-download.jpg?resize=798%2C360&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-boxes-vm-setup.png?resize=800%2C301&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-nightly-install.jpg?resize=800%2C636&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-installation.jpg?resize=800%2C619&ssl=1 -[14]: https://news.itsfoss.com/gnome-40-release/ diff --git a/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md new file mode 100644 index 0000000000..bc1e438b16 --- /dev/null +++ b/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -0,0 +1,135 @@ +[#]: subject: (GNOME’s Very Own “GNOME OS” is Not a Linux Distro for Everyone [Review]) +[#]: via: (https://itsfoss.com/gnome-os/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +GNOME OS:一个并不是适合所有人的 Linux 发行版 +====== + +![](https://img.linux.net.cn/data/attachment/album/202104/11/103205t34lcaa3t0a3xjjw.jpg) + +每当 GNOME 的一个重要版本到来时,总是很想尽快试用它。但是,要想第一时间进行测试,主要还是得依靠 [Fedora Rawhide][1] 开发分支。 + +然而,开发分支并不总是让人放心的,所以,用来尝试最新的 GNOME 并不是最方便的解决方案。这里,我所说的测试,并不仅仅是指用户的测试,同时也能够用于开发者对设计变更进行测试。 + +所以,最近来了个大救星 GNOME OS,让测试的过程变得轻松起来。但是,它到底是什么,怎么安装呢?让我们一起来看看吧。 + +### 什么是 GNOME OS? + +GNOME OS 并不是一个独立完整的 Linux 发行版。事实上,它根本不基于任何东西。它是一个不完整的参考系统,只是为了让 GNOME 桌面工作。它仅仅是一个可启动的虚拟机镜像,在 GNOME 进入任何发行版的仓库之前,为调试和测试功能而量身定做的。 + +在 GNOME 的博客中,有一篇提到了它: + +> GNOME OS 旨在通过提供一个用于开发、设计和用户测试的工作系统,来更好地促进 GNOME 的开发。 + +如果你好奇的话,你可以看看 GNOME 星球上的一篇 [博客文章][2] 来了解关于 GNOME OS 的更多信息。 + +### 如果它不是一个成熟的 Linux 发行版,那么它是用来干什么的? + +![][3] + +值得注意的是,每一次新的提交都可以创建一个新的 GNOME OS 镜像,所以它应该会使测试过程变得高效,并帮助你在开发周期的早期测试并发现问题。 + +不要忘了,设计者不再需要自己构建软件来测试 GNOME Shell 或任何其他核心模块。这为他们节省了时间和整个 GNOME 开发周期。 + +当然,不仅限于开发者和技术测试人员,它还可以让记者们拿到最新的和最棒的东西,来报道 GNOME 下一个版本或它是如何成型的。 + +媒体和 GNOME 团队也得到了一个很好的机会,借助于 GNOME OS,他们可以准备视频、图片两种形式的视觉资料来宣传此次发布。 + +### 如何安装 GNOME OS? + +要轻松安装 GNOME OS,你需要先安装 GNOME Boxes 应用程序。 + +#### 安装 GNOME Boxes + +Boxes 是一款简单的虚拟化软件,它不提供任何高级选项,但可以让你轻松安装操作系统镜像来快速测试。它是专门针对桌面终端用户的,所以使用起来也很方便。 + +要在任何 Linux 发行版上安装它,你可以利用 [Flathub][5] 的 [Flatpak][4] 包。如果你不知道 Flatpak,你可能需要阅读我们的《[在 Linux 中安装和使用 Flatpak][6]》指南。 + +你也可以在任何基于 Ubuntu 的发行版上直接在终端上输入以下内容进行安装: + +``` +sudo apt install gnome-boxes +``` + +一旦你安装了 Boxes,从这里安装 GNOME OS 就相当容易了。 + +#### 安装 GNOME OS + +安装好 Boxes 后,你需要启动程序。接下来,点击窗口左上角的 “+” 标志,然后点击 “操作系统下载”,如下图所示。 + +![][7] + +这个选项可以让你直接下载镜像文件,然后就可以继续安装它。 + +你所需要做的就是搜索 “GNOME”,然后你应该会找到可用的每夜构建版。这可以确保你正在尝试最新和最优秀的 GNOME 开发版本。 + +另外,你也可以前往 [GNOME OS 每夜构建网站][8] 下载系统镜像,然后在 Boxes 应用中选择 “运行系统镜像文件” 选择该 ISO,如上图截图所示,继续安装。 + +![][9] + +考虑到你没有单独下载镜像。当你点击后,应该会开始下载,并且会出现一个进度条。 + +![][10] + +完成后,如果需要,它会要求你自定义配置,让你创建虚拟机,如下图所示。 + +![][11] + +你可以根据你可用的系统资源来定制资源分配,但应该可以使用默认设置。 + +点击 “创建”,就会直接开始 GNOME OS 的安装。 + +![][12] + +选择“使用现有的版本”,然后继续。接下来,你必须选择磁盘(保持原样),然后同意擦除你所有的文件和应用程序(它不会删除本地计算机上的任何东西)。 + +![][13] + +现在,它将简单地重新格式化并安装它。然后就完成了。它会提示你重启,重启后,你会发现 GNOME OS 已经安装好了。 + +它会像其他 Linux 发行版一样简单地启动,并要求你设置一些东西,包括用户名和密码。然后,你就可以开始探索了。 + +如果你想知道它的样子,它基本上就是最新的 GNOME 桌面环境。在 GNOME 40 正式发布之前,我用 GNOME OS 做了一个 GNOME 40 的概述视频。 + +### 结束语 + +GNOME OS 绝对是对开发者、设计师和媒体有用的东西。它可以让你轻松地测试最新的 GNOME 开发版本,而无需投入大量的时间。 + +我可以很快地测试 [GNOME 40][14],就是因为这个。当然,你要记住,这并不是一个可以在物理设备上安装的完整功能的操作系统。他们有计划让它可以在物理机器上运行,但就目前而言,它只是为虚拟机量身定做的,尤其是使用 GNOME Boxes。 + +GNOME Boxes 并没有提供任何高级选项,所以设置和使用它变得相当容易。如果体验太慢的话,你可能要调整一下资源,但在我的情况下,总体来说是一个不错的体验。 + +你试过 GNOME OS 了吗?欢迎在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnome-os/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://fedoraproject.org/wiki/Releases/Rawhide +[2]: https://blogs.gnome.org/alatiera/2020/10/07/what-is-gnome-os/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/GNOME-OS-distro-review.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://flathub.org/apps/details/org.gnome.Boxes +[6]: https://itsfoss.com/flatpak-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-search.jpg?resize=800%2C729&ssl=1 +[8]: https://os.gnome.org/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-boxes.jpg?resize=800%2C694&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-download.jpg?resize=798%2C360&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-boxes-vm-setup.png?resize=800%2C301&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-nightly-install.jpg?resize=800%2C636&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/gnome-os-installation.jpg?resize=800%2C619&ssl=1 +[14]: https://news.itsfoss.com/gnome-40-release/ From ae142200fca6b21d9e3c66f023d0bf629ac3760f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 11 Apr 2021 10:34:58 +0800 Subject: [PATCH 080/307] PUB @wxy https://linux.cn/article-13287-1.html --- ...n -GNOME OS- is Not a Linux Distro for Everyone -Review.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md (99%) diff --git a/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md b/published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md similarity index 99% rename from translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md rename to published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md index bc1e438b16..0e251d8829 100644 --- a/translated/tech/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md +++ b/published/20210411 GNOME-s Very Own -GNOME OS- is Not a Linux Distro for Everyone -Review.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13287-1.html) GNOME OS:一个并不是适合所有人的 Linux 发行版 ====== From 0daec50e9c07212042ada7e1d4fd3d7d1a235652 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 11 Apr 2021 20:32:15 +0800 Subject: [PATCH 081/307] Translating --- ...10330 Access Python package index JSON APIs with requests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210330 Access Python package index JSON APIs with requests.md b/sources/tech/20210330 Access Python package index JSON APIs with requests.md index 3150248d58..7f4a9f9df2 100644 --- a/sources/tech/20210330 Access Python package index JSON APIs with requests.md +++ b/sources/tech/20210330 Access Python package index JSON APIs with requests.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/python-package-index-json-apis-requests) [#]: author: (Ben Nuttall https://opensource.com/users/bennuttall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 26438904800ceed409348843f23661e6b6bb494b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 12 Apr 2021 05:02:54 +0800 Subject: [PATCH 082/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210411=20?= =?UTF-8?q?Why=20Crate.io=20has=20returned=20to=20its=20pure=20open=20sour?= =?UTF-8?q?ce=20roots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md --- ... returned to its pure open source roots.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md diff --git a/sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md b/sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md new file mode 100644 index 0000000000..2de53527f4 --- /dev/null +++ b/sources/tech/20210411 Why Crate.io has returned to its pure open source roots.md @@ -0,0 +1,49 @@ +[#]: subject: (Why Crate.io has returned to its pure open source roots) +[#]: via: (https://opensource.com/article/21/4/crate-open-source) +[#]: author: (Bernd Dorn https://opensource.com/users/bernd-dorn) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Why Crate.io has returned to its pure open source roots +====== +CrateDB's renewed commitment to open source aligns with both our best +ideals and what's best for our business. +![Open source stars.][1] + +The headline benefits of open source are widely known and well-articulated. Open source technologies provide enterprise-level scalability, performance, security, and reliability. Trust is there, and it's deserved. But what's less celebrated, other than by die-hard open source adherents, are the inner workings of the everyday community contributions building those macro benefits at the atomic level. For those offering open source technologies, it is the community's constant user-driven testing and hardening that forges those technologies into robust and proven solutions. Those contributions don't show up on the balance sheet, but they can be absolutely formative to an enterprise's health and success. + +In 2013, I co-founded [Crate.io][2] with open source ideals and my belief in the power of the community. As a startup intent on bringing the simplicity and strength of open source to the realm of advanced SQL databases that could handle the growing volume of Internet of Things (IoT) and Industrial IoT data, we rooted our CrateDB database in 100% open source component technologies. And we were sure to play our role as active contributors to those technologies and nurtured our own community of CrateDB developers. + +In 2017, Crate began exploring an open core business model, and soon after, I took a few years away from the company. In 2019, Crate began to offer a CrateDB Free Edition with a strict three-node limit and stopped building and distributing packages for CrateDB Community Edition (the open source code could still be downloaded). This move focused the company more heavily on a paid open core enterprise edition that added some proprietary features. From a sales perspective, the idea was to spur community users to convert to paying customers. However, this strategy ended up being a fundamental misunderstanding of the user base. The result was a marked decline in user engagement and the strength of our valuable community while failing to convert much of anyone. + +When I returned to Crate towards the end of 2020 as CTO, I made it my priority to bring back a commitment to pure open source. This sparked a rich conversation between competing viewpoints within our organization. The key to winning over my more revenue-minded colleagues was to explain that community users are completely different in nature from our enterprise customers and offer our business a different kind of support. Furthermore, forcing them away does nothing positive. Our open source community user base contributes crucial influence and experience that improves our technologies very effectively. Their support is invaluable and irreplaceable. Without them, CrateDB isn't nearly as compelling or as enterprise-ready a product. + +Ultimately, it was our investors that weighed in and championed Crate's once and future commitment to pure open source. Our investors even helped us abandon considerations towards other licensing models such as the Business Source License by favoring the [Apache License 2.0][3] we now utilize, pressing for the fully open source permissions it offers. + +Our recent [4.5 release][4] of CrateDB completes this full circle to our open source roots. I couldn't be prouder to say that our business is rededicated to building our community and openly welcomes all contributors as we work hand-in-hand to push CrateDB toward its full potential as a distributed SQL database for machine data. + +I also need to mention the recent decision by [Elastic to discontinue its longstanding commitment to open source][5], as it offers a stark juxtaposition to ours. CrateDB has used open source Elasticsearch from the very beginning. But more than that, open source Elasticsearch was a formative inspiration to Crate's founders, especially me. Our drive to serve as contributing citizens in that community was born out of our work operating some of Europe's largest Elasticsearch deployments. That team and I later created Crate with Elasticsearch as our clearest example of why upholding open source ideals results in powerful technologies. + +Our renewed commitment to open source elegantly aligns with both our best ideals and what's best for our business. The activity of a robust and inclusive open source community is the vital pulse of our product. It's our hope to provide an example of what dedication to pure open source can truly accomplish. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/crate-open-source + +作者:[Bernd Dorn][a] +选题:[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/bernd-dorn +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_opensourcestars.png?itok=hnrMETFh (Open source stars.) +[2]: https://crate.io/ +[3]: https://www.apache.org/licenses/LICENSE-2.0 +[4]: https://crate.io/products/cratedb/ +[5]: https://www.elastic.co/blog/licensing-change From ec8c4bde4e31a23ab082f1c55389fa14fd100870 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 12 Apr 2021 08:40:16 +0800 Subject: [PATCH 083/307] translated --- ...tifully in Linux Terminal With CPUFetch.md | 105 ------------------ ...tifully in Linux Terminal With CPUFetch.md | 105 ++++++++++++++++++ 2 files changed, 105 insertions(+), 105 deletions(-) delete mode 100644 sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md create mode 100644 translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md diff --git a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md deleted file mode 100644 index 1c151112e0..0000000000 --- a/sources/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ /dev/null @@ -1,105 +0,0 @@ -[#]: subject: (Show CPU Details Beautifully in Linux Terminal With CPUFetch) -[#]: via: (https://itsfoss.com/cpufetch/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Show CPU Details Beautifully in Linux Terminal With CPUFetch -====== - -There are [ways to check CPU information on Linux][1]. Probably the most common is the `lscpu` command that gives you plenty of information about all the CPU cores on your system. - -![lscpu command output][2] - -You may find CPU information there without installing any additional packages. That works of course. However, I recently stumbled upon a new tool that displays the CPU details in Linux in a beautiful manner. - -The ASCII art of the processor manufacturer makes it look cool. - -![][3] - -This looks beautiful, isn’t it? This is similar to [Neoftech or Screenfetch tools that show the system information in beautiful ASCII art in Linux][4]. Similar to those tools, you can use CPUFetch if you are showcasing your desktop screenshot. - -The tool outputs the ASCII art of the processor manufacturer, its name, microarchitecture, frequency, cores, threads, peak performance, cache sizes, [Advanced Vector Extensions][5], and more. - -You can use custom colors apart from a few themes it provides. This gives you additional degree of freedom when you are ricing your desktop and want to color match all the elements on your Linux setup. - -### Installing CPUFetch on Linux - -Unfortunately, CPUFetch is rather new, and it is not included in your distribution’s repository. It doesn’t even provide ready to use DEB/RPM binaries, PPAs, Snap or Flatpak packages. - -Arch Linux users can [find][6] it in [AUR][7] but for others, the only way forward here is to [build from source code][8]. - -Don’t worry. Installation as well as removal is not that complicated. Let me show you the steps. - -I am using Ubuntu and you would [need to install Git on Ubuntu first][9]. Some other distributions come preinstalled with it, if not use your distribution’s package manager to install it. - -Now, clone the Git repository wherever you want. Home directory is fine as well. - -``` -git clone https://github.com/Dr-Noob/cpufetch -``` - -Switch to the directory you just cloned: - -``` -cd cpufetch -``` - -You’ll see a make file here. Use it to compile the code. - -``` -make -``` - -![CPUFetch Installation][10] - -Now you’ll see a new executable file named `cpufetch`. You run this executable to display the CPU information in the terminal. - -``` -./cpufetch -``` - -This is what it showed for my system. AMD logo looks a lot cooler in ASCII, don’t you think? - -![][11] - -How do you remove Cpufetch? It’s pretty simple. When you compiled the code, it produced just one file and that too in the same directory as the rest of the code. - -So, to remove CPUFetch from your system, simply remove its entire folder. You know how to [remove a directory in Linux terminal][12], don’t you? Come out of the cpufetch directory and use the rm command: - -``` -rm -rf cpufetch -``` - -That was simple, thankfully because removing software installed from source code could be really tricky at times. - -Back to cpufetch. I think it’s a utility for those who like to show off their desktop screenshots in various Linux group. Since we have Neofetch for the distribution and CPUFetch for CPU, I wonder if we could have a GPU fetch with ASCII art of Nvidia as well :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/cpufetch/ - -作者:[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://linuxhandbook.com/check-cpu-info-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/lscpu-command-output.png?resize=800%2C415&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-1.png?resize=800%2C307&ssl=1 -[4]: https://itsfoss.com/display-linux-logo-in-ascii/ -[5]: https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html -[6]: https://aur.archlinux.org/packages/cpufetch-git -[7]: https://itsfoss.com/aur-arch-linux/ -[8]: https://itsfoss.com/install-software-from-source-code/ -[9]: https://itsfoss.com/install-git-ubuntu/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-installation.png?resize=800%2C410&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-for-itsfoss.png?resize=800%2C335&ssl=1 -[12]: https://linuxhandbook.com/remove-files-directories/ diff --git a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md new file mode 100644 index 0000000000..c6ca93d622 --- /dev/null +++ b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -0,0 +1,105 @@ +[#]: subject: (Show CPU Details Beautifully in Linux Terminal With CPUFetch) +[#]: via: (https://itsfoss.com/cpufetch/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节 +====== + +Linux 上有[检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命令,它可以提供大量的系统上所有 CPU 核心的信息。 + +![lscpu command output][2] + +你可以在那里找到 CPU 信息,而无需安装任何额外的包。当然这是可行的。然而,我最近偶然发现了一个新的工具,它以一种漂亮的方式显示 Linux 中的 CPU 细节。 + +处理器制造商的 ASCII 艺术使它看起来很酷。 + +![][3] + +这看起来很美,不是吗?这类似于 [Neoftech 或者 Screenfetch,在 Linux 中用漂亮的 ASCII 艺术来展示系统信息][4]。与这些工具类似,如果你要展示你的桌面截图,可以使用 CPUFetch。 + +该工具可以输出处理器制造商的 ASCII 艺术,它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展][5]等等。 + +除了它提供的一些主题外,你还可以使用自定义颜色。当你在整理桌面,并希望对 Linux 设置中的所有元素进行颜色匹配时,这给了你更多的自由度。 + +### 在 Linux 上安装 CPUFetch + +不幸的是,CPUFetch 是一个相当新的软件,而且它并不包含在你的发行版的软件库中,甚至没有提供现成的 DEB/RPM 二进制文件、PPA、Snap 或 Flatpak 包。 + +Arch Linux 用户可以在 [AUR][7] 中[找到][6]它,但对于其他人来说,唯一的出路是[从源代码构建][8]。 + +不要担心。安装以及删除并不是那么复杂。让我来告诉你步骤。 + +我使用的是 Ubuntu,你会[需要先在 Ubuntu 上安装 Git][9]。一些发行版会预装 Git,如果没有,请使用你的发行版的包管理器来安装。 + +现在,把 Git 仓库克隆到你想要的地方。家目录也可以。 + +``` +git clone https://github.com/Dr-Noob/cpufetch +``` + +切换到你刚才克隆的目录: + +``` +cd cpufetch +``` + +你会在这里看到一个 make 文件。用它来编译代码。 + +``` +make +``` + +![CPUFetch Installation][10] + +现在你会看到一个新的可执行文件,名为 `cpufetch`。你运行这个可执行文件来显示终端的 CPU 信息。 + +``` +./cpufetch +``` + +这是我系统的显示。AMD 的 logo 用 ASCII 码看起来更酷,你不觉得吗? + +![][11] + +如何删除 Cpufetch?这很简单。当你编译代码时,它只产生了一个文件,而且也和其他代码在同一个目录下。 + +所以,要想从系统中删除 CPUFetch,只需删除它的整个文件夹即可。你知道[在 Linux 终端中删除一个目录][12]的方法吧?从 cpufetch 目录中出来,然后使用 rm 命令。 + +``` +rm -rf cpufetch +``` + +这很简单,值得庆幸的是,因为从源代码中删除安装的软件有时真的很棘手。 + +说回 cpufetch。我想这是一个实用工具,适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch,CPU 有了 CPUFetch,不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/cpufetch/ + +作者:[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://linuxhandbook.com/check-cpu-info-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/lscpu-command-output.png?resize=800%2C415&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-1.png?resize=800%2C307&ssl=1 +[4]: https://itsfoss.com/display-linux-logo-in-ascii/ +[5]: https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html +[6]: https://aur.archlinux.org/packages/cpufetch-git +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://itsfoss.com/install-software-from-source-code/ +[9]: https://itsfoss.com/install-git-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-installation.png?resize=800%2C410&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/cpufetch-for-itsfoss.png?resize=800%2C335&ssl=1 +[12]: https://linuxhandbook.com/remove-files-directories/ From 1e70c9b4c3652d1df6f59576bd77eb16266b112c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 12 Apr 2021 08:48:23 +0800 Subject: [PATCH 084/307] translating --- .../20210410 How to Install Steam on Fedora -Beginner-s Tip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md index 3315f1c000..7a36c9f9db 100644 --- a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/install-steam-fedora/) [#]: author: (John Paul https://itsfoss.com/author/john/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 53609a52ccd1d3c93a05e24c3497a4cc762adc28 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 09:38:40 +0800 Subject: [PATCH 085/307] PRF @geekpi --- ...tifully in Linux Terminal With CPUFetch.md | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md index c6ca93d622..6a9b533ba9 100644 --- a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ b/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -3,14 +3,16 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节 ====== -Linux 上有[检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命令,它可以提供大量的系统上所有 CPU 核心的信息。 +![](https://img.linux.net.cn/data/attachment/album/202104/12/093818iie270mi8am6ttk7.jpg) + +Linux 上有 [检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命令,它可以提供大量的系统上所有 CPU 核心的信息。 ![lscpu command output][2] @@ -22,19 +24,19 @@ Linux 上有[检查 CPU 信息的方法][1]。最常见的可能是 `lscpu` 命 这看起来很美,不是吗?这类似于 [Neoftech 或者 Screenfetch,在 Linux 中用漂亮的 ASCII 艺术来展示系统信息][4]。与这些工具类似,如果你要展示你的桌面截图,可以使用 CPUFetch。 -该工具可以输出处理器制造商的 ASCII 艺术,它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展][5]等等。 +该工具可以输出处理器制造商的 ASCII 艺术,它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展][5] 等等。 -除了它提供的一些主题外,你还可以使用自定义颜色。当你在整理桌面,并希望对 Linux 设置中的所有元素进行颜色匹配时,这给了你更多的自由度。 +除了它提供的一些主题外,你还可以使用自定义颜色。当你在整理桌面,并希望对 Linux 环境中的所有元素进行颜色匹配时,这给了你更多的自由度。 ### 在 Linux 上安装 CPUFetch 不幸的是,CPUFetch 是一个相当新的软件,而且它并不包含在你的发行版的软件库中,甚至没有提供现成的 DEB/RPM 二进制文件、PPA、Snap 或 Flatpak 包。 -Arch Linux 用户可以在 [AUR][7] 中[找到][6]它,但对于其他人来说,唯一的出路是[从源代码构建][8]。 +Arch Linux 用户可以在 [AUR][7] 中 [找到][6] 它,但对于其他人来说,唯一的出路是 [从源代码构建][8]。 不要担心。安装以及删除并不是那么复杂。让我来告诉你步骤。 -我使用的是 Ubuntu,你会[需要先在 Ubuntu 上安装 Git][9]。一些发行版会预装 Git,如果没有,请使用你的发行版的包管理器来安装。 +我使用的是 Ubuntu,你会 [需要先在 Ubuntu 上安装 Git][9]。一些发行版会预装 Git,如果没有,请使用你的发行版的包管理器来安装。 现在,把 Git 仓库克隆到你想要的地方。家目录也可以。 @@ -48,7 +50,7 @@ git clone https://github.com/Dr-Noob/cpufetch cd cpufetch ``` -你会在这里看到一个 make 文件。用它来编译代码。 +你会在这里看到一个 Makefile 文件。用它来编译代码。 ``` make @@ -62,13 +64,13 @@ make ./cpufetch ``` -这是我系统的显示。AMD 的 logo 用 ASCII 码看起来更酷,你不觉得吗? +这是我系统的显示。AMD 的徽标用 ASCII 码看起来更酷,你不觉得吗? ![][11] -如何删除 Cpufetch?这很简单。当你编译代码时,它只产生了一个文件,而且也和其他代码在同一个目录下。 +如何删除 CPUFetch?这很简单。当你编译代码时,它只产生了一个文件,而且也和其他代码在同一个目录下。 -所以,要想从系统中删除 CPUFetch,只需删除它的整个文件夹即可。你知道[在 Linux 终端中删除一个目录][12]的方法吧?从 cpufetch 目录中出来,然后使用 rm 命令。 +所以,要想从系统中删除 CPUFetch,只需删除它的整个文件夹即可。你知道 [在 Linux 终端中删除一个目录][12] 的方法吧?从 `cpufetch` 目录中出来,然后使用 `rm` 命令。 ``` rm -rf cpufetch @@ -76,7 +78,7 @@ rm -rf cpufetch 这很简单,值得庆幸的是,因为从源代码中删除安装的软件有时真的很棘手。 -说回 cpufetch。我想这是一个实用工具,适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch,CPU 有了 CPUFetch,不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch。 +说回 CPUFetch。我想这是一个实用工具,适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch,CPU 有了 CPUFetch,不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch? -------------------------------------------------------------------------------- @@ -85,7 +87,7 @@ via: https://itsfoss.com/cpufetch/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f0dfecbbd3ff8d591662f5f60799d811836c7f8d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 09:41:20 +0800 Subject: [PATCH 086/307] PUB @geekpi https://linux.cn/article-13289-1.html --- ...CPU Details Beautifully in Linux Terminal With CPUFetch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md (98%) diff --git a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md b/published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md similarity index 98% rename from translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md rename to published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md index 6a9b533ba9..e366481a6f 100644 --- a/translated/tech/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md +++ b/published/20210407 Show CPU Details Beautifully in Linux Terminal With CPUFetch.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13289-1.html) 使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节 ====== From 86b860fa0474bf4863577a8f5031174a2ba77674 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 09:56:20 +0800 Subject: [PATCH 087/307] APL --- sources/tech/20210406 Teach anyone how to code with Hedy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210406 Teach anyone how to code with Hedy.md b/sources/tech/20210406 Teach anyone how to code with Hedy.md index 1e2122fc50..5b352ad67a 100644 --- a/sources/tech/20210406 Teach anyone how to code with Hedy.md +++ b/sources/tech/20210406 Teach anyone how to code with Hedy.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/hedy-teach-code) [#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From a349e3641f4fbb4f13e43627fba41d1f5f933029 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 11:12:42 +0800 Subject: [PATCH 088/307] TSL&PRF --- ...0406 Teach anyone how to code with Hedy.md | 82 ------------------- ...0406 Teach anyone how to code with Hedy.md | 80 ++++++++++++++++++ 2 files changed, 80 insertions(+), 82 deletions(-) delete mode 100644 sources/tech/20210406 Teach anyone how to code with Hedy.md create mode 100644 translated/tech/20210406 Teach anyone how to code with Hedy.md diff --git a/sources/tech/20210406 Teach anyone how to code with Hedy.md b/sources/tech/20210406 Teach anyone how to code with Hedy.md deleted file mode 100644 index 5b352ad67a..0000000000 --- a/sources/tech/20210406 Teach anyone how to code with Hedy.md +++ /dev/null @@ -1,82 +0,0 @@ -[#]: subject: (Teach anyone how to code with Hedy) -[#]: via: (https://opensource.com/article/21/4/hedy-teach-code) -[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Teach anyone how to code with Hedy -====== -Hedy is a new programming language designed specifically for teaching -people to code. -![Teacher or learner?][1] - -Learning to code involves learning both the programming logic and the syntax of a specific programming language. When I took my first programming class in college, the language taught was C++. The first code example, the basic "Hello World" program, looked like the example below. - - -``` -#include <iostream> - -int main() { -    std::cout << "Hello World!"; -    return 0; -} -``` - -The instructor would not explain most of the code until several lessons later. The expectation was that we would just type in the code and eventually learn why things were required and how they worked. - -The complex syntax of C++ (and other, similar languages) is why Python is often suggested as an easier language for teaching programming. Here is the same example in Python: - - -``` -`print("Hello World!")` -``` - -While the basic "Hello World" example in Python is much simpler, it still has complex and precise syntax rules. The `print` function requires parentheses and quotes around the string. This can still confuse those who have no experience with programming. Python has fewer "I'll explain later" syntax issues than C++, but it still has them. - -[Hedy][2], a new language designed specifically for teaching coding, addresses the issue of syntax complexity by building multiple levels of complexity into the language. Instead of providing the full features of the language right away, Hedy takes a gradual approach and slowly becomes more complex as students work through Hedy's levels. As the levels progress, the language gains new features and eventually becomes more Python-like. There are currently seven levels available, but more are planned. - -At level 1, a Hedy program cannot do anything except print a statement (which does not require quotes or parentheses), ask a question, and echo back an answer. Level 1 has no variables, no loops, and minimal structure. Echo works almost like a variable but only for the last user input. This allows students to become comfortable with basic concepts without having to learn everything all at once. - -This is a level 1 Hedy "Hello World" program: - - -``` -`print Hello World` -``` - -Level 2 introduces variables, but because the `print` function does not use quotes, there can be some interesting outcomes. If the variable used to store a person's name is `name`, it is impossible to print the output "Your name is [name]" because both the first use of name, which is intended to be a string, and the second use, which is a variable, are both interpreted as a variable. If `name` is set to `John Doe`, the output of `print Your name is name.` would be "Your John Doe is John Doe." As odd as this sounds, it is a good way for to introduce the concept of variables, which just happens to be a feature added in Level 3. - -Level 3 requires quotation marks around strings, which makes variables function like they do in Python. It is now possible to output strings combined with variables to make complex statements without worrying about conflicts between variable names and words in a string. This level does away with the `echo` function, which does seem like something that might frustrate some learners. They should be using variables, which is better code, but it could be confusing if an `ask`/`echo` block of code becomes invalid syntax. - -Level 4 adds basic `if`/`else` functionality. Students can move from simple ask/answer code to complex interactions. For example, a prompt that asks, "What is your favorite color?" can accept different replies depending on what the user enters. If they enter green, the reply can be "Green! That's also my favorite color." If they enter anything else, the reply could be different. The `if`/`else` block is a basic programming concept, which Hedy introduces without having to worry about complex syntax or overly precise formatting. - -Level 5 has a `repeat` function, which adds a basic loop to the features available. This loop can only repeat the same command multiple times, so it is not as powerful as loops in Python, but it lets the students get used to the general concept of repeating commands. It's one more programming concept introduced without bogging things down with needless complexity. The students can grasp the basics of the concept before moving on to more powerful, complex versions of the same thing. - -At level 6, Hedy can now do basic math calculations. Addition, subtraction, multiplication, and division are supported, but more advanced math features are not. It is not possible to use exponents, modulo, or anything else that Python and other languages handle. As yet, no higher level of Hedy adds more complex math. - -Level 7 brings in Python-style indenting, which means `repeat` can work with multiple lines of code. Students worked with code line by line up to this point, but now they can work with blocks of code. This Hedy level still falls way short of what a non-teaching programming language can do, but it can teach students a lot. - -The easiest way to get started with Hedy is to access the [lessons][3] on the Hedy website, which is currently available in Dutch, English, French, German, Portuguese, and Spanish. This makes the learning process accessible to anyone with a web browser. It is also possible to download Hedy from [GitHub][4] and run the interpreter from the command line or run a local copy of the Hedy website with its interactive lessons. The web-based version is more approachable, but both the web and command-line versions support running Hedy programs targeted at its various levels of complexity. - -Hedy will never compete with Python, C++, or other languages as the language of choice for coding for real-world projects, but it is an excellent way to teach coding. The programs students write as part of the learning process are real and possibly even complex. Hedy can foster learning and creativity without confusing students with too much information too soon in the learning process. Like math classes, which start with counting, adding, etc., long before getting to calculus (a process that takes years), programming does not have to start with "I'll explain later" for programming language syntax issues that must be followed precisely to produce even the most basic program in the language. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/hedy-teach-code - -作者:[Joshua Allen Holm][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/holmja -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/5538035618_4e19c9787c_o.png?itok=naiD1z1S (Teacher or learner?) -[2]: https://www.hedycode.com/ -[3]: https://www.hedycode.com/hedy?lang=en -[4]: https://github.com/felienne/hedy diff --git a/translated/tech/20210406 Teach anyone how to code with Hedy.md b/translated/tech/20210406 Teach anyone how to code with Hedy.md new file mode 100644 index 0000000000..656fa1d30a --- /dev/null +++ b/translated/tech/20210406 Teach anyone how to code with Hedy.md @@ -0,0 +1,80 @@ +[#]: subject: (Teach anyone how to code with Hedy) +[#]: via: (https://opensource.com/article/21/4/hedy-teach-code) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Hedy 教人编程 +====== + +> Hedy 是一种专门为教人编程而设计的新型编程语言。 + +!["教师还是学习者?"][1] + +学习编程既要学习编程逻辑,又要学习特定编程语言的语法。我在大学上第一堂编程课的时候,教的语言是 C++。第一个代码例子是基本的 “Hello World” 程序,就像下面的例子。 + +``` +#include + +int main() { + std::cout << "Hello World!"; + return 0; +} +``` + +老师直到几节课后才会解释大部分的代码。我们的期望是,我们只需输入代码,并最终了解为什么需要这些东西以及它们如何工作。 + +C++(以及其他类似的语言)的复杂语法是为什么 Python 经常被建议作为一种更容易的编程教学语言。下面是 Python 中的同一个例子: + +``` +print("Hello World!") +``` + +虽然 Python 中的 “Hello World” 基础例子要简单得多,但它仍然有复杂而精确的语法规则。`print` 函数需要在字符串周围加括号和引号。这对于没有编程经验的人来说,还是会感到困惑。Python 比 C++ 少了 “我以后再解释” 的语法问题,但还是有一些。 + +[Hedy][2] 是一种专门为编码教学而设计的新语言,它通过在语言中将复杂性分成多个关卡来解决语法复杂性的问题。Hedy 没有马上提供语言的全部功能,而是采取循序渐进的方式,随着学生在 Hedy 的学习的通关,慢慢变得更加复杂。随着关卡的进展,该语言获得了新的功能,最终变得更像 Python。目前有七个关卡,但更多的关卡正在计划中。 + +在第 1 关,Hedy 程序除了打印(`print`)一条语句(不需要引号或括号),提出(`ask`)一个问题,并回传(`echo`)一个答案外,不能做任何事情。第 1 关没有变量,没有循环,结构极精简。回传的工作原理几乎和变量一样,但只针对用户的最后一个输入。这可以让学生对基本概念感到舒适,而不必一下子学习所有的东西。 + +这是一个第 1 关的 Hedy “Hello World” 程序: + +``` +print Hello World +``` + +第 2 关引入了变量,但由于 `print` 函数没有使用引号,可能会出现一些有趣的结果。如果用来存储一个人的名字的变量是 `name`,那么就不可能打印输出 `Your name is [name]`,因为 `name` 的第一次使用(本意是字符串)和第二次使用(是变量)都被解释为变量。如果将 `name` 设置为(`is`) `John Doe`,那么 `print Your name is name.` 的输出就会是 `Your John Doe is John Doe`。虽然这听起来很奇怪,但这是一个引入变量概念的好方法,这恰好是第 3 关中增加的一个功能。 + +第 3 关要求在字符串周围加引号,这使得变量的功能就像在 Python 中一样。现在可以输出与变量相结合的字符串,做出复杂的语句,而不用担心变量名和字符串中的单词之间的冲突。这个级别取消了 “回传”(`echo`)函数,这看起来确实是一个可能会让一些学习者感到沮丧的东西。他们应该使用变量,这是更好的代码,但如果一个 `ask`/`echo` 代码块变成无效语法,可能会让人感到困惑。 + +第 4 关增加了基本的 `if`/`else` 功能。学生可以从简单的问/答代码转向复杂的交互。例如,一个问“你最喜欢的颜色是什么?”的提示可以根据用户输入的内容接受不同的回复。如果他们输入绿色,回答可以是“绿色!这也是我最喜欢的颜色。”如果他们输入其他的东西,回复可以是不同的。`if`/`else` 块是一个基本的编程概念,Hedy 引入了这个概念,而不必担心复杂的语法或过于精确的格式。 + +第 5 关有一个 `repeat` 函数,在现有的功能上增加了一个基本的循环。这个循环只能多次重复同一个命令,所以它没有 Python 中的循环那么强大,但它让学生习惯了重复命令的一般概念。这是多介绍了一个编程概念,而不会用无谓的复杂来拖累。学生们可以先掌握概念的基础知识,然后再继续学习同一事物的更强大、更复杂的版本。 + +在第 6 关,Hedy 现在可以进行基本的数学计算。加法、减法、乘法和除法都支持,但更高级的数学功能不支持。不能使用指数、模数或其他任何 Python 和其他语言能处理的东西。目前,Hedy 还没有更高关卡的产品增加更复杂的数学功能。 + +第 7 关引入了 Python 风格的缩进,这意味着 `repeat` 可以处理多行代码。学生在这之前都是逐行处理代码,但现在他们可以处理代码块。这个 Hedy 关卡与非教学型编程语言能做的事情相比还是有很大的差距,但它可以教会学生很多东西。 + +开始学习 Hedy 最简单的方法是访问 Hedy 网站上的 [课程][3],目前有荷兰语、英语、法语、德语、葡萄牙语和西班牙语。这样一来,任何有网页浏览器的人都可以进入学习过程。也可以从 [GitHub][4] 下载 Hedy,并从命令行运行解释器,或者运行 Hedy 网站的本地副本及其交互式课程。基于网页的版本更容易使用,但网页版本和命令行版本都支持运行针对不同复杂程度的 Hedy 程序。 + +Hedy 永远不会与 Python、C++ 或其他语言竞争,成为现实世界项目编码的首选语言,但它是编码教学的绝佳方式。作为学习过程的一部分,学生编写的程序是真实的,甚至可能是复杂的。Hedy 可以促进学生的学习和创造力,而不会让学生在学习过程中过早地被过多的信息所迷惑。就像数学课一样,在进入微积分之前很久要从学习计数、相加等开始(这个过程需要数年时间),编程也不必一开始就对编程语言的语法问题“我稍后再解释”、精确地遵循这些语法问题,才能产生哪怕是最基本的语言程序。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/hedy-teach-code + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/5538035618_4e19c9787c_o.png?itok=naiD1z1S (Teacher or learner?) +[2]: https://www.hedycode.com/ +[3]: https://www.hedycode.com/hedy?lang=en +[4]: https://github.com/felienne/hedy From 8590152e899269ffcf1cc6f3da52f74a4d2ee9fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 11:19:39 +0800 Subject: [PATCH 089/307] PUB @wxy https://linux.cn/article-13290-1.html --- .../20210406 Teach anyone how to code with Hedy.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210406 Teach anyone how to code with Hedy.md (97%) diff --git a/translated/tech/20210406 Teach anyone how to code with Hedy.md b/published/20210406 Teach anyone how to code with Hedy.md similarity index 97% rename from translated/tech/20210406 Teach anyone how to code with Hedy.md rename to published/20210406 Teach anyone how to code with Hedy.md index 656fa1d30a..68b0c45815 100644 --- a/translated/tech/20210406 Teach anyone how to code with Hedy.md +++ b/published/20210406 Teach anyone how to code with Hedy.md @@ -4,15 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13290-1.html) 用 Hedy 教人编程 ====== > Hedy 是一种专门为教人编程而设计的新型编程语言。 -!["教师还是学习者?"][1] +![](https://img.linux.net.cn/data/attachment/album/202104/12/111814w62da2sannsd2q76.jpg) 学习编程既要学习编程逻辑,又要学习特定编程语言的语法。我在大学上第一堂编程课的时候,教的语言是 C++。第一个代码例子是基本的 “Hello World” 程序,就像下面的例子。 From c7b858144e0d94efa4b89f534c80d12df7078aba Mon Sep 17 00:00:00 2001 From: tt67wq Date: Mon, 12 Apr 2021 10:14:41 +0800 Subject: [PATCH 090/307] translating by tt67wq --- ...01209 Program a simple game with Elixir.md | 141 ------------------ ...01209 Program a simple game with Elixir.md | 137 +++++++++++++++++ 2 files changed, 137 insertions(+), 141 deletions(-) delete mode 100644 sources/tech/20201209 Program a simple game with Elixir.md create mode 100644 translated/tech/20201209 Program a simple game with Elixir.md diff --git a/sources/tech/20201209 Program a simple game with Elixir.md b/sources/tech/20201209 Program a simple game with Elixir.md deleted file mode 100644 index 8304970ff0..0000000000 --- a/sources/tech/20201209 Program a simple game with Elixir.md +++ /dev/null @@ -1,141 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Program a simple game with Elixir) -[#]: via: (https://opensource.com/article/20/12/elixir) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -Program a simple game with Elixir -====== -Learn Elixir by programming a "guess the number" game and comparing the -language against ones you know. -![A die with rainbow color background][1] - -To you learn a new programming language, it's good to focus on the things most programming languages have in common: - - * Variables - * Expressions - * Statements - - - -These concepts are the basis of most programming languages. Because of these similarities, once you know one programming language, you can start figuring another one out by recognizing its differences. - -Another good tool for learning a new language is starting with a standard program. This allows you to focus on the language, not the program's logic. We're doing that in this article series using a "guess the number" program, in which the computer picks a number between one and 100 and asks you to guess it. The program loops until you guess the number correctly. - -The "guess the number" program exercises several concepts in programming languages: - - * Variables - * Input - * Output - * Conditional evaluation - * Loops - - - -It's a great practical experiment to learn a new programming language. - -### Guess the number in Elixir - -The [Elixir][2] programming language is a dynamically typed functional language designed for building stable and maintainable applications. It runs on top of the same virtual machine as [Erlang][3] and shares many of its strengths—but with slightly easier syntax. - -You can explore Elixir by writing a version of the "guess the number" game. - -Here is my implementation: - - -``` -defmodule Guess do -  def guess() do -     random = Enum.random(1..100) -     IO.puts "Guess a number between 1 and 100" -     Guess.guess_loop(random) -  end -  def guess_loop(num) do -    data = IO.read(:stdio, :line) -    {guess, _rest} = Integer.parse(data) -    cond do -      guess < num -> -        IO.puts "Too low!" -        guess_loop(num) -      guess > num -> -        IO.puts "Too high!" -        guess_loop(num) -      true -> -        IO.puts "That's right!" -    end -  end -end - -Guess.guess() -``` - -To assign a value to a variable, list the variable's name followed by the `=` sign. For example, the statement `random = 0` assigns a zero value to the `random` variable. - -The script starts by defining a **module**. In Elixir, only modules can have named functions in them. - -The next line defines the function that will serve as the entry point, `guess()`, which: - - * Calls the `Enum.random()` function to get a random integer - * Prints the game prompt - * Calls the function that will serve as the loop - - - -The rest of the game logic is implemented in the `guess_loop()` function. - -The `guess_loop()` function uses [tail recursion][4] to loop. There are several ways to do looping in Elixir, but using tail recursion is a common one. The last thing `guess_loop()` does is call _itself_. - -The first line in `guess_loop()` reads the input from the user. The next line uses `parse()` to convert the input to an integer. - -The `cond` statement is Elixir's version of a multi-branch statement. Unlike `if/elif` or `if/elsif` in other languages, Elixir does not treat the first nor the last branch in a different way. - -This `cond` statement has a three-way branch: The guess can be smaller, bigger, or equal to the random number. The first two options output the inequality's direction and then tail-call `guess_loop()`, looping back to the beginning. The last option outputs `That's right`, and the function finishes. - -### Sample output - -Now that you've written your Elixir program, you can run it to play the "guess the number" game. Every time you run the program, Elixir will pick a different random number, and you can guess until you find the correct number: - - -``` -$ elixir guess.exs -Guess a number between 1 and 100 -50 -Too high -30 -Too high -20 -Too high -10 -Too low -15 -Too high -13 -Too low -14 -That's right! -``` - -This "guess the number" game is a great introductory program for learning a new programming language because it exercises several common programming concepts in a pretty straightforward way. By implementing this simple game in different programming languages, you can demonstrate some core concepts of the languages and compare their details. - -Do you have a favorite programming language? How would you write the "guess the number" game in it? Follow this article series to see examples of other programming languages that might interest you. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/12/elixir - -作者:[Moshe Zadka][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/moshez -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dice_tabletop_board_gaming_game.jpg?itok=y93eW7HN (A die with rainbow color background) -[2]: https://elixir-lang.org/ -[3]: https://www.erlang.org/ -[4]: https://en.wikipedia.org/wiki/Tail_call diff --git a/translated/tech/20201209 Program a simple game with Elixir.md b/translated/tech/20201209 Program a simple game with Elixir.md new file mode 100644 index 0000000000..3583e77763 --- /dev/null +++ b/translated/tech/20201209 Program a simple game with Elixir.md @@ -0,0 +1,137 @@ +[#]: collector: (lujun9972) +[#]: translator: (tt67wq) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Program a simple game with Elixir) +[#]: via: (https://opensource.com/article/20/12/elixir) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +使用 Elixir 语言编写一个小游戏 +====== +通过编写"猜数字"游戏来学习 Elixir 编程语言并将它与一个你熟知的语言做对比。 + +![A die with rainbow color background][1] + +为了更好的学习一门新的编程语言,最好的方法是去关注主流语言的一些共有特征: + + * 变量 + * 表达式 + * 声明 + + +这些概念是大多数编程语言的基础。因为这些相似性,只要你通晓了一门编程语言,你可以通过对比差异来熟知另一门编程语言。 + +另外一个学习新编程语言的好方法是开始编写一个简单标准的程序。它可以让你集中精力在语言上而非程序的逻辑本身。在这个系列的文章中,我们使用"猜数字"程序来实现,计算机会选择一个介于 1 到 100 之间的数字,并要求你来猜测它。程序会循环执行,直到您正确猜出该数字为止。 + +"猜数字"这个小程序使用了编程语言的以下概念: + + * 变量 + * 输入 + * 输出 + * 条件判断 + * 循环 + + +这是一个学习新编程语言的绝佳实践。 + +### 猜数字的 Elixir 实现 + +[Elixir][2] 是一门被设计用于构建稳定可维护应用的动态类型函数式编程语言。它与 [Erlang][3] 运行于同一虚拟机之上,吸纳了 Erlang 的众多长处的同时拥有更加轻便的语法。 + +你可以编写一个 Elixir 版本的"猜数字"游戏来体验这门语言。 + +这是我的实现方法: + + +``` +defmodule Guess do +  def guess() do +     random = Enum.random(1..100) +     IO.puts "Guess a number between 1 and 100" +     Guess.guess_loop(random) +  end +  def guess_loop(num) do +    data = IO.read(:stdio, :line) +    {guess, _rest} = Integer.parse(data) +    cond do +      guess < num -> +        IO.puts "Too low!" +        guess_loop(num) +      guess > num -> +        IO.puts "Too high!" +        guess_loop(num) +      true -> +        IO.puts "That's right!" +    end +  end +end + +Guess.guess() +``` + +Elixir 通过列出变量的名称后面跟一个`=`号来为了给变量分配一个数值。举个例子,表达式 `random = 0` 给 `random` 变量分配一个数值 0。 + +代码以定义一个 **module** 开始。在 Elixir 语言中,只有 module 可以包含非匿名函数。 + +紧随其后的这行代码定义了入口函数 `guess()`,这个函数: + + * 调用 `Enum.random()` 函数来获取一个随机数 + * 打印游戏提示 + * 调用循环执行的函数 + +剩余的游戏逻辑实现在 `guess_loop()` 函数中。 + +`guess_loop()` 函数利用[尾递归 ][4] 来实现循环。Elixir 中有好几种实现循环的方法,尾递归是比较常用的一种方式。`guess_loop()` 函数做的最后一件事就是调用自身。 + +`guess_loop()` 函数的第一行读取用户输入。下一行调用 `parse()` 函数将输入转换成一个整数。 + +`cond` 表达式是 Elixir 版本的多重分支表达式。与其他语言中的 `if/elif` 或者 `if/elsif` 表达式不同,Elixir 对于的首个分支或者最后一个没有分支并没有区别对待。 + +`cond` 表达式有三路分支:猜测的结果可以比随机数大、小或者相等。前两个选项先输出不等式的方向然后递归调用 `guess_loop()`,循环返回至函数开始。最后一个选项输出 `That's right`,然后这个函数就完成了。 + +### 输出例子 + +现在你已经编写了你的 Elixir 代码,你可以运行它来玩"猜数字"的游戏。每次你执行这个程序,Elixir 会选择一个不同的随机数,你可以一直猜下去直到你找到正确的答案: + + +``` +$ elixir guess.exs +Guess a number between 1 and 100 +50 +Too high +30 +Too high +20 +Too high +10 +Too low +15 +Too high +13 +Too low +14 +That's right! +``` + +"猜数字"游戏是一个学习一门新编程语言的绝佳入门程序,因为它用了非常直接的方法实践了常用的几个编程概念。通过用不同语言实现这个简单的小游戏,你可以实践各个语言的核心概念并且比较它们的细节。 + +你是否有你最喜爱的编程语言?你将怎样用它来编写"猜数字"这个游戏?关注这个系列的文章来看看其他你可能感兴趣的语言实现。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/12/elixir + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[tt67wq](https://github.com/tt67wq) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/dice_tabletop_board_gaming_game.jpg?itok=y93eW7HN (A die with rainbow color background) +[2]: https://elixir-lang.org/ +[3]: https://www.erlang.org/ +[4]: https://en.wikipedia.org/wiki/Tail_call From 41c9ea16bdff0f17450d37639d9a7c258018fd16 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" <44011673+DCOLIVERSUN@users.noreply.github.com> Date: Mon, 12 Apr 2021 21:06:44 +0800 Subject: [PATCH 091/307] translating --- .../20210409 4 ways open source gives you a competitive edge.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210409 4 ways open source gives you a competitive edge.md b/sources/tech/20210409 4 ways open source gives you a competitive edge.md index 56bb2cb7db..a8782c3749 100644 --- a/sources/tech/20210409 4 ways open source gives you a competitive edge.md +++ b/sources/tech/20210409 4 ways open source gives you a competitive edge.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) [#]: author: (Jason Blais https://opensource.com/users/jasonblais) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 71ae070aae3bd1930c1a36f4afb35ba90465db2c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 22:34:46 +0800 Subject: [PATCH 092/307] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tt67wq 感谢你,完成了第一篇翻译贡献 ! --- ...01209 Program a simple game with Elixir.md | 77 +++++++++---------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/translated/tech/20201209 Program a simple game with Elixir.md b/translated/tech/20201209 Program a simple game with Elixir.md index 3583e77763..c794b65271 100644 --- a/translated/tech/20201209 Program a simple game with Elixir.md +++ b/translated/tech/20201209 Program a simple game with Elixir.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Program a simple game with Elixir) @@ -9,22 +9,22 @@ 使用 Elixir 语言编写一个小游戏 ====== -通过编写"猜数字"游戏来学习 Elixir 编程语言并将它与一个你熟知的语言做对比。 -![A die with rainbow color background][1] +> 通过编写“猜数字”游戏来学习 Elixir 编程语言,并将它与一个你熟知的语言做对比。 + +![](https://img.linux.net.cn/data/attachment/album/202104/12/223351t68886wmza1m9jnt.jpg) 为了更好的学习一门新的编程语言,最好的方法是去关注主流语言的一些共有特征: * 变量 * 表达式 - * 声明 - + * 语句 这些概念是大多数编程语言的基础。因为这些相似性,只要你通晓了一门编程语言,你可以通过对比差异来熟知另一门编程语言。 -另外一个学习新编程语言的好方法是开始编写一个简单标准的程序。它可以让你集中精力在语言上而非程序的逻辑本身。在这个系列的文章中,我们使用"猜数字"程序来实现,计算机会选择一个介于 1 到 100 之间的数字,并要求你来猜测它。程序会循环执行,直到您正确猜出该数字为止。 +另外一个学习新编程语言的好方法是开始编写一个简单标准的程序。它可以让你集中精力在语言上而非程序的逻辑本身。在这个系列的文章中,我们使用“猜数字”程序来实现,在这个程序中,计算机会选择一个介于 1 到 100 之间的数字,并要求你来猜测它。程序会循环执行,直到你正确猜出该数字为止。 -"猜数字"这个小程序使用了编程语言的以下概念: +“猜数字”这个程序使用了编程语言的以下概念: * 变量 * 输入 @@ -32,68 +32,65 @@ * 条件判断 * 循环 - 这是一个学习新编程语言的绝佳实践。 ### 猜数字的 Elixir 实现 -[Elixir][2] 是一门被设计用于构建稳定可维护应用的动态类型函数式编程语言。它与 [Erlang][3] 运行于同一虚拟机之上,吸纳了 Erlang 的众多长处的同时拥有更加轻便的语法。 +[Elixir][2] 是一门被设计用于构建稳定可维护应用的动态类型的函数式编程语言。它与 [Erlang][3] 运行于同一虚拟机之上,吸纳了 Erlang 的众多长处的同时拥有更加简单的语法。 -你可以编写一个 Elixir 版本的"猜数字"游戏来体验这门语言。 +你可以编写一个 Elixir 版本的“猜数字”游戏来体验这门语言。 这是我的实现方法: - ``` defmodule Guess do -  def guess() do -     random = Enum.random(1..100) -     IO.puts "Guess a number between 1 and 100" -     Guess.guess_loop(random) -  end -  def guess_loop(num) do -    data = IO.read(:stdio, :line) -    {guess, _rest} = Integer.parse(data) -    cond do -      guess < num -> -        IO.puts "Too low!" -        guess_loop(num) -      guess > num -> -        IO.puts "Too high!" -        guess_loop(num) -      true -> -        IO.puts "That's right!" -    end -  end + def guess() do + random = Enum.random(1..100) + IO.puts "Guess a number between 1 and 100" + Guess.guess_loop(random) + end + def guess_loop(num) do + data = IO.read(:stdio, :line) + {guess, _rest} = Integer.parse(data) + cond do + guess < num -> + IO.puts "Too low!" + guess_loop(num) + guess > num -> + IO.puts "Too high!" + guess_loop(num) + true -> + IO.puts "That's right!" + end + end end Guess.guess() ``` -Elixir 通过列出变量的名称后面跟一个`=`号来为了给变量分配一个数值。举个例子,表达式 `random = 0` 给 `random` 变量分配一个数值 0。 +Elixir 通过列出变量的名称后面跟一个 `=` 号来为了给变量分配一个值。举个例子,表达式 `random = 0` 给 `random` 变量分配一个数值 0。 -代码以定义一个 **module** 开始。在 Elixir 语言中,只有 module 可以包含非匿名函数。 +代码以定义一个模块开始。在 Elixir 语言中,只有模块可以包含命名函数。 紧随其后的这行代码定义了入口函数 `guess()`,这个函数: - * 调用 `Enum.random()` 函数来获取一个随机数 + * 调用 `Enum.random()` 函数来获取一个随机整数 * 打印游戏提示 * 调用循环执行的函数 剩余的游戏逻辑实现在 `guess_loop()` 函数中。 -`guess_loop()` 函数利用[尾递归 ][4] 来实现循环。Elixir 中有好几种实现循环的方法,尾递归是比较常用的一种方式。`guess_loop()` 函数做的最后一件事就是调用自身。 +`guess_loop()` 函数利用 [尾递归][4] 来实现循环。Elixir 中有好几种实现循环的方法,尾递归是比较常用的一种方式。`guess_loop()` 函数做的最后一件事就是调用自身。 `guess_loop()` 函数的第一行读取用户输入。下一行调用 `parse()` 函数将输入转换成一个整数。 `cond` 表达式是 Elixir 版本的多重分支表达式。与其他语言中的 `if/elif` 或者 `if/elsif` 表达式不同,Elixir 对于的首个分支或者最后一个没有分支并没有区别对待。 -`cond` 表达式有三路分支:猜测的结果可以比随机数大、小或者相等。前两个选项先输出不等式的方向然后递归调用 `guess_loop()`,循环返回至函数开始。最后一个选项输出 `That's right`,然后这个函数就完成了。 +这个 `cond` 表达式有三路分支:猜测的结果可以比随机数大、小或者相等。前两个选项先输出不等式的方向然后递归调用 `guess_loop()`,循环返回至函数开始。最后一个选项输出 `That's right`,然后这个函数就完成了。 ### 输出例子 -现在你已经编写了你的 Elixir 代码,你可以运行它来玩"猜数字"的游戏。每次你执行这个程序,Elixir 会选择一个不同的随机数,你可以一直猜下去直到你找到正确的答案: - +现在你已经编写了你的 Elixir 代码,你可以运行它来玩“猜数字”的游戏。每次你执行这个程序,Elixir 会选择一个不同的随机数,你可以一直猜下去直到你找到正确的答案: ``` $ elixir guess.exs @@ -114,9 +111,9 @@ Too low That's right! ``` -"猜数字"游戏是一个学习一门新编程语言的绝佳入门程序,因为它用了非常直接的方法实践了常用的几个编程概念。通过用不同语言实现这个简单的小游戏,你可以实践各个语言的核心概念并且比较它们的细节。 +“猜数字”游戏是一个学习一门新编程语言的绝佳入门程序,因为它用了非常直接的方法实践了常用的几个编程概念。通过用不同语言实现这个简单的小游戏,你可以实践各个语言的核心概念并且比较它们的细节。 -你是否有你最喜爱的编程语言?你将怎样用它来编写"猜数字"这个游戏?关注这个系列的文章来看看其他你可能感兴趣的语言实现。 +你是否有你最喜爱的编程语言?你将怎样用它来编写“猜数字”这个游戏?关注这个系列的文章来看看其他你可能感兴趣的语言实现。 -------------------------------------------------------------------------------- @@ -125,7 +122,7 @@ via: https://opensource.com/article/20/12/elixir 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c5cefb04597fef9cc081450f539f1685e8735079 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 22:35:33 +0800 Subject: [PATCH 093/307] PUB @tt67wq https://linux.cn/article-13292-1.html --- .../20201209 Program a simple game with Elixir.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201209 Program a simple game with Elixir.md (98%) diff --git a/translated/tech/20201209 Program a simple game with Elixir.md b/published/20201209 Program a simple game with Elixir.md similarity index 98% rename from translated/tech/20201209 Program a simple game with Elixir.md rename to published/20201209 Program a simple game with Elixir.md index c794b65271..4d7f6e6211 100644 --- a/translated/tech/20201209 Program a simple game with Elixir.md +++ b/published/20201209 Program a simple game with Elixir.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13292-1.html) [#]: subject: (Program a simple game with Elixir) [#]: via: (https://opensource.com/article/20/12/elixir) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 10ba82cc5b0ad5cced04cbcdbfc71c2ea08c24ce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 23:28:56 +0800 Subject: [PATCH 094/307] PRF @wxy --- ...cal guide to using the git stash command.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/translated/tech/20210402 A practical guide to using the git stash command.md b/translated/tech/20210402 A practical guide to using the git stash command.md index ddd8a761dd..37149498ca 100644 --- a/translated/tech/20210402 A practical guide to using the git stash command.md +++ b/translated/tech/20210402 A practical guide to using the git stash command.md @@ -3,24 +3,24 @@ [#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) git stash 命令实用指南 ====== -> 学习如何使用 `git stash` 命令,以及何时应该使用它。 +> 学习如何使用 `git stash` 命令,以及何时应该使用它。 -![女人在笔记本上坐在窗口][1] +![](https://img.linux.net.cn/data/attachment/album/202104/12/232830chuyr6lkzevrfuzr.jpg) -版本控制是软件开发人员日常生活中不可分割的一部分。很难想象有哪个团队在开发软件时不使用版本控制工具。同样也很难想象有哪个开发者没有使用过(或没有听说过)Git。在 2018 年 Stackoverflow 开发者调查中,74298 名参与者中 87.2% 的人 [使用 Git][2] 进行版本控制。 +版本控制是软件开发人员日常生活中不可分割的一部分。很难想象有哪个团队在开发软件时不使用版本控制工具。同样也很难想象有哪个开发者没有使用过(或没有听说过)Git。在 2018 年 Stackoverflow 开发者调查中,74298 名参与者中有 87.2% 的人 [使用 Git][2] 进行版本控制。 -Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将介绍 `git stash` 命令,并探讨一些有用的暂存修改的选项。本文假定你对 [Git 概念][3] 有基本的了解,并对工作树、暂存区和相关命令有良好的理解。 +Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将介绍 `git stash` 命令,并探讨一些有用的暂存变更的选项。本文假定你对 [Git 概念][3] 有基本的了解,并对工作树、暂存区和相关命令有良好的理解。 ### 为什么 git stash 很重要? -首先要明白为什么在 Git 中暂存变更很重要。假设 Git 没有暂存变更的命令。当你正在一个有两个分支(A 和 B)的仓库上工作时,这两个分支已经分叉了一段时间,并且有不同的头。当你正在处理 A 分支的一些文件时,你的团队要求你修复 B 分支的一个错误。你迅速将你的修改保存到 A 分支,并尝试用 `git checkout B` 来签出 B 分支。Git 立即中止了这个操作,并抛出错误:“你对以下文件的本地修改会被该签出覆盖……请在切换分支之前提交你的修改或将它们暂存起来。” +首先要明白为什么在 Git 中暂存变更很重要。假设 Git 没有暂存变更的命令。当你正在一个有两个分支(A 和 B)的仓库上工作时,这两个分支已经分叉了一段时间,并且有不同的头。当你正在处理 A 分支的一些文件时,你的团队要求你修复 B 分支的一个错误。你迅速将你的修改保存到 A 分支(但没有提交),并尝试用 `git checkout B` 来签出 B 分支。Git 会立即中止了这个操作,并抛出错误:“你对以下文件的本地修改会被该签出覆盖……请在切换分支之前提交你的修改或将它们暂存起来。” 在这种情况下,有几种方法可以启用分支切换: @@ -31,7 +31,7 @@ Linus Torvalds 在 2005 年创建了 Git 用于开发 Linux 内核。本文将 `git stash` 将未提交的改动保存在本地,让你可以进行修改、切换分支以及其他 Git 操作。然后,当你需要的时候,你可以重新应用这些存储的改动。暂存是本地范围的,不会被 `git push` 推送到远程。 -### 如何使用git stash +### 如何使用 git stash 下面是使用 `git stash` 时要遵循的顺序: @@ -54,7 +54,7 @@ $ git stash Saved working directory and index state WIP on master; d7435644 Feat: configure graphql endpoint ``` -默认情况下,`git stash` 存储(或“暂存”)未提交的更改(已暂存和未暂存的文件),并忽略未跟踪和忽略的文件。通常情况下,你不需要暂存未跟踪和忽略的文件,但有时它们可能会干扰你在代码库中要做的其他事情。 +默认情况下,`git stash` 存储(或称之为“暂存”)未提交的更改(已暂存和未暂存的文件),并忽略未跟踪和忽略的文件。通常情况下,你不需要暂存未跟踪和忽略的文件,但有时它们可能会干扰你在代码库中要做的其他事情。 你可以使用附加选项让 `git stash` 来处理未跟踪和忽略的文件: @@ -212,7 +212,7 @@ via: https://opensource.com/article/21/4/git-stash 作者:[Ramakrishna Pattnaik][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From de8cd1562bfd93766c2005a60b578af8f93cbd75 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 12 Apr 2021 23:29:42 +0800 Subject: [PATCH 095/307] PUB @wxy https://linux.cn/article-13293-1.html --- ...210402 A practical guide to using the git stash command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210402 A practical guide to using the git stash command.md (99%) diff --git a/translated/tech/20210402 A practical guide to using the git stash command.md b/published/20210402 A practical guide to using the git stash command.md similarity index 99% rename from translated/tech/20210402 A practical guide to using the git stash command.md rename to published/20210402 A practical guide to using the git stash command.md index 37149498ca..51917981dd 100644 --- a/translated/tech/20210402 A practical guide to using the git stash command.md +++ b/published/20210402 A practical guide to using the git stash command.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13293-1.html) git stash 命令实用指南 ====== From 22547cb04d6931be67557bdc6fb9c2b4f05ac0db Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:02:31 +0800 Subject: [PATCH 096/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412=20?= =?UTF-8?q?Scheduling=20tasks=20with=20cron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 Scheduling tasks with cron.md --- .../20210412 Scheduling tasks with cron.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/20210412 Scheduling tasks with cron.md diff --git a/sources/tech/20210412 Scheduling tasks with cron.md b/sources/tech/20210412 Scheduling tasks with cron.md new file mode 100644 index 0000000000..5f0e427d42 --- /dev/null +++ b/sources/tech/20210412 Scheduling tasks with cron.md @@ -0,0 +1,207 @@ +[#]: subject: (Scheduling tasks with cron) +[#]: via: (https://fedoramagazine.org/scheduling-tasks-with-cron/) +[#]: author: (Darshna Das https://fedoramagazine.org/author/climoiselle/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Scheduling tasks with cron +====== + +![][1] + +Photo by [Yomex Owo][2] on [Unsplash][3] + +Cron is a scheduling daemon that executes tasks at specified intervals. These tasks are called _cron_ jobs and are mostly used to automate system maintenance or administration tasks. For example, you could set a _cron_ job to automate repetitive tasks such as backing up database or data, updating the system with the latest security patches, checking the disk space usage, sending emails, and so on. The _cron_ jobs can be scheduled to run by the minute, hour, day of the month, month, day of the week, or any combination of these. + +### **Some advantages of cron** + +These are a few of the advantages of using _cron_ jobs: + + * You have much more control over when your job runs i.e. you can control the minute, the hour, the day, etc. when it will execute. + * It eliminates the need to write the code for the looping and logic of the task and you can shut it off when you no longer need to execute the job. + * Jobs do not occupy your memory when not executing so you are able to save the memory allocation. + * If a job fails to execute and exits for some reason it will run again when the proper time comes. + + + +### Installing the cron daemon + +Luckily Fedora Linux is pre-configured to run important system tasks to keep the system updated. There are several utilities that can run tasks such as _cron_, _anacron_, _at_ and _batch_. This article will focus on the installation of the _cron_ utility only. Cron is installed with the _cronie_ package that also provides the _cron_ services. + +To determine if the package is already present or not, use the rpm command: + +``` +$ rpm -q cronie + Cronie-1.5.2-4.el8.x86_64 +``` + +If the _cronie_ package is installed it will return the full name of the _cronie_ package. If you do not have the package present in your system it will say the package is not installed. +To install type this: + +``` +$ dnf install cronie +``` + +### Running the cron daemon + +A _cron_ job is executed by the _crond_ service based on information from a configuration file. Before adding a job to the configuration file, however, it is necessary to start the _crond_ service, or in some cases install it. What is _crond_? _Crond_ is the compressed name of cron daemon (crond). To determine if the _crond_ service is running or not, type in the following command: + +``` +$ systemctl status crond.service +● crond.service - Command Scheduler + Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor pre> + Active: active (running) since Sat 2021-03-20 14:12:35 PDT; 1 day 21h ago + Main PID: 1110 (crond) +``` + +If you do not see something similar including the line “Active: active (running) since…”, you will have to start the _crond_ daemon. To run the _crond_ service in the current session, enter the following command: + +``` +$ systemctl run crond.service +``` + +To configure the service to start automatically at boot time, type the following: + +``` +$ systemctl enable crond.service +``` + +If, for some reason, you wish to stop the _crond_ service from running, use the _stop_ command as follows: + +``` +$ systemctl stop crond.service +``` + +To restart it, simply use the _restart_ command: + +``` +$ systemctl restart crond.service +``` + +### Defining a cron job + +#### The cron configuration + +Here is an example of the configuration details for a _cron_ job. This defines a simple _cron_ job to pull the latest changes of a _git_ master branch into a cloned repository: + +``` +*/59 * * * * username cd /home/username/project/design && git pull origin master +``` + +There are two main parts: + + * The first part is “*/59 * * * *”. This is where the timer is set to every 59 minutes. + * The rest of the line is the command as it would run from the command line. +The command itself in this example has three parts: + * The job will run as the user “username” + * It will change to the directory /home/username/project/design + * The git command runs to pull the latest changes in the master branch. + + + +#### **Timing syntax** + +The timing information is the first part of the _cron_ job string, as mentioned above. This determines how often and when the cron job is going to run. It consists of 5 parts in this order: + + * minute + * hour + * day of the month + * month + * day of the week + + + +Here is a more graphic way to explain the syntax may be seen here: + +``` +.---------------- minute (0 - 59) + | .------------- hour (0 - 23) + | | .---------- day of month (1 - 31) + | | | .------- month (1 - 12) OR jan,feb,mar,apr … + | | | | .---- day of week (0-6) (Sunday=0 or 7) + | | | | | OR sun,mon,tue,wed,thr,fri,sat + | | | | | + * * * * user-name command-to-be-executed +``` + +#### Use of the **asterisk** + +An asterisk (*) may be used in place of a number to represents all possible values for that position. For example, an asterisk in the minute position would make it run every minute. The following examples may help to better understand the syntax. + +This cron job will run every minute, all the time: + +``` +* * * * [command] +``` + +A slash (/) indicates a multiple number of minutes The following example will run 12 times per hour, i.e., every 5 minutes: + +``` +*/5 * * * * [command] +``` + +The next example will run once a month, on the second day of the month at midnight (e.g. January 2nd 12:00am, February 2nd 12:00am, etc.): + +``` +0 0 2 * * [command] +``` + +#### Using crontab to create a cron job + +Cron jobs run in the background and constantly check the _/etc/crontab_ file, and the _/etc/cron.*/_ and _/var/spool/cron/_ directories. Each user has a unique crontab file in _/var/spool/cron/_ . + +These _cron_ files are not supposed to be edited directly. The _crontab_ command is the method you use to create, edit, install, uninstall, and list cron jobs. + +The same _crontab_ command is used for creating and editing cron jobs. And what’s even cooler is that you don’t need to restart cron after creating new files or editing existing ones. + +``` +$ crontab -e +``` + +This opens your existing _crontab_ file or creates one if necessary. The _vi_ editor opens by default when calling _crontab -e_. Note: To edit the _crontab_ file using Nano editor, you can optionally set the **EDITOR**=nano environment variable. + +List all your _cron_ jobs using the option _-l_ and specify a user using the _-u_ option, if desired. + +``` +$ crontab -l +$ crontab -u username -l +``` + +Remove or erase all your _cron_ jobs using the following command: + +``` +$ crontab -r +``` + +To remove jobs for a specific user you must run the following command as the _root user_: + +``` +$ crontab -r -u username +``` + +Thank you for reading. _cron_ jobs may seem like a tool just for system admins, but they are actually relevant to many kinds of web applications and user tasks. + +#### Reference + +Fedora Linux documentation for [Automated Tasks][4] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/scheduling-tasks-with-cron/ + +作者:[Darshna Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/climoiselle/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/schedule_with_cron-816x345.jpg +[2]: https://unsplash.com/@yomex4life?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/clock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/ch-autotasks.html From ca6fcaeb4bb5610c0213970b4761ceaecec74086 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:01 +0800 Subject: [PATCH 097/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413=20?= =?UTF-8?q?Create=20and=20Edit=20EPUB=20Files=20on=20Linux=20With=20Sigil?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md --- ...and Edit EPUB Files on Linux With Sigil.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md diff --git a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md new file mode 100644 index 0000000000..afa283e131 --- /dev/null +++ b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -0,0 +1,101 @@ +[#]: subject: (Create and Edit EPUB Files on Linux With Sigil) +[#]: via: (https://itsfoss.com/sigile-epub-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Create and Edit EPUB Files on Linux With Sigil +====== + +Sigil is an open source EPUB editor available for Linux, Windows and macOS. With Sigil, you can create a new ebook in EPUB file format or edit an existing EPUB ebook (file ending in .epub extension). + +In case you are wondering, EPUB is a standard ebook file format endorsed by several digital publishing groups. It is well-supported on a range of devices and ebook readers except Amazon Kindle. + +### Sigil lets you create or edit EPUB files + +[Sigil][1] is an open source software that allows you to edit EPUB files. You may, of course, create a new EPUB file from scratch. + +![][2] + +Many people swear by [Calibre for creating ebooks][3] or editing them. It is indeed a complete tool with lots of features and supports more than just EPUB file format. However, Calibre could be heavy on resources at times. + +Sigil is focused on just the EPUB books with the following features: + + * Support for EPUB 2 and EPUB 3 (with some limitations) + * Provides a preview along with the code view + * Editing EPUB syntax + * Table of content generator with mult-level heading + * Edit metadat + * Spell checking + * REGEX support for find and replace feature + * Supports import of EPUB and HTML files, images, and style sheets + * Additional plugins + * Multiple language support for the interface + * Supports Linux, Windows and macOS + + + +Sigil is not [WYSIWYG][4] type of editor where you can type the chapters of new book. It is focused on code as EPUB depends on XML. Consider it a [code editor like VS Code][5] for EPUB files. For this reason, you should use some other [open source tool for writing][6], export your files in .epub format (if possible) and then edit it in Sigil. + +![][7] + +Sigil does have a [Wiki][8] to provide you some documentation on installing and using Sigil. + +### Installing Sigil on Linux + +Sigil is a cross-platform application with support for Windows and macOS along with Linux. It is a popular software with more than a decade of existence. This is why you should find it in the repositories of your Linux distributions. Just look for it in the software center application of your distribution. + +![Sigil in Ubuntu Software Center][9] + +You may need to enable the universe repository beforehand. You may also use the apt command in Ubuntu-based distributions: + +``` +sudo apt install sigil +``` + +Sigil has a lot of dependencies on Python libraries and modules and hence it downloads and installs a good number of packages. + +![][10] + +I am not going to list commands for Fedora, SUSE, Arch and other distributions. You probably already know how to use your distribution’s package manager, right? + +The version provided by your distribution may not always be the latest. If you want the latest version of Sigil, you can check out its GitHub repositories. + +[Sigil on GitHub][11] + +### Not for everyone, certianly not for reading ePUB books + +I wouldn’t recommend using Sigil for reading ebooks. There are [other dedicated applications on Linux to read .epub files][12]. + +If you are a writer who has to deal with EPUB books or if you are digitizing old books and converting them in various formats, Sigil could be worth a try. + +I haven’t used Sigil extensively so I cannot provide a review of it. I let it up to you to explore it and share your experienced with the rest of us here. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sigile-epub-editor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://sigil-ebook.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-epub-sigil.png?resize=800%2C621&ssl=1 +[3]: https://itsfoss.com/create-ebook-calibre-linux/ +[4]: https://www.computerhope.com/jargon/w/wysiwyg.htm +[5]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[6]: https://itsfoss.com/open-source-tools-writers/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-epub-editor-800x621.png?resize=800%2C621&ssl=1 +[8]: https://github.com/Sigil-Ebook/Sigil/wiki +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-software-center-ubuntu.png?resize=800%2C424&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/installing-sigil-ubuntu.png?resize=800%2C547&ssl=1 +[11]: https://github.com/Sigil-Ebook/Sigil +[12]: https://itsfoss.com/open-epub-books-ubuntu-linux/ From 1415e21b635bf98b9fd47b2f852b882f1af30ab4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:20 +0800 Subject: [PATCH 098/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412=20?= =?UTF-8?q?6=20open=20source=20tools=20and=20tips=20to=20securing=20a=20Li?= =?UTF-8?q?nux=20server=20for=20beginners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md --- ...o securing a Linux server for beginners.md | 202 ++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md diff --git a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md new file mode 100644 index 0000000000..36b202743a --- /dev/null +++ b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -0,0 +1,202 @@ +[#]: subject: (6 open source tools and tips to securing a Linux server for beginners) +[#]: via: (https://opensource.com/article/21/4/securing-linux-servers) +[#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +6 open source tools and tips to securing a Linux server for beginners +====== +Use open source tools to protect your Linux environment from breaches. +![People work on a computer server with devices][1] + +Because so much of our personal and professional data is available online today, it is important for everyone—from professionals to general internet users—to learn the basics of security and privacy. As a student, I've been able to gain experience in this area through my school's CyberPatriot initiative, where I've had the opportunity to interact with industry experts to learn about cyber breaches and the basic steps to establish a system's security. + +This article details six simple steps to improve the security of your Linux environment for personal use, based on what I have learned thus far as a beginner. Throughout my journey, I have utilized open source tools to accelerate my learning process and familiarize myself with higher-level concepts related to securing my Linux server. + +I have tested these steps using Ubuntu 18.04, the version I am most familiar with, but these steps will also work for other Linux distributions. + +### 1\. Run updates + +Developers are constantly finding ways to make servers more stable, fast, and secure by patching known vulnerabilities. Running updates regularly is a good habit to get into to maximize security. Run them with: + + +``` +`sudo apt-get update && apt-get upgrade` +``` + +### 2\. Enable firewall protection + +[Enabling a firewall][2] makes it easier to control incoming and outgoing traffic on your server. There are many firewall applications you can use on Linux, including [firewall-cmd][3] and Uncomplicated Firewall ([UFW][4]). I use UFW, so my examples are specific to it, but these principles apply to any interface you choose. + +Install UFW: + + +``` +`sudo apt-get install ufw` +``` + +If you want to secure your server even more, you can deny incoming and outgoing connections. Be warned: This cuts your server off from the world, so once you've blocked all traffic, you must specify which outgoing connections are allowed from your system: + + +``` +sudo ufw default deny incoming +sudo ufw default allow outgoing +``` + +You can also write rules for allowing incoming connections you need for personal use: + + +``` +`ufw allow ` +``` + +For example, to allow SSH connections: + + +``` +`ufw allow ssh` +``` + +Finally, enable your firewall with: + + +``` +`sudo ufw enable` +``` + +### 3\. Strengthen password protection + +Implementing a strong password policy is an important aspect of keeping a server secure from cyberattacks and data breaches. Some best practices for password policies include enforcing a minimum length and specifying password age. I use the libpam-cracklib package to accomplish these tasks. + +Install the libpam-cracklib package: + + +``` +`sudo apt-get install libpam-cracklib` +``` + +To enforce password length: + + * Open the `/etc/pam.d/common-password` file. + * Change the minimum character length of all passwords by changing the `minlen=12` line to however many characters you want. + + + +To prevent password reuse: + + * In the same file (`/etc/pam.d/common-password`), add the line `remember=x`. + * For example, if you want to prevent a user from reusing one of their last five passwords, use: `remember=5`. + + + +To enforce password age: + + * Find the following lines in the `/etc/login.defs` file and replace them with your preferred amount of time (days). For example: [code] PASS_MIN_AGE: 3 +PASS_MAX_AGE: 90 +PASS_WARN_AGE: 14 +``` +To enforce character specifications: + + * The four parameters to enforce character specifications in passwords are `lcredit` (lowercase), `ucredit` (uppercase), `dcredit` (digit), and `ocredit` (other characters). + * In the same file (`/etc/pam.d/common-password`), locate the line containing `pam_cracklib.so`. + * Add the following to the end of this line: [code]`lcredit=-a ucredit=-b dcredit=-c ocredit=-d` +``` + * For example, the following line requires passwords to contain _one_ of each parameter. You can change the numbers based on your preferred level of password security: [code]`lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1` +``` +## 4\. Disable nonessential services that are prone to exploitation + +It's a best practice to disable unnecessary services. This allows fewer ports to be open for exploitation. + +Install the systemd package: +``` +`sudo apt-get install systemd` +``` +See which services are running: +``` +`systemctl list-units` +``` +[Recognize][5] which services could cause potential vulnerabilities to your system. For each service: + + * Stop the service if it's currently running: [code]`systemctl stop ` +``` + * Disable the service from starting on boot: [code]`systemctl disable ` +``` +* After running these commands, check the status of the service: [code]`systemctl status ` +``` + + + +### 5\. Check for listening ports + +Open ports might pose security risks, so it's important to check for ports that are listening on your server. I use the [netstat][6] command to show all network connections: + + +``` +`netstat -tulpn` +``` + +Look at the address columns to determine the [port number][7]. Once you've found open ports, review them to make sure they're all necessary. If they aren't, [adjust what services you have running][8], or adjust your firewall settings. + +### 6\. Scan for malware + +Antivirus scanning software can be useful to keep viruses out of your system. Using them is a simple way to keep your server free from malware. My preferred tool is the open source software [ClamAV][9]. + +Install ClamAV: + + +``` +`sudo apt-get install clamav` +``` + +Update virus signatures: + + +``` +`sudo freshclam` +``` + +Scan all files and print out infected files, ringing a bell when one is found: + + +``` +`sudo clamscan -r --bell -i /` +``` + +You can and should automate scans so that you don't have to remember or spend time doing them manually. For simple automation like this, you can use [systemd timers][10] or your [favorite cron][11]. + +### Keep your server safe + +We cannot leave the responsibility for securing servers to a single person or organization. As the threat landscape continues to expand rapidly, it is up to each of us to be aware of the importance of server security and to employ some simple, effective security best practices. + +These are just a few of the many steps you can take to keep your Linux server safe. Of course, prevention is only part of the solution. These policies should be combined with rigorous monitoring for denial of service attacks, doing system analysis with [Lynis][12], and creating frequent backups. + +What open source tools do you use to keep your server safe? Tell us about them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/securing-linux-servers + +作者:[Sahana Sreeram][a] +选题:[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/sahanasreeram01gmailcom +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[3]: https://opensource.com/article/20/2/firewall-cheat-sheet +[4]: https://wiki.ubuntu.com/UncomplicatedFirewall +[5]: http://www.yorku.ca/infosec/Administrators/UNIX_disable.html +[6]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat +[7]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers +[8]: https://opensource.com/article/20/5/systemd-units +[9]: https://www.clamav.net/ +[10]: https://opensource.com/article/20/7/systemd-timers +[11]: https://opensource.com/article/21/2/linux-automation +[12]: https://opensource.com/article/20/5/linux-security-lynis From 7e84c15e20ab26e893f4f0f9ce3e0d3570d527fe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:33 +0800 Subject: [PATCH 099/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412=20?= =?UTF-8?q?Encrypt=20your=20files=20with=20this=20open=20source=20software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 Encrypt your files with this open source software.md --- ...ur files with this open source software.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20210412 Encrypt your files with this open source software.md diff --git a/sources/tech/20210412 Encrypt your files with this open source software.md b/sources/tech/20210412 Encrypt your files with this open source software.md new file mode 100644 index 0000000000..d5cd35cde2 --- /dev/null +++ b/sources/tech/20210412 Encrypt your files with this open source software.md @@ -0,0 +1,90 @@ +[#]: subject: (Encrypt your files with this open source software) +[#]: via: (https://opensource.com/article/21/4/open-source-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Encrypt your files with this open source software +====== +VeraCrypt offers open source file-encryption with cross-platform +capabilities. +![Lock][1] + +Many years ago, there was encryption software called [TrueCrypt][2]. Its source code was available, although there were no major claims that anyone had ever audited or contributed to it. Its author was (and remains to this day) anonymous. Still, it was cross-platform, easy to use, and really, really useful. + +TrueCrypt allowed you to create an encrypted file "vault," where you could store sensitive information of any kind (text, audio, video, images, PDFs, and so on). Provided you had the correct passphrase, TrueCrypt could decrypt the vault and provide read and write access on any computer running TrueCrypt. It was a useful technique that essentially provided a virtual, portable, fully encrypted drive (except it was a file) where you could safely store your data. + +TrueCrypt eventually closed down, but a replacement project called VeraCrypt quickly sprang up to fill the void. [VeraCrypt][3] is based on TrueCrypt 7.1a and features many improvements over the original (including significant algorithm changes for standard encrypted volumes and boot volumes). With VeraCrypt 1.12 and later versions, you can use custom iterations for increased encryption security. Better yet, VeraCrypt can load old TrueCrypt volumes, so if you were a TrueCrypt user, it's easy to transfer them over to VeraCrypt. + +### Install VeraCrypt + +You can install VeraCrypt on all major platforms by downloading the appropriate installer file from the [VeraCrypt download page][4]. + +Alternately, you can build it yourself from source code. On Linux, it requires wxGTK3, makeself, and the usual development stack (Binutils, GCC, and so on). + +Once you have it installed, launch VeraCrypt from your application menu. + +### Create a VeraCrypt volume + +If you're new to VeraCrypt, you must create a VeraCrypt volume first (otherwise, you have nothing to decrypt). In the VeraCrypt window, click the **Create Volume** button on the left. + +![Creating a volume with VeraCrypt][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +In VeraCrypt's **Volume Creator Wizard** window that appears, choose whether you want to create an encrypted file container or to encrypt an entire drive. The wizard steps you through creating a vault for your data, so follow along as prompted. + +For this article, I created a file container. A VeraCrypt container is a lot like any other file: it exists on a hard drive, external drive, in cloud storage, or anywhere else you can think to store data. Like other files, it can be moved, copied, and deleted. Unlike most other files, it can _contain_ more files, which is why I think of it as a "vault," and VeraCrypt developers refer to it as a "container." Its developers call a VeraCrypt file a "container" because it can contain other data objects; it has nothing to do with the container technology made popular by LXC, Kubernetes, and other modern IT mechanisms. + +#### Choose a filesystem + +During the volume-creation process, you're asked to select a filesystem to decide how the files you place inside your vault are stored. The Microsoft FAT format is archaic, non-journaled, and limits both volume and file sizes, but it's the one format all platforms can read from and write to. If you intend your VeraCrypt vault to cross platforms, FAT is your best bet. + +Aside from that, NTFS works for Windows and Linux. The open source EXT series works for Linux. + +### Mount a VeraCrypt volume + +Once you've created a VeraCrypt volume, you can mount it from within the VeraCrypt window. To mount an encrypted vault, click the **Select File** button on the right. Select your encrypted file, choose one of the numbered slots in the upper half of the VeraCrypt window, and then click the **Mount** button located in the lower-left corner of the VeraCrypt window. + +Your mounted volume is available in the list of available volumes in the VeraCrypt window, and you can access that volume through your file manager as if it were an external drive. For instance, on KDE, I open [Dolphin][7], navigate to `/media/veracrypt1`, and then I can copy files into my vault. + +As long as you have VeraCrypt on a device, you can always access your vault. It's encrypted until you manually mount it in VeraCrypt, where it remains decrypted until you close the volume again. + +### Close a VeraCrypt volume + +To keep your data safe, it's important to close a VeraCrypt volume when you don't need it open. That keeps it safe from prying eyes and crimes of opportunity. + +![Mounting a VeraCrypt volume][8] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +Closing up the VeraCrypt container is about as easy as it is to open one: Select the listed volume in the VeraCrypt window, and click **Dismount**. You no longer have access to the files inside your vault, and neither does anyone else. + +### VeraCrypt for easy cross-platform encryption + +There are many ways to keep your data secure, and VeraCrypt tries to make it easy for you, regardless of what platform you need to use that data on. If you want to experience easy, open source file encryption, try VeraCrypt. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-encryption + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://en.wikipedia.org/wiki/TrueCrypt +[3]: https://www.veracrypt.fr/en/Home.html +[4]: https://www.veracrypt.fr/en/Downloads.html +[5]: https://opensource.com/sites/default/files/uploads/veracrypt-create.jpg (Creating a volume with VeraCrypt) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://en.wikipedia.org/wiki/Dolphin_%28file_manager%29 +[8]: https://opensource.com/sites/default/files/uploads/veracrypt-volume.jpg (Mounting a VeraCrypt volume) From b5c0a4645e25e7190f528bd04032b0777a51edf4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 13 Apr 2021 05:03:45 +0800 Subject: [PATCH 100/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210412=20?= =?UTF-8?q?Send=20your=20scans=20to=20a=20Linux=20machine=20over=20your=20?= =?UTF-8?q?network?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210412 Send your scans to a Linux machine over your network.md --- ...ns to a Linux machine over your network.md | 205 ++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 sources/tech/20210412 Send your scans to a Linux machine over your network.md diff --git a/sources/tech/20210412 Send your scans to a Linux machine over your network.md b/sources/tech/20210412 Send your scans to a Linux machine over your network.md new file mode 100644 index 0000000000..b9479545e4 --- /dev/null +++ b/sources/tech/20210412 Send your scans to a Linux machine over your network.md @@ -0,0 +1,205 @@ +[#]: subject: (Send your scans to a Linux machine over your network) +[#]: via: (https://opensource.com/article/21/4/linux-scan-samba) +[#]: author: (Marc Skinner https://opensource.com/users/marc-skinner) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Send your scans to a Linux machine over your network +====== +Set up a Samba share to make a scanner easily accessible by a Linux +computer over your network. +![Files in a folder][1] + +The free software movement famously got started [because of a poorly designed printer][2]. Decades later, printer and scanner manufacturers continue to reinvent the wheel, ignoring established and universal protocols. As a result, every now and again, you'll stumble onto a printer or scanner that just doesn't seem to work with your operating system. + +This happened to me recently with a Canon 3-in-1 scanner (the Canon Maxify MB2720). I was able to solve the scanner's problem with open source. Specifically, I set up a Samba share to make the scanner available on my network. + +The [Samba project][3] is a Windows interoperability suite of programs for Linux and Unix. Although it's mostly low-level code that many users never knowingly interact with, the software makes it easy to share files over your local network, regardless of what platforms are used. + +I'm using Fedora, so these instructions should work for any RPM-based Linux distribution. Minor modifications may be necessary for other distributions. Here's how I did it. + +### Get the Canon tools + +Download the required Windows Canon Quick Utility Toolbox software from Canon's website. The software is required because it is the only way to configure the printer's destination folder location and credentials. Once this is done, you do not need to use the tool unless you want to make a change. + +Before configuring the printer, you must set up a Samba share on your Linux computer or server. Install Samba with the following command: + + +``` +`$ sudo dnf -y install samba` +``` + +Create `/etc/smb.conf` file with the following content: + + +``` +[global] +        workgroup = WORKGROUP +        netbios name = MYSERVER +        security = user +        #CORE needed for CANON PRINTER SCAN FOLDER +        min protocol = CORE +        #NTML AUTHV1 needed for CANON PRINTER SCAN FOLDER +        ntlm auth = yes +        passdb backend = tdbsam + +        printing = cups +        printcap name = cups +        load printers = no +        cups options = raw + +        hosts allow = 127. 192.168.33. +        max smbd processes = 1000 + +[homes] +        comment = Home Directories +        valid users = %S, %D%w%S +        browseable = No +        writable = yes +        read only = No +        inherit acls = Yes + +[SCANS] +        comment = MB2720 SCANS +        path = /mnt/SCANS +        public = yes +        writable = yes +        browseable = yes +        printable = no +        force user = tux +        create mask = 770 +``` + +In the `force user` line near the end, change the username from `tux` to your own username. + +Unfortunately, the Canon printer won't work with Server Message Block ([SMB][4]) protocols higher than CORE or NTML authentication v2. For this reason, the Samba share must be configured with the oldest SMB protocol and NTML authentication versions. This is not ideal by any means and has security implications, so I created a separate Samba server dedicated to the scanner use case. My other Samba server, which shares all home networked files, still uses SMB protocol 3 and NTML authentication v2. + +Start the Samba server service and enable it for restart: + + +``` +$ sudo systemctl start smb +$ sudo systemctl enable smb +``` + +### Create a Samba user + +Create your Samba user and a password for it: + + +``` +`$ sudo smbpasswd -a tux` +``` + +Enter your password at the prompt. + +Assuming you want to mount your Samba scans on a Linux system, you need to do a few steps. + +Create a Samba client credentials file. Mine looks like this: + + +``` +$ sudo cat /root/smb-credentials.txt +username=tux +password=mySTRONGpassword +``` + +Change the permissions so that it isn't world-readable: + + +``` +`$ sudo chmod 640 /root/smb-credentials.txt` +``` + +Create a mount point and add it to `/etc/fstab`: + + +``` +`$ sudo mkdir /mnt/MB2720-SCANS` +``` + +Add the following line into your `/etc/fstab`: + + +``` +`//192.168.33.50/SCANS  /mnt/MB2720-SCANS  cifs vers=3.0,credentials=/root/smb-credentials.txt,gid=1000,uid=1000,_netdev    0 0` +``` + +This mounts the Samba share scans to the new mount point using [CIFS][5], forcing SMBv3, and using the username and password stored in `/root/smb-credetials.txt`. It also passes the user's group identifier (GID) and the user identifier (UID), giving you full ownership of the Linux mount. The `_netdev` option is required so that the mount point is mounted after networking is fully functional (after a reboot, for instance) because this mount requires networking to be accessed. + +### Configure the Canon software + +Now that you have created the Samba share, configured it on the server, and configured the share to be mounted on your Linux client, you need to launch the Canon Quick Utility Toolbox to configure the printer. Because Canon doesn't release this toolbox for Linux, this step requires Windows. You can try [running it on WINE][6], but should that fail, you'll have to either borrow a Windows computer from someone or run a [Windows developer virtual machine][7] in [GNOME Boxes][8] or [VirtualBox][9]. + +Power on the printer, and then start the Canon Quick Utility Toolbox. It should find your printer. If it can't see your printer, you must configure the printer for either LAN or wireless networking first. + +In the toolbox, click on **Destination Folder Settings**. + +![Canon Quick Utility Toolbox][10] + +(Marc Skinner, [CC BY-SA 4.0][11]) + +Enter the printer administration password—my default password was **canon**. + +Click the **Add** button. + +![Add destination folder][12] + +Fill out the form with a Displayed Name, your Samba share location, and your Samba username and password. + +I left the PIN Code blank, but if you want to require a PIN to be entered each time you scan from the printer, you can set one. This would be useful in an office where each user has their own Samba share and PIN to protect their scans. + +Click **Connection Test** to validate the form data. + +Click the **OK** button. + +Click **Register to Printer** to save your configuration back to the printer. + +![Register to Printer ][13] + +(Marc Skinner, [CC BY-SA 4.0][11]) + +Everything is set up. Click **Exit**. You're done with Windows now, and probably the toolbox, unless you need to change something. + +### Start scanning + +You can now scan from the printer and select your Destination Folder from its LCD menu. Scans are saved directly to the Samba share, which you have access to from your Linux computer. + +For convenience, create a symbolic link on your Linux desktop or home directory with the following command: + + +``` +`$ sudo ln -sd /mnt/MB2720-SCANS /home/tux/Desktop/MB2720-SCANS` +``` + +That's all there is to it! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-scan-samba + +作者:[Marc Skinner][a] +选题:[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/marc-skinner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: https://opensource.com/article/18/2/pivotal-moments-history-open-source +[3]: http://samba.org/ +[4]: https://en.wikipedia.org/wiki/Server_Message_Block +[5]: https://searchstorage.techtarget.com/definition/Common-Internet-File-System-CIFS +[6]: https://opensource.com/article/21/2/linux-wine +[7]: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/ +[8]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[9]: https://www.virtualbox.org/ +[10]: https://opensource.com/sites/default/files/uploads/canontoolbox.png (Canon Quick Utility Toolbox) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ +[12]: https://opensource.com/sites/default/files/add_destination_folder.png (Add destination folder) +[13]: https://opensource.com/sites/default/files/uploads/canonregistertoprinter.png (Register to Printer ) From d54549427ebdb9864ea6e1d9d47561b1b93dbade Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 13 Apr 2021 08:38:37 +0800 Subject: [PATCH 101/307] translated --- .../20210407 What is Git cherry-picking.md | 200 ------------------ .../20210407 What is Git cherry-picking.md | 200 ++++++++++++++++++ 2 files changed, 200 insertions(+), 200 deletions(-) delete mode 100644 sources/tech/20210407 What is Git cherry-picking.md create mode 100644 translated/tech/20210407 What is Git cherry-picking.md diff --git a/sources/tech/20210407 What is Git cherry-picking.md b/sources/tech/20210407 What is Git cherry-picking.md deleted file mode 100644 index eede7de952..0000000000 --- a/sources/tech/20210407 What is Git cherry-picking.md +++ /dev/null @@ -1,200 +0,0 @@ -[#]: subject: (What is Git cherry-picking?) -[#]: via: (https://opensource.com/article/21/4/cherry-picking-git) -[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is Git cherry-picking? -====== -Learn the what, why, and how of the git cherry-pick command. -![Measuring and baking a cherry pie recipe][1] - -Whenever you're working with a group of programmers on a project, whether small or large, handling changes between multiple Git branches can become difficult. Sometimes, instead of combining an entire Git branch into a different one, you want to select and move a couple of specific commits. This procedure is known as "cherry-picking." - -This article will cover the what, why, and how of cherry-picking. - -So let's start. - -### What is cherry-pick? - -With the `cherry-pick` command, Git lets you incorporate selected individual commits from any branch into your current [Git HEAD][2] branch. - -When performing a `git merge` or `git rebase`, all the commits from a branch are combined. The `cherry-pick` command allows you to select individual commits for integration. - -### Benefits of cherry-pick - -The following situation might make it easier to comprehend the way cherry-picking functions. - -Imagine you are implementing new features for your upcoming weekly sprint. When your code is ready, you will push it into the remote branch, ready for testing. - -However, the customer is not delighted with all of the modifications and requests that you present only certain ones. Because the client hasn't approved all changes for the next launch, `git rebase` wouldn't create the desired results. Why? Because `git rebase` or `git merge` will incorporate every adjustment from the last sprint. - -Cherry-picking is the answer! Because it focuses only on the changes added in the commit, cherry-picking brings in only the approved changes without adding other commits. - -There are several other reasons to use cherry-picking: - - * It is essential for bug fixing because bugs are set in the development branch using their commits. - * You can avoid unnecessary battles by using `git cherry-pick` instead of other options that apply changes in the specified commits, e.g., `git diff`. - * It is a useful tool if a full branch unite is impossible because of incompatible versions in the various Git branches. - - - -### Using the cherry-pick command - -In the `cherry-pick` command's simplest form, you can just use the [SHA][3] identifier for the commit you want to integrate into your current HEAD branch. - -To get the commit hash, you can use the `git log` command: - - -``` -`$ git log --oneline` -``` - -Once you know the commit hash, you can use the `cherry-pick` command. - -The syntax is: - - -``` -`$ git cherry-pick ` -``` - -For example: - - -``` -`$ git cherry-pick 65be1e5` -``` - -This will dedicate the specified change to your currently checked-out branch. - -If you'd like to make further modifications, you can also instruct Git to add commit changes to your working copy. - -The syntax is: - - -``` -`$ git cherry-pick --no-commit` -``` - -For example: - - -``` -`$ git cherry-pick 65be1e5 --no-commit` -``` - -If you would like to select more than one commit simultaneously, add their commit hashes separated by a space: - - -``` -`$ git cherry-pick hash1 hash3` -``` - -When cherry-picking commits, you can't use the `git pull` command because it fetches _and_ automatically merges commits from one repository into another. The `cherry-pick` command is a tool you use to specifically not do that; instead, use `git fetch`, which fetches commits but does not apply them. There's no doubt that `git pull` is convenient, but it's imprecise. - -### Try it yourself - -To try the process, launch a terminal and generate a sample project: - - -``` -$ mkdir fruit.git -$ cd fruit.git -$ git init . -``` - -Create some data and commit it: - - -``` -$ echo "Kiwifruit" > fruit.txt -$ git add fruit.txt -$ git commit -m 'First commit' -``` - -Now, represent a remote developer by creating a fork of your project: - - -``` -$ mkdir ~/fruit.fork -$ cd !$ -$ echo "Strawberry" >> fruit.txt -$ git add fruit.txt -$ git commit -m 'Added a fruit" -``` - -That's a valid commit. Now, create a bad commit to represent something you wouldn't want to merge into your project: - - -``` -$ echo "Rhubarb" >> fruit.txt -$ git add fruit.txt -$ git commit -m 'Added a vegetable that tastes like a fruit" -``` - -Return to your authoritative repo and fetch the commits from your imaginary developer: - - -``` -$ cd ~/fruit.git -$ git remote add dev ~/fruit.fork -$ git fetch dev -remote: Counting objects: 6, done. -remote: Compressing objects: 100% (2/2), done. -remote: Total 6 (delta 0), reused 0 (delta 0) -Unpacking objects: 100% (6/6), done... - -[/code] [code] - -$ git log –oneline dev/master -e858ab2 Added a vegetable that tastes like a fruit -0664292 Added a fruit -b56e0f8 First commit -``` - -You've fetched the commits from your imaginary developer, but you haven't merged them into your repository yet. You want to accept the second commit but not the third, so use `cherry-pick`: - - -``` -`$ git cherry-pick 0664292` -``` - -The second commit is now in your repository: - - -``` -$ cat fruit.txt -Kiwifruit -Strawberry -``` - -Push your changes to your remote server, and you're done! - -### Reasons to avoid cherry-picking - -Cherry-picking is usually discouraged in the developer community. The primary reason is that it creates duplicate commits, but you also lose the ability to track your commit history. - -If you're cherry-picking a lot of commits out of order, those commits will be recorded in your branch, and it might lead to undesirable results in your Git branch. - -Cherry-picking is a powerful command that might cause problems if it's used without a proper understanding of what might occur. However, it may save your life (or at least your day job) when you mess up and make commits to the wrong branches. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/cherry-picking-git - -作者:[Rajeev Bera][a] -选题:[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/acompiler -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) -[2]: https://acompiler.com/git-head/ -[3]: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms diff --git a/translated/tech/20210407 What is Git cherry-picking.md b/translated/tech/20210407 What is Git cherry-picking.md new file mode 100644 index 0000000000..91ead9d3c8 --- /dev/null +++ b/translated/tech/20210407 What is Git cherry-picking.md @@ -0,0 +1,200 @@ +[#]: subject: (What is Git cherry-picking?) +[#]: via: (https://opensource.com/article/21/4/cherry-picking-git) +[#]: author: (Rajeev Bera https://opensource.com/users/acompiler) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +什么是 Git cherry-pick? +====== +了解 git cherry-pick 命令是什么,为什么用以及如何使用。 +![Measuring and baking a cherry pie recipe][1] + +当你和一群程序员一起工作时,无论项目大小,处理多个 Git 分支之间的变化都会变得很困难。有时,你不想将整个 Git 分支合并到另一个分支,而是想选择并移动几个特定的提交。这个过程被称为 ”cherry-pick“。 + +本文将介绍 cherry-pick 是什么、为何使用以及如何使用。 + +那么让我们开始吧。 + +### 什么是 cherry-pick? + +使用 `cherry-pick` 命令,Git 可以让你将任何分支中的个别提交合并到你当前的 [Git HEAD][2] 分支中。 + +当执行 `git merge` 或者 `git rebase` 时,一个分支的所有提交都会被合并。`cherry-pick` 命令允许你选择单个提交进行整合。 + +### cherry-pick 的好处 + +下面的情况可能会让你更容易理解 cherry-pick 的功能。 + +想象一下,你正在为即将到来的每周冲刺实现新功能。当你的代码准备好了,你会把它推送到远程分支,准备进行测试。 + +然而,客户并不对所有修改满意,要求你只呈现某些修改。因为客户还没有批准下次发布的所有修改,所以 `git rebase` 不会有预期的结果。为什么会这样?因为 `git rebase` 或者 `git merge` 会把上一个冲刺的每一个调整都纳入其中。 + +cherry-pick 是答案!因为它只关注在提交中添加的变化,所以 cherry-pick 只会带入批准的变化,而不添加其他提交。 + +还有其他几个原因可以使用 cherry-pick: + + * 这对于 bug 修复是必不可少的,因为 bug 是在开发分支中使用他们的提交产生的。 + * 你可以通过使用 `git cherry-pick` 来避免不必要的工作,而不用使用其他选项例如 `git diff` 来应用特定更改。 + * 如果因为不同 Git 分支的版本不兼容而无法将整个分支联合起来,那么它是一个很有用的工具。 + + + +### 使用 cherry-pick 命令 + +在 `cherry-pick` 命令的最简单形式中,你只需使用 [SHA][3] 标识符来表示你想整合到当前 HEAD 分支的提交。 + +要获得提交的哈希值,可以使用 `git log` 命令: + + +``` +`$ git log --oneline` +``` + +当你知道了提交的哈希值后,你就可以使用 `cherry-pick` 命令。 + +语法是: + + +``` +`$ git cherry-pick ` +``` + +例如: + + +``` +`$ git cherry-pick 65be1e5` +``` + +这将会把指定的修改合并到当前已签出的分支上。 + +如果你想做进一步的修改,也可以让 Git 在你的工作副本中添加提交修改。 + +语法是: + + +``` +`$ git cherry-pick --no-commit` +``` + +例如: + + +``` +`$ git cherry-pick 65be1e5 --no-commit` +``` + +如果你想同时选择多个提交,请将它们的提交哈希值用空格隔开: + + +``` +`$ git cherry-pick hash1 hash3` +``` + +当 cherry-pick 提交时,你不能使用 `git pull` 命令,因为它能获取一个仓库的提交_并_自动合并到另一个仓库。`cherry-pick` 并不是一个专门这么做的工具。相反,你可以使用 `git fetch`,它可以获取提交,但不应用它们。毫无疑问,`git pull` 很方便,但它不精确。 + +### 自己尝试 + +要尝试这个过程,启动终端并生成一个示例项目: + + +``` +$ mkdir fruit.git +$ cd fruit.git +$ git init . +``` + +创建一些数据并提交: + + +``` +$ echo "Kiwifruit" > fruit.txt +$ git add fruit.txt +$ git commit -m 'First commit' +``` + +现在,通过创建一个项目的分叉来代表一个远程开发者: + + +``` +$ mkdir ~/fruit.fork +$ cd !$ +$ echo "Strawberry" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a fruit" +``` + +这是一个有效的提交。现在,创建一个不好的提交,代表你不想合并到你的项目中的东西: + + +``` +$ echo "Rhubarb" >> fruit.txt +$ git add fruit.txt +$ git commit -m 'Added a vegetable that tastes like a fruit" +``` + +返回你的仓库,从你的假想的开发者那里获取提交的内容: + + +``` +$ cd ~/fruit.git +$ git remote add dev ~/fruit.fork +$ git fetch dev +remote: Counting objects: 6, done. +remote: Compressing objects: 100% (2/2), done. +remote: Total 6 (delta 0), reused 0 (delta 0) +Unpacking objects: 100% (6/6), done... + +[/code] [code] + +$ git log –oneline dev/master +e858ab2 Added a vegetable that tastes like a fruit +0664292 Added a fruit +b56e0f8 First commit +``` + +你已经从你想象中的开发者那里获取了提交的内容,但你还没有将它们合并到你的版本库中。你想接受第二个提交,但不想接受第三个提交,所以使用 `cherry-pick`。 + + +``` +`$ git cherry-pick 0664292` +``` + +第二次提交现在在你的仓库里了: + + +``` +$ cat fruit.txt +Kiwifruit +Strawberry +``` + +将你的更改推送到远程服务器上,这就完成了! + +### 避免使用 cherry-pick 的原因 + +在开发者社区中,通常不鼓励 cherry-pick。主要原因是它会造成重复提交,但你也失去了跟踪提交历史的能力。 + +如果你不按顺序地 cherry-pick 了大量的提交,这些提交会被记录在你的分支中,这可能会在 Git 分支中导致不理想的结果。 + +cherry-pick 是一个强大的命令,如果没有正确理解可能发生的情况,它可能会导致问题。不过,当你搞砸了,提交到错误的分支时,它可能会救你一命(至少是你当天的工作)。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cherry-picking-git + +作者:[Rajeev Bera][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/acompiler +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://acompiler.com/git-head/ +[3]: https://en.wikipedia.org/wiki/Secure_Hash_Algorithms From 041e3cb6a346424221944962ddefc70d0dfa25c6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 13 Apr 2021 08:46:39 +0800 Subject: [PATCH 102/307] translating --- ...210407 Why I love using bspwm for my Linux window manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md index c3285f24f2..1e1a8f7ee1 100644 --- a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/bspwm-linux) [#]: author: (Stephen Adams https://opensource.com/users/stevehnh) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 32b62d83004d186492cee92870879df2df8dded7 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 13 Apr 2021 14:40:02 +0800 Subject: [PATCH 103/307] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20210405 7 Git tips for managing your home directory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/sources/tech/20210405 7 Git tips for managing your home directory.md index 1239482260..3d6beeb574 100644 --- a/sources/tech/20210405 7 Git tips for managing your home directory.md +++ b/sources/tech/20210405 7 Git tips for managing your home directory.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/git-home) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -122,7 +122,7 @@ via: https://opensource.com/article/21/4/git-home 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9f21e3ceb4f6bc053e4e840fa805a2a41ce64ee1 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Tue, 13 Apr 2021 16:58:02 +0800 Subject: [PATCH 104/307] translated by DCOLIVERSUN 4 ways open source gives you a competitive edge is translated by DCOLIVERSUN --- ...pen source gives you a competitive edge.md | 83 ------------------- ...pen source gives you a competitive edge.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210409 4 ways open source gives you a competitive edge.md create mode 100644 translated/tech/20210409 4 ways open source gives you a competitive edge.md diff --git a/sources/tech/20210409 4 ways open source gives you a competitive edge.md b/sources/tech/20210409 4 ways open source gives you a competitive edge.md deleted file mode 100644 index a8782c3749..0000000000 --- a/sources/tech/20210409 4 ways open source gives you a competitive edge.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: subject: (4 ways open source gives you a competitive edge) -[#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) -[#]: author: (Jason Blais https://opensource.com/users/jasonblais) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4 ways open source gives you a competitive edge -====== -Using open source technology can help organizations drive better -business outcomes. -![Open ethernet cords.][1] - -Building a tech stack is a major decision for every organization. While picking the right tools will set your team up for success, picking the wrong solutions or platforms can have devastating effects on productivity and profitability. To succeed in today's fast-paced world, organizations must make smart investments in digital solutions that enable them to move faster and increase operational agility. - -This is precisely why more and more organizations of all sizes and across all industries are embracing open source solutions. According to a recent [McKinsey][2] report, open source adoption is the biggest differentiator for top-performing organizations. - -Here are four reasons why adopting open source technology can help organizations drive competitive advantage and experience better business outcomes. - -### 1\. Extensibility and flexibility - -Suffice it to say the world of technology moves quickly. For example, Kubernetes didn't exist before 2014, but today, it's impressively ubiquitous. According to the CNCF's [2020 Cloud Native Survey][3], 91% of teams are using Kubernetes in some form. - -One of the main reasons organizations are investing in open source is because it enables them to operate with agility and rapidly integrate new technologies into their stack. That's compared to the more traditional approach, where teams would take quarters or even years to vet, implement, and adopt software—making it impossible for them to pivot with any sense of urgency. - -Since open source solutions offer complete access to source code, teams can easily connect the software to the other tools they use every day. - -Simply put, open source enables development teams to build the perfect tool for what is at hand instead of being forced to change how they work to fit into how inflexible proprietary tools are designed. - -### 2\. Security and high-trust collaboration - -In the age of high-profile data breaches, organizations need highly secure tools that enable them to keep sensitive data secure. - -When vulnerabilities exist in proprietary solutions, they're often undiscovered until it's too late. Unfortunately for the teams using these platforms, the lack of visibility into source code means they're essentially outsourcing security to the specific vendor and hoping for the best. - -Another main driver of open source adoption is that open source tools enable organizations to take control over their own security. For example, open source projects—particularly those with large communities—tend to receive more responsible vulnerability disclosures because everyone using the product can thoroughly inspect the source code. - -Since the source code is freely available, such disclosures often come with detailed proposed solutions for fixing bugs. This enables dev teams to remedy issues faster, continuously strengthening the software. - -In the age of remote work, it's more important than ever for distributed teams to collaborate while knowing that sensitive data stays protected. Since open source solutions allow organizations to audit security while maintaining complete control over their data, they can facilitate the high-trust collaboration needed to thrive in remote environments. - -### 3\. Freedom from vendor lock-in - -According to a [recent study][4], 68% of CIOs are concerned about vendor lock-in. They should be. When you're locked into a piece of technology, you're forced to live with someone else's conclusions instead of making your own. - -Proprietary solutions often make it [challenging to take data with you][5] when an organization switches vendors. On the other hand, open source tools offer the freedom and flexibility needed to avoid vendor lock-in and take data wherever an organization wants to go. - -### 4\. Top talent and community - -As more and more companies [embrace remote work][6], the war for talent is becoming even more competitive. - -In the world of software development, landing top talent starts with giving engineers access to modern tools that enable them to reach their full potential at work. Since developers increasingly [prefer open source solutions][7] to proprietary counterparts, organizations should strongly consider open source alternatives to their commercial solutions to attract the best developers on the market. - -In addition to making it easier to hire and retain top talent, open source platforms also enable companies to tap into a community of contributors for advice on how to walk through problems and get the most out of the platform. Plus, members of the community also [contribute to open source projects directly][8]. - -### Open source offers freedom - -Open source software is increasingly popular among enterprise teams—[for good reason][9]. It gives teams the flexibility needed to build the perfect tool for the job while enabling them to maintain a highly secure environment. At the same time, an open source approach allows teams to maintain control of their future, rather than being locked into one vendor's roadmap. And it also gives companies access to talented engineers and members of the open source community. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/open-source-competitive-advantage - -作者:[Jason Blais][a] -选题:[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/jasonblais -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) -[2]: https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/developer-velocity-how-software-excellence-fuels-business-performance# -[3]: https://www.cncf.io/blog/2020/11/17/cloud-native-survey-2020-containers-in-production-jump-300-from-our-first-survey/ -[4]: https://solutionsreview.com/cloud-platforms/flexera-68-percent-of-cios-worry-about-vendor-lock-in-with-public-cloud/ -[5]: https://www.computerworld.com/article/3428679/mattermost-makes-case-for-open-source-as-team-messaging-market-booms.html -[6]: https://mattermost.com/blog/tips-for-working-remotely/ -[7]: https://opensource.com/article/20/6/open-source-developers-survey -[8]: https://mattermost.com/blog/100-most-popular-mattermost-features-invented-and-contributed-by-our-amazing-open-source-community/ -[9]: https://mattermost.com/open-source-advantage/ diff --git a/translated/tech/20210409 4 ways open source gives you a competitive edge.md b/translated/tech/20210409 4 ways open source gives you a competitive edge.md new file mode 100644 index 0000000000..6c16fd31d6 --- /dev/null +++ b/translated/tech/20210409 4 ways open source gives you a competitive edge.md @@ -0,0 +1,83 @@ +[#]: subject: (4 ways open source gives you a competitive edge) +[#]: via: (https://opensource.com/article/21/4/open-source-competitive-advantage) +[#]: author: (Jason Blais https://opensource.com/users/jasonblais) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 ways open source gives you a competitive edge +开源为你带来竞争优势的 4 条理由 +====== +使用开源技术可以帮助组织获得更好的业务结果。 +![开放式以太网线缆][1] + +构建技术栈是每个组织的主要决策。选择合适的工具将让团队获得成功,选择错误的解决方案或平台会对生产率和利润率产生毁灭性影响。为了在当今快节奏的世界中脱颖而出,组织必须明智地选择数字解决方案,好的数字解决方案可以提升团队行动力与运营敏捷性。 + +这就是为什么越来越多的组织都采用开源解决方案的原因,这些组织来自各行各业,规模有大有小。根据[麦肯锡][2]最近的报告,高绩效组织的最大区别是采用不同的开源方案。 + +采用开源技术可以帮助组织提高竞争优势、获得更好业务成果的原因有以下四点。 + +### 1\. 可拓展性和灵活性 + +可以说,技术世界发展很快。例如,在2014年之前,Kubernetes 并不存在,但今天,它却令人印象深刻,无处不在。根据 CNCF [2020 云原生调查][3],91% 的团队正在以某种形式使用 Kubernetes。 + +组织投资开源的一个主要原因是因为开源赋予组织行动敏捷性,组织迅速将新技术集成到技术栈中。这与传统方法不同,在传统方法中,团队需要几个季度甚至几年来审查、实施、采用软件,这导致团队不可能实现火速转变。 + +开源解决方案完整地提供源代码,团队可以轻松将软件与他们每天使用的工具连接起来。 + +简而言之,开源让开发团队能够为手头的东西构建完美的工具,而不是被迫改变工作方式来适应不灵活的专有工具。 + +### 2\. 安全性和高可信的协作 + +在数据泄露备受瞩目的时代,组织需要高度安全的工具来保护敏感数据的安全。 + +专有解决方案中的漏洞不易被发现,被发现时为时已晚。不幸的是,使用这些平台的团队无法看到源代码,本质上他们将安全性外包给特定供应商,希望得到最好的结果。 + +采用开源的另一个主要原因是开源工具使组织能够自己把控安全。例如,开源项目——尤其是大型开源社区的项目——往往会收到更负责任的漏洞披露,因为每个人在使用过程中都可以彻底检查源代码。 + +由于源代码是免费提供的,因此披露通常伴随着修复缺陷的详细建议解决方案。这些方案使得开发团队能够快速解决问题,不断增强软件。 + +在远程办公时代,协作的分布式团队知道敏感数据受到保护比以往任何时候都更重要。开源解决方案允许组织审核安全性、完成掌控自己数据,因此开源方案可以促进远程环境下高可信协作方式的成长。 + +### 3\. 不受供应商限制 + +根据[最近的一项研究][4],68% 的 CIO 担心受供应商限制。当你受限于一项技术中,你会被迫接受别人的结论,而不是自己做结论。 + +当组织更换供应商时,专有解决方案通常会[给你带来数据使用挑战][5]。另一方面,开源工具提供了组织需要的自由度和灵活性,以避免受供应商限制,开源工具可以让组织把数据带去任意地方。 + +### 4\. 顶尖人才和社区 + +随着越来越多的公司[接受远程办公][6],人才争夺战变得愈发激烈。 + +在软件开发领域,获得顶尖人才始于赋予工程师先进工具,让工程师在工作中充分发挥潜力。开发人员[越来越喜欢开源解决方案][7]而不是专有解决方案,组织应该强烈考虑用开源替代商业解决方案,以吸引市场上最好的开发人员。 + +除了雇佣、留住顶尖人才更容易,公司能够通过开源平台利用贡献者社区,得到解决问题的建议,从平台中得到最大收益。此外,社区成员还[直接贡献开源项目][8]。 + +### 开源带来自由 + +开源软件在企业团队中越来越受到欢迎——[这是有原因的][8]。它帮助团队灵活地构建完美的工作工具,同时使团队可以维护高度安全的环境。同时,开源允许团队掌控未来方向,而不是局限于供应商的路线图。开源还帮助公司接触才华横溢的工程师和开源社区成员。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-competitive-advantage + +作者:[Jason Blais][a] +选题:[lujun9972][b] +译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jasonblais +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) +[2]: https://www.mckinsey.com/industries/technology-media-and-telecommunications/our-insights/developer-velocity-how-software-excellence-fuels-business-performance# +[3]: https://www.cncf.io/blog/2020/11/17/cloud-native-survey-2020-containers-in-production-jump-300-from-our-first-survey/ +[4]: https://solutionsreview.com/cloud-platforms/flexera-68-percent-of-cios-worry-about-vendor-lock-in-with-public-cloud/ +[5]: https://www.computerworld.com/article/3428679/mattermost-makes-case-for-open-source-as-team-messaging-market-booms.html +[6]: https://mattermost.com/blog/tips-for-working-remotely/ +[7]: https://opensource.com/article/20/6/open-source-developers-survey +[8]: https://mattermost.com/blog/100-most-popular-mattermost-features-invented-and-contributed-by-our-amazing-open-source-community/ +[9]: https://mattermost.com/open-source-advantage/ From fbd019e0f9bdb0d3f366bf68a8ef87217baff0a7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 13 Apr 2021 22:13:40 +0800 Subject: [PATCH 105/307] APL --- .../20210331 3 reasons I use the Git cherry-pick command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md index 0ce31f8798..dcf32b229b 100644 --- a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/git-cherry-pick) [#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 90c9dd350a3350c7d6778830d031d95708f3c693 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 13 Apr 2021 22:25:57 +0800 Subject: [PATCH 106/307] Translating: 5 signs you're a groff programmer --- sources/tech/20210410 5 signs you-re a groff programmer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210410 5 signs you-re a groff programmer.md b/sources/tech/20210410 5 signs you-re a groff programmer.md index 6708800e7e..9cb584d1bc 100644 --- a/sources/tech/20210410 5 signs you-re a groff programmer.md +++ b/sources/tech/20210410 5 signs you-re a groff programmer.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/groff-programmer) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (liweitianux) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 72a5bfb63dcc8c044fccadec6be60bb78844fd17 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 13 Apr 2021 22:59:32 +0800 Subject: [PATCH 107/307] TSL --- ...asons I use the Git cherry-pick command.md | 198 ------------------ ...asons I use the Git cherry-pick command.md | 181 ++++++++++++++++ 2 files changed, 181 insertions(+), 198 deletions(-) delete mode 100644 sources/tech/20210331 3 reasons I use the Git cherry-pick command.md create mode 100644 translated/tech/20210331 3 reasons I use the Git cherry-pick command.md diff --git a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md b/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md deleted file mode 100644 index dcf32b229b..0000000000 --- a/sources/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ /dev/null @@ -1,198 +0,0 @@ -[#]: subject: (3 reasons I use the Git cherry-pick command) -[#]: via: (https://opensource.com/article/21/3/git-cherry-pick) -[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -3 reasons I use the Git cherry-pick command -====== -Cherry-picking solves a lot of problems in Git repositories. Here are -three ways to fix your mistakes with git cherry-pick. -![Measuring and baking a cherry pie recipe][1] - -Finding your way around a version control system can be tricky. It can be massively overwhelming for a newbie, but being well-versed with the terminology and the basics of a version control system like Git is one of the baby steps to start contributing to open source. - -Being familiar with Git can also help you out of sticky situations in your open source journey. Git is powerful and makes you feel in control—there is not a single way in which you cannot revert to a working version. - -Here is an example to help you understand the importance of cherry-picking. Suppose you have made several commits in a branch, but you realize it's the wrong branch! What do you do now? Either you repeat all your changes in the correct branch and make a fresh commit, or you merge the branch into the correct branch. Wait, the former is too tedious, and you may not want to do the latter. So, is there a way? Yes, Git's got you covered. Here is where cherry-picking comes into play. As the term suggests, you can use it to hand-pick a commit from one branch and transfer it into another branch. - -There are various reasons to use cherry-picking. Here are three of them. - -### Avoid redundancy of efforts - -There's no need to redo the same changes in a different branch when you can just copy the same commits to the other branch. Please note that cherry-picking commits will create a fresh commit with a new hash in the other branch, so please don't be confused if you see a different commit hash. - -In case you are wondering what a commit hash is and how it is generated, here is a note to help you: A commit hash is a string generated using the [SHA-1][2] algorithm. The SHA-1 algorithm takes an input and outputs a unique 40-character hash. If you are on a [POSIX][3] system, try running this in your terminal: - - -``` -`$ echo -n "commit" | openssl sha1` -``` - -This outputs a unique 40-character hash, `4015b57a143aec5156fd1444a017a32137a3fd0f`. This hash represents the string `commit`. - -A SHA-1 hash generated by Git when you make a commit represents much more than just a single string. It represents: - - -``` -sha1( -    meta data -        commit message -        committer -        commit date -        author -        authoring date -    Hash of the entire tree object -) -``` - -This explains why you get a unique commit hash for the slightest change you make to your code. Not even a single change goes unnoticed. This is because Git has integrity. - -### Undoing/restoring lost changes - -Cherry-picking can be handy when you want to restore to a working version. When multiple developers are working on the same codebase, it is very likely for changes to get lost and the latest version to move to a stale or non-working version. That's where cherry-picking commits to the working version can be a savior. - -#### How does it work? - -Suppose there are two branches, `feature1` and `feature2`, and you want to apply commits from `feature1` to `feature2`. - -On the `feature1` branch, run a `git log` command, and copy the commit hash that you want to cherry-pick. You can see a series of commits resembling the code sample below. The alphanumeric code following "commit" is the commit hash that you need to copy. You may choose to copy the first six characters (`966cf3` in this example) for the sake of convenience: - - -``` -commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) -Author: manaswinidas <[me@example.com][4]> -Date:   Mon Mar 8 09:20:21 2021 +1300 - -   add instructions -``` - -Then switch to `feature2` and run `git cherry-pick` on the hash you just got from the log: - - -``` -$ git checkout feature2 -$ git cherry-pick 966cf3. -``` - -If the branch doesn't exist, use `git checkout -b feature2` to create it. - -Here's a catch: You may encounter the situation below: - - -``` -$ git cherry-pick 966cf3 -On branch feature2 -You are currently cherry-picking commit 966cf3d. - -nothing to commit, working tree clean -The previous cherry-pick is now empty, possibly due to conflict resolution. -If you wish to commit it anyway, use: - -   git commit --allow-empty - -Otherwise, please use 'git reset' -``` - -Do not panic. Just run `git commit --allow-empty` as suggested: - - -``` -$ git commit --allow-empty -[feature2 afb6fcb] add instructions -Date: Mon Mar 8 09:20:21 2021 +1300 -``` - -This opens your default editor and allows you to edit the commit message. It's acceptable to save the existing message if you have nothing to add. - -There you go; you did your first cherry-pick. As discussed above, if you run a `git log` on branch `feature2`, you will see a different commit hash. Here is an example: - - -``` -commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) -Author: manaswinidas <[me@example.com][4]> -Date:   Mon Mar 8 09:20:21 2021 +1300 -   add instructions -``` - -Don't be confused about the different commit hash. That just distinguishes between the commits in `feature1` and `feature2`. - -### Cherry-pick multiple commits - -But what if you want to cherry-pick multiple commits? You can use: - - -``` -`git cherry-pick ... ` -``` - -Please note that you don't have to use the entire commit hash; you can use the first five or six characters. - -Again, this is tedious. What if the commits you want to cherry-pick are a range of continuous commits? This approach is too much work. Don't worry; there's an easier way. - -Assume that you have two branches: - - * `feature1` includes commits you want to copy (from `commitA` (older) to `commitB`). - * `feature2` is the branch you want the commits to be transferred to from `feature1`. - - - -Then: - - 1. Enter `git checkout `. - 2. Get the hashes of `commitA` and `commitB`. - 3. Enter `git checkout `. - 4. Enter `git cherry-pick ^..` (please note that this includes `commitA` and `commitB`). - 5. Should you encounter a merge conflict, [solve it as usual][5] and then type `git cherry-pick --continue` to resume the cherry-pick process. - - - -### Important cherry-pick options - -Here are some useful options from the [Git documentation][6] that you can use with the `cherry-pick` command: - - * `-e`, `--edit`: With this option, `git cherry-pick` lets you edit the commit message prior to committing. - * `-s`, `--signoff`: Add a "Signed-off-by" line at the end of the commit message. See the signoff option in git-commit(1) for more information. - * `-S[]`, `--gpg-sign[=]`: These are GPG-sign commits. The `keyid` argument is optional and defaults to the committer identity; if specified, it must be stuck to the option without a space. - * `--ff`: If the current HEAD is the same as the parent of the cherry-picked commit, then a fast-forward to this commit will be performed. - - - -Here are some other sequencer subcommands (apart from continue): - - * `--quit`: You can forget about the current operation in progress. This can be used to clear the sequencer state after a failed cherry-pick or revert. - * `--abort`: Cancel the operation and return to the presequence state. - - - -Here are some examples of cherry-picking: - - * `git cherry-pick master`: Applies the change introduced by the commit at the tip of the master branch and creates a new commit with this change - * `git cherry-pick master~4 master~2`: Applies the changes introduced by the fifth and third-last commits pointed to by master and creates two new commits with these changes - - - -Feeling overwhelmed? You needn't remember all the commands. You can always type `git cherry-pick --help` in your terminal to look at more options or help. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/git-cherry-pick - -作者:[Manaswini Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/manaswinidas -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) -[2]: https://en.wikipedia.org/wiki/SHA-1 -[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[4]: mailto:me@example.com -[5]: https://opensource.com/article/20/4/git-merge-conflict -[6]: https://git-scm.com/docs/git-cherry-pick diff --git a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md new file mode 100644 index 0000000000..01c228978c --- /dev/null +++ b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -0,0 +1,181 @@ +[#]: subject: (3 reasons I use the Git cherry-pick command) +[#]: via: (https://opensource.com/article/21/3/git-cherry-pick) +[#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我使用 Git cherry-pick 命令的 3 个理由 +====== + +> “挑选”可以解决 Git 仓库中的很多问题。以下是用 `git cherry-pick` 修复错误的三种方法。 + +![测量和烘烤樱桃派配方][1] + +在版本控制系统中摸索前进是一件很棘手的事情。对于一个新手来说,这可能是非常难以应付的,但熟悉版本控制系统(如 Git)的术语和基础知识是开始为开源贡献的第一步。 + +熟悉 Git 也能帮助你在开源之路上走出困境。Git 功能强大,让你感觉自己在掌控之中 —— 没有哪一种方法会让你无法恢复到工作版本。 + +这里有一个例子可以帮助你理解“挑选”的重要性。假设你已经在一个分支上做了好几个提交,但你意识到这是个错误的分支!你现在该怎么办?你现在要做什么?要么在正确的分支上重复所有的修改,然后重新提交,要么把这个分支合并到正确的分支上。等等,前者太过繁琐,而你可能不想做后者。那么,有没有办法呢?是的,Git 已经为你准备好了。这就是挑选的作用。顾名思义,你可以用它从一个分支中手工挑选一个提交,然后转移到另一个分支。 + +使用挑选的原因有很多。以下是其中的三个原因。 + +### 避免重复性工作 + +如果你可以直接将相同的提交复制到另一个分支,就没有必要在不同的分支中重做相同的修改。请注意,挑选出来的提交会在另一个分支中创建带有新哈希的新提交,所以如果你看到不同的提交哈希,请不要感到困惑。 + +如果您想知道什么是提交的哈希,以及它是如何生成的,这里有一个说明可以帮助你。提交哈希是用 [SHA-1][2] 算法生成的字符串。SHA-1 算法接收一个输入,然后输出一个唯一的 40 个字符的哈希值。如果你使用的是 [POSIX][3] 系统,请尝试在您的终端上运行这个程序: + +``` +$ echo -n "commit" | openssl sha1 +``` + +这将输出一个唯一的 40 个字符的哈希值 `4015b57a143aec5156fd1444a017a32137a3fd0f`。这个哈希表示字符串 `commit`。 + +Git 在提交时生成的 SHA-1 哈希值不仅仅代表一个字符串。它代表的是: + +``` +sha1( +    meta data +        commit message +        committer +        commit date +        author +        authoring date +    Hash of the entire tree object +) +``` + +这就解释了为什么你对代码所做的任何细微改动都会得到一个独特的提交哈希值。哪怕是一个微小的改动都会被发现。这是因为Git具有完整性。 + +### 撤销/恢复丢失的更改 + +当你想恢复到工作版本时,挑选就很方便。当多个开发人员在同一个代码库上工作时,很可能会丢失更改,最新的版本会被转移到一个陈旧的或非工作版本上。这时,挑选提交到工作版本就可以成为救星。 + +#### 它是如何工作的? + +假设有两个分支,`feature1` 和 `feature2`,你想把 `feature1` 中的提交应用到 `feature2`。 + +在 `feature1` 分支上,运行 `git log` 命令,复制你想挑选的提交哈希值。你可以看到一系列类似于下面代码示例的提交。`commit` 后面的字母数字代码就是你需要复制的提交哈希。为了方便起见,您可以选择复制前六个字符(本例中为 `966cf3`)。 + +``` +commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) +Author: manaswinidas <[me@example.com][4]> +Date:   Mon Mar 8 09:20:21 2021 +1300 + +   add instructions +``` + +然后切换到 `feature2` 分支,在刚刚从日志中得到的哈希值上运行 `git cherry-pick`: + +``` +$ git checkout feature2 +$ git cherry-pick 966cf3. +``` + +如果该分支不存在,使用 `git checkout -b feature2` 来创建它。 + +这里有一个问题。你可能会遇到下面这种情况: + +``` +$ git cherry-pick 966cf3 +On branch feature2 +You are currently cherry-picking commit 966cf3d. + +nothing to commit, working tree clean +The previous cherry-pick is now empty, possibly due to conflict resolution. +If you wish to commit it anyway, use: + +   git commit --allow-empty + +Otherwise, please use 'git reset' +``` + +不要惊慌。只要按照建议运行 `git commit --allow-empty`: + +``` +$ git commit --allow-empty +[feature2 afb6fcb] add instructions +Date: Mon Mar 8 09:20:21 2021 +1300 +``` + +这将打开你的默认编辑器,允许你编辑提交信息。如果你没有什么要补充的,可以保存现有的信息。 + +就这样,你完成了你的第一次挑选。如上所述,如果你在分支 `feature2` 上运行 `git log`,你会看到一个不同的提交哈希。下面是一个例子: + +``` +commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) +Author: manaswinidas <[me@example.com][4]> +Date:   Mon Mar 8 09:20:21 2021 +1300 +   add instructions +``` + +不要对不同的提交哈希感到困惑。这只是区分 `feature1` 和 `feature2` 的提交。 + +### 挑选多个提交 + +但如果你想挑选多个提交的内容呢?你可以使用: + +``` +git cherry-pick ... +``` + +请注意,你不必使用整个提交的哈希值,你可以使用前五到六个字符。 + +同样,这也是很繁琐的。如果你想挑选的提交是一系列的连续提交呢?这种方法太费劲了。别担心,有一个更简单的方法。 + +假设你有两个分支: + + * `feature1` 包括你想复制的提交(从更早的 `commitA` 到 `commitB`)。 + * `feature2` 是你想把提交从 `feature1` 转移到的分支。 + +然后: + + 1. 输入 `git checkout `。 + 2. 获取 `commitA` 和 `commitB` 的哈希值。 + 3. 输入 `git checkout `。 + 4. 输入 `git cherry-pick ^..` (请注意,这包括 `commitA` 和 `commitB`)。 + 5. 如果遇到合并冲突,[像往常一样解决][5],然后输入 `git cherry-pick --continue` 恢复挑选过程。 + +### 重要的挑选选项 + +以下是 [Git 文档][6] 中的一些有用的选项,你可以在 `cherry-pick` 命令中使用。 + + * `-e`、`--edit`:用这个选项,`git cherry-pick` 可以让你在提交前编辑提交信息。 + * `-s`、`--signoff`:在提交信息的结尾添加 `Signed-off by` 行。更多信息请参见 `git-commit(1)` 中的 signoff 选项。 + * `-S[]`、`--pgg-sign[=]`:这些是 GPG 签名的提交。`keyid` 参数是可选的,默认为提交者身份;如果指定了,则必须卡在选项中,不加空格。 + * `--ff`:如果当前 HEAD 与挑选的提交的父级提交相同,则会对该提交进行快进操作。 + +下面是除了 `--continue` 外的一些其他的后继操作子命令: + + * `--quit`:你可以忘记当前正在进行的操作。这可以用来清除挑选或撤销失败后的后继操作状态。 + * `--abort`:取消操作并返回到操作序列前状态。 + +下面是一些关于挑选的例子: + + * `git cherry-pick master`:应用 `master` 分支顶端的提交所引入的变更,并创建一个包含该变更的新提交。 + * `git cherry-pick master~4 master~2':应用 `master` 指向的第五个和第三个最新提交所带来的变化,并根据这些变化创建两个新的提交。 + +感到不知所措?你不需要记住所有的命令。你可以随时在你的终端输入 `git cherry-pick --help` 查看更多选项或帮助。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/git-cherry-pick + +作者:[Manaswini Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/manaswinidas +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/pictures/cherry-picking-recipe-baking-cooking.jpg?itok=XVwse6hw (Measuring and baking a cherry pie recipe) +[2]: https://en.wikipedia.org/wiki/SHA-1 +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: mailto:me@example.com +[5]: https://opensource.com/article/20/4/git-merge-conflict +[6]: https://git-scm.com/docs/git-cherry-pick From a1e27363eeb1c1779adb6d95486bc7cbcc67c747 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Apr 2021 05:03:23 +0800 Subject: [PATCH 108/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413=20?= =?UTF-8?q?Create=20an=20encrypted=20file=20vault=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 Create an encrypted file vault on Linux.md --- ...Create an encrypted file vault on Linux.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210413 Create an encrypted file vault on Linux.md diff --git a/sources/tech/20210413 Create an encrypted file vault on Linux.md b/sources/tech/20210413 Create an encrypted file vault on Linux.md new file mode 100644 index 0000000000..6c3dbd7bdf --- /dev/null +++ b/sources/tech/20210413 Create an encrypted file vault on Linux.md @@ -0,0 +1,119 @@ +[#]: subject: (Create an encrypted file vault on Linux) +[#]: via: (https://opensource.com/article/21/4/linux-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Create an encrypted file vault on Linux +====== +Use Linux Unified Key Setup to create an encrypted vault for sensitive +files on a physical drive or cloud storage. +![Secure safe][1] + +Recently, I demonstrated how to [implement full-drive encryption][2] on Linux with LUKS and the `cryptsetup` command. While encrypting a whole drive is useful in many cases, there are reasons you might not want to encode an entire drive. For instance, you might require a drive to work across several platforms, some of which may not have Linux Unified Key Setup ([LUKS][3]) integration. Furthermore, it's the 21st century, the cloud exists, and you may not be using a physical drive for all your data. + +Several years ago, there was a system called [TrueCrypt][4] that allowed users to create encrypted file "vaults," which could be decrypted by TrueCrypt to provide read/write access. It was a useful technique and essentially provided a virtual portable and fully encrypted drive where you could store important data. TrueCrypt closed down, but it serves as an interesting model. + +Fortunately, LUKS is a flexible system, and you can use it and `cryptsetup` to create an encrypted vault as a self-contained file, which you can save on a physical drive or in cloud storage. + +Here's how to do it. + +### 1\. Create an empty file + +First, you must create an empty file of a predetermined size. This serves as a kind of vault or safe in which you can store other files. The command you use for this is `fallocate`, from the `util-linux` package: + + +``` +`$ fallocate --length 512M vaultfile.img` +``` + +This example creates a 512MB file, but you can make yours any size you want. + +### 2\. Create a LUKS volume + +Next, create a LUKS volume within the empty file: + + +``` +$ cryptsetup --verify-passphrase \ +luksFormat vaultfile.img +``` + +### 3\. Open the LUKS volume + +So that you can create a filesystem ready for file storage, you must open the LUKS volume and mount it on your computer first: + + +``` +$ sudo cryptsetup open \ +\--type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +``` + +### 4\. Create a filesystem + +Make a filesystem in your open vault: + + +``` +`$ sudo mkfs.ext4 -L myvault /dev/mapper/myvault` +``` + +If you don't need it for anything right now, you can close it: + + +``` +`$ sudo cryptsetup close myvault` +``` + +### 5\. Start using your encrypted vault + +Now that it's all set up, you can use your encrypted file vault whenever you need to store or access private data. To access your vault, you must mount it as a usable filesystem: + + +``` +$ sudo cryptsetup open \ +\--type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +$ sudo mkdir /myvault +$ sudo mount /dev/mapper/myvault /myvault +``` + +This example opens the vault with `cryptsetup` and then mounts the vault from `/dev/mapper` to a new directory called `/myvault`. As with any volume on Linux, you can mount the LUKS volume anywhere you want, so instead of `/myvault`, you can use `/mnt` or `~/myvault` or whatever you prefer. + +While it's mounted, your LUKS volume is decrypted. You can read and write files to it just as if it were a physical drive. + +When you're finished using your encrypted vault, unmount and close it: + + +``` +$ sudo umount /myvault +$ sudo cryptsetup close myvault +``` + +### Encrypted file vaults + +An image file you encrypt with LUKS is as portable as any other file, so you can store your vault on your hard drive, an external drive, or even on the internet. As long as you have LUKS available, you can decrypt, mount, and use it to keep your data safe. It's easy encryption for improved data safety, so give it a try. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-encryption + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_bank_vault_secure_safe.png?itok=YoW93h7C (Secure safe) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md +[4]: https://en.wikipedia.org/wiki/TrueCrypt From 234d36d5107e39f83a350b4cfcb226e3e0f37b63 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Apr 2021 05:03:35 +0800 Subject: [PATCH 109/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413=20?= =?UTF-8?q?What's=20new=20with=20Drupal=20in=202021=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 What-s new with Drupal in 2021.md --- ...20210413 What-s new with Drupal in 2021.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20210413 What-s new with Drupal in 2021.md diff --git a/sources/tech/20210413 What-s new with Drupal in 2021.md b/sources/tech/20210413 What-s new with Drupal in 2021.md new file mode 100644 index 0000000000..c53b7d678b --- /dev/null +++ b/sources/tech/20210413 What-s new with Drupal in 2021.md @@ -0,0 +1,148 @@ +[#]: subject: (What's new with Drupal in 2021?) +[#]: via: (https://opensource.com/article/21/4/drupal-updates) +[#]: author: (Shefali Shetty https://opensource.com/users/shefalishetty) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What's new with Drupal in 2021? +====== +Its newest initiatives include decoupled menus, automated updates, and +other usability-focused updates. +![Computer screen with files or windows open][1] + +The success of open source projects is largely carried by the pillars of the community and group collaborations. Without putting a stake in the ground to achieve strategic initiatives, an open source project can lose focus. Open source strategic initiatives should aim at solving impactful problems through collaboration involving the project's stakeholders. + +### The why and how of Drupal's strategic initiatives + +As one of the leading open source projects, [Drupal][2]'s success largely thrives on implementing its various proposed strategic initiatives. Drupal's focus on strategic initiatives and continuous innovation since Drupal 7 brought huge architectural changes in Drupal 8, 9, and beyond that offer a platform for continuous innovation on the web and an easy upgrade path for end users. + +The vision for Drupal's core strategic initiatives is determined by Dries Buytaert, Drupal project lead. These initiatives are backed by community collaboration and lead to significant developments driven by forces like: + + * Collaboration with the core maintainers + * Survey data and usability studies + * A vision to build a leading open source digital experience platform + * Relevancy in the market by improving editorial, developer, and customer experiences + * Validation by broader community discussions and collaborations + + + +Once initiatives are **proposed**, they move ahead to the **planned** initiatives stage, where each initiative is nurtured with detailed plans and goals by a strong team of contributors. When an initiative passes through this stage, it moves to the **active** initiatives stage. Here's where the initiatives take structure and come alive. + +Some of the most successful Drupal 8 initiatives, like Twig and Bigpipe, did not follow the traditional process. However, following a thoughtfully planned process will avoid a lot of [bike-shedding][3]. + +### Popular past initiatives + +In 2011, at DrupalCon Chicago, Dries announced that Drupal 8 would feature core initiatives that would cause big changes to Drupal's architecture. To support the transition, each initiative would have a few leads involved in decision-making and coordination with Dries. Some popular initiatives included: + + * **Configuration Management Initiative (CMI):** This was the first key initiative announced at the 2011 DrupalCon. The idea was to offer site builders more powerful, flexible, and traceable configuration handling in Drupal 8 core. As planned, the Configuration Manager module is now a Drupal 8 core module that allows deploying configurations between different environments easily. + * **Web Services and Context Core Initiative:** This initiative aimed at embracing a modern web and turned Drupal into a first-class REST server with a first-class content management system (CMS) on top of it. The result? Drupal is now a competent REST server providing the ability to manage content entities through HTTP requests. This is part of why Drupal has been the leading CMS for decoupled experiences for several years. + * **Layout Initiative:** This initiative's focus was on improving and simplifying the site-building experience by non-technical users, like site builders and content authors. This initiative came alive in Drupal 8 by introducing the Layout Discovery API (a Layout plugin API) in v.8.4 and the Layout Builder module (a complete layout management solution) in v.8.5 core. + * **Media Initiative:** The Media Initiative was proposed to launch a rich, intuitive, easy-to-use, API-based media solution with extensible media functionalities in the core. This resulted in bringing in the Media API (which manages various operations on media entities) and Media Library (a rich digital asset management tool) to Drupal 8 core. + * **Drupal 9 Readiness Initiative:** The focus of this initiative was to get Drupal 9 ready by June 3, 2020, so that Drupal 7 and 8 users had at least 18 months to upgrade. Since Drupal 9 is just a cleaned-up version of the last version of Drupal 8 (8.9), the idea was to update dependencies and remove any deprecated code. And as planned, Drupal 9 was successfully released on June 3, 2020. Drupal 8-compatible modules were ported to Drupal 9 faster than any major version upgrade in Drupal's history, with more than 90% of the top 1,000 modules already ported (and many of the remaining now obsolete). + + + +### The new strategic initiatives + +Fast-forward to 2021, where everything is virtual. DrupalCon North America will witness a first-of-its-kind "Initiative Days" event added to the traditional DrupalCon content. Previously, initiatives were proposed during the [Driesnote][4] session, but this time, initiatives are more interactive and detailed. DrupalCon North America 2021 participants can learn about an initiative and participate in building components and contributing back to the project. + +#### The Decoupled Menus Initiative + +Dries proposed the Decoupled Menus Initiative in his keynote speech during DrupalCon Global 2020. While this initiative's broader intent is to make Drupal the best decoupled CMS, to accomplish the larger goal, the project chose to work on decoupled menus as a first step because menus are used on every project and are not easy to implement in decoupled architectures. + +The goals of this initiative are to build APIs, documentation, and examples that can: + + * Give JavaScript front-end developers the best way to integrate Drupal-managed menus into their front ends. + * Provide site builders and content editors with an easy-to-use experience to build and update menus independently. + + + +This is because, without web services for decoupled menus in Drupal core, JavaScript developers are often compelled to hard-code menu items. This makes it really hard for a non-developer to edit or remove a menu item without getting a developer involved. The developer needs to make the change, build the JavaScript code, and then deploy it to production. With the Decoupled Menus Initiative, the developer can easily eliminate all these steps and many lines of code by using Drupal's HTTP APIs and using JavaScript-focused resources. + +The bigger idea is to establish patterns and a roadmap that can be adapted to solve other decoupled problems. At DrupalCon 2021, on the [Decoupled Menus Initiative day][5], April 13, you can both learn about where it stands and get involved by building custom menu components and contributing them back to the project. + +#### The Easy Out-Of-The-Box Initiative + +During DrupalCon 2019 in Amsterdam, CMS users were asked about their perceptions of their CMS. The research found that beginners did not favor Drupal as much as intermediate- and expert-level users. However, it was the opposite for other CMS users; they seemed to like their CMS less over time. + +![CMS users' preferences][6] + +([Driesnote, DrupalCon Global 2020][7]) + +Hence, the Easy Out-Of-The-Box Initiative's goal is to make Drupal easy to use, especially for non-technical users and beginners. It is an extension of the great work that has been done for Layouts, Media, and Claro. Layout Builder's low-code design flexibility, Media's robust management of audio-visual content, and Claro's modern and accessible administrative UI combine to empower less-technical users with the power Drupal has under the hood. + +This initiative bundles all three of these features into one initiative and aims to provide a delightful user experience. The ease of use can help attract new and novice users to Drupal. On April 14, DrupalCon North America's [Easy Out-Of-The-Box Initiative day][8], the initiative leads will discuss the initiative and its current progress. Learn about how you can contribute to the project by building a better editorial experience. + +#### Automated Updates Initiative + +The results of a Drupal survey in 2020 revealed that automated updating was the most frequently requested feature. Updating a Drupal site manually can be tedious, expensive, and time-consuming. Luckily, the initiative team has been on this task since 2019, when the first prototype for the Automated Update System was developed as a [contributed module][9]. The focus of the initiative now is to bring this feature into Drupal core. As easy as it may sound, there's a lot more work that needs to go in to: + + * Ensure site readiness for a safe update + * Integrate composer + * Verify updates with package signing + * Safely apply updates in a way that can be rolled back in case of errors + + + +In its first incarnation, the focus is on Drupal Core patch releases and security updates, but the intent is to support the contributed module ecosystem as well. + +The initiative intends to make it easier for small to midsized businesses that sometimes overlook the importance of updating their Drupal site or struggle with the manual process. The [Automated Updates Initiative day][10] is happening on April 15 at DrupalCon North America. You will get an opportunity to know more about this initiative and get involved in the project. + +#### Drupal 10 Readiness Initiative + +With the release of Drupal 10 not too far away (as early as June 2022), the community is gearing up to welcome a more modern version of Drupal. Drupal now integrates more third-party technologies than ever. Dependencies such as Symfony, jQuery, Guzzle, Composer, CKEditor, and more have their own release cycles that Drupal needs to align with. + +![CMS Release Cycles][11] + +([Driesnote, DrupalCon 2020][7]) + +The goal of the initiative is to get Drupal 10 ready, and this involves: + + * Releasing Drupal 10 on time + * Getting compatible with the latest versions of the dependencies for security + * Deprecating the dependencies, libraries, modules, and themes that are no longer needed and removing them from Drupal 10 core. + + + +At the [Drupal 10 Readiness Initiative day][12], April 16, you can learn about the tools you'll use to update your websites and modules from Drupal 9 to Drupal 10 efficiently. There are various things you can do to help make Drupal better. Content authors will get an opportunity to peek into the new CKEditor 5, its new features, and improved editing experience. + +### Learn more at DrupalCon + +Drupal is celebrating its 20th year and its evolution to a more relevant, easier to adopt open source software. Leading an evolution is close to impossible without taking up strategic initiatives. Although the initial initiatives did not focus on offering great user experiences, today, ease of use and out-of-the-box experience are Drupal's most significant goals. + +Our ambition is to create software that works for everyone. At every DrupalCon, the intent is to connect with the community that fosters the same belief, learn from each other, and ultimately, build a better Drupal. + +[DrupalCon North America][13], hosted by the Drupal Association, is the largest Drupal event of the year. Drupal experts, enthusiasts, and users will unite online April 12–16, 2021, share lessons learned and best practices, and collaborate on creating better, more engaging digital experiences. PHP and JavaScript developers, designers, marketers, and anyone interested in a career in open source will be able to learn, connect, and build by attending DrupalCon. + +The [Drupal Association][14] is the nonprofit organization focused on accelerating Drupal, fostering the Drupal community's growth, and supporting the project's vision to create a safe, secure, and open web for everyone. DrupalCon is the primary source of funding for the Drupal Association. Your support and attendance at DrupalCon make our work possible. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/drupal-updates + +作者:[Shefali Shetty][a] +选题:[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/shefalishetty +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://www.drupal.org/ +[3]: https://en.wikipedia.org/wiki/Law_of_triviality +[4]: https://events.drupal.org/global2020/program/driesnote +[5]: https://events.drupal.org/northamerica2021/decoupled-menus-day +[6]: https://opensource.com/sites/default/files/uploads/cms_preferences.png (CMS users' preferences) +[7]: https://youtu.be/RIeRpLgI1mM +[8]: https://events.drupal.org/northamerica2021/easy-out-box-day +[9]: http://drupal.org/project/automatic_updates/ +[10]: https://events.drupal.org/northamerica2021/automatic-updates-day +[11]: https://opensource.com/sites/default/files/uploads/cms_releasecycles.png (CMS Release Cycles) +[12]: https://events.drupal.org/northamerica2021/drupal-10-readiness-day +[13]: https://events.drupal.org/northamerica2021?utm_source=replyio&utm_medium=email&utm_campaign=DCNA2021-20210318 +[14]: https://www.drupal.org/association From f4d1f6c0ee97e7ae61bed3f4b831d1b423e69604 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 14 Apr 2021 05:03:48 +0800 Subject: [PATCH 110/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210413=20?= =?UTF-8?q?Make=20Conway's=20Game=20of=20Life=20in=20WebAssembly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md --- ...ke Conway-s Game of Life in WebAssembly.md | 472 ++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md diff --git a/sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md b/sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md new file mode 100644 index 0000000000..83ba01325d --- /dev/null +++ b/sources/tech/20210413 Make Conway-s Game of Life in WebAssembly.md @@ -0,0 +1,472 @@ +[#]: subject: (Make Conway's Game of Life in WebAssembly) +[#]: via: (https://opensource.com/article/21/4/game-life-simulation-webassembly) +[#]: author: (Mohammed Saud https://opensource.com/users/saud) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make Conway's Game of Life in WebAssembly +====== +WebAssembly is a good option for computationally expensive tasks due to +its predefined execution environment and memory granularity. +![Woman sitting in front of her computer][1] + +Conway's [Game of Life][2] is a popular programming exercise to create a [cellular automaton][3], a system that consists of an infinite grid of cells. You don't play the game in the traditional sense; in fact, it is sometimes referred to as a game for zero players. + +Once you start the Game of Life, the game plays itself to multiply and sustain "life." In the game, digital cells representing lifeforms are allowed to change states as defined by a set of rules. When the rules are applied to cells through multiple iterations, they exhibit complex behavior and interesting patterns. + +The Game of Life simulation is a very good candidate for a WebAssembly implementation because of how computationally expensive it can be; every cell's state in the entire grid must be calculated for every iteration. WebAssembly excels at computationally expensive tasks due to its predefined execution environment and memory granularity, among many other features. + +### Compiling to WebAssembly + +Although it's possible to write WebAssembly by hand, it is very unintuitive and error-prone as complexity increases. Most importantly, it's not intended to be written that way. It would be the equivalent of manually writing [assembly language][4] instructions. + +Here's a simple WebAssembly function to add two numbers: + + +``` +(func $Add (param $0 i32) (param $1 i32) (result i32) +    local.get $0 +    local.get $1 +    i32.add +) +``` + +It is possible to compile WebAssembly modules using many existing languages, including C, C++, Rust, Go, and even interpreted languages like Lua and Python. This [list][5] is only growing. + +One of the problems with using existing languages is that WebAssembly does not have much of a runtime. It does not know what it means to [free a pointer][6] or what a [closure][7] is. All these language-specific runtimes have to be included in the resulting WebAssembly binaries. Runtime size varies by language, but it has an impact on module size and execution time. + +### AssemblyScript + +[AssemblyScript][8] is one language that is trying to overcome some of these challenges with a different approach. AssemblyScript is designed specifically for WebAssembly, with a focus on providing low-level control, producing smaller binaries, and reducing the runtime overhead. + +AssemblyScript uses a strictly typed variant of [TypeScript][9], a superset of JavaScript. Developers familiar with TypeScript do not have to go through the trouble of learning an entirely new language. + +### Getting started + +The AssemblyScript compiler can easily be installed through [Node,js][10]. Start by initializing a new project in an empty directory: + + +``` +npm init +npm install --save-dev assemblyscript +``` + +If you don't have Node installed locally, you can play around with AssemblyScript on your browser using the nifty [WebAssembly Studio][11] application. + +AssemblyScript comes with `asinit`, which should be installed when you run the installation command above. It is a helpful utility to quickly set up an AssemblyScript project with the recommended directory structure and configuration files: + + +``` +`npx asinit .` +``` + +The newly created `assembly` directory will contain all the AssemblyScript code, a simple example function in `assembly/index.ts`, and the `asbuild` command inside `package.json`. `asbuild`, which compiles the code into WebAssembly binaries. + +When you run `npm run asbuild` to compile the code, it creates files inside `build`. The `.wasm` files are the generated WebAssembly modules. The `.wat` files are the modules in text format and are generally used for debugging and inspection. + +You have to do a little bit of work to get the binaries to run on a browser. + +First, create a simple HTML file, `index.html`: + + +``` +<[html][12]> +    <[head][13]> +        <[meta][14] charset=utf-8> +        <[title][15]>Game of life</[title][15]> +    </[head][13]> +    +    <[body][16]> +        <[script][17] src='./index.js'></[script][17]> +    </[body][16]> +</[html][12]> +``` + +Next, replace the contents of `index.js` with the code snippet below to load the WebAssembly modules: + + +``` +const runWasm = async () => { +  const module = await WebAssembly.instantiateStreaming(fetch('./build/optimized.wasm')); +  const exports = module.instance.exports; + +  console.log('Sum = ', exports.add(20, 22)); +}; + +runWasm(); +``` + +This `fetches` the binary and passes it to `WebAssembly.instantiateStreaming`, the browser API that compiles a module into a ready-to-use instance. This is an asynchronous operation, so it is run inside an async function so that await can be used to wait for it to finish compiling. + +The `module.instance.exports` object contains all the functions exported by AssemblyScript. Use the example function in `assembly/index.ts` and log the result. + +You will need a simple development server to host these files. There are a lot of options listed in this [gist][18]. I used [node-static][19]: + + +``` +npm install -g node-static +static +``` + +You can view the result by pointing your browser to `localhost:8080` and opening the console. + +![console output][20] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +### Drawing to a canvas + +You will be drawing all the cells onto a `` element: + + +``` +<[body][16]> +    <[canvas][22] id=canvas></[canvas][22]> + +    ... +</[body][16]> +``` + +Add some CSS: + + +``` +<[head][13]> +    ... + +    <[style][23] type=text/css> +    body { +      background: #ccc; +    } +    canvas { +      display: block; +      padding: 0; +      margin: auto; +      width: 40%; + +      image-rendering: pixelated; +      image-rendering: crisp-edges; +    } +    </[style][23]> +</[head][13]> +``` + +The `image-rendering` styles are used to prevent the canvas from smoothing and blurring out pixelated images. + +You will need a canvas drawing context in `index.js`: + + +``` +const canvas = document.getElementById('canvas'); +const ctx = canvas.getContext('2d'); +``` + +There are many functions in the [Canvas API][24] that you could use for drawing—but you need to draw using WebAssembly, not JavaScript. + +Remember that WebAssembly does NOT have access to the browser APIs that JavaScript has, and any call that needs to be made should be interfaced through JavaScript. This also means that your WebAssembly module will run the fastest if there is as little communication with JavaScript as possible. + +One method is to create [ImageData][25] (a data type for the underlying pixel data of a canvas), fill it up with the WebAssembly module's memory, and draw it on the canvas. This way, if the memory buffer is updated inside WebAssembly, it will be immediately available to the `ImageData`. + +Define the pixel count of the canvas and create an `ImageData` object: + + +``` +const WIDTH = 10, HEIGHT = 10; + +const runWasm = async () => { +... + +canvas.width = WIDTH; +canvas.height = HEIGHT; + +const ctx = canvas.getContext('2d'); +const memoryBuffer = exports.memory.buffer; +const memoryArray = new Uint8ClampedArray(memoryBuffer) + +const imageData = ctx.createImageData(WIDTH, HEIGHT); +imageData.data.set(memoryArray.slice(0, WIDTH * HEIGHT * 4)); +ctx.putImageData(imageData, 0, 0); +``` + +The memory of a WebAssembly module is provided in `exports.memory.buffer` as an [ArrayBuffer][26]. You need to use it as an array of 8-bit unsigned integers or `Uint8ClampedArray`. Now you can fill up the module's memory with some pixels. In `assembly/index.ts`, you first need to grow the available memory: + + +``` +`memory.grow(1);` +``` + +WebAssembly does not have access to memory by default and needs to request it from the browser using the `memory.grow` function. Memory grows in chunks of 64Kb, and the number of required chunks can be specified when calling it. You will not need more than one chunk for now. + +Keep in mind that memory can be requested multiple times, whenever needed, and once acquired, memory cannot be freed or given back to the browser. + +Writing to the memory: + + +``` +`store(0, 0xff101010);` +``` + +A pixel is represented by 32 bits, with the RGBA values taking up 8 bits each. Here, RGBA is defined in reverse—ABGR—because WebAssembly is [little-endian][27]. + +The `store` function stores the value `0xff101010` at index `0`, taking up 32 bits. The alpha value is `0xff` so that the pixel is fully opaque. + +![Byte order for a pixel's color][28] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +Build the module again with `npm run asbuild` before refreshing the page to see your first pixel on the top-left of the canvas. + +### Implementing rules + +Let's review the rules. The [Game of Life Wikipedia page][29] summarizes them nicely: + + 1. Any live cell with fewer than two live neighbors dies, as if by underpopulation. + 2. Any live cell with two or three live neighbors lives on to the next generation. + 3. Any live cell with more than three live neighbors dies, as if by overpopulation. + 4. Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. + + + +You need to iterate through all the rows, implementing these rules on each cell. You do not know the width and height of the grid, so write a little function to initialize the WebAssembly module with this information: + + +``` +let universe_width: u32; +let universe_height: u32; +let alive_color: u32; +let dead_color: u32; +let chunk_offset: u32; + +export function init(width: u32, height: u32): void { +  universe_width = width; +  universe_height = height; +  chunk_offset = width * height * 4; + +  alive_color = 0xff101010; +  dead_color = 0xffefefef; +} +``` + +Now you can use this function in `index.js` to provide data to the module: + + +``` +`exports.init(WIDTH, HEIGHT);` +``` + +Next, write an `update` function to iterate over all the cells, count the number of active neighbors for each, and set the current cell's state accordingly: + + +``` +export function update(): void { +  for (let x: u32 = 0; x < universe_width; x++) { +    for (let y: u32 = 0; y < universe_height; y++) { + +      const neighbours = countNeighbours(x, y); + +      if (neighbours < 2) { +        // less than 2 neighbours, cell is no longer alive +        setCell(x, y, dead_color); +      } else if (neighbours == 3) { +        // cell will be alive +        setCell(x, y, alive_color); +      } else if (neighbours > 3) { +        // cell dies due to overpopulation +        setCell(x, y, dead_color); +      } +    } +  } + +  copyToPrimary(); +} +``` + +You have two copies of cell arrays, one representing the current state and the other for calculating and temporarily storing the next state. After the calculation is done, the second array is copied to the first for rendering. + +The rules are fairly straightforward, but the `countNeighbours()` function looks interesting. Take a closer look: + + +``` +function countNeighbours(x: u32, y: u32): u32 { +  let neighbours = 0; + +  const max_x = universe_width - 1; +  const max_y = universe_height - 1; + +  const y_above = y == 0 ? max_y : y - 1; +  const y_below = y == max_y ? 0 : y + 1; +  const x_left = x == 0 ? max_x : x - 1; +  const x_right = x == max_x ? 0 : x + 1; + +  // top left +  if(getCell(x_left, y_above) == alive_color) { +    neighbours++; +  } + +  // top +  if(getCell(x, y_above) == alive_color) { +    neighbours++; +  } + +  // top right +  if(getCell(x_right, y_above) == alive_color) { +    neighbours++; +  } + +  ... + +  return neighbours; +} +``` + +![Coordinates of a cell's neighbors][30] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +Every cell has eight neighbors, and you can check if each one is in the `alive_color` state. The important situation handled here is if a cell is exactly on the edge of the grid. Cellular automata are generally assumed to be on an infinite space, but since infinitely large displays haven't been invented yet, stick to warping at the edges. This means when a cell goes off the top, it comes back in its corresponding position on the bottom. This is commonly known as [toroidal space][31]. + +The `getCell` and `setCell` functions are wrappers to the `store` and `load` functions to make it easier to interact with memory using 2D coordinates: + + +``` +@inline +function getCell(x: u32, y: u32): u32 { +  return load<u32>((x + y * universe_width) << 2); +} + +@inline +function setCell(x: u32, y: u32, val: u32): void { +  store<u32>(((x + y * universe_width) << 2) + chunk_offset, val); +} + +function copyToPrimary(): void { +  memory.copy(0, chunk_offset, chunk_offset); +} +``` + +The `@inline` is an [annotation][32] that requests that the compiler convert calls to the function with the function definition itself. + +Call the update function on every iteration from `index.js` and render the image data from the module memory: + + +``` +const FPS = 5; + +const runWasm = async () => { +  ... + +  const step = () => { +    exports.update(); +  +    imageData.data.set(memoryArray.slice(0, WIDTH * HEIGHT * 4)); +    ctx.putImageData(imageData, 0, 0); +  +    setTimeout(step, 1000 / FPS); +  }; +  step(); +``` + +At this point, if you compile the module and load the page, it shows nothing. The code works fine, but since you don't have any living cells initially, there are no new cells coming up. + +Create a new function to randomly add cells during initialization: + + +``` +function fillUniverse(): void { +  for (let x: u32 = 0; x < universe_width; x++) { +    for (let y: u32 = 0; y < universe_height; y++) { +      setCell(x, y, Math.random() > 0.5 ? alive_color : dead_color); +    } +  } + +  copyToPrimary(); +} + +export function init(width: u32, height: u32): void { +  ... + +  fillUniverse(); +``` + +Since `Math.random` is used to determine the initial state of a cell, the WebAssembly module needs a seed function to derive a random number from. + +AssemblyScript provides a convenient [module loader][33] that does this and a lot more, like wrapping the browser APIs for module loading and providing functions for more fine-grained memory control. You will not be using it here since it abstracts away many details that would otherwise help in learning the inner workings of WebAssembly, so pass in a seed function instead: + + +``` +  const importObject = { +    env: { +      seed: Date.now, +      abort: () => console.log('aborting!') +    } +  }; +  const module = await WebAssembly.instantiateStreaming(fetch('./build/optimized.wasm'), importObject); +``` + +`instantiateStreaming` can be called with an optional second parameter, an object that exposes JavaScript functions to WebAssembly modules. Here, use `Date.now` as the seed to generate random numbers. + +It should now be possible to run the `fillUniverse` function and finally have life on your grid! + +You can also play around with different `WIDTH`, `HEIGHT`, and `FPS` values and use different cell colors. + +![Game of Life result][34] + +(Mohammed Saud, [CC BY-SA 4.0][21]) + +### Try the game + +If you use large sizes, make sure to grow the memory accordingly. + +Here's the [complete code][35]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/game-life-simulation-webassembly + +作者:[Mohammed Saud][a] +选题:[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/saud +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life +[3]: https://en.wikipedia.org/wiki/Cellular_automaton +[4]: https://en.wikipedia.org/wiki/Assembly_language +[5]: https://github.com/appcypher/awesome-wasm-langs +[6]: https://en.wikipedia.org/wiki/C_dynamic_memory_allocation +[7]: https://en.wikipedia.org/wiki/Closure_(computer_programming) +[8]: https://www.assemblyscript.org +[9]: https://www.typescriptlang.org/ +[10]: https://nodejs.org/en/download/ +[11]: https://webassembly.studio +[12]: http://december.com/html/4/element/html.html +[13]: http://december.com/html/4/element/head.html +[14]: http://december.com/html/4/element/meta.html +[15]: http://december.com/html/4/element/title.html +[16]: http://december.com/html/4/element/body.html +[17]: http://december.com/html/4/element/script.html +[18]: https://gist.github.com/willurd/5720255 +[19]: https://www.npmjs.com/package/node-static +[20]: https://opensource.com/sites/default/files/uploads/console_log.png (console output) +[21]: https://creativecommons.org/licenses/by-sa/4.0/ +[22]: http://december.com/html/4/element/canvas.html +[23]: http://december.com/html/4/element/style.html +[24]: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API +[25]: https://developer.mozilla.org/en-US/docs/Web/API/ImageData +[26]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer +[27]: https://en.wikipedia.org/wiki/Endianness +[28]: https://opensource.com/sites/default/files/uploads/color_bits.png (Byte order for a pixel's color) +[29]: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Rules +[30]: https://opensource.com/sites/default/files/uploads/count_neighbours.png (Coordinates of a cell's neighbors) +[31]: https://en.wikipedia.org/wiki/Torus +[32]: https://www.assemblyscript.org/peculiarities.html#annotations +[33]: https://www.assemblyscript.org/loader.html +[34]: https://opensource.com/sites/default/files/uploads/life.png (Game of Life result) +[35]: https://github.com/rottencandy/game-of-life-wasm From a2e0a814ab539dcda2eddce3df2ede52c8e66f8c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 14 Apr 2021 08:44:45 +0800 Subject: [PATCH 111/307] translated --- ...Install Steam on Fedora -Beginner-s Tip.md | 117 ------------------ ...Install Steam on Fedora -Beginner-s Tip.md | 117 ++++++++++++++++++ 2 files changed, 117 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md create mode 100644 translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md diff --git a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md deleted file mode 100644 index 7a36c9f9db..0000000000 --- a/sources/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: subject: (How to Install Steam on Fedora [Beginner’s Tip]) -[#]: via: (https://itsfoss.com/install-steam-fedora/) -[#]: author: (John Paul https://itsfoss.com/author/john/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Install Steam on Fedora [Beginner’s Tip] -====== - -Steam is the best thing that could happen to Linux gamers. Thanks to Steam, you can play hundreds and thousands of games on Linux. - -If you are not already aware of it, Steam is the most popular PC gaming platform. In 2013, it became available for Linux. [Steam’s latest Proton project][1] allows you to play games created for Windows platform on Linux. This enhanced Linux gaming library many folds. - -![][2] - -Steam provides a desktop client and you can use it to download or purchase games from the Steam store, install the game and play it. - -We have discussed [installing Steam on Ubuntu][3] in the past. In this beginner’s tutorial, I am going to show you the steps for installing Steam on Fedora Linux. - -### Installing Steam on Fedora - -To get Steam on Fedora, you’ll have to use RMPFusion repository. [RPMFusion][4] is a series of third-party repos that contain software that Fedora chooses not to ship with their operating system. They offer both free (open source) and non-free (closed source) repos. Since Steam is in the non-free repo, you will only install that one. - -I shall go over both the terminal and graphical installation methods. - -#### Method 1: Install Steam via terminal - -This is the easiest method because it requires the fewest steps. Just enter the following command to enable the free repo: - -``` -sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -``` - -You will be asked to enter your password. You will then be asked to verify that you want to install these repos. Once you approve it, the installation of the repo will be completed. - -To install Steam, simply enter the following command: - -``` -sudo dnf install steam -``` - -![Install Steam via command line][5] - -Enter your password and press “Y” to accept. Once installed, open Steam and play some games. - -#### Method 2: Install Steam via GUI - -You can [enable the third-party repository on Fedora][6] from the Software Center. Open the Software Center application and click on the hamburger menu: - -![][7] - -In the Software Repositories window, you will see a section at the top that says “Third Party Repositories”. Click the Install button. Enter your password when you are prompted and you are done. - -![][8] - -Once you have installed RPM Fusion repository for Steam, update your system’s software cache (if needed) and search for Steam in the software center. - -![Steam in GNOME Software Center][9] - -Once that installation is complete, open up the GNOME Software Center and search for Steam. Once you locate the Steam page, click install. Enter your password when asked and you’re done. - -After installing Steam, start the application, enter your Steam account details or register for it and enjoy your games. - -### Using Steam as Flatpak - -Steam is also available as a Flatpak. Flatpak is installed by default on Fedora. Before we can install Steam using that method, we have to install the Flathub repo. - -![Install Flathub][10] - -First, open the [Flatpak site][11] in your browser. Now, click the blue button marked “Flathub repository file”. The browser will ask you if you want to open the file in GNOME Software Center. Click okay. Once GNOME Software Center open, click the install button. You will be prompted to enter your password. - -If you get an error when you try to install the Flathub repo, run this command in the terminal: - -``` -flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -``` - -With the Flathub repo installed, all you need to do is search for Steam in the GNOME Software Center. Once you find it, install it, and you are ready to go. - -![Fedora Repo Select][12] - -The Flathub version of Steam has several add-ons you can install, as well. These include a DOS compatibility tool and a couple of tools for [Vulkan][13] and Proton. - -![][14] - -I think this should help you with Steam on Fedora. Enjoy your games :) - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-steam-fedora/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/steam-play-proton/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/05/Steam-Store.jpg?resize=800%2C382&ssl=1 -[3]: https://itsfoss.com/install-steam-ubuntu-linux/ -[4]: https://rpmfusion.org/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-steam-fedora.png?resize=800%2C588&ssl=1 -[6]: https://itsfoss.com/fedora-third-party-repos/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/software-meni.png?resize=800%2C672&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repo-gui.png?resize=746%2C800&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gnome-store-steam.jpg?resize=800%2C434&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/flatpak-install-button.jpg?resize=800%2C434&ssl=1 -[11]: https://www.flatpak.org/setup/Fedora/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/fedora-repo-select.jpg?resize=800%2C434&ssl=1 -[13]: https://developer.nvidia.com/vulkan -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/steam-flatpak-addons.jpg?resize=800%2C434&ssl=1 diff --git a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md new file mode 100644 index 0000000000..2a51d86e0f --- /dev/null +++ b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -0,0 +1,117 @@ +[#]: subject: (How to Install Steam on Fedora [Beginner’s Tip]) +[#]: via: (https://itsfoss.com/install-steam-fedora/) +[#]: author: (John Paul https://itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Fedora 上安装 Steam(入门技巧) +====== + +Steam 对 Linux 游戏玩家来说是最好的事情。由于 Steam,你可以在 Linux 上玩成百上千的游戏。 + +如果你还不知道,Steam 是最流行的 PC 游戏平台。2013 年,它开始适用于 Linux。[Steam 最新的 Proton 项目][1]允许你在 Linux 上玩为 Windows 平台创建的游戏。这让 Linux 游戏库增强了许多倍。 + +![][2] + +Steam 提供了一个桌面客户端,你可以用它从 Steam 商店下载或购买游戏,然后安装并玩它。 + +过去我们曾讨论过[在 Ubuntu 上安装 Steam][3]。在这个初学者教程中,我将向你展示在 Fedora Linux 上安装 Steam 的步骤。 + +### 在 Fedora 上安装 Steam + +要在 Fedora 上使用 Steam,你必须使用 RMPFusion 软件库。[RPMFusion][4] 是一系列第三方软件库,其中包含了 Fedora 选择不与它们的操作系统一起发布的软件。它们提供自由(开源)和非自由(闭源)的软件库。由于 Steam 在非自由软件库中,你将只安装那一个。 + +我将同时介绍终端和图形安装方法。 + +#### 方法 1:通过终端安装 Steam + +这是最简单的方法,因为它需要的步骤最少。只需输入以下命令即可启用仓库: + +``` +sudo dnf install https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +``` + +你会被要求输入密码。然后你会被要求验证是否要安装这些仓库。你同意后,仓库安装就会完成。 + +要安装 Steam,只需输入以下命令: + +``` +sudo dnf install steam +``` + +![Install Steam via command line][5] + +输入密码后按 “Y” 接受。安装完毕后,打开 Steam,玩一些游戏。 + +#### 方法 2:通过 GUI 安装 Steam + +你可以从软件中心[启用 Fedora 上的第三方仓库][6]。打开软件中心并点击菜单。 + +![][7] + +在 Software Repositories 窗口中,你会看到顶部有一个 “Third Party Repositories”。点击 “Install” 按钮。当提示你输入密码时,就完成了。 + +![][8] + +安装了 Steam 的 RPM Fusion 仓库后,更新你系统的软件缓存(如果需要),并在软件中心搜索 Steam。 + +![Steam in GNOME Software Center][9] + +安装完成后,打开 GNOME 软件中心,搜索 Steam。找到 Steam 页面后,点击安装。当被问及密码时,输入你的密码就可以了。 + +安装完 Steam 后,启动应用,输入你的 Steam 帐户详情或注册它,然后享受你的游戏。 + +### 将 Steam 作为 Flatpak 使用 + +Steam 也可以作为 Flatpak 使用。Fedora 上默认安装 Flatpak。在使用该方法安装 Steam 之前,我们必须安装 Flathub 仓库。 + +![Install Flathub][10] + +首先,在浏览器中打开 [Flatpak 网站][11]。现在,点击标有 “Flathub repository file” 的蓝色按钮。浏览器会询问你是否要在 GNOME 软件中心打开该文件。点击确定。在 GNOME 软件中心打开后,点击安装按钮。系统会提示你输入密码。 + +如果你在尝试安装 Flathub 仓库时出现错误,请在终端运行以下命令: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +安装好 Flathub 仓库后,你需要做的就是在 GNOME 软件中心搜索 Steam。找到后,安装它,你就可以开始玩了。 + +![Fedora Repo Select][12] + +Flathub 版本的 Steam 也有几个附加组件可以安装。其中包括一个 DOS 兼容工具和几个 [Vulkan][13] 和 Proton 工具。 + +![][14] + +我想这应该可以帮助你在 Fedora 上使用 Steam。享受你的游戏 :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-steam-fedora/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/steam-play-proton/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2017/05/Steam-Store.jpg?resize=800%2C382&ssl=1 +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://rpmfusion.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/install-steam-fedora.png?resize=800%2C588&ssl=1 +[6]: https://itsfoss.com/fedora-third-party-repos/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/software-meni.png?resize=800%2C672&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/fedora-third-party-repo-gui.png?resize=746%2C800&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/gnome-store-steam.jpg?resize=800%2C434&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/flatpak-install-button.jpg?resize=800%2C434&ssl=1 +[11]: https://www.flatpak.org/setup/Fedora/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/fedora-repo-select.jpg?resize=800%2C434&ssl=1 +[13]: https://developer.nvidia.com/vulkan +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/steam-flatpak-addons.jpg?resize=800%2C434&ssl=1 From 74f3190612f4a15248f18fc37bddd13d68996578 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 14 Apr 2021 08:50:50 +0800 Subject: [PATCH 112/307] translating --- ...0210412 Encrypt your files with this open source software.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210412 Encrypt your files with this open source software.md b/sources/tech/20210412 Encrypt your files with this open source software.md index d5cd35cde2..0aa7803a9c 100644 --- a/sources/tech/20210412 Encrypt your files with this open source software.md +++ b/sources/tech/20210412 Encrypt your files with this open source software.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/open-source-encryption) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 42b5706c93db85fb008641f6cc946b2b206c8c0e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 13:18:07 +0800 Subject: [PATCH 113/307] PRF @geekpi --- .../20210407 What is Git cherry-picking.md | 87 ++++++++----------- 1 file changed, 37 insertions(+), 50 deletions(-) diff --git a/translated/tech/20210407 What is Git cherry-picking.md b/translated/tech/20210407 What is Git cherry-picking.md index 91ead9d3c8..b19b13750d 100644 --- a/translated/tech/20210407 What is Git cherry-picking.md +++ b/translated/tech/20210407 What is Git cherry-picking.md @@ -3,104 +3,97 @@ [#]: author: (Rajeev Bera https://opensource.com/users/acompiler) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -什么是 Git cherry-pick? +什么是 Git 遴选(cherry-pick)? ====== -了解 git cherry-pick 命令是什么,为什么用以及如何使用。 -![Measuring and baking a cherry pie recipe][1] -当你和一群程序员一起工作时,无论项目大小,处理多个 Git 分支之间的变化都会变得很困难。有时,你不想将整个 Git 分支合并到另一个分支,而是想选择并移动几个特定的提交。这个过程被称为 ”cherry-pick“。 +> 了解 `git cherry-pick` 命令是什么,为什么用以及如何使用。 -本文将介绍 cherry-pick 是什么、为何使用以及如何使用。 +![](https://img.linux.net.cn/data/attachment/album/202104/14/131735o63v3ow6y2wc281o.jpg) + +当你和一群程序员一起工作时,无论项目大小,处理多个 Git 分支之间的变更都会变得很困难。有时,你不想将整个 Git 分支合并到另一个分支,而是想选择并移动几个特定的提交。这个过程被称为 “遴选cherry-pick”。 + +本文将介绍“遴选”是什么、为何使用以及如何使用。 那么让我们开始吧。 -### 什么是 cherry-pick? +### 什么是遴选? -使用 `cherry-pick` 命令,Git 可以让你将任何分支中的个别提交合并到你当前的 [Git HEAD][2] 分支中。 +使用遴选(`cherry-pick`)命令,Git 可以让你将任何分支中的个别提交合并到你当前的 [Git HEAD][2] 分支中。 当执行 `git merge` 或者 `git rebase` 时,一个分支的所有提交都会被合并。`cherry-pick` 命令允许你选择单个提交进行整合。 -### cherry-pick 的好处 +### 遴选的好处 -下面的情况可能会让你更容易理解 cherry-pick 的功能。 +下面的情况可能会让你更容易理解遴选功能。 想象一下,你正在为即将到来的每周冲刺实现新功能。当你的代码准备好了,你会把它推送到远程分支,准备进行测试。 -然而,客户并不对所有修改满意,要求你只呈现某些修改。因为客户还没有批准下次发布的所有修改,所以 `git rebase` 不会有预期的结果。为什么会这样?因为 `git rebase` 或者 `git merge` 会把上一个冲刺的每一个调整都纳入其中。 +然而,客户并不是对所有修改都满意,要求你只呈现某些修改。因为客户还没有批准下次发布的所有修改,所以 `git rebase` 不会有预期的结果。为什么会这样?因为 `git rebase` 或者 `git merge` 会把上一个冲刺的每一个调整都纳入其中。 -cherry-pick 是答案!因为它只关注在提交中添加的变化,所以 cherry-pick 只会带入批准的变化,而不添加其他提交。 +遴选就是答案!因为它只关注在提交中添加的变更,所以遴选只会带入批准的变更,而不添加其他的提交。 -还有其他几个原因可以使用 cherry-pick: +还有其他几个原因可以使用遴选: - * 这对于 bug 修复是必不可少的,因为 bug 是在开发分支中使用他们的提交产生的。 - * 你可以通过使用 `git cherry-pick` 来避免不必要的工作,而不用使用其他选项例如 `git diff` 来应用特定更改。 + * 这对于 bug 修复是必不可少的,因为 bug 是出现在开发分支中对应的提交的。 + * 你可以通过使用 `git cherry-pick` 来避免不必要的工作,而不用使用其他选项例如 `git diff` 来应用特定变更。 * 如果因为不同 Git 分支的版本不兼容而无法将整个分支联合起来,那么它是一个很有用的工具。 - - ### 使用 cherry-pick 命令 在 `cherry-pick` 命令的最简单形式中,你只需使用 [SHA][3] 标识符来表示你想整合到当前 HEAD 分支的提交。 要获得提交的哈希值,可以使用 `git log` 命令: - ``` -`$ git log --oneline` +$ git log --oneline ``` 当你知道了提交的哈希值后,你就可以使用 `cherry-pick` 命令。 语法是: - ``` -`$ git cherry-pick ` +$ git cherry-pick ``` 例如: - ``` -`$ git cherry-pick 65be1e5` +$ git cherry-pick 65be1e5 ``` 这将会把指定的修改合并到当前已签出的分支上。 -如果你想做进一步的修改,也可以让 Git 在你的工作副本中添加提交修改。 +如果你想做进一步的修改,也可以让 Git 将提交的变更内容添加到你的工作副本中。 语法是: - ``` -`$ git cherry-pick --no-commit` +$ git cherry-pick --no-commit ``` 例如: - ``` -`$ git cherry-pick 65be1e5 --no-commit` +$ git cherry-pick 65be1e5 --no-commit ``` 如果你想同时选择多个提交,请将它们的提交哈希值用空格隔开: - ``` -`$ git cherry-pick hash1 hash3` +$ git cherry-pick hash1 hash3 ``` -当 cherry-pick 提交时,你不能使用 `git pull` 命令,因为它能获取一个仓库的提交_并_自动合并到另一个仓库。`cherry-pick` 并不是一个专门这么做的工具。相反,你可以使用 `git fetch`,它可以获取提交,但不应用它们。毫无疑问,`git pull` 很方便,但它不精确。 +当遴选提交时,你不能使用 `git pull` 命令,因为它能获取一个仓库的提交**并**自动合并到另一个仓库。`cherry-pick` 是一个专门不这么做的工具;另一方面,你可以使用 `git fetch`,它可以获取提交,但不应用它们。毫无疑问,`git pull` 很方便,但它不精确。 ### 自己尝试 要尝试这个过程,启动终端并生成一个示例项目: - ``` $ mkdir fruit.git $ cd fruit.git @@ -109,36 +102,32 @@ $ git init . 创建一些数据并提交: - ``` -$ echo "Kiwifruit" > fruit.txt +$ echo "Kiwifruit" > fruit.txt $ git add fruit.txt $ git commit -m 'First commit' ``` -现在,通过创建一个项目的分叉来代表一个远程开发者: - +现在,通过创建一个项目的复刻来代表一个远程开发者: ``` $ mkdir ~/fruit.fork $ cd !$ -$ echo "Strawberry" >> fruit.txt +$ echo "Strawberry" >> fruit.txt $ git add fruit.txt $ git commit -m 'Added a fruit" ``` 这是一个有效的提交。现在,创建一个不好的提交,代表你不想合并到你的项目中的东西: - ``` -$ echo "Rhubarb" >> fruit.txt +$ echo "Rhubarb" >> fruit.txt $ git add fruit.txt $ git commit -m 'Added a vegetable that tastes like a fruit" ``` 返回你的仓库,从你的假想的开发者那里获取提交的内容: - ``` $ cd ~/fruit.git $ git remote add dev ~/fruit.fork @@ -147,9 +136,9 @@ remote: Counting objects: 6, done. remote: Compressing objects: 100% (2/2), done. remote: Total 6 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (6/6), done... +``` -[/code] [code] - +``` $ git log –oneline dev/master e858ab2 Added a vegetable that tastes like a fruit 0664292 Added a fruit @@ -158,14 +147,12 @@ b56e0f8 First commit 你已经从你想象中的开发者那里获取了提交的内容,但你还没有将它们合并到你的版本库中。你想接受第二个提交,但不想接受第三个提交,所以使用 `cherry-pick`。 - ``` -`$ git cherry-pick 0664292` +$ git cherry-pick 0664292 ``` 第二次提交现在在你的仓库里了: - ``` $ cat fruit.txt Kiwifruit @@ -174,13 +161,13 @@ Strawberry 将你的更改推送到远程服务器上,这就完成了! -### 避免使用 cherry-pick 的原因 +### 避免使用遴选的原因 -在开发者社区中,通常不鼓励 cherry-pick。主要原因是它会造成重复提交,但你也失去了跟踪提交历史的能力。 +在开发者社区中,通常不鼓励所以遴选。主要原因是它会造成重复提交,而你也失去了跟踪你的提交历史的能力。 -如果你不按顺序地 cherry-pick 了大量的提交,这些提交会被记录在你的分支中,这可能会在 Git 分支中导致不理想的结果。 +如果你不按顺序地遴选了大量的提交,这些提交会被记录在你的分支中,这可能会在 Git 分支中导致不理想的结果。 -cherry-pick 是一个强大的命令,如果没有正确理解可能发生的情况,它可能会导致问题。不过,当你搞砸了,提交到错误的分支时,它可能会救你一命(至少是你当天的工作)。 +遴选是一个强大的命令,如果没有正确理解可能发生的情况,它可能会导致问题。不过,当你搞砸了,提交到错误的分支时,它可能会救你一命(至少是你当天的工作)。 -------------------------------------------------------------------------------- @@ -189,7 +176,7 @@ via: https://opensource.com/article/21/4/cherry-picking-git 作者:[Rajeev Bera][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 67f1687e16eb80807ce55d68e81ddd9ad9c71668 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 13:18:31 +0800 Subject: [PATCH 114/307] PUB @geekpi https://linux.cn/article-13295-1.html --- .../tech => published}/20210407 What is Git cherry-picking.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210407 What is Git cherry-picking.md (98%) diff --git a/translated/tech/20210407 What is Git cherry-picking.md b/published/20210407 What is Git cherry-picking.md similarity index 98% rename from translated/tech/20210407 What is Git cherry-picking.md rename to published/20210407 What is Git cherry-picking.md index b19b13750d..ba25e9572c 100644 --- a/translated/tech/20210407 What is Git cherry-picking.md +++ b/published/20210407 What is Git cherry-picking.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13295-1.html) 什么是 Git 遴选(cherry-pick)? ====== From 1bd58859f34c568b9ef63c103672c9ecd6d06a38 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 14:23:21 +0800 Subject: [PATCH 115/307] APL --- .../tech/20210413 Create an encrypted file vault on Linux.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210413 Create an encrypted file vault on Linux.md b/sources/tech/20210413 Create an encrypted file vault on Linux.md index 6c3dbd7bdf..fb5a87de24 100644 --- a/sources/tech/20210413 Create an encrypted file vault on Linux.md +++ b/sources/tech/20210413 Create an encrypted file vault on Linux.md @@ -2,15 +2,14 @@ [#]: via: (https://opensource.com/article/21/4/linux-encryption) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) Create an encrypted file vault on Linux ====== -Use Linux Unified Key Setup to create an encrypted vault for sensitive -files on a physical drive or cloud storage. +Use Linux Unified Key Setup to create an encrypted vault for sensitive files on a physical drive or cloud storage. ![Secure safe][1] Recently, I demonstrated how to [implement full-drive encryption][2] on Linux with LUKS and the `cryptsetup` command. While encrypting a whole drive is useful in many cases, there are reasons you might not want to encode an entire drive. For instance, you might require a drive to work across several platforms, some of which may not have Linux Unified Key Setup ([LUKS][3]) integration. Furthermore, it's the 21st century, the cloud exists, and you may not be using a physical drive for all your data. From c30700e43eb80c2fc77a366ab7ee6d9a03817efd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 15:08:11 +0800 Subject: [PATCH 116/307] TSL&PRF --- ...Create an encrypted file vault on Linux.md | 118 ------------------ ...Create an encrypted file vault on Linux.md | 113 +++++++++++++++++ 2 files changed, 113 insertions(+), 118 deletions(-) delete mode 100644 sources/tech/20210413 Create an encrypted file vault on Linux.md create mode 100644 translated/tech/20210413 Create an encrypted file vault on Linux.md diff --git a/sources/tech/20210413 Create an encrypted file vault on Linux.md b/sources/tech/20210413 Create an encrypted file vault on Linux.md deleted file mode 100644 index fb5a87de24..0000000000 --- a/sources/tech/20210413 Create an encrypted file vault on Linux.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: (Create an encrypted file vault on Linux) -[#]: via: (https://opensource.com/article/21/4/linux-encryption) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Create an encrypted file vault on Linux -====== -Use Linux Unified Key Setup to create an encrypted vault for sensitive files on a physical drive or cloud storage. -![Secure safe][1] - -Recently, I demonstrated how to [implement full-drive encryption][2] on Linux with LUKS and the `cryptsetup` command. While encrypting a whole drive is useful in many cases, there are reasons you might not want to encode an entire drive. For instance, you might require a drive to work across several platforms, some of which may not have Linux Unified Key Setup ([LUKS][3]) integration. Furthermore, it's the 21st century, the cloud exists, and you may not be using a physical drive for all your data. - -Several years ago, there was a system called [TrueCrypt][4] that allowed users to create encrypted file "vaults," which could be decrypted by TrueCrypt to provide read/write access. It was a useful technique and essentially provided a virtual portable and fully encrypted drive where you could store important data. TrueCrypt closed down, but it serves as an interesting model. - -Fortunately, LUKS is a flexible system, and you can use it and `cryptsetup` to create an encrypted vault as a self-contained file, which you can save on a physical drive or in cloud storage. - -Here's how to do it. - -### 1\. Create an empty file - -First, you must create an empty file of a predetermined size. This serves as a kind of vault or safe in which you can store other files. The command you use for this is `fallocate`, from the `util-linux` package: - - -``` -`$ fallocate --length 512M vaultfile.img` -``` - -This example creates a 512MB file, but you can make yours any size you want. - -### 2\. Create a LUKS volume - -Next, create a LUKS volume within the empty file: - - -``` -$ cryptsetup --verify-passphrase \ -luksFormat vaultfile.img -``` - -### 3\. Open the LUKS volume - -So that you can create a filesystem ready for file storage, you must open the LUKS volume and mount it on your computer first: - - -``` -$ sudo cryptsetup open \ -\--type luks vaultfile.img myvault -$ ls /dev/mapper -myvault -``` - -### 4\. Create a filesystem - -Make a filesystem in your open vault: - - -``` -`$ sudo mkfs.ext4 -L myvault /dev/mapper/myvault` -``` - -If you don't need it for anything right now, you can close it: - - -``` -`$ sudo cryptsetup close myvault` -``` - -### 5\. Start using your encrypted vault - -Now that it's all set up, you can use your encrypted file vault whenever you need to store or access private data. To access your vault, you must mount it as a usable filesystem: - - -``` -$ sudo cryptsetup open \ -\--type luks vaultfile.img myvault -$ ls /dev/mapper -myvault -$ sudo mkdir /myvault -$ sudo mount /dev/mapper/myvault /myvault -``` - -This example opens the vault with `cryptsetup` and then mounts the vault from `/dev/mapper` to a new directory called `/myvault`. As with any volume on Linux, you can mount the LUKS volume anywhere you want, so instead of `/myvault`, you can use `/mnt` or `~/myvault` or whatever you prefer. - -While it's mounted, your LUKS volume is decrypted. You can read and write files to it just as if it were a physical drive. - -When you're finished using your encrypted vault, unmount and close it: - - -``` -$ sudo umount /myvault -$ sudo cryptsetup close myvault -``` - -### Encrypted file vaults - -An image file you encrypt with LUKS is as portable as any other file, so you can store your vault on your hard drive, an external drive, or even on the internet. As long as you have LUKS available, you can decrypt, mount, and use it to keep your data safe. It's easy encryption for improved data safety, so give it a try. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/linux-encryption - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_bank_vault_secure_safe.png?itok=YoW93h7C (Secure safe) -[2]: https://opensource.com/article/21/3/encryption-luks -[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md -[4]: https://en.wikipedia.org/wiki/TrueCrypt diff --git a/translated/tech/20210413 Create an encrypted file vault on Linux.md b/translated/tech/20210413 Create an encrypted file vault on Linux.md new file mode 100644 index 0000000000..1b3a234768 --- /dev/null +++ b/translated/tech/20210413 Create an encrypted file vault on Linux.md @@ -0,0 +1,113 @@ +[#]: subject: (Create an encrypted file vault on Linux) +[#]: via: (https://opensource.com/article/21/4/linux-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Linux 上创建一个加密文件保险库 +====== + +> 使用 Linux 统一密钥设置(LUKS)为物理驱动器或云存储上的敏感文件创建一个加密保险库。 + +![安全保险库][1] + +最近,我演示了如何在 Linux 上使用统一密钥设置Linux Unified Key Setup([LUKS][3])和 `cryptsetup` 命令 [实现全盘加密][2]。虽然加密整个硬盘在很多情况下是有用的,但也有一些原因让你不想对整个硬盘进行加密。例如,你可能需要让一个硬盘在多个平台上工作,其中一些平台可能没有集成 [LUKS][3]。此外,现在是 21 世纪,由于云的存在,你可能不会使用物理硬盘来处理所有的数据。 + +几年前,有一个名为 [TrueCrypt][4] 的系统,允许用户创建加密的文件保险库,可以通过 TrueCrypt 解密来提供读/写访问。这是一项有用的技术,基本上提供了一个虚拟的便携式、完全加密的驱动器,你可以在那里存储重要数据。TrueCrypt 项目关闭了,但它可以作为一个有趣的模型。 + +幸运的是,LUKS 是一个灵活的系统,你可以使用它和 `cryptsetup` 在一个独立的文件中创建一个加密保险库,你可以将其保存在物理驱动器或云存储中。 + +下面就来介绍一下怎么做。 + +### 1、建立一个空文件 + +首先,你必须创建一个预定大小的空文件。就像是一种保险库或保险箱,你可以在其中存储其他文件。你使用的命令是 `util-linux` 软件包中的 `fallocate`: + +``` +$ fallocate --length 512M vaultfile.img +``` + +这个例子创建了一个 512MB 的文件,但你可以把你的文件做成任何你想要的大小。 + +### 2、创建一个 LUKS 卷 + +接下来,在空文件中创建一个 LUKS 卷: + +``` +$ cryptsetup --verify-passphrase \ + luksFormat vaultfile.img +``` + +### 3、打开 LUKS 卷 + +要想创建一个可以存储文件的文件系统,必须先打开 LUKS 卷,并将其挂载到电脑上: + +``` +$ sudo cryptsetup open \ + --type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +``` + +### 4、建立一个文件系统 + +在你打开的保险库中建立一个文件系统: + +``` +$ sudo mkfs.ext4 -L myvault /dev/mapper/myvault +``` + +如果你现在不需要它做什么,你可以关闭它: + +``` +$ sudo cryptsetup close myvault +``` + +### 5、开始使用你的加密保险库 + +现在一切都设置好了,你可以在任何需要存储或访问私人数据的时候使用你的加密文件库。要访问你的保险库,必须将其挂载为一个可用的文件系统: + +``` +$ sudo cryptsetup open \ + --type luks vaultfile.img myvault +$ ls /dev/mapper +myvault +$ sudo mkdir /myvault +$ sudo mount /dev/mapper/myvault /myvault +``` + +这个例子用 `cryptsetup` 打开保险库,然后把保险库从 `/dev/mapper` 下挂载到一个叫 `/myvault` 的新目录。和 Linux 上的任何卷一样,你可以把 LUKS 卷挂载到任何你想挂载的地方,所以除了 `/myvault`,你可以用 `/mnt` 或 `~/myvault` 或任何你喜欢的位置。 + +当它被挂载后,你的 LUKS 卷就会被解密。你可以像读取和写入文件一样读取和写入它,就像它是一个物理驱动器一样。 + +当使用完你的加密保险库时,请卸载并关闭它: + +``` +$ sudo umount /myvault +$ sudo cryptsetup close myvault +``` + +### 加密的文件保险库 + +你用 LUKS 加密的镜像文件和其他文件一样,都是可移动的,因此你可以将你的保险库存储在硬盘、外置硬盘,甚至是互联网上。只要你可以使用 LUKS,就可以解密、挂载和使用它来保证你的数据安全。轻松加密,提高数据安全性,不妨一试。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-encryption + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_bank_vault_secure_safe.png?itok=YoW93h7C (Secure safe) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://gitlab.com/cryptsetup/cryptsetup/blob/master/README.md +[4]: https://en.wikipedia.org/wiki/TrueCrypt From 69f4eef07a5aff406a101179b2e755b8fa2edb33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 15:13:11 +0800 Subject: [PATCH 117/307] PUB @wxy https://linux.cn/article-13296-1.html --- .../20210413 Create an encrypted file vault on Linux.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20210413 Create an encrypted file vault on Linux.md (96%) diff --git a/translated/tech/20210413 Create an encrypted file vault on Linux.md b/published/20210413 Create an encrypted file vault on Linux.md similarity index 96% rename from translated/tech/20210413 Create an encrypted file vault on Linux.md rename to published/20210413 Create an encrypted file vault on Linux.md index 1b3a234768..94dde76530 100644 --- a/translated/tech/20210413 Create an encrypted file vault on Linux.md +++ b/published/20210413 Create an encrypted file vault on Linux.md @@ -3,16 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13296-1.html) 在 Linux 上创建一个加密文件保险库 ====== > 使用 Linux 统一密钥设置(LUKS)为物理驱动器或云存储上的敏感文件创建一个加密保险库。 -![安全保险库][1] +![](https://img.linux.net.cn/data/attachment/album/202104/14/151220l5zkkxiukgzix54k.jpg) 最近,我演示了如何在 Linux 上使用统一密钥设置Linux Unified Key Setup([LUKS][3])和 `cryptsetup` 命令 [实现全盘加密][2]。虽然加密整个硬盘在很多情况下是有用的,但也有一些原因让你不想对整个硬盘进行加密。例如,你可能需要让一个硬盘在多个平台上工作,其中一些平台可能没有集成 [LUKS][3]。此外,现在是 21 世纪,由于云的存在,你可能不会使用物理硬盘来处理所有的数据。 From 931e35285de37a0165953cc8a106458bfb61b92c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 22:55:45 +0800 Subject: [PATCH 118/307] APL --- ...e tools and tips to securing a Linux server for beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md index 36b202743a..2f065ca43a 100644 --- a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md +++ b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/securing-linux-servers) [#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c30436fe32811a72094f7f613c9f597246666554 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 14 Apr 2021 23:47:02 +0800 Subject: [PATCH 119/307] TSL&PRF --- ...o securing a Linux server for beginners.md | 202 ------------------ ...o securing a Linux server for beginners.md | 191 +++++++++++++++++ 2 files changed, 191 insertions(+), 202 deletions(-) delete mode 100644 sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md create mode 100644 translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md diff --git a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md deleted file mode 100644 index 2f065ca43a..0000000000 --- a/sources/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md +++ /dev/null @@ -1,202 +0,0 @@ -[#]: subject: (6 open source tools and tips to securing a Linux server for beginners) -[#]: via: (https://opensource.com/article/21/4/securing-linux-servers) -[#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -6 open source tools and tips to securing a Linux server for beginners -====== -Use open source tools to protect your Linux environment from breaches. -![People work on a computer server with devices][1] - -Because so much of our personal and professional data is available online today, it is important for everyone—from professionals to general internet users—to learn the basics of security and privacy. As a student, I've been able to gain experience in this area through my school's CyberPatriot initiative, where I've had the opportunity to interact with industry experts to learn about cyber breaches and the basic steps to establish a system's security. - -This article details six simple steps to improve the security of your Linux environment for personal use, based on what I have learned thus far as a beginner. Throughout my journey, I have utilized open source tools to accelerate my learning process and familiarize myself with higher-level concepts related to securing my Linux server. - -I have tested these steps using Ubuntu 18.04, the version I am most familiar with, but these steps will also work for other Linux distributions. - -### 1\. Run updates - -Developers are constantly finding ways to make servers more stable, fast, and secure by patching known vulnerabilities. Running updates regularly is a good habit to get into to maximize security. Run them with: - - -``` -`sudo apt-get update && apt-get upgrade` -``` - -### 2\. Enable firewall protection - -[Enabling a firewall][2] makes it easier to control incoming and outgoing traffic on your server. There are many firewall applications you can use on Linux, including [firewall-cmd][3] and Uncomplicated Firewall ([UFW][4]). I use UFW, so my examples are specific to it, but these principles apply to any interface you choose. - -Install UFW: - - -``` -`sudo apt-get install ufw` -``` - -If you want to secure your server even more, you can deny incoming and outgoing connections. Be warned: This cuts your server off from the world, so once you've blocked all traffic, you must specify which outgoing connections are allowed from your system: - - -``` -sudo ufw default deny incoming -sudo ufw default allow outgoing -``` - -You can also write rules for allowing incoming connections you need for personal use: - - -``` -`ufw allow ` -``` - -For example, to allow SSH connections: - - -``` -`ufw allow ssh` -``` - -Finally, enable your firewall with: - - -``` -`sudo ufw enable` -``` - -### 3\. Strengthen password protection - -Implementing a strong password policy is an important aspect of keeping a server secure from cyberattacks and data breaches. Some best practices for password policies include enforcing a minimum length and specifying password age. I use the libpam-cracklib package to accomplish these tasks. - -Install the libpam-cracklib package: - - -``` -`sudo apt-get install libpam-cracklib` -``` - -To enforce password length: - - * Open the `/etc/pam.d/common-password` file. - * Change the minimum character length of all passwords by changing the `minlen=12` line to however many characters you want. - - - -To prevent password reuse: - - * In the same file (`/etc/pam.d/common-password`), add the line `remember=x`. - * For example, if you want to prevent a user from reusing one of their last five passwords, use: `remember=5`. - - - -To enforce password age: - - * Find the following lines in the `/etc/login.defs` file and replace them with your preferred amount of time (days). For example: [code] PASS_MIN_AGE: 3 -PASS_MAX_AGE: 90 -PASS_WARN_AGE: 14 -``` -To enforce character specifications: - - * The four parameters to enforce character specifications in passwords are `lcredit` (lowercase), `ucredit` (uppercase), `dcredit` (digit), and `ocredit` (other characters). - * In the same file (`/etc/pam.d/common-password`), locate the line containing `pam_cracklib.so`. - * Add the following to the end of this line: [code]`lcredit=-a ucredit=-b dcredit=-c ocredit=-d` -``` - * For example, the following line requires passwords to contain _one_ of each parameter. You can change the numbers based on your preferred level of password security: [code]`lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1` -``` -## 4\. Disable nonessential services that are prone to exploitation - -It's a best practice to disable unnecessary services. This allows fewer ports to be open for exploitation. - -Install the systemd package: -``` -`sudo apt-get install systemd` -``` -See which services are running: -``` -`systemctl list-units` -``` -[Recognize][5] which services could cause potential vulnerabilities to your system. For each service: - - * Stop the service if it's currently running: [code]`systemctl stop ` -``` - * Disable the service from starting on boot: [code]`systemctl disable ` -``` -* After running these commands, check the status of the service: [code]`systemctl status ` -``` - - - -### 5\. Check for listening ports - -Open ports might pose security risks, so it's important to check for ports that are listening on your server. I use the [netstat][6] command to show all network connections: - - -``` -`netstat -tulpn` -``` - -Look at the address columns to determine the [port number][7]. Once you've found open ports, review them to make sure they're all necessary. If they aren't, [adjust what services you have running][8], or adjust your firewall settings. - -### 6\. Scan for malware - -Antivirus scanning software can be useful to keep viruses out of your system. Using them is a simple way to keep your server free from malware. My preferred tool is the open source software [ClamAV][9]. - -Install ClamAV: - - -``` -`sudo apt-get install clamav` -``` - -Update virus signatures: - - -``` -`sudo freshclam` -``` - -Scan all files and print out infected files, ringing a bell when one is found: - - -``` -`sudo clamscan -r --bell -i /` -``` - -You can and should automate scans so that you don't have to remember or spend time doing them manually. For simple automation like this, you can use [systemd timers][10] or your [favorite cron][11]. - -### Keep your server safe - -We cannot leave the responsibility for securing servers to a single person or organization. As the threat landscape continues to expand rapidly, it is up to each of us to be aware of the importance of server security and to employ some simple, effective security best practices. - -These are just a few of the many steps you can take to keep your Linux server safe. Of course, prevention is only part of the solution. These policies should be combined with rigorous monitoring for denial of service attacks, doing system analysis with [Lynis][12], and creating frequent backups. - -What open source tools do you use to keep your server safe? Tell us about them in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/securing-linux-servers - -作者:[Sahana Sreeram][a] -选题:[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/sahanasreeram01gmailcom -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) -[2]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd -[3]: https://opensource.com/article/20/2/firewall-cheat-sheet -[4]: https://wiki.ubuntu.com/UncomplicatedFirewall -[5]: http://www.yorku.ca/infosec/Administrators/UNIX_disable.html -[6]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat -[7]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers -[8]: https://opensource.com/article/20/5/systemd-units -[9]: https://www.clamav.net/ -[10]: https://opensource.com/article/20/7/systemd-timers -[11]: https://opensource.com/article/21/2/linux-automation -[12]: https://opensource.com/article/20/5/linux-security-lynis diff --git a/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md new file mode 100644 index 0000000000..019fcd2979 --- /dev/null +++ b/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -0,0 +1,191 @@ +[#]: subject: (6 open source tools and tips to securing a Linux server for beginners) +[#]: via: (https://opensource.com/article/21/4/securing-linux-servers) +[#]: author: (Sahana Sreeram https://opensource.com/users/sahanasreeram01gmailcom) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +6 个提升 Linux 服务器的安全开源工具和技巧 +====== + +> 使用开源工具来保护你的 Linux 环境不被入侵。 + +![人们在带设备的计算机服务器上工作][1] + +由于如今我们的许多个人和专业数据都可以在网上获得,因此无论是专业人士还是普通互联网用户,学习安全和隐私的基本知识是非常重要的。作为一名学生,我通过学校的 CyberPatriot 活动获得了这方面的经验,在那里我有机会与行业专家交流,了解网络漏洞和建立系统安全的基本步骤。 + +本文基于我作为初学者迄今所学的知识,详细介绍了六个简单的步骤,以提高个人使用的 Linux 环境的安全性。在我的整个旅程中,我利用开源工具来加速我的学习过程,并熟悉了与提升 Linux 服务器安全有关的更高层次的概念。 + +我使用我最熟悉的 Ubuntu 18.04 版本测试了这些步骤,但这些步骤也适用于其他 Linux 发行版。 + +### 1、运行更新 + +开发者们不断地寻找方法,通过修补已知的漏洞,使服务器更加稳定、快速、安全。定期运行更新是一个好习惯,可以最大限度地提高安全性。运行它们: + +``` +sudo apt-get update && apt-get upgrade +``` + +### 2、启用防火墙保护 + +[启用防火墙][2] 可以更容易地控制服务器上的进站和出站流量。在 Linux 上有许多防火墙应用程序可以使用,包括 [firewall-cmd][3] 和 简单防火墙Uncomplicated Firewall([UFW][4])。我使用 UFW,所以我的例子是专门针对它的,但这些原则适用于你选择的任何防火墙。 + +安装 UFW: + +``` +sudo apt-get install ufw +``` + +如果你想进一步保护你的服务器,你可以拒绝传入和传出的连接。请注意,这将切断你的服务器与世界的联系,所以一旦你封锁了所有的流量,你必须指定哪些出站连接是允许从你的系统中发出的: + +``` +sudo ufw default deny incoming +sudo ufw default allow outgoing +``` + +你也可以编写规则来允许你个人使用所需要的传入连接: + +``` +ufw allow +``` + +例如,允许 SSH 连接: + +``` +ufw allow ssh +``` + +最后,启用你的防火墙: + +``` +sudo ufw enable +``` + +### 3、加强密码保护 + +实施强有力的密码政策是保持服务器安全、防止网络攻击和数据泄露的一个重要方面。密码策略的一些最佳实践包括强制要求最小长度和指定密码年龄。我使用 libpam-cracklib 软件包来完成这些任务。 + +安装 libpam-cracklib 软件包: + +``` +sudo apt-get install libpam-cracklib +``` + +强制要求密码的长度: + + * 打开 `/etc/pam.d/common-password` 文件。 + * 将 `minlen=12` 行改为你需要的任意字符数,从而改变所有密码的最小字符长度要求。 + +为防止密码重复使用: + + * 在同一个文件(`/etc/pam.d/common-password`)中,添加 `remember=x` 行。 + * 例如,如果你想防止用户重复使用他们最后 5 个密码中的一个,使用 `remember=5`。 + +要强制要求密码年龄: + + * 在 `/etc/login.defs` 文件中找到以下几行,并用你喜欢的时间(天数)替换。例如: + +``` +PASS_MIN_AGE: 3 +PASS_MAX_AGE: 90 +PASS_WARN_AGE: 14 +``` + +强制要求字符规格: + + * 在密码中强制要求字符规格的四个参数是 `lcredit`(小写)、`ucredit`(大写)、`dcredit`(数字)和 `ocredit`(其他字符)。 + * 在同一个文件(`/etc/pam.d/common-password`)中,找到包含 `pam_cracklib.so` 的行。 + * 在该行末尾添加以下内容:`lcredit=-a ucredit=-b dcredit=-c ocredit=-d`。 + * 例如,下面这行要求密码必须至少包含一个每种字符。你可以根据你喜欢的密码安全级别来改变数字。`lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1`。 + +### 4、停用容易被利用的非必要服务。 + +停用不必要的服务是一种最好的做法。这样可以减少开放的端口,以便被利用。 + +安装 systemd 软件包: + +``` +sudo apt-get install systemd +``` + +查看哪些服务正在运行: + +``` +systemctl list-units +``` + +[识别][5] 哪些服务可能会导致你的系统出现潜在的漏洞。对于每个服务可以: + + * 停止当前正在运行的服务:`systemctl stop `。 + * 禁止服务在系统启动时启动:`systemctl disable `。 + * 运行这些命令后,检查服务的状态:`systemctl status `。 + +### 5、检查监听端口 + +开放的端口可能会带来安全风险,所以检查服务器上的监听端口很重要。我使用 [netstat][6] 命令来显示所有的网络连接: + +``` +netstat -tulpn +``` + +查看 “address” 列,确定 [端口号][7]。一旦你找到了开放的端口,检查它们是否都是必要的。如果不是,[调整你正在运行的服务][8],或者调整你的防火墙设置。 + +### 6、扫描恶意软件 + +杀毒扫描软件可以有用的防止病毒进入你的系统。使用它们是一种简单的方法,可以让你的服务器免受恶意软件的侵害。我首选的工具是开源软件 [ClamAV][9]。 + +安装 ClamAV: + +``` +sudo apt-get install clamav +``` + +更新病毒签名: + +``` +sudo freshclam +``` + +扫描所有文件,并打印出被感染的文件,发现一个就会响铃: + +``` +sudo clamscan -r --bell -i / +``` + +你可以而且应该设置为自动扫描,这样你就不必记住或花时间手动进行扫描。对于这样简单的自动化,你可以使用 [systemd 定时器][10] 或者你的 [喜欢的 cron][11] 来做到。 + +### 保证你的服务器安全 + +我们不能把保护服务器安全的责任只交给一个人或一个组织。随着威胁环境的不断迅速扩大,我们每个人都应该意识到服务器安全的重要性,并采用一些简单、有效的安全最佳实践。 + +这些只是你提升 Linux 服务器的安全可以采取的众多步骤中的一部分。当然,预防只是解决方案的一部分。这些策略应该与严格监控拒绝服务攻击、用 [Lynis][12] 做系统分析以及创建频繁的备份相结合。 + +你使用哪些开源工具来保证服务器的安全?在评论中告诉我们它们的情况。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/securing-linux-servers + +作者:[Sahana Sreeram][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sahanasreeram01gmailcom +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[3]: https://opensource.com/article/20/2/firewall-cheat-sheet +[4]: https://wiki.ubuntu.com/UncomplicatedFirewall +[5]: http://www.yorku.ca/infosec/Administrators/UNIX_disable.html +[6]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/netstat +[7]: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers +[8]: https://opensource.com/article/20/5/systemd-units +[9]: https://www.clamav.net/ +[10]: https://opensource.com/article/20/7/systemd-timers +[11]: https://opensource.com/article/21/2/linux-automation +[12]: https://opensource.com/article/20/5/linux-security-lynis From 0de350723974ae3743c4a9413e18c43b2af07beb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:02:30 +0800 Subject: [PATCH 120/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414=20?= =?UTF-8?q?Fedora=20Workstation=2034=20feature=20focus:=20Btrfs=20transpar?= =?UTF-8?q?ent=20compression?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md --- ...re focus- Btrfs transparent compression.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md diff --git a/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md b/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md new file mode 100644 index 0000000000..530feb0a03 --- /dev/null +++ b/sources/tech/20210414 Fedora Workstation 34 feature focus- Btrfs transparent compression.md @@ -0,0 +1,145 @@ +[#]: subject: (Fedora Workstation 34 feature focus: Btrfs transparent compression) +[#]: via: (https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/) +[#]: author: (nickavem https://fedoramagazine.org/author/nickavem/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Workstation 34 feature focus: Btrfs transparent compression +====== + +![][1] + +Photo by [Patrick Lindenberg][2] on [Unsplash][3] + +The release of Fedora 34 grows ever closer, and with that, some fun new features! A [previous feature focus][4] talked about some changes coming to GNOME version 40. This article is going to go a little further under the hood and talk about data compression and _transparent compression_ in _btrfs_. A term like that may sound scary at first, but less technical users need not be wary. This change is simple to grasp, and will help many Workstation users in several key areas. + +### What is transparent compression exactly? + +Transparent compression is complex, but at its core it is simple to understand: it makes files take up less space. It is somewhat like a compressed tar file or ZIP file. Transparent compression will dynamically optimize your file system’s bits and bytes into a smaller, reversible format. This has many benefits that will be discussed in more depth later on, however, at its core, it makes files smaller. This may leave most computer users with a question: “I can’t just read ZIP files. You need to decompress them. Am I going to need to constantly decompress things when I access them?”. That is where the “transparent” part of this whole concept comes in. + +Transparent compression makes a file smaller, but the final version is indistinguishable from the original by the human viewer. If you have ever worked with Audio, Video, or Photography you have probably heard of the terms “lossless” and “lossy”. Think of transparent compression like a lossless compressed PNG file. You want the image to look exactly like the original. Small enough to be streamed over the web but still readable by a human. Transparent compression works similarly. Your file system will look and behave the same way as before (no ZIP files everywhere, no major speed reductions). Everything will look, feel, and behave the same. However, in the background it is taking up much less disk space. This is because BTRFS will dynamically compress and decompress your files for you. It’s “Transparent” because even with all this going on, you won’t notice the difference. + +> You can learn more about transparent compression at + +### Transparent compression sounds cool, but also too good to be true… + +I would be lying if I said transparent compression doesn’t slow some things down. It adds extra CPU cycles to pretty much any I/O operation, and can affect performance in certain scenarios. However, Fedora is using the extremely efficient _zstd:1_ algorithm. [Several tests][5] show that relative to the other benefits, the downsides are negligible (as I mentioned in my explanation before). Better disk space usage is the greatest benefit. You may also receive reduction of write amplification (can increase the lifespan of SSDs), and enhanced read/write performance. + +Btrfs transparent compression is extremely performant, and chances are you won’t even notice a difference when it’s there. + +### I’m convinced! How do I get this working? + +In fresh **installations of Fedora 34 and its [corresponding beta][6], it should be enabled by default. However, it is also straightforward to enable before and after an upgrade from Fedora 33. You can even enable it in Fedora 33, if you aren’t ready to upgrade just yet. + + 1. (Optional) Backup any important data. The process itself is completely safe, but human error isn’t. + 2. To truly begin you will be editing your _[fstab][7]_. This file tells your computer what file systems exist where, and how they should be handled. You need to be cautious here, but only a few small changes will be made so don’t be intimidated. On an installation of Fedora 33 with the default Btrfs layout the _/etc/fstab_ file will probably look something like this: + + +``` + +``` + +<strong>$ $EDITOR /etc/fstab</strong> +UUID=1234 /                       btrfs   subvol=root     0 0 +UUID=1234 /boot                   ext4    defaults        1 2 +UUID=1234         /boot/efi               vfat    umask=0077,shortname=winnt 0 2 +UUID=1234 /home                   btrfs   subvol=home     0 0 +``` + +``` + +NOTE: _While this guide builds around the standard partition layout, you may be an advanced enough user to partition things yourself. If so, you are probably also advanced enough to extrapolate the info given here onto your existing system. However, comments on this article are always open for any questions._ + +Disregard the _/boot_ and _/boot/efi_ directories as they aren’t ([currently][8]) compressed. You will be adding the argument _compress=zstd:1_. This tells the computer that it should transparently compress any newly written files if they benefit from it. Add this option in the fourth column, which currently only contains the _subvol_ option for both /home and /: +``` + +``` + +UUID=1234 /                       btrfs   subvol=root,compress=zstd:1     0 0 +UUID=1234 /boot                   ext4    defaults        1 2 +UUID=1234         /boot/efi               vfat    umask=0077,shortname=winnt 0 2 +UUID=1234 /home                   btrfs   subvol=home,compress=zstd:1     0 0 +``` + +``` + +Once complete, simply save and exit (on the default _nano_ editor this is CTRL-X, SHIFT-Y, then ENTER). + +3\. Now that fstab has been edited, tell the computer to read it again. After this, it will make all the changes required: + +``` +$ sudo mount -o remount / /home/ +``` + +Once you’ve done this, you officially have transparent compression enabled for all newly written files! + +### Recommended: Retroactively compress old files + +Chances are you already have many files on your computer. While the previous configuration _will_ compress all newly written files, those old files will not benefit. I recommend taking this next (but optional) step to receive the full benefits of transparent compression. + + 1. (Optional) Clean out any data you don’t need (empty trash etc.). This will speed things up. However, it’s not required. + 2. Time to compress your data. One simple command can do this, but its form is dependent on your system. Fedora Workstation (and any other desktop spins using the DNF package manager) should use: + + + +``` +$ sudo btrfs filesystem defrag -czstd -rv / /home/ +``` + +Fedora Silverblue users should use: + +``` +$ sudo btrfs filesystem defrag -czstd -rv / /var/home/ +``` + +Silverblue users may take note of the immutability of some parts of the file system as described [here][9] as well as this [Bugzilla entry][10]. + +NOTE: _You may receive several warnings that say something like “Cannot compress permission denied.”. This is because some files, on Silverblue systems especially, the user cannot easily modify. This is a tiny subset of files. They will most likely compress on their own, in time, as the system upgrades._ + +Compression can take anywhere from a few minutes to an hour depending on how much data you have. Luckily, since all new writes are compressed, you can continue working while this process completes. Just remember it may partially slow down your work at hand and/or the process itself depending on your hardware. + +Once this command completes you are officially fully compressed! + +### How much file space is used, how big are my files + +Due to the nature of transparent compression, utilities like _du_ will only report exact, uncompressed, files space usage. This is not the actual space they take up on the disk. The [_compsize_][11] utility is the best way to see how much space your files are actually taking up on disk. An example of a _compsize_ command is: + +``` +$ sudo compsize -x / /home/ +``` + +This example provides exact information on how the two locations, / and /home/ are currently, transparently, compressed. If not installed, this utility is available in the Fedora Linux repository. + +### Conclusion: + +Transparent compression is a small but powerful change. It should benefit everyone from developers to sysadmin, from writers to artists, from hobbyists to gamers. It is one among many of the changes in Fedora 34. These changes will allow us to take further advantage of our hardware, and of the powerful Fedora Linux operating system. I have only just touched the surface here. I encourage those of you with interest to begin at the [Fedora Project Wiki][12] and [Btrfs Wiki][13] to learn more! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ + +作者:[nickavem][a] +选题:[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/nickavem/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/btrfs_compression-1-816x345.jpg +[2]: https://unsplash.com/@heapdump?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/hdd-compare?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ +[5]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression#Simple_Analysis_of_btrfs_zstd_compression_level +[6]: https://fedoramagazine.org/announcing-fedora-34-beta/ +[7]: https://en.wikipedia.org/wiki/Fstab +[8]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression#Q:_Will_.2Fboot_be_compressed.3F +[9]: https://docs.fedoraproject.org/en-US/fedora-silverblue/technical-information/#filesystem-layout +[10]: https://bugzilla.redhat.com/show_bug.cgi?id=1943850 +[11]: https://github.com/kilobyte/compsize +[12]: https://fedoraproject.org/wiki/Changes/BtrfsTransparentCompression +[13]: https://btrfs.wiki.kernel.org/index.php/Compression From 5e00c99042e1ce07a17eb16ebc3f6b894f81b3f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:02:58 +0800 Subject: [PATCH 121/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414=20?= =?UTF-8?q?Using=20Web=20Assembly=20Written=20in=20Rust=20on=20the=20Serve?= =?UTF-8?q?r-Side?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md --- ...mbly Written in Rust on the Server-Side.md | 306 ++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md diff --git a/sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md b/sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md new file mode 100644 index 0000000000..d610f17791 --- /dev/null +++ b/sources/tech/20210414 Using Web Assembly Written in Rust on the Server-Side.md @@ -0,0 +1,306 @@ +[#]: subject: (Using Web Assembly Written in Rust on the Server-Side) +[#]: via: (https://www.linux.com/news/using-web-assembly-written-in-rust-on-the-server-side/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/using-web-assembly-written-in-rust-on-the-server-side/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Using Web Assembly Written in Rust on the Server-Side +====== + +_By Bob Reselman_ + +_This article was originally published at [TheNewStac][1]k_ + +WebAssembly allows you to write code in a low-level programming language such as Rust, that gets compiled into a transportable binary. That binary can then be run on the client-side in the WebAssembly virtual machine that is [standard in today’s web browsers][2]. Or, the binary can be used on the server-side, as a component consumed by another programming framework — such as Node.js or [Deno][3]. + +WebAssembly combines the efficiency inherent in low-level code programming with the ease of component transportability typically found in Linux containers. The result is a development paradigm specifically geared toward doing computationally intensive work at scale — for example, artificial intelligence and complex machine learning tasks. + +As Solomon Hykes, the creator of Docker, [tweeted][4] on March 27, 2019: “If WASM+WASI existed in 2008, we wouldn’t have needed to have created Docker. That’s how important it is. WebAssembly on the server is the future of computing.” + +WebAssembly is a compelling approach to software development. However, in order to get a true appreciation for the technology, you need to see it in action. + +In this article, I am going to show you how to program a WebAssembly binary in Rust and use it in a TypeScript-powered web server running under Deno. I’ll show you how to install Rust and prep the runtime environment. We’ll compile the source code into a Rust binary. Then, once the binary is created, I’ll demonstrate how to run it on the server-side under [Deno][3]. Deno is a TypeScript-based programming framework that was started by Ryan Dahl, the creator of Node.js. + +### Understanding the Demonstration Project + +The demonstration project that accompanies this article is called Wise Sayings. The project stores a collection of “wise sayings” in a text file named wisesayings.txt. Each line in the text file is a wise saying, for example, “_A friend in need is a friend indeed._” + +The Rust code publishes a single function, get_wise_saying(). That function gets a random line from the text file, wisesayings.txt, and returns the random line to the caller. (See Figure 1, below) + + + +Figure 1: The demonstration project compiles data in a text file directly into the WebAssembly binary + +Both the code and text file are compiled into a single WebAssembly binary file, named wisesayings.wasm. Then another layer of processing is performed to make the WebAssembly binary consumable by the Deno web server code. The Deno code calls the function get_wise_sayings() in the WebAssembly binary, to produce a random wise saying. (See Figure 2.) + + + +Figure 2: WebAssembly binaries can be consumed by a server-side programming framework such as Deno. + +_You get the source code for the Wise Sayings demonstration project used in this article [on GitHub][5]. All the steps described in this article are listed on the repository’s main [Readme][6] document._ + +### Prepping the Development Environment + +The first thing we need to do to get the code up and running is to make sure that Rust is installed in the development environment. The following steps describe the process. + +**Step 1: **Make sure Rust is installed on your machine by typing: + +1 | rustc —version +---|--- + +You’ll get output similar to the following: + +1 | rustc 1.50.0 (cb75ad5db 2021–02–10) +---|--- + +If the call to rustc –version fails, you don’t have Rust installed. Follow the instructions below and** make sure you do all the tasks presented by the given installation method**. + +To install Rust, go here and install on Linux/MAC: … + +1 | curl —proto ‘=https’ —tlsv1.2 –sSf +---|--- + +… or here to install it on Windows: + +Download and run rustup-init.exe which you can find at this URL: . + +**Step 2:** Modify your system’s PATH + +1 | export PATH=“$HOME/.cargo/bin:$PATH” +---|--- + +**Step 3: **If you’re working in a Linux environment do the following steps to install the required additional Linux components. + +1 2 3 4 5 | sudo apt–get update –y sudo apt–get install –y libssl–dev apt install pkg–config +---|--- + +***Developer’s Note: *_The optimal development environment in which to run this code is one that uses the Linux operating system._ + +**Step 4: **Get the CLI tool that you’ll use for generating the TypeScript/JavaScript adapter files. These adapter files (a.k.a. shims) do the work of exposing the function get_wise_saying() in the WebAssembly binary to the Deno web server that will be hosting the binary. Execute the following command at the command line to install the tool, [wasm-bindgen-cli][7]. + +1 | cargo install wasm–bindgen–cli +---|--- + +The development environment now has Rust installed, along with the necessary ancillary libraries. Now we need to get the Wise Saying source code. + +### Working with the Project Files + +The Wise Saying source code is hosted in a GitHub repository. Take the following steps to clone the source code from GitHub onto the local development environment. + +**Step 1: **Execute the following command to clone the Wise Sayings source code from GitHub + +1 | git clone +---|--- + +**Step 2: **Go to the working directory + +1 | cd wisesayingswasm/ +---|--- + +Listing 1, below lists the files that make up the source code cloned from the GitHub repository. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 | . ├── Cargo.toml ├── cheatsheet.txt ├── LICENSE ├── lldbconfig ├── package–lock.json ├── README.md ├── server │   ├── main.ts │   └── package–lock.json └── src     ├── fortunes.txt     ├── lib.rs     └── main.rs +---|--- + +_Listing 1: The files for the source code for the Wise Sayings demonstration project hosted in the GitHub repository_ + +Let’s take a moment to describe the source code files listed above in Listing 1. The particular files of interest with regard to creating the WebAssembly binary are the files in the directory named, src at Line 11 and the file, Cargo.toml at Line 2. + +Let’s discuss Cargo.toml first. The content of Cargo.toml is shown in Listing 2, below. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [package] name = “wise-sayings-wasm” version = “0.1.0” authors = [“Bob Reselman <bob@CogArtTech.com>”] edition = “2018” [dependencies] rand = “0.8.3” getrandom = { version = “0.2”, features = [“js”] } wasm–bindgen = “0.2.70” [lib] name = “wisesayings” crate–type =[“cdylib”, “lib”] +---|--- + +_Listing 2: The content of Cargo.toml for the demonstration project Wise Sayings_ + +Cargo.toml is the [manifest file][8] that describes various aspects of the Rust project under development. The Cargo.toml file for the Wise Saying project is organized into three sections: package, dependencies, and lib. The section names are defined in the Cargo manifest specification, which you read [here][8]. + +#### Understanding the Package Section of Cargo.toml + +The package section indicates the name of the package (wise-sayings-wasm), the developer assigned version (0.1.0), the authors (Bob Reselman <[bob@CogArtTech.com][9]>) and the edition of Rust (2018) that is used to program the binary. + +#### Understanding the Dependencies Section of Cargo.toml + +The dependencies section lists the dependencies that the WebAssembly project needs to do its work. As you can see in Listing 2, above at Line 8, the Cargo.toml lists the rand library as a dependency. The rand library provides the capability to generate a random number which is used to get a random line of wise saying text from the file, wisesayings.txt. + +The reference to getrandom at Line 9 in Listing 2 above indicates that the WebAssembly binary’s [getrandom][10] is running under Javascript and that the [JavaScript interface should be used][11]. This condition is very particular to running a WebAssembly binary under JavaScript. The long and short of it is that if the line getrandom = { version = “0.2”, features = [“js”] } is not included in the Cargo.toml, the WebAssembly binary will not be able to create a random number. + +The entry at Line 10 declares the [wasm-bindgen][12] library as a dependency. The wasm-bindgen library provides the capability for wasm modules to talk to JavaScript and JavaScript to talk to wasm modules. + +#### Understanding the Lib Section of Cargo.toml + +The entry [crate-type =[“cdylib”, “lib”]][13] at Line 14 in the lib section of the Cargo.toml file tells the Rust compiler to create a wasm binary without a start function. Typically when cdylib is indicated, the compiler will create a [dynamic library][14] with the extension .dll in Windows, .so in Linux, or .dylib in MacOS. In this case, because the deployment unit is a WebAssembly binary, the compiler will create a file with the extension .wasm. The name of the wasm file will be wisesayings.wasm, as indicated at Line 13 above in Listing 2. + +The important thing to understand about Cargo.toml is that it provides both the design and runtime information needed to get your Rust code up and running. If the Cargo.toml file is not present, the Rust compiler doesn’t know what to do and the build will fail. + +### Understanding the Core Function, get_wise_saying() + +The actual work of getting a random line that contains a Wise Saying from the text file wisesayings.txt is done by the function get_wise_saying(). The code for get_wise_sayings() is in the Rust library file, ./src/lib.rs. The Rust code is shown below in Listing 3. + +1 2 3 4 5 6 7 8 9 10 11 12 13 | use rand::seq::IteratorRandom; use wasm_bindgen::prelude::*; #[wasm_bindgen] pub fn get_wise_saying() -> String {     let str = include_str!(“fortunes.txt”);     let mut lines = str.lines();     let line = lines         .choose(&mut rand::thread_rng())         .expect(“File had no lines”);     return line.to_string(); } +---|--- + +_Listing 3: The function file, lib.rs contains the function, get_wise_saying()._ + +The important things to know about the source is that it’s tagged at Line 4 with the attribute #[wasm_bindgen], which lets the Rust compiler know that the source code is targeted as a WebAssembly binary. The code publishes one function, get_wise_saying(), at Line 5. The way the wise sayings text file is loaded into memory is to use the [Rust macro][15], [include_str!][16]. This macro does the work of getting the file from disk and loading the data into memory. The macro loads the file as a string and the function str.lines() separates the lines within the string into an array. (Line 7.) + +The rand::thread_rng() call at Line 10 returns a number that is used as an index by the .choose() function at Line 10. The result of it all is an array of characters (a string) that reflects the wise saying returned by the function. + +### Creating the WebAssembly Binary + +Let’s move on compiling the code into a WebAssembly Binary. + +**Step 1: **Compile the source code into a WebAssembly is shown below. + +1 | cargo build —lib —target wasm32–unknown–unknown +---|--- + +WHERE + +**cargo build** is the command and subcommand to invoke the Rust compiler using the settings in the Cargo.toml file. + +**–lib** is the option indicating that you’re going to build a library against the source code in the ./lib directory. + +**–targetwasm32-unknown-unknown** indicates that Rust will use the wasm-unknown-unknown compiler and will store the build artifacts as well as the WebAssembly binary into directories within the target directory, **wasm32-unknown-unknown.** + +#### **Understanding the Rust Target Triple Naming Convention** + +Rust has a naming convention for targets. The term used for the convention is a _target triple_. A target triple uses the following format: ARCH-VENDOR-SYS-ABI. + +**WHERE** + +**ARCH** describes the intended target architecture, for example wasm32 for WebAssembly, or i686 for current-generation Intel chips. + +**VENDOR** describes the vendor publishing the target; for example, Apple or Nvidia. + +**SYS** describes the operating system; for example, Windows or Linux. + +**ABI** describes how the process starts up, for eabi is used for bare metal, while gnu is used for glibc. + +Thus, the name i686-unknown-linux-gnu means that the Rust binary is targeted to an i686 architecture, the vendor is defined as unknown, the targeted operating system is Linux, and ABI is gnu. + +In the case of wasm32-unknown-unknown, the target is WebAssembly, the operating system is unknown and the ABI is unknown. The informal inference of the name is “it’s a WebAssembly binary.” + +There are a standard set of built-in targets defined by Rust that can be found [here][17]. + +If you find the naming convention to be confusing because there are optional fields and sometimes there are four sections to the name, while other times there will be three sections, you are not alone. + +### Deploying the Binary Server-Side Using Deno + +After we build the base WeAssembly binary, we need to create the adapter (a.k.a shim) files and a special version of the WebAssembly binary — all of which can be run from within JavaScript. We’ll create these artifacts using the [wasm-bindgen][18] tool. + +**Step 1: **We create these new artifacts using the command shown below. + +1 | wasm–bindgen —target deno ./target/wasm32–unknown–unknown/debug/wisesayings.wasm —out–dir ./server +---|--- + +WHERE + +**wasm-bindgen** is the command for creating the adapter files and the special WebAssembly binary. + +**–target deno ./target/wasm32-unknown-unknown/debug/wisesayings.wasm** is the option that indicates the adapter files will be targeted for Deno. Also, the option denotes the location of the original WebAssembly wasm binary that is the basis for the artifact generation process. + +**–out-dir ./server** is the option that declares the location where the created adapter files will be stored on disk; in this case, **./server**. + +The result of running wasm-bindgen is the server directory shown in Listing 4 below. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | . ├── Cargo.toml ├── cheatsheet.txt ├── LICENSE ├── lldbconfig ├── package–lock.json ├── README.md ├── server │   ├── main.ts │   ├── package–lock.json │   ├── wisesayings_bg.wasm │   ├── wisesayings_bg.wasm.d.ts │   ├── wisesayings.d.ts │   └── wisesayings.js └── src     ├── fortunes.txt     ├── lib.rs     └── main.rs +---|--- + +_Listing 4: The server directory contains the results of running wasm-bindgen_ + +Notice that the contents of the server directory, shown above in Listing 4, now has some added JavaScript (js) and TypeScript (ts) files. Also, the server directory has the special version of the WebAssembly binary, named wisesayings_bg.wasm. This version of the WebAssembly binary is a stripped-down version of the wasm file originally created by the initial compilation, done when invoking cargo build earlier. You can think of this new wasm file as a JavaScript-friendly version of the original WebAssembly binary. The suffix, _bg, is an abbreviation for bindgen. + +### Running the Deno Server + +Once all the artifacts for running WebAssembly have been generated into the server directory, we’re ready to invoke the Deno web server. Listing 5 below shows content of main.ts, which is the source code for the Deno web server. + +1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | import { serve } from “https://deno.land/std@0.86.0/http/server.ts”; import { get_wise_saying } from “./wisesayings.js”; const env = Deno.env.toObject(); let port = 4040; if(env.WISESAYING_PORT){   port = Number(env.WISESAYING_PORT); }; const server = serve({ hostname: “0.0.0.0”, port}); console.log(`HTTP webserver running at ${new Date()}.  Access it at:  http://localhost:${port}/`); for await (const request of server) {     const saying = get_wise_saying();     request.respond({ status: 200, body: saying });   } +---|--- + +_Listing 5: main.ts is the Deno webserver code that uses the WebAssembly binary_ + +You’ll notice that the WebAssembly wasm binary is not imported directly. This is because the work of representing the WebAssembly binary is done by the JavaScript and TypeScript adapter (a.k.a shim) files generated earlier. The WebAssembly/Rust function, get_wise_sayings(), is exposed in the auto-generated JavaScript file, wisesayings.js. + +The function get_wise_saying is imported into the webserver code at Line 2 above. The function is used at Line 16 to get a wise saying that will be returned as an HTTP response by the webserver. + +To get the Deno web server up and running, execute the following command in a terminal window. + +**Step 1:** + +1 | deno run —allow–read —allow–net —allow–env ./main.ts +---|--- + +WHERE + +deno run is the command set to invoke the webserver. + +–allow-read is the option that allows the Deno webserver code to have permission to read files from disk. + +–allow-net is the option that allows the Deno webserver code to have access to the network. + +–allow-env is the option that allows the Deno webserver code read environment variables. + +./main.ts is the TypeScript file that Deno is to run. In this case, it’s the webserver code. + +When the webserver is up and running, you’ll get output similar to the following: + +HTTP webserver running at Thu Mar 11 2021 17:57:32 GMT+0000 (Coordinated Universal Time). Access it at: + +**Step 2:** + +Run the following command in a terminal on your computer to exercise the Deno/WebAssembly code + +1 | curl localhost:4040 +---|--- + +You’ll get a wise saying, for example: + +_True beauty lies within._ + +**Congratulations!** You’ve created and run a server-side WebAssembly binary. + +### Putting It All Together + +In this article, I’ve shown you everything you need to know to create and use a WebAssembly binary in a Deno web server. Yet for as detailed as the information presented in this article is, there is still a lot more to learn about what’s under the covers. Remember, Rust is a low-level programming language. It’s meant to go right up against the processor and memory directly. That’s where its power really is. The real benefit of WebAssembly is using the technology to do computationally intensive work from within a browser. Applications that are well suited to WebAssembly are visually intensive games and activities that require complex machine learning capabilities — for example, real-time voice recognition and language translation. WebAssembly allows you to do computation on the client-side that previously was only possible on the server-side. As Solomon Hykes said, WebAssembly is the future of computing. He might very well be right. + +The important thing to understand is that WebAssembly provides enormous opportunities for those wanting to explore cutting-edge approaches to modern distributed computing. Hopefully, the information presented in this piece will motivate you to explore those opportunities. + +The post [Using Web Assembly Written in Rust on the Server-Side][19] appeared first on [Linux Foundation – Training][20]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/using-web-assembly-written-in-rust-on-the-server-side/ + +作者:[Dan 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://training.linuxfoundation.org/announcements/using-web-assembly-written-in-rust-on-the-server-side/ +[b]: https://github.com/lujun9972 +[1]: https://thenewstack.io/using-web-assembly-written-in-rust-on-the-server-side/ +[2]: https://www.infoq.com/news/2017/12/webassembly-browser-support/ +[3]: https://deno.land/ +[4]: https://twitter.com/solomonstre/status/1111004913222324225?s=20 +[5]: https://github.com/reselbob/wisesayingswasm +[6]: https://github.com/reselbob/wisesayingswasm/blob/main/README.md +[7]: https://rustwasm.github.io/docs/wasm-bindgen/reference/cli.html +[8]: https://doc.rust-lang.org/cargo/reference/manifest.html +[9]: mailto:bob@CogArtTech.com +[10]: https://docs.rs/getrandom/0.2.2/getrandom/ +[11]: https://docs.rs/getrandom/0.2.2/getrandom/#webassembly-support +[12]: https://rustwasm.github.io/docs/wasm-bindgen/ +[13]: https://rustwasm.github.io/docs/wasm-pack/tutorials/npm-browser-packages/template-deep-dive/cargo-toml.html#1-crate-type +[14]: https://en.wikipedia.org/wiki/Library_(computing)#Shared_libraries +[15]: https://doc.rust-lang.org/book/ch19-06-macros.html +[16]: https://doc.rust-lang.org/std/macro.include_str.html +[17]: https://docs.rust-embedded.org/embedonomicon/compiler-support.html#built-in-target +[18]: https://rustwasm.github.io/wasm-bindgen/ +[19]: https://training.linuxfoundation.org/announcements/using-web-assembly-written-in-rust-on-the-server-side/ +[20]: https://training.linuxfoundation.org/ From ea259bc238988fb250a093663cc1c555896a76a3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:03:39 +0800 Subject: [PATCH 122/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414=20?= =?UTF-8?q?3=20essential=20Linux=20cheat=20sheets=20for=20productivity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 3 essential Linux cheat sheets for productivity.md --- ...ial Linux cheat sheets for productivity.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20210414 3 essential Linux cheat sheets for productivity.md diff --git a/sources/tech/20210414 3 essential Linux cheat sheets for productivity.md b/sources/tech/20210414 3 essential Linux cheat sheets for productivity.md new file mode 100644 index 0000000000..0456fb5d85 --- /dev/null +++ b/sources/tech/20210414 3 essential Linux cheat sheets for productivity.md @@ -0,0 +1,123 @@ +[#]: subject: (3 essential Linux cheat sheets for productivity) +[#]: via: (https://opensource.com/article/21/4/linux-cheat-sheets) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 essential Linux cheat sheets for productivity +====== +Download cheat sheets for sed, grep, and parted to integrate new +processes into your work. +![Hand putting a Linux file folder into a drawer][1] + +Linux is famous for its commands. This is partially because nearly everything that Linux does can also be invoked from a terminal, but it's also that Linux as an operating system is highly modular. Its tools are designed to produce fairly specific results, and when you know a lot about a few commands, you can combine them in interesting ways for useful output. Learning Linux is equal parts learning commands and learning how to string those commands together in interesting combinations. + +With so many Linux commands to learn, though, taking the first step can seem daunting. What command should you learn first? Which commands should you learn well, and which commands require only a passing familiarity? I've thought about these questions a lot, and I'm not convinced there's a universal answer. The "basic" commands are probably the same for anyone: + + * `ls` + * `cd` + * `mv` + + + +These amount to being able to navigate your Linux file system. + +Beyond the basics, though, the "default" commands vary from industry to industry. Sysadmins need tools for [system introspection and monitoring][2]. Artists need tools for [media conversion][3] and [graphic processing][4]. Home users might want tools for [PDF processing][5], or [calendaring][6], or [document conversion][7]. The list goes on and on. + +However, some Linux commands stand out as being particularly important—either because they're common low-level tools that everyone needs on occasion or they're all-purpose tools that anyone might find useful most of the time. + +Here are three to add to your list. + +### Sed + +**Purpose:** The `sed` command is a good, all-purpose tool that any Linux user can benefit from knowing. On the surface, it's just a terminal-based "find and replace." That makes it great for quick and easy corrections across multiple documents. The `sed` command has saved me hours (or possibly cumulative days) of opening individual files, searching and replacing a word, saving the file, and closing the file. It alone justifies my investment in learning the Linux terminal. Once you get to know `sed` well, you're likely to discover a whole world of potential editing tricks that make your life easier. + +**Strength:** The command's strength is in repetition. If you have just one file to edit, it's easy to open it and do a "find and replace" in a traditional [text editor][8]. However, when you're faced with five or 50 files, a good `sed` command (maybe combined with [GNU Parallel][9] for extra speed) can reclaim hours of your day. + +**Weakness:** You have to balance the time you expect to spend making a change with how long it may take you to construct the right `sed` command. Simple edits with the common `sed 's/foo/bar/g` syntax are almost always worth the trivial amount of time it takes to type the command, but complex `sed` commands that utilize a hold space and any of the `ed` style subcommands can take serious concentration combined with several rounds of trial and error. It can be, as it turns out, better to do some edits the new-fashioned way. + +**Cheat:** Download our [sed cheat sheet][10] for quick reference to its single-letter subcommands and an overview of its syntax. + +### Grep + +**Purpose:** The `grep` command comes from its admittedly clunky description: global regular expression print. In other words, `grep` prints to the terminal any matching pattern it finds in files (or other forms of input). That makes it a great search tool, especially adept at scrubbing through vast amounts of text. + +You might use it to find URLs: + + +``` +$ grep --only-matching \ +http\:\/\/.* example.txt +``` + +You could use it to find a specific config option: + + +``` +$ grep --line-number \ +foo= example.ini +2:foo=true +``` + +And of course, you can combine it with other commands: + + +``` +$ grep foo= example.ini | cut -d= -f2 +true +``` + +**Strength:** The `grep` command is a straightforward search command. If you've read the few examples above, then you've essentially learned the command. For even more flexibility, you can use its extended regular expression syntax. + +**Weakness:** The problem with `grep` is also one of its strengths: It's just a search function. Once you've found what you're looking for, you might be faced with the larger question of what to do with it. Sometimes the answer is as easy as redirecting the output to a file, which becomes your filtered list of results. However, more complex use cases mean further processing with any number of commands like [awk][11], [curl][12] (incidentally, [we have a cheat sheet for curl][13], too), or any of the thousands of other options you have on a modern computer. + +**Cheat:** Download our [grep cheat sheet][14] for a quick reference to its many options and regex syntax. + +### Parted + +**Purpose:** GNU `parted` isn't a daily-use command for most people, but it is one of the most powerful tools for hard-drive manipulation. The frustrating thing about hard drives is that you spend years ignoring them until you get a new one and have to set it up for your computer. It's only then that you remember that you have no idea how to best format your drive. That's when familiarity with `parted` can be useful. GNU `parted` can create disk labels and create, back up, and rescue partitions. In addition, it can provide you with lots of information about a drive and its layout and generally prepare a drive for a filesystem. + +**Strength:** The reason I love `parted` over `fdisk` and similar tools is for its combination of an easy interactive mode and its fully noninteractive option. Regardless of how you choose to use `parted`, its commands follow a consistent syntax, and its help menus are well-written and informative. Better still, the command itself is _smart_. When partitioning a drive, you can specify sizes in anything from sectors to percentages, and `parted` does its best to figure out the finer points of partition table placement. + +**Weakness:** It took me a long while to learn GNU `parted` after switching to Linux because, for a very long time, I didn't have a good understanding of how drives actually work. GNU `parted` and most terminal-based drive utilities assume you know what a partition is, that drives have sectors and need disk labels and partition tables that initially lack filesystems, and so on. There's a steep learning curve—not to the command so much as to the foundations of hard-drive technology, and GNU `parted` doesn't do much to bridge the potential gap. It's arguably not the command's job to step you through the process because there are [graphical applications][15] for that, but a workflow-focused option for GNU `parted` could be an interesting addition to the utility. + +**Cheat:** Download our [parted cheat sheet][16] for a quick reference to its many subcommands and options. + +### Learn more + +These are some of my favorite commands, but the list is naturally biased to how I use my computer. I do a lot of shell scripting, so I make heavy use of `grep` to find configuration options, I use `sed` for text editing, and I use `parted` because when I'm working on multimedia projects, there are usually a lot of hard drives involved. You either already have, or you'll soon develop, your own workflows with your own favorite (or at least _frequent_) commands. + +When I'm integrating new processes into my daily work, I create or download a cheat sheet (like the ones linked above), and then I practice. We all learn in our own way, though, so find what works best for you, and learn a new essential command. The more you learn about your most frequent commands, the more you can make them work harder for you. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-cheat-sheets + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[3]: https://opensource.com/article/17/6/ffmpeg-convert-media-file-formats +[4]: https://opensource.com/article/17/8/imagemagick +[5]: https://opensource.com/article/20/8/reduce-pdf +[6]: https://opensource.com/article/19/4/calendar-git +[7]: https://opensource.com/article/20/5/pandoc-cheat-sheet +[8]: https://opensource.com/article/21/2/open-source-text-editors +[9]: https://opensource.com/article/18/5/gnu-parallel +[10]: https://opensource.com/downloads/sed-cheat-sheet +[11]: https://opensource.com/article/20/9/awk-ebook +[12]: https://www.redhat.com/sysadmin/social-media-curl +[13]: https://opensource.com/article/20/5/curl-cheat-sheet +[14]: https://opensource.com/downloads/grep-cheat-sheet +[15]: https://opensource.com/article/18/11/partition-format-drive-linux#gui +[16]: https://opensource.com/downloads/parted-cheat-sheet From 6fef5a627762f57cb69cdcbadfa7f9eb3cfe720c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 05:04:03 +0800 Subject: [PATCH 123/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414=20?= =?UTF-8?q?Make=20your=20data=20boss-friendly=20with=20this=20open=20sourc?= =?UTF-8?q?e=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 Make your data boss-friendly with this open source tool.md --- ...oss-friendly with this open source tool.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210414 Make your data boss-friendly with this open source tool.md diff --git a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md new file mode 100644 index 0000000000..53062a7785 --- /dev/null +++ b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md @@ -0,0 +1,114 @@ +[#]: subject: (Make your data boss-friendly with this open source tool) +[#]: via: (https://opensource.com/article/21/4/visualize-data-eda) +[#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Make your data boss-friendly with this open source tool +====== +Enterprise Data Analytics aims to bring data visualization to everyday +business users. +![metrics and data shown on a computer screen][1] + +Enterprise Data Analytics ([EDA][2]) is a web application that enables access to information through a simple, clear interface. + +After several years of working for Barcelona open source analytics company [Jortilles][3], we realized that the modern world collects data compulsively but there was no easy way for average people to see or interpret that data. There are some powerful open source tools for this purpose, but they are very complex. We couldn't identify a tool designed to be easy to use by common people with little technical skill. + +We developed EDA because we consider access to information to be a requirement and obligation for modern organizations and wanted to provide everyone with access to information. + +![EDA interface][4] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +### Visualize your data + +EDA offers a data model using business terms that people already understand. You choose the information you want, and you can view it how you want. It aims to be user friendly and still powerful. + +EDA visualizes and enriches the information in a database through a metadata model. It can read data from BigQuery, Postgres, [MariaDB, MySQL][6], and several other databases. This transforms the technical database model into familiar business concepts. + +It is also designed to speed up information propagation because it taps into the data already stored in a database. EDA discovers the database's topology and proposes a business model. If you've designed a good database model, you have a good business model. EDA can also connect to production servers to provide real-time analysis. + +This combination of data and a data model mean you and anyone in your organization can analyze its data. However, to protect the data, you can define data security, down to the row, to grant access to the right data to the right people. + +Some of EDA's features include: + + * Automatic data-model generation + * A consistent data model that prevents inconsistent queries + * SQL mode for advanced users + * Data visualizations: + * Standard charts (e.g., bar charts, pie charts, line charts, treemaps) + * Map integration (e.g., geoJSON shapefiles, latitude, longitude) + * Email alerts, which can be defined though key performance indicators (KPIs) + * Private and public information controls to enable private and public dashboards, which you can share with a link + * Data caches and programatic refreshes + + + +### How to use EDA + +The first step in visualizing data with EDA is to create a data model. + +#### Create a data model + +First, select **New Datasource** in the left-hand menu. + +Next, choose the database system where your data is stored (e.g., Postgres, MariaDB, MySQL, Vertica, SqlServer, Oracle, Big Query) and provide the connection parameters. + +EDA will automatically generate the data model for you. It reads tables and columns and defines names for them as well as the relationships between tables. You can also enrich your data model by adding virtual views or geoJSON maps. + +#### Make a dashboard + +Now you are ready to make your first dashboard. On the main page of EDA's interface, you should see a **New dashboard** button. Click it, name your dashboard, and select the data model you created. A new dashboard will appear with a panel for you to configure. + +To configure a panel, click the **Configuration** button in the top-right corner and choose what you want to do. In **Edit query**, select the data you want to show. A new window will appear with your data model represented by entities and attributes for the entities. Choose the entity you want to see and the attributes you want to use. For example, for an entity named **Customers** you might show **Customer Name**, and for a **Sales** entity, you might want to show **Total Sales**. + +Next, run a query, and choose the visualization you want. + +![EDA interface][7] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +You can add as many panels, filters, and text fields as you want, all with explanations. Once you save your dashboard, you can view it, share it with colleagues, and even publish it to the internet. + +### Getting EDA + +The quickest way to take a look at EDA is with the [public demo][8]. But if you want to give it a try on your own, you can get the latest EDA release with Docker: + + +``` +`$ docker run -p 80:80 jortilles / eda: latest` +``` + +We also have a cloud software-as-a-service option for anyone who wants to use EDA without having to do setup, configuration, and ongoing updates. You can review the [cloud options][9] on our website. + +If you want to see it in action, you can watch some [demonstrations][10] on YouTube. + +EDA is in continuous development, and you can find its [source code on GitHub][11]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/visualize-data-eda + +作者:[Juanjo Ortilles][a] +选题:[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/jortilles +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://eda.jortilles.com/en/jortilles-english/ +[3]: https://www.jortilles.com/ +[4]: https://opensource.com/sites/default/files/uploads/eda-display.jpeg (EDA interface) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/20/10/mariadb-mysql-cheat-sheet +[7]: https://opensource.com/sites/default/files/uploads/eda-chart.jpeg (EDA interface) +[8]: https://demoeda.jortilles.com/ +[9]: https://eda.jortilles.com +[10]: https://youtu.be/cBAAJbohHXQ +[11]: https://github.com/jortilles/EDA From a06d44fe3f778d0e28a2dd5b25c6740d6ed06862 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 15 Apr 2021 08:28:30 +0800 Subject: [PATCH 124/307] PUB:20210412 6 open source tools and tips to securing a linux server for beginners (#21603) @wxy https://linux.cn/article-13298-1.html --- ...nd tips to securing a Linux server for beginners.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20210412 6 open source tools and tips to securing a Linux server for beginners.md (92%) diff --git a/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md b/published/20210412 6 open source tools and tips to securing a Linux server for beginners.md similarity index 92% rename from translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md rename to published/20210412 6 open source tools and tips to securing a Linux server for beginners.md index 019fcd2979..ebc367d9ff 100644 --- a/translated/tech/20210412 6 open source tools and tips to securing a Linux server for beginners.md +++ b/published/20210412 6 open source tools and tips to securing a Linux server for beginners.md @@ -4,17 +4,17 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13298-1.html) -6 个提升 Linux 服务器的安全开源工具和技巧 +6 个提升 Linux 服务器安全的开源工具和技巧 ====== > 使用开源工具来保护你的 Linux 环境不被入侵。 -![人们在带设备的计算机服务器上工作][1] +![](https://img.linux.net.cn/data/attachment/album/202104/15/082334ltqtgg40tu7l80rd.jpg) -由于如今我们的许多个人和专业数据都可以在网上获得,因此无论是专业人士还是普通互联网用户,学习安全和隐私的基本知识是非常重要的。作为一名学生,我通过学校的 CyberPatriot 活动获得了这方面的经验,在那里我有机会与行业专家交流,了解网络漏洞和建立系统安全的基本步骤。 +如今我们的许多个人和专业数据都可以在网上获得,因此无论是专业人士还是普通互联网用户,学习安全和隐私的基本知识是非常重要的。作为一名学生,我通过学校的 CyberPatriot 活动获得了这方面的经验,在那里我有机会与行业专家交流,了解网络漏洞和建立系统安全的基本步骤。 本文基于我作为初学者迄今所学的知识,详细介绍了六个简单的步骤,以提高个人使用的 Linux 环境的安全性。在我的整个旅程中,我利用开源工具来加速我的学习过程,并熟悉了与提升 Linux 服务器安全有关的更高层次的概念。 From fc381c9c1d3c255e1892cc3125f7456008a7da89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 15 Apr 2021 08:29:55 +0800 Subject: [PATCH 125/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210414=20?= =?UTF-8?q?4=20tips=20for=20context=20switching=20in=20Git=20(#21601)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210414 4 tips for context switching in Git.md --- ...414 4 tips for context switching in Git.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/20210414 4 tips for context switching in Git.md diff --git a/sources/tech/20210414 4 tips for context switching in Git.md b/sources/tech/20210414 4 tips for context switching in Git.md new file mode 100644 index 0000000000..9ee57414ec --- /dev/null +++ b/sources/tech/20210414 4 tips for context switching in Git.md @@ -0,0 +1,188 @@ +[#]: subject: (4 tips for context switching in Git) +[#]: via: (https://opensource.com/article/21/4/context-switching-git) +[#]: author: (Olaf Alders https://opensource.com/users/oalders) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 tips for context switching in Git +====== +Compare the pros and cons of four options to switch branches while +working in Git. +![Computer screen with files or windows open][1] + +Anyone who spends a lot of time working with Git will eventually need to do some form of context switching. Sometimes this adds very little overhead to your workflow, but other times, it can be a real pain. + +Let's discuss the pros and cons of some common strategies for dealing with context switching using this example problem: + +> Imagine you are working in a branch called `feature-X`. You have just discovered you need to solve an unrelated problem. This cannot be done in `feature-X`. You will need to do this work in a new branch, `feature-Y`. + +### Solution #1: stash + branch + +Probably the most common workflow to tackle this issue looks something like this: + + 1. Halt work on the branch `feature-X` + 2. `git stash` + 3. `git checkout -b feature-Y origin/main` + 4. Hack, hack, hack… + 5. `git checkout feature-X` or `git switch -` + 6. `git stash pop` + 7. Resume work on `feature-X` + + + +**Pros:** The nice thing about this approach is that this is a fairly easy workflow for simple changes. It can work quite well, especially for small repositories. + +**Cons:** When using this workflow, you can have only one workspace at a time. Also, depending on the state of your repository, working with the stash can be non-trivial. + +### Solution #2: WIP commit + branch + +A variation on this solution looks quite similar, but it uses a WIP (Work in Progress) commit rather than the stash. When you're ready to switch back, rather than popping the stash, `git reset HEAD~1` unrolls your WIP commit, and you're free to continue, much as you did in the earlier scenario but without touching the stash. + + 1. Halt work on the branch `feature-X` + 2. `git add -u` (adds only modified and deleted files) + 3. `git commit -m "WIP"` + 4. `git checkout -b feature-Y origin/master` + 5. Hack, hack, hack… + 6. `git checkout feature-X` or `git switch -` + 7. `git reset HEAD~1` + + + +**Pros:** This is an easy workflow for simple changes and also good for small repositories. You don't have to work with the stash. + +**Cons:** You can have only one workspace at any time. Also, WIP commits can sneak into your final product if you or your code reviewer are not vigilant. + +When using this workflow, you _never_ want to add a `--hard` to `git reset`. If you do this accidentally, you should be able to restore your commit using `git reflog`, but it's less heartstopping to avoid this scenario entirely. + +### Solution #3: new repository clone + +In this solution, rather than creating a new branch, you make a new clone of the repository for each new feature branch. + +**Pros:** You can work in multiple workspaces simultaneously. You don't need `git stash` or even WIP commits. + +**Cons:** Depending on the size of your repository, this can use a lot of disk space. (Shallow clones can help with this scenario, but they may not always be a good fit.) Additionally, your repository clones will be agnostic about each other. Since they can't track each other, you must track where your clones live. If you need git hooks, you will need to set them up for each new clone. + +### Solution #4: git worktree + +To use this solution, you may need to learn about `git add worktree`. Don't feel bad if you're not familiar with worktrees in Git. Many people get by for years in blissful ignorance of this concept. + +#### What is a worktree? + +Think of a worktree as the files in the repository that belong to a project. Essentially, it's a kind of workspace. You may not realize that you're already using worktrees. When using Git, you get your first worktree for free. + + +``` +$ mkdir /tmp/foo && cd /tmp/foo +$ git init +$ git worktree list +/tmp  0000000 [master] +``` + +As you can see, the worktree exists even before the first commit. Now, add a new worktree to an existing project. + +#### Add a worktree + +To add a new worktree, you need to provide: + + 1. A location on disk + 2. A branch name + 3. Something to branch from + + + + +``` +$ git clone +$ cd http-browserdetect/ +$ git worktree list +/Users/olaf/http-browserdetect  90772ae [master] + +$ git worktree add ~/trees/oalders/feature-X -b oalders/feature-X origin/master +$ git worktree add ~/trees/oalders/feature-Y -b oalders/feature-Y e9df3c555e96b3f1 + +$ git worktree list +/Users/olaf/http-browserdetect       90772ae [master] +/Users/olaf/trees/oalders/feature-X  90772ae [oalders/feature-X] +/Users/olaf/trees/oalders/feature-Y  e9df3c5 [oalders/feature-Y] +``` + +Like with most other Git commands, you need to be inside a repository when issuing this command. Once the worktrees are created, you have isolated work environments. The Git repository tracks where the worktrees live on disk. If Git hooks are already set up in the parent repository, they will also be available in the worktrees. + +Don't overlook that each worktree uses only a fraction of the parent repository's disk space. In this case, the worktree requires about one-third of the original's disk space. This can scale very well. Once your repositories are measured in the gigabytes, you'll really come to appreciate these savings. + + +``` +$ du -sh /Users/olaf/http-browserdetect +2.9M + +$ du -sh /Users/olaf/trees/oalders/feature-X +1.0M +``` + +**Pros:** You can work in multiple workspaces simultaneously. You don't need the stash. Git tracks all of your worktrees. You don't need to set up Git hooks. This is also faster than `git clone` and can save on network traffic since you can do this in airplane mode. You also get more efficient disk space use without needing to resort to a shallow clone. + +**Cons:** This is yet another thing to remember. However, if you can get into the habit of using this feature, it can reward you handsomely. + +### A few more tips + +When you need to clean up your worktrees, you have a couple of options. The preferable way is to let Git remove the worktree: + + +``` +`git worktree remove /Users/olaf/trees/oalders/feature-X` +``` + +If you prefer a scorched-earth approach, `rm -rf` is also your friend: + + +``` +`rm -rf /Users/olaf/trees/oalders/feature-X` +``` + +However, if you do this, you may want to clean up any remaining files with `git worktree prune`. Or you can skip the `prune` now, and this will happen on its own at some point in the future via `git gc`. + +### Notable notes + +If you're ready to get started with `git worktree`, here are a few things to keep in mind. + + * Removing a worktree does not delete the branch. + * You can switch branches within a worktree. + * You cannot simultaneously check out the same branch in multiple worktrees. + * Like many other Git commands, `git worktree` needs to be run from inside a repository. + * You can have many worktrees at once. + * Create your worktrees from the same local checkout, or they will be agnostic about each other. + + + +### git rev-parse + +One final note: When using `git worktree`, your concept of where the root of the repository lives may depend on context. Fortunately, `git rev-parse` allows you to distinguish between the two. + + * To find the parent repository's root: [code]`git rev-parse --git-common-dir` +``` +* To find the root of the repository you're in: [code]`git rev-parse --show-toplevel` +``` + + + +### Choose the best method for your needs + +As in many things, TIMTOWDI (there's more than one way to do it). What's important is that you find a workflow that suits your needs. What your needs are may vary depending on the problem at hand. Maybe you'll occasionally find yourself reaching for `git worktree` as a handy tool in your revision-control toolbelt. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/context-switching-git + +作者:[Olaf Alders][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/oalders +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) From 8733b823521f39fff03a5287fcb739d2ec62682d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 15 Apr 2021 08:35:57 +0800 Subject: [PATCH 126/307] translated --- ...using bspwm for my Linux window manager.md | 114 ------------------ ...using bspwm for my Linux window manager.md | 114 ++++++++++++++++++ 2 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20210407 Why I love using bspwm for my Linux window manager.md create mode 100644 translated/tech/20210407 Why I love using bspwm for my Linux window manager.md diff --git a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md b/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md deleted file mode 100644 index 1e1a8f7ee1..0000000000 --- a/sources/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: (Why I love using bspwm for my Linux window manager) -[#]: via: (https://opensource.com/article/21/4/bspwm-linux) -[#]: author: (Stephen Adams https://opensource.com/users/stevehnh) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Why I love using bspwm for my Linux window manager -====== -Install, configure, and start using the bspwm window manager on Fedora -Linux. -![Tall building with windows][1] - -Some folks like to rearrange furniture. Other folks like to try new shoes or redecorate their bedroom on the regular. Me? I try out Linux desktops. - -After drooling over some of the incredible desktop environments I've seen online, I got curious about one window manager in particular: [bspwm][2]. - -![bspwm desktop][3] - -(Stephen Adams, [CC BY-SA 4.0][4]) - -I've been a fan of the [i3][5] window manager for quite a while, and I enjoy the way everything is laid out and the ease of getting started. But something about bspwm called to me. There are a few reasons I decided to try it out: - - * It is _only_ a window manager. - * It is managed by a few easy-to-configure scripts. - * It supports gaps between windows by default. - - - -The first reason—that it is simply a window manager—is probably the top thing to point out. Like i3, there are no graphical bells and whistles applied by default. You can certainly customize it to your heart's content, but _you_ will be putting in all the work to make it look like you want. That's part of its appeal to me. - -Although it is available on many distributions, my examples use Fedora Linux. - -### Install bspwm - -Bspwm is packaged in most common distributions, so you can install it with your system's package manager. This command also installs [sxkhd][6], a daemon for the X Window System "that reacts to input events by executing commands," and [dmenu][7], a generic X Window menu: - - -``` -`dnf install bspwm sxkhd dmenu` -``` - -Since bspwm is _just_ a window manager, there aren't any built-in shortcuts or keyboard commands. This is where it stands in contrast to something like i3. sxkhd makes it easier to get going. So, go ahead and configure sxkhd before you fire up the window manager for the first time: - - -``` -systemctl start sxkhd -systemctl enable sxkhd -``` - -This enables sxkhd at login, but you also need a configuration with some basic functionality ready to go: - - -``` -`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` -``` - -It's worth taking a look at this file before you get much further, as some commands that the scripts call may not exist on your system. A good example is the `super + Return` shortcut that calls `urxvt`. Change this to your preferred terminal, especially if you do not have urxvt installed: - - -``` -# -# wm independent hotkeys -# -    -# terminal emulator -super + Return -        urxvt -    -# program launcher -super + @space -        dmenu_run -``` - -If you are using GDM, LightDM, or another display manager, just choose bspwm before logging in. - -### Configure bspwm - -Once you are logged in, you'll see a whole lot of nothing on the screen. That's not a sense of emptiness you feel. It's possibility! You are now ready to start fiddling with all the parts of a desktop environment that you have taken for granted all these years. Building from scratch is not easy, but it's very rewarding once you get the hang of it. - -The most difficult thing about any window manager is getting a handle on the shortcuts. You're going to be slow to start, but in a short time, you'll be flying around your system using your keyboard alone and looking like an ultimate hacker to your friends and family. - -You can tailor the system as much as you want by editing `~/.config/bspwm/bspwmrc` to add apps at launch, set up your desktops and monitors, and set rules for how your windows should behave. There are a few examples set by default to get you going. Keyboard shortcuts are all managed by the **sxkhdrc** file. - -There are plenty more open source projects to install to really get things looking nice—like [Feh][8] for desktop backgrounds, [Polybar][9] for that all-important status bar, [Rofi][10] to really help your app launcher pop, and [Compton][11] to give you the shadows and transparency to get things nice and shiny. - -Happy hacking! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/bspwm-linux - -作者:[Stephen Adams][a] -选题:[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/stevehnh -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) -[2]: https://github.com/baskerville/bspwm -[3]: https://opensource.com/sites/default/files/uploads/bspwm-desktop.png (bspwm desktop) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://i3wm.org/ -[6]: https://github.com/baskerville/sxhkd -[7]: https://linux.die.net/man/1/dmenu -[8]: https://github.com/derf/feh -[9]: https://github.com/polybar/polybar -[10]: https://github.com/davatorium/rofi -[11]: https://github.com/chjj/compton diff --git a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md new file mode 100644 index 0000000000..e7d89c9782 --- /dev/null +++ b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -0,0 +1,114 @@ +[#]: subject: (Why I love using bspwm for my Linux window manager) +[#]: via: (https://opensource.com/article/21/4/bspwm-linux) +[#]: author: (Stephen Adams https://opensource.com/users/stevehnh) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +为什么我喜欢用 bspwm 来做我的 Linux 窗口管理器 +====== +在 Fedora Linux 上安装、配置并开始使用 bspwm 窗口管理器。 +![Tall building with windows][1] + +有些人喜欢重新布置家具。还有的人喜欢尝试新鞋或定期重新装修他们的卧室。我呢,则是尝试 Linux 桌面。 + +在对网上看到的一些不可思议的桌面环境流口水之后,我对一个窗口管理器特别好奇:[bspwm][2]。 + +![bspwm desktop][3] + +(Stephen Adams, [CC BY-SA 4.0][4]) + +我喜欢 [i3][5] 窗口管理器已经有一段时间了,我很喜欢它的布局方式和上手的便捷性。但 bspwm 的某些特性吸引了我。有几个原因让我决定尝试一下: + + * 它_只是_一个窗口管理器。 + * 它由几个易于配置的脚本管理。 + * 它默认支持窗口之间的间隙。 + + + +可能是最需要指出的第一个原因是它只是一个窗口管理器。和 i3 一样,默认情况下没有任何图形化的功能。你当然可以随心所欲地定制它,但_你_需要付出努力来使它看起来像你想要的。这也是它吸引我的部分原因。 + + +虽然它可以在许多发行版上使用,但在我这个例子中使用的是 Fedora Linux。 + +### 安装 bspwm + +bspwm 在大多数常见的发行版中都有打包,所以你可以用系统的包管理器安装它。这个命令还会安装 [sxkhd][6],一个 X 窗口系统的守护程序,它“通过执行命令对输入事件做出反应”,还有 [dmenu][7],一个通用的 X 窗口菜单: + + +``` +`dnf install bspwm sxkhd dmenu` +``` + +因为 bspwm 只是一个窗口管理器,所以没有任何内置的快捷键或键盘命令。这也是它与 i3 等软件的不同之处。所以,在你第一次启动窗口管理器之前,请先配置一下 sxkhd: + + +``` +systemctl start sxkhd +systemctl enable sxkhd +``` + +这样就可以在登录时启用 sxkhd,但你还需要一些基本功能的配置: + + +``` +`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` +``` + +在你深入了解之前,不妨先看看这个文件,因为有些脚本调用的命令可能在你的系统中并不存在。一个很好的例子是调用 `urxvt` 的 `super + Return` 快捷键。把它改成你喜欢的终端,尤其是当你没有安装 urxvt 的时候: + + +``` +# +# wm independent hotkeys +# +    +# terminal emulator +super + Return +        urxvt +    +# program launcher +super + @space +        dmenu_run +``` + +如果你使用的是 GDM、LightDM 或其他显示管理器,只要在登录前选择 bspwm 即可。 + +### 配置 bspwm + +当你登录后,你会看到屏幕上什么都没有。这不是你感觉到的空虚感。而是可能性!你现在可以开始摆弄桌面环境的所有部分了。你现在可以开始摆弄这些年你认为理所当然的桌面环境的所有部分了。从头开始构建并不容易,但一旦你掌握了诀窍,就会非常有收获。 + +任何窗口管理器最困难的是掌握快捷键。你开始会很慢,但在很短的时间内,你会只使用键盘在系统中到处操作,在你的朋友和家人面前看起来像一个终极黑客。 + +你可以通过编辑 `~/.config/bspwm/bspwmrc`,在启动时添加应用,设置桌面和显示器,并为你的窗口应该如何表现设置规则,随心所欲地定制系统。有一些默认设置的例子可以让你开始使用。键盘快捷键都是由 **sxkhdrc** 文件管理的。 + +还有更多的开源项目可以安装,让你的电脑看起来更漂亮,比如用于桌面背景的 [Feh][8] ,状态栏的 [Polybar][9] ,应用启动器的 [Rofi][10] ,还有 [Compton][11] 可以给你提供阴影和透明度,让你的电脑看起来更漂亮更有光泽。 + +玩得愉快! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/bspwm-linux + +作者:[Stephen Adams][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/stevehnh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/windows_building_sky_scale.jpg?itok=mH6CAX29 (Tall building with windows) +[2]: https://github.com/baskerville/bspwm +[3]: https://opensource.com/sites/default/files/uploads/bspwm-desktop.png (bspwm desktop) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://i3wm.org/ +[6]: https://github.com/baskerville/sxhkd +[7]: https://linux.die.net/man/1/dmenu +[8]: https://github.com/derf/feh +[9]: https://github.com/polybar/polybar +[10]: https://github.com/davatorium/rofi +[11]: https://github.com/chjj/compton From 50b63f4395bd6a42df433c9c5e9064b471319259 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 15 Apr 2021 08:40:52 +0800 Subject: [PATCH 127/307] translating --- ...4 Make your data boss-friendly with this open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md index 53062a7785..a6b86444f9 100644 --- a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md +++ b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/visualize-data-eda) [#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3baedf515ad5d6e5c9b136c85ec30e5504424b7e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 08:54:11 +0800 Subject: [PATCH 128/307] PRF @DCOLIVERSUN --- ...pen source gives you a competitive edge.md | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210409 4 ways open source gives you a competitive edge.md b/translated/tech/20210409 4 ways open source gives you a competitive edge.md index 6c16fd31d6..f261704a5b 100644 --- a/translated/tech/20210409 4 ways open source gives you a competitive edge.md +++ b/translated/tech/20210409 4 ways open source gives you a competitive edge.md @@ -3,57 +3,58 @@ [#]: author: (Jason Blais https://opensource.com/users/jasonblais) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -4 ways open source gives you a competitive edge -开源为你带来竞争优势的 4 条理由 +开源为你带来竞争优势的 4 种方式 ====== -使用开源技术可以帮助组织获得更好的业务结果。 -![开放式以太网线缆][1] + +> 使用开源技术可以帮助组织获得更好的业务结果。 + +![](https://img.linux.net.cn/data/attachment/album/202104/15/085345a2aani3axxj7wcis.jpg) 构建技术栈是每个组织的主要决策。选择合适的工具将让团队获得成功,选择错误的解决方案或平台会对生产率和利润率产生毁灭性影响。为了在当今快节奏的世界中脱颖而出,组织必须明智地选择数字解决方案,好的数字解决方案可以提升团队行动力与运营敏捷性。 -这就是为什么越来越多的组织都采用开源解决方案的原因,这些组织来自各行各业,规模有大有小。根据[麦肯锡][2]最近的报告,高绩效组织的最大区别是采用不同的开源方案。 +这就是为什么越来越多的组织都采用开源解决方案的原因,这些组织来自各行各业,规模有大有小。根据 [麦肯锡][2] 最近的报告,高绩效组织的最大区别是采用不同的开源方案。 采用开源技术可以帮助组织提高竞争优势、获得更好业务成果的原因有以下四点。 -### 1\. 可拓展性和灵活性 +### 1、可拓展性和灵活性 -可以说,技术世界发展很快。例如,在2014年之前,Kubernetes 并不存在,但今天,它却令人印象深刻,无处不在。根据 CNCF [2020 云原生调查][3],91% 的团队正在以某种形式使用 Kubernetes。 +可以说,技术世界发展很快。例如,在 2014 年之前,Kubernetes 并不存在,但今天,它却令人印象深刻,无处不在。根据 CNCF [2020 云原生调查][3],91% 的团队正在以某种形式使用 Kubernetes。 -组织投资开源的一个主要原因是因为开源赋予组织行动敏捷性,组织迅速将新技术集成到技术栈中。这与传统方法不同,在传统方法中,团队需要几个季度甚至几年来审查、实施、采用软件,这导致团队不可能实现火速转变。 +组织投资开源的一个主要原因是因为开源赋予组织行动敏捷性,组织可以迅速地将新技术集成到技术栈中。这与传统方法不同,在传统方法中,团队需要几个季度甚至几年来审查、实施、采用软件,这导致团队不可能实现火速转变。 开源解决方案完整地提供源代码,团队可以轻松将软件与他们每天使用的工具连接起来。 简而言之,开源让开发团队能够为手头的东西构建完美的工具,而不是被迫改变工作方式来适应不灵活的专有工具。 -### 2\. 安全性和高可信的协作 +### 2、安全性和高可信的协作 在数据泄露备受瞩目的时代,组织需要高度安全的工具来保护敏感数据的安全。 -专有解决方案中的漏洞不易被发现,被发现时为时已晚。不幸的是,使用这些平台的团队无法看到源代码,本质上他们将安全性外包给特定供应商,希望得到最好的结果。 +专有解决方案中的漏洞不易被发现,被发现时为时已晚。不幸的是,使用这些平台的团队无法看到源代码,本质上是他们将安全性外包给特定供应商,并希望得到最好的结果。 -采用开源的另一个主要原因是开源工具使组织能够自己把控安全。例如,开源项目——尤其是大型开源社区的项目——往往会收到更负责任的漏洞披露,因为每个人在使用过程中都可以彻底检查源代码。 +采用开源的另一个主要原因是开源工具使组织能够自己把控安全。例如,开源项目——尤其是拥有大型开源社区的项目——往往会收到更负责任的漏洞披露,因为每个人在使用过程中都可以彻底检查源代码。 由于源代码是免费提供的,因此披露通常伴随着修复缺陷的详细建议解决方案。这些方案使得开发团队能够快速解决问题,不断增强软件。 -在远程办公时代,协作的分布式团队知道敏感数据受到保护比以往任何时候都更重要。开源解决方案允许组织审核安全性、完成掌控自己数据,因此开源方案可以促进远程环境下高可信协作方式的成长。 +在远程办公时代,对于分布式团队来说,在知道敏感数据受到保护的情况下进行协作比以往任何时候都更重要。开源解决方案允许组织审核安全性、完全掌控自己数据,因此开源方案可以促进远程环境下高可信协作方式的成长。 -### 3\. 不受供应商限制 +### 3、不受供应商限制 -根据[最近的一项研究][4],68% 的 CIO 担心受供应商限制。当你受限于一项技术中,你会被迫接受别人的结论,而不是自己做结论。 +根据 [最近的一项研究][4],68% 的 CIO 担心受供应商限制。当你受限于一项技术中,你会被迫接受别人的结论,而不是自己做结论。 -当组织更换供应商时,专有解决方案通常会[给你带来数据使用挑战][5]。另一方面,开源工具提供了组织需要的自由度和灵活性,以避免受供应商限制,开源工具可以让组织把数据带去任意地方。 +当组织更换供应商时,专有解决方案通常会 [给你带走数据带来挑战][5]。另一方面,开源工具提供了组织需要的自由度和灵活性,以避免受供应商限制,开源工具可以让组织把数据带去任意地方。 -### 4\. 顶尖人才和社区 +### 4、顶尖人才和社区 -随着越来越多的公司[接受远程办公][6],人才争夺战变得愈发激烈。 +随着越来越多的公司 [接受远程办公][6],人才争夺战变得愈发激烈。 -在软件开发领域,获得顶尖人才始于赋予工程师先进工具,让工程师在工作中充分发挥潜力。开发人员[越来越喜欢开源解决方案][7]而不是专有解决方案,组织应该强烈考虑用开源替代商业解决方案,以吸引市场上最好的开发人员。 +在软件开发领域,获得顶尖人才始于赋予工程师先进工具,让工程师在工作中充分发挥潜力。开发人员 [越来越喜欢开源解决方案][7] 而不是专有解决方案,组织应该强烈考虑用开源替代商业解决方案,以吸引市场上最好的开发人员。 -除了雇佣、留住顶尖人才更容易,公司能够通过开源平台利用贡献者社区,得到解决问题的建议,从平台中得到最大收益。此外,社区成员还[直接贡献开源项目][8]。 +除了雇佣、留住顶尖人才更容易,公司能够通过开源平台利用贡献者社区,得到解决问题的建议,从平台中得到最大收益。此外,社区成员还可以 [直接为开源项目做贡献][8]。 ### 开源带来自由 @@ -66,7 +67,7 @@ via: https://opensource.com/article/21/4/open-source-competitive-advantage 作者:[Jason Blais][a] 选题:[lujun9972][b] 译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3c65d86927ca46995ac5f6949a2860a5682fbff9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 08:54:56 +0800 Subject: [PATCH 129/307] PUB @DCOLIVERSUN https://linux.cn/article-13299-1.html --- ...0210409 4 ways open source gives you a competitive edge.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210409 4 ways open source gives you a competitive edge.md (98%) diff --git a/translated/tech/20210409 4 ways open source gives you a competitive edge.md b/published/20210409 4 ways open source gives you a competitive edge.md similarity index 98% rename from translated/tech/20210409 4 ways open source gives you a competitive edge.md rename to published/20210409 4 ways open source gives you a competitive edge.md index f261704a5b..4a9603b1ba 100644 --- a/translated/tech/20210409 4 ways open source gives you a competitive edge.md +++ b/published/20210409 4 ways open source gives you a competitive edge.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13299-1.html) 开源为你带来竞争优势的 4 种方式 ====== From 3a9dcf2744e52dd3ab22a2360bfa059918cce925 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 22:08:48 +0800 Subject: [PATCH 130/307] APL --- ...20210407 Using network bound disk encryption with Stratis.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210407 Using network bound disk encryption with Stratis.md b/sources/tech/20210407 Using network bound disk encryption with Stratis.md index becf63e533..ceb717ac4d 100644 --- a/sources/tech/20210407 Using network bound disk encryption with Stratis.md +++ b/sources/tech/20210407 Using network bound disk encryption with Stratis.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) [#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3c3a80fa9f8c7ebea5f21029ae3e2a99d8cb6393 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 15 Apr 2021 23:16:22 +0800 Subject: [PATCH 131/307] TSL&PRF --- ...work bound disk encryption with Stratis.md | 288 ------------------ ...work bound disk encryption with Stratis.md | 284 +++++++++++++++++ 2 files changed, 284 insertions(+), 288 deletions(-) delete mode 100644 sources/tech/20210407 Using network bound disk encryption with Stratis.md create mode 100644 translated/tech/20210407 Using network bound disk encryption with Stratis.md diff --git a/sources/tech/20210407 Using network bound disk encryption with Stratis.md b/sources/tech/20210407 Using network bound disk encryption with Stratis.md deleted file mode 100644 index ceb717ac4d..0000000000 --- a/sources/tech/20210407 Using network bound disk encryption with Stratis.md +++ /dev/null @@ -1,288 +0,0 @@ -[#]: subject: (Using network bound disk encryption with Stratis) -[#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) -[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Using network bound disk encryption with Stratis -====== - -![][1] - -Photo by [iMattSmart][2] on [Unsplash][3] - -In an environment with many encrypted disks, unlocking them all is a difficult task. Network bound disk encryption (NBDE) helps automate the process of unlocking Stratis volumes. This is a critical requirement in large environments. Stratis version 2.1 added support for encryption, which was introduced in the article “[Getting started with Stratis encryption][4].” Stratis version 2.3 recently introduced support for Network Bound Disk Encryption (NBDE) when using encrypted Stratis pools, which is the topic of this article. - -The [Stratis website][5] describes Stratis as an “_easy to use local storage management for Linux_.” The  short video [“Managing Storage With Stratis”][6] gives a quick demonstration of the basics. The video was recorded on a Red Hat Enterprise Linux 8 system, however, the concepts shown in the video also apply to Stratis in Fedora Linux. - -### Prerequisites - -This article assumes you are familiar with Stratis, and also Stratis pool encryption. If you aren’t familiar with these topics, refer to this [article][4] and the [Stratis overview video][6] previously mentioned. - -NBDE requires Stratis 2.3 or later. The examples in this article use a pre-release version of Fedora Linux 34. The Fedora Linux 34 final release will include Stratis 2.3. - -### Overview of network bound disk encryption (NBDE) - -One of the main challenges of encrypting storage is having a secure method to unlock the storage again after a system reboot. In large environments, typing in the encryption passphrase manually doesn’t scale well. NBDE addresses this and allows for encrypted storage to be unlocked in an automated manner. - -At a high level, NBDE requires a Tang server in the environment. Client systems (using Clevis Pin) can automatically decrypt storage as long as they can establish a network connection to the Tang server. If there is no network connectivity to the Tang server, the storage would have to be decrypted manually. - -The idea behind this is that the Tang server would only be available on an internal network, thus if the encrypted device is lost or stolen, it would no longer have access to the internal network to connect to the Tang server, therefore would not be automatically decrypted. - -For more information on Tang and Clevis, see the man pages (man tang, man clevis) , the [Tang GitHub page][7], and the [Clevis GitHub page][8]. - -### Setting up the Tang server - -This example uses another Fedora Linux system as the Tang server with a hostname of tang-server. Start by installing the tang package: - -``` -dnf install tang -``` - -Then enable and start the tangd.socket with systemctl: - -``` -systemctl enable tangd.socket --now -``` - -Tang uses TCP port 80, so you also need to open that in the firewall: - -``` -firewall-cmd --add-port=80/tcp --permanent -firewall-cmd --add-port=80/tcp -``` - -Finally, run _tang-show-keys_ to display the output signing key thumbprint. You’ll need this later. - -``` -# tang-show-keys -l3fZGUCmnvKQF_OA6VZF9jf8z2s -``` - -### Creating the encrypted Stratis Pool - -The previous article on Stratis encryption goes over how to setup an encrypted Stratis pool in detail, so this article won’t cover that in depth. - -The first step is capturing a key that will be used to decrypt the Stratis pool. Even when using NBDE, you need to set this, as it can be used to manually unlock the pool in the event that the NBDE server is unreachable. Capture the pool1 key with the following command: - -``` -# stratis key set --capture-key pool1key -Enter key data followed by the return key: -``` - -Then I’ll create an encrypted Stratis pool (using the pool1key just created) named pool1 using the _/dev/vdb_ device: - -``` -# stratis pool create --key-desc pool1key pool1 /dev/vdb -``` - -Next, create a filesystem in this Stratis pool named filesystem1, create a mount point, mount the filesystem, and create a testfile in it: - -``` -# stratis filesystem create pool1 filesystem1 -# mkdir /filesystem1 -# mount /dev/stratis/pool1/filesystem1 /filesystem1 -# cd /filesystem1 -# echo "this is a test file" > testfile -``` - -### Binding the Stratis pool to the Tang server - -At this point, we have the encrypted Stratis pool created, and also have a filesystem created in the pool. The next step is to bind your Stratis pool to the Tang server that you just setup. Do this with the _stratis pool bind nbde_ command. - -When you make the Tang binding, you need to pass several parameters to the command: - - * the pool name (in this example, pool1) - * the key descriptor name (in this example, pool1key) - * the Tang server name (in this example, ) - - - -Recall that on the Tang server, you previously ran _tang-show-keys_ which showed the Tang output signing key thumbprint is _l3fZGUCmnvKQF_OA6VZF9jf8z2s_. In addition to the previous parameters, you either need to pass this thumbprint with the parameter _–thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s_, or skip the verification of the thumbprint with the _–trust-url_ parameter. **** - -It is more secure to use the _–thumbprint_ parameter. For example: - -``` -# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s -``` - -### Unlocking the Stratis Pool with NBDE - -Next reboot the host, and validate that you can unlock the Stratis pool with NBDE, without requiring the use of the key passphrase. After rebooting the host, the pool is no longer available: - -``` -# stratis pool list -Name Total Physical Properties -``` - -To unlock the pool using NBDE, run the following command: - -``` -# stratis pool unlock clevis -``` - -Note that you did not need to use the key passphrase. This command could be automated to run during the system boot up. - -At this point, the pool is now available: - -``` -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr -``` - -You can mount the filesystem and access the file that was previously created: - -``` -# mount /dev/stratis/pool1/filesystem1 /filesystem1/ -# cat /filesystem1/testfile -this is a test file -``` - -### Rotating Tang server keys - -Best practices recommend that you periodically rotate the Tang server keys and update the Stratis client servers to use the new Tang keys. - -To generate new Tang keys, start by logging in to your Tang server and look at the current status of the /var/db/tang directory. Then, run the _tang-show-keys_ command: - -``` -# ls -al /var/db/tang -total 8 -drwx------. 1 tang tang 124 Mar 15 15:51 . -drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. --rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk --rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk -# tang-show-keys -l3fZGUCmnvKQF_OA6VZF9jf8z2s -``` - -To generate new keys, run tangd-keygen and point it to the /var/db/tang directory: - -``` -# /usr/libexec/tangd-keygen /var/db/tang -``` - -If you look at the /var/db/tang directory again, you will see two new files: - -``` -# ls -al /var/db/tang -total 16 -drwx------. 1 tang tang 248 Mar 22 10:41 . -drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. --rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk --rw-r--r--. 1 root root 354 Mar 22 10:41 iyG5HcF01zaPjaGY6L_3WaslJ_E.jwk --rw-r--r--. 1 root root 349 Mar 22 10:41 jHxerkqARY1Ww_H_8YjQVZ5OHao.jwk --rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk -``` - -And if you run _tang-show-keys_, it will show the keys being advertised by Tang: - -``` -# tang-show-keys -l3fZGUCmnvKQF_OA6VZF9jf8z2s -iyG5HcF01zaPjaGY6L_3WaslJ_E -``` - -You can prevent the old key (starting with l3fZ) from being advertised by renaming the two original files to be hidden files, starting with a period. With this method, the old key will no longer be advertised, however it will still be usable by any existing clients that haven’t been updated to use the new key. Once all clients have been updated to use the new key, these old key files can be deleted. - -``` -# cd /var/db/tang -# mv hbjJEDXy8G8wynMPqiq8F47nJwo.jwk .hbjJEDXy8G8wynMPqiq8F47nJwo.jwk -# mv l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk .l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk -``` - -At this point, if you run _tang-show-keys_ again, only the new key is being advertised by Tang: - -``` -# tang-show-keys -iyG5HcF01zaPjaGY6L_3WaslJ_E -``` - -Next, switch over to your Stratis system and update it to use the new Tang key. Stratis supports doing this while the filesystem(s) are online. - -First, unbind the pool: - -``` -# stratis pool unbind pool1 -``` - -Next, set the key with the original passphrase used when the encrypted pool was created: - -``` -# stratis key set --capture-key pool1key -Enter key data followed by the return key: -``` - -Finally, bind the pool to the Tang server with the updated key thumbprint: - -``` -# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint iyG5HcF01zaPjaGY6L_3WaslJ_E -``` - -The Stratis system is now configured to use the updated Tang key. Once any other client systems using the old Tang key have been updated, the two original key files that were renamed to hidden files in the /var/db/tang directory on the Tang server can be backed up and deleted. - -### What if the Tang server is unavailable? - -Next, shutdown the Tang server to simulate it being unavailable, then reboot the Stratis system. - -Again, after the reboot, the Stratis pool is not available: - -``` -# stratis pool list -Name Total Physical Properties -``` - -If you try to unlock it with NBDE, this fails because the Tang server is unavailable: - -``` -# stratis pool unlock clevis -Execution failed: -An iterative command generated one or more errors: The operation 'unlock' on a resource of type pool failed. The following errors occurred: -Partial action "unlock" failed for pool with UUID 4d62f840f2bb4ec9ab53a44b49da3f48: Cryptsetup error: Failed with error: Error: Command failed: cmd: "clevis" "luks" "unlock" "-d" "/dev/vdb" "-n" "stratis-1-private-42142fedcb4c47cea2e2b873c08fcf63-crypt", exit reason: 1 stdout: stderr: /dev/vdb could not be opened. -``` - -At this point, without the Tang server being reachable, the only option to unlock the pool is to use the original key passphrase: - -``` -# stratis key set --capture-key pool1key -Enter key data followed by the return key: -``` - -You can then unlock the pool using the key: - -``` -# stratis pool unlock keyring -``` - -Next, verify the pool was successfully unlocked: - -``` -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr -``` - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ - -作者:[briansmith][a] -选题:[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/briansmith/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg -[2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ -[5]: https://stratis-storage.github.io/ -[6]: https://www.youtube.com/watch?v=CJu3kmY-f5o -[7]: https://github.com/latchset/tang -[8]: https://github.com/latchset/clevis diff --git a/translated/tech/20210407 Using network bound disk encryption with Stratis.md b/translated/tech/20210407 Using network bound disk encryption with Stratis.md new file mode 100644 index 0000000000..69d8a6987f --- /dev/null +++ b/translated/tech/20210407 Using network bound disk encryption with Stratis.md @@ -0,0 +1,284 @@ +[#]: subject: (Using network bound disk encryption with Stratis) +[#]: via: (https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/) +[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 Stratis 的网络绑定磁盘加密 +====== + +![][1] + +在一个有许多加密磁盘的环境中,解锁所有的磁盘是一项困难的任务。网络绑定磁盘加密Network bound disk encryption(NBDE)有助于自动解锁 Stratis 卷的过程。这是在大型环境中的一个关键要求。Stratis 2.1 版本增加了对加密的支持,这在《[Stratis 加密入门][4]》一文中介绍过。Stratis 2.3 版本最近在使用加密的 Stratis 池时引入了对网络绑定磁盘加密(NBDE)的支持,这是本文的主题。 + +[Stratis 网站][5] 将 Stratis 描述为一个“_易于使用的 Linux 本地存储管理_”。短视频《[使用 Stratis 管理存储][6]》对基础知识进行了快速演示。该视频是在 Red Hat Enterprise Linux 8 系统上录制的,然而,视频中显示的概念也适用于 Fedora Linux 中的 Stratis。 + +### 先决条件 + +本文假设你熟悉 Stratis,也熟悉 Stratis 池加密。如果你不熟悉这些主题,请参考这篇 [文章][4] 和前面提到的 [Stratis 概述视频][6]。 + +NBDE 需要 Stratis 2.3 或更高版本。本文中的例子使用的是 Fedora Linux 34 的预发布版本。Fedora Linux 34 的最终版本将包含 Stratis 2.3。 + +### 网络绑定磁盘加密(NBDE)概述 + +加密存储的主要挑战之一是有一个安全的方法在系统重启后再次解锁存储。在大型环境中,手动输入加密口令并不能很好地扩展。NBDE 解决了这一问题,允许以自动方式解锁加密存储。 + +在更高层次上,NBDE 需要环境中的 Tang 服务器。客户端系统(使用 Clevis Pin)只要能与 Tang 服务器建立网络连接,就可以自动解密存储。如果网络没有连接到 Tang 服务器,则必须手动解密存储。 + +这背后的想法是,Tang 服务器只能在内部网络上使用,因此,如果加密设备丢失或被盗,它将不再能够访问内部网络连接到 Tang 服务器,因此不会被自动解密。 + +关于 Tang 和 Clevis 的更多信息,请参见手册页(`man tang`、`man clevis`)、[Tang 的 GitHub 页面][7] 和 [Clevis 的 GitHub 页面][8]。 + +### 设置 Tang 服务器 + +本例使用另一个 Fedora Linux 系统作为 Tang 服务器,主机名为 `tang-server`。首先安装 `tang` 包。 + +``` +dnf install tang +``` + +然后用 `systemctl` 启用并启动 `tangd.socket`。 + +``` +systemctl enable tangd.socket --now +``` + +Tang 使用的是 TCP 80 端口,所以你也需要在防火墙中打开该端口。 + +``` +firewall-cmd --add-port=80/tcp --permanent +firewall-cmd --add-port=80/tcp +``` + +最后,运行 `tang-show-keys` 来显示输出签名密钥指纹。你以后会需要这个。 + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### 创建加密的 Stratis 池 + +上一篇关于 Stratis 加密的文章详细介绍了如何设置加密的 Stratis 池,所以本文不会深入介绍。 + +第一步是捕获一个将用于解密 Stratis 池的密钥。即使使用 NBDE,也需要设置这个,因为在 NBDE 服务器无法到达的情况下,可以用它来手动解锁池。使用以下命令捕获 `pool1` 密钥。 + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +然后我将使用 `/dev/vdb` 设备创建一个加密的 Stratis 池(使用刚才创建的 `pool1key`),命名为 `pool1`。 + +``` +# stratis pool create --key-desc pool1key pool1 /dev/vdb。 +``` + +接下来,在这个 Stratis 池中创建一个名为 `filesystem1` 的文件系统,创建一个挂载点,挂载文件系统,并在其中创建一个测试文件: + +``` +# stratis filesystem create pool1 filesystem1 +# mkdir /filesystem1 +# mount /dev/stratis/pool1/filesystem1 /filesystem1 +# cd /filesystem1 +# echo "this is a test file" > testfile +``` + +### 将 Stratis 池绑定到 Tang 服务器上 + +此时,我们已经创建了加密的 Stratis 池,并在池中创建了一个文件系统。下一步是将你的 Stratis 池绑定到刚刚设置的 Tang 服务器上。使用 `stratis pool bind nbde` 命令进行。 + +当你进行 Tang 绑定时,需要向该命令传递几个参数: + + * 池名(在本例中,`pool1`) + * 钥匙描述符名称(本例中为 `pool1key`) + * Tang 服务器名称(在本例中,`http://tang-server`) + +记得之前在 Tang 服务器上,运行了 `tang-show-keys`,显示 Tang 输出的签名密钥指纹是 `l3fZGUCmnvKQF_OA6VZF9jf8z2s`。除了前面的参数外,还需要用参数 `-thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s` 传递这个指纹,或者用 `-trust-url` 参数跳过对指纹的验证。 + +使用 `-thumbprint` 参数更安全。例如: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +### 用 NBDE 解锁 Stratis 池 + +接下来重启主机,并验证你可以用 NBDE 解锁 Stratis 池,而不需要使用密钥口令。重启主机后,该池不再可用: + +``` +# stratis pool list +Name Total Physical Properties +``` + +要使用 NBDE 解锁池,请运行以下命令: + +``` +# stratis pool unlock clevis +``` + +注意,你不需要使用密钥口令。这个命令可以在系统启动时自动运行。 + +此时,Stratis 池已经可以使用了: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +你可以挂载文件系统,访问之前创建的文件: + +``` +# mount /dev/stratis/pool1/filesystem1 /filesystem1/ +# cat /filesystem1/testfile +this is a test file +``` + +### 轮换 Tang 服务器密钥 + +最好定期轮换 Tang 服务器密钥,并更新 Stratis 客户服务器以使用新的 Tang 密钥。 + +要生成新的 Tang 密钥,首先登录到 Tang 服务器,查看 `/var/db/tang` 目录的当前状态。然后,运行 `tang-show-keys` 命令: + +``` +# ls -al /var/db/tang +total 8 +drwx------. 1 tang tang 124 Mar 15 15:51 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +``` + +要生成新的密钥,运行 `tangd-keygen` 并将其指向 `/var/db/tang` 目录: + +``` +# /usr/libexec/tangd-keygen /var/db/tang +``` + +如果你再看看 `/var/db/tang` 目录,你会看到两个新文件: + +``` +# ls -al /var/db/tang +total 16 +drwx------. 1 tang tang 248 Mar 22 10:41 . +drwxr-xr-x. 1 root root 16 Mar 15 15:48 .. +-rw-r--r--. 1 tang tang 361 Mar 15 15:51 hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +-rw-r--r--. 1 root root 354 Mar 22 10:41 iyG5HcF01zaPjaGY6L_3WaslJ_E.jwk +-rw-r--r--. 1 root root 349 Mar 22 10:41 jHxerkqARY1Ww_H_8YjQVZ5OHao.jwk +-rw-r--r--. 1 tang tang 367 Mar 15 15:51 l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +如果你运行 `tang-show-keys`,就会显示出 Tang 所公布的密钥: + +``` +# tang-show-keys +l3fZGUCmnvKQF_OA6VZF9jf8z2s +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +你可以通过将两个原始文件改名为以句号开头的隐藏文件,来防止旧的密钥(以 `l3fZ` 开头)被公布。通过这种方法,旧的密钥将不再被公布,但是它仍然可以被任何没有更新为使用新密钥的现有客户端使用。一旦所有的客户端都更新使用了新密钥,这些旧密钥文件就可以删除了。 + +``` +# cd /var/db/tang +# mv hbjJEDXy8G8wynMPqiq8F47nJwo.jwk .hbjJEDXy8G8wynMPqiq8F47nJwo.jwk +# mv l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk .l3fZGUCmnvKQF_OA6VZF9jf8z2s.jwk +``` + +此时,如果再运行 `tang-show-keys`,Tang 只公布新钥匙: + +``` +# tang-show-keys +iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +下一步,切换到你的 Stratis 系统并更新它以使用新的 Tang 密钥。当文件系统在线时, Stratis 支持这样做。 + +首先,解除对池的绑定: + +``` +# stratis pool unbind pool1 +``` + +接下来,用创建加密池时使用的原始口令设置密钥: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +最后,用更新后的密钥指纹将 Stratis 池绑定到 Tang 服务器上: + +``` +# stratis pool bind nbde pool1 pool1key http://tang-server --thumbprint iyG5HcF01zaPjaGY6L_3WaslJ_E +``` + +Stratis 系统现在配置为使用更新的 Tang 密钥。一旦使用旧的 Tang 密钥的任何其他客户系统被更新,在 Tang 服务器上的 `/var/db/tang` 目录中被重命名为隐藏文件的两个原始密钥文件就可以被备份和删除了。 + +### 如果 Tang 服务器不可用怎么办? + +接下来,关闭 Tang 服务器,模拟它不可用,然后重启 Stratis 系统。 + +重启后,Stratis 池又不可用了: + +``` +# stratis pool list +Name Total Physical Properties +``` + +如果你试图用 NBDE 解锁,会因为 Tang 服务器不可用而失败: + +``` +# stratis pool unlock clevis +Execution failed: +An iterative command generated one or more errors: The operation 'unlock' on a resource of type pool failed. The following errors occurred: +Partial action "unlock" failed for pool with UUID 4d62f840f2bb4ec9ab53a44b49da3f48: Cryptsetup error: Failed with error: Error: Command failed: cmd: "clevis" "luks" "unlock" "-d" "/dev/vdb" "-n" "stratis-1-private-42142fedcb4c47cea2e2b873c08fcf63-crypt", exit reason: 1 stdout: stderr: /dev/vdb could not be opened. +``` + +此时,在 Tang 服务器无法到达的情况下,解锁池的唯一选择就是使用原密钥口令: + +``` +# stratis key set --capture-key pool1key +Enter key data followed by the return key: +``` + +然后你可以使用钥匙解锁池: + +``` +# stratis pool unlock keyring +``` + +接下来,验证池是否成功解锁: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ + +作者:[briansmith][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/briansmith/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg +[2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ +[5]: https://stratis-storage.github.io/ +[6]: https://www.youtube.com/watch?v=CJu3kmY-f5o +[7]: https://github.com/latchset/tang +[8]: https://github.com/latchset/clevis From 2a6330450f9528a9244a570ac920501e040d5727 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 16 Apr 2021 05:03:05 +0800 Subject: [PATCH 132/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210415=20?= =?UTF-8?q?5=20reasons=20sysadmins=20love=20systemd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210415 5 reasons sysadmins love systemd.md --- ...210415 5 reasons sysadmins love systemd.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20210415 5 reasons sysadmins love systemd.md diff --git a/sources/tech/20210415 5 reasons sysadmins love systemd.md b/sources/tech/20210415 5 reasons sysadmins love systemd.md new file mode 100644 index 0000000000..f063a55ddc --- /dev/null +++ b/sources/tech/20210415 5 reasons sysadmins love systemd.md @@ -0,0 +1,204 @@ +[#]: subject: (5 reasons sysadmins love systemd) +[#]: via: (https://opensource.com/article/21/4/sysadmins-love-systemd) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 reasons sysadmins love systemd +====== +Systemd's speed and ease make it a popular way to manage modern Linux +systems. +![Woman sitting in front of her laptop][1] + +As systems administrators know, there's a lot happening on modern computers. Applications run in the background, automated events wait to be triggered at a certain time, log files are written, status reports are delivered. Traditionally, these disparate processes have been managed and monitored with a collection of Unix tools to great effect and with great efficiency. However, modern computers are diverse, with local services running alongside containerized applications, easy access to clouds and the clusters they run on, real-time processes, and more data to process than ever. + +Having a unified method of managing them is an expectation for users and a useful luxury for busy sysadmins. For this nontrivial task, the system daemon, or **systemd**, was developed and quickly adopted by all major Linux distributions. + +Of course, systemd isn't the only way to manage a Linux system. There are many alternative init systems, including sysvinit, OpenRC, runit, s6, and even BusyBox, but systemd treats Linux as a unified data set, meant to be manipulated and queried consistently with robust tools. For a busy systems administrator and many users, the speed and ease of systemd is an important feature. Here are five reasons why. + +### Boot management + +Booting a Linux computer can be a surprisingly rare event, if you want it to be. Certainly in the server world, uptimes are often counted in _years_ rather than months or weeks. Laptops and desktops tend to be shut down and booted pretty frequently, although even these are as likely to be suspended or hibernated as they are to be shut down. Either way, the time since the most recent boot event can serve as a sort of session manager for a computer health check. It's a useful way to limit what data you look at when monitoring your system or diagnosing problems. + +In the likely event that you can't remember the last time you booted your computer, you can list boot sessions with systemd's logging tool, `journalctl`: + + +``` +$ journalctl --list-boots +-42 7fe7c3... Fri 2020-12-04 05:13:59 - Wed 2020-12-16 16:01:23 +-41 332e99... Wed 2020-12-16 20:07:39 - Fri 2020-12-18 22:08:13 +[...] +-1 e0fe5f... Mon 2021-03-29 20:47:46 - Mon 2021-03-29 21:59:29 + 0 37fbe4... Tue 2021-03-30 04:46:13 - Tue 2021-03-30 10:42:08 +``` + +The latest boot sessions appear at the bottom of the list, so you can pipe the output to `tail` for just the latest boots. + +The numbers on the left (42, 41, 1, and 0 in this example) are index numbers for each boot session. In other words, to view logs for only a specific boot session, you can use its index number as reference. + +### Log reviews + +Looking at logs is an important method of extrapolating information about your system. Logs provide a history of much of the activity your computer engages in without your direct supervision. You can see when services launched, when timed jobs ran, what services are running in the background, which activities failed, and more. One of the most common initial troubleshooting steps is to review logs, which is easy to do with `journalctl`: + + +``` +`$ journalctl --pager-end` +``` + +The `--pager-end` (or `-e` for short) option starts your view of the logs at the end of the `journalctl` output, so you must scroll up to see events that happened earlier. + +Systemd maintains a "catalog" of errors and messages filled with records of errors, possible solutions, pointers to support forums, and developer documentation. This can provide important context to a log event, which can otherwise be a confusing blip in a sea of messages, or worse, could go entirely unnoticed. To integrate error messages with explanatory text, you can use the `--catalog` (or `-x` for short) option: + + +``` +`$ journalctl --pager-end --catalog` +``` + +To further limit the log output you need to wade through, you can specify which boot session you want to see logs for. Because each boot session is indexed, you can specify certain sessions with the `--boot` option and view only the logs that apply to it: + + +``` +`$ journalctl --pager-end --catalog --boot 42` +``` + +You can also see logs for a specific systemd unit. For instance, to troubleshoot an issue with your secure shell (SSH) service, you can specify `--unit sshd` to see only the logs that apply to the `sshd` daemon: + + +``` +$ journalctl --pager-end \ +\--catalog --boot 42 \ +\--unit sshd +``` + +### Service management + +The first task for systemd is to boot your computer, and it generally does that promptly, efficiently, and effectively. But the task that's never finished is service management. By design, systemd ensures that the services you want to run do indeed start and continue running during your session. This is nicely robust, because in theory even a crashed service can be restarted without your intervention. + +Your interface to help systemd manage services is the `systemctl` command. With it, you can view the unit files that define a service: + + +``` +$ systemctl cat sshd +# /usr/lib/systemd/system/sshd.service +[Unit] +Description=OpenSSH server daemon +Documentation=man:sshd(8) man:sshd_config(5) +After=network.target sshd-keygen.target +Wants=sshd-keygen.target + +[Service] +Type=notify +EnvironmentFile=-/etc/crypto-policies/back-ends/opensshserver.config +EnvironmentFile=-/etc/sysconfig/sshd +ExecStart=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY +ExecReload=/bin/kill -HUP $MAINPID +KillMode=process +Restart=on-failure +RestartSec=42s + +[Install] +WantedBy=multi-user.target +``` + +Most unit files exist in `/usr/lib/systemd/system/` but, as with many important configurations, you're encouraged to modify them with local changes. There's an interface for that, too: + + +``` +`$ systemctl edit sshd` +``` + +You can see whether a service is currently active: + + +``` +$ systemctl is-active sshd +active +$ systemctl is-active foo +inactive +``` + +Similarly, you can see whether a service has failed with `is-failed`. + +Starting and stopping services is nicely intuitive: + + +``` +$ systemctl stop sshd +$ systemctl start sshd +``` + +And enabling a service to start at boot time is simple: + + +``` +`$ systemctl enable sshd` +``` + +Add the `--now` option to enable a service to start at boot time or to start it for your current session. + +### Timers + +Long ago, when you wanted to automate a task on Linux, the canonical tool for the job was `cron`. There's still a place for the cron command, but there are also some compelling alternatives. For instance, the [`anacron` command][2] is a versatile, cron-like system capable of running tasks that otherwise would have been missed during downtime. + +Scheduled events are little more than services activated at a specific time, so systemd manages a cron-like function called [timers][3]. You can list active timers: + + +``` +$ systemctl list-timers +NEXT                          LEFT       +Tue 2021-03-30 12:37:54 NZDT  16min left [...] +Wed 2021-03-31 00:00:00 NZDT  11h left [...] +Wed 2021-03-31 06:42:02 NZDT  18h left [...] + +3 timers listed. +Pass --all to see loaded but inactive timers, too. +``` + +You can enable a timer the same way you enable a service: + + +``` +`$ systemctl enable myMonitor.timer` +``` + +### Targets + +Targets are the final major component of the systemd matrix. A target is defined by a unit file, the same as services and timers. Targets can also be started and enabled in the same way. What makes targets unique is that they group other unit files in an arbitrarily significant way. For instance, you might want to boot to a text console instead of a graphical desktop, so the `multi-user` target exists. However, the `multi-user` target is only the `graphical` target without the desktop unit files as dependencies. + +In short, targets are an easy way for you to collect services, timers, and even other targets together to represent an intended state for your machine. + +In fact, within systemd, a reboot, a power-off, or a shut-down action is just another target. + +You can list all available targets using the `list-unit-files` option, constraining it with the `--type` option set to `target`: + + +``` +`$ systemctl list-unit-files --type target` +``` + +### Taking control with systemd + +Modern Linux uses systemd for service management and log introspection. It provides everything from personal Linux systems to enterprise servers with a modern mechanism for monitoring and easy maintenance. The more you use it, the more systemd becomes comfortably predictable and intuitive, and the more you discover how disparate parts of your system are interconnected. + +To get better acquainted with systemd, you must use it. And to get comfortable with using it, [download our cheat sheet][4] and refer to it often. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/sysadmins-love-systemd + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_4.png?itok=VGZO8CxT (Woman sitting in front of her laptop) +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/20/7/systemd-timers +[4]: https://opensource.com/downloads/linux-systemd-cheat-sheet From b1598470f6119974064ad0fbb4248d037e0b66ee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 16 Apr 2021 05:03:17 +0800 Subject: [PATCH 133/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210415=20?= =?UTF-8?q?A=20beginner's=20guide=20to=20load=20balancing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210415 A beginner-s guide to load balancing.md --- ...15 A beginner-s guide to load balancing.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/tech/20210415 A beginner-s guide to load balancing.md diff --git a/sources/tech/20210415 A beginner-s guide to load balancing.md b/sources/tech/20210415 A beginner-s guide to load balancing.md new file mode 100644 index 0000000000..b12f5c066a --- /dev/null +++ b/sources/tech/20210415 A beginner-s guide to load balancing.md @@ -0,0 +1,84 @@ +[#]: subject: (A beginner's guide to load balancing) +[#]: via: (https://opensource.com/article/21/4/load-balancing) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A beginner's guide to load balancing +====== +Load balancing distributes resources to where they're needed most at +that moment. +![eight stones balancing][1] + +When the personal computer was young, a household was likely to have one (or fewer) computers in it. Children played games on it during the day, and parents did accounting or programming or roamed through a BBS in the evening. Imagine a one-computer household today, though, and you can predict the conflict it would create. Everyone would want to use the computer at the same time, and there wouldn't be enough keyboard and mouse to go around. + +This is, more or less, the same scenario that's been happening to the IT industry as computers have become more and more ubiquitous. Demand for services and servers has increased to the point that they could grind to a halt from overuse. Fortunately, we now have the concept of load balancing to help us handle the demand. + +### What is load balancing? + +Load balancing is a generic term referring to anything you do to ensure the resources you manage are distributed efficiently. For a web server's systems administrator, load balancing usually means ensuring that the web server software (such as [Nginx][2]) is configured with enough worker nodes to handle a spike in incoming visitors. In other words, should a site suddenly become very popular and its visitor count quadruple in a matter of minutes, the software running the server must be able to respond to each visitor without any of them noticing service degradation. For simple sites, this is as simple as a one-line configuration option, but for complex sites with dynamic content and several database queries for each user, it can be a serious problem. + +This problem is supposed to have been solved with cloud computing, but it's not impossible for a web app to fail to scale out when it experiences an unexpected surge. + +The important thing to keep in mind when it comes to load balancing is that distributing resources _efficiently_ doesn't necessarily mean distributing them _evenly_. Not all tasks require all available resources at all times. A smart load-balancing strategy provides resources to users and tasks only when those resources are needed. This is often the application developer's domain rather than the IT infrastructure's responsibility. Asynchronous applications are vital to ensuring that a user who walks away from the computer for a coffee break isn't occupying valuable resources on the server. + +### How does load balancing work? + +Load balancing avoids bottlenecks by distributing a workload across multiple computational nodes. Those nodes may be physical servers in a data center, containers in a cloud, strategically placed servers enlisted for edge computing, separate Java Virtual Machines (JVMs) in a complex application framework, or daemons running on a single Linux server. + +The idea is to divide a large problem into small tasks and assign each task to a dedicated computer. For a website that requires its users to log in, for instance, the website might be hosted on Server A, while the login page and all the authentication lookups that go along with it are hosted on Server B. This way, the process of a new user logging into an account doesn't steal resources from other users actively using the site. + +#### Load balancing the cloud + +Cloud computing uses [containers][3], so there aren't usually separate physical servers to handle distinct tasks (actually, there are many separate servers, but they're clustered together to act as one computational "brain"). Instead, a "pod" is created from several containers. When one pod starts to run out of resources due to its user or task load, an identical pod is generated. Pods share storage and network resources, and each pod is assigned to a compute node as it's created. Pods can be created or destroyed on demand as the load requires so that users experience consistent quality of service regardless of how many users there are. + +#### Edge computing + +[Edge computing][4] takes the physical world into account when load balancing. The cloud is naturally a distributed system, but in practice, a cloud's nodes are usually concentrated in a few data centers. The further a user is from the data center running the cloud, the more physical barriers they must overcome for optimal service. Even with fiber connections and proper load balancing, the response time of a server located 3,000 miles away is likely greater than the response time of something just 300 miles away. + +Edge computing brings compute nodes to the "edge" of the cloud in an attempt to bridge the geographic divide, forming a sort of satellite network for the cloud, so it also plays a part in a good load-balancing effort. + +### What is a load-balancing algorithm? + +There are many strategies for load balancing, and they range in complexity depending on what technology is involved and what the requirements demand. Load balancing doesn't have to be complicated, and it's important, even when using specialized software like [Kubernetes][5] or [Keepalived][6], to start load balancing from inception. + +Don't rely on containers to balance the load when you could design your application to take simple precautions on its own. If you design your application to be modular and ephemeral from the start, then you'll benefit from the load balancing opportunities made available by clever network design, container orchestration, and whatever tomorrow's technology brings. + +Some popular algorithms that can guide your efforts as an application developer or network engineer include: + + * Assign tasks to servers sequentially (this is often called _round-robin_). + * Assign tasks to the server that's currently the least busy. + * Assign tasks to the server with the best response time. + * Assign tasks randomly. + + + +These principles can be combined or weighted to favor, for instance, the most powerful server in a group when assigning particularly complex tasks. [Orchestration][7] is commonly used so that an administrator doesn't have to drum up the perfect algorithm or strategy for load balancing, although sometimes it's up to the admin to choose which combination of load balancing schemes to use. + +### Expect the unexpected + +Load balancing isn't really about ensuring that all your resources are used evenly across your network. Load balancing is all about guaranteeing a reliable user experience even when the unexpected happens. Good infrastructure can withstand a computer crash, application overload, onslaught of network traffic, and user errors. Think about how your service can be resilient and design load balancing accordingly from the ground up. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/load-balancing + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/water-stone-balance-eight-8.png?itok=1aht_V5V (eight stones balancing) +[2]: https://opensource.com/business/15/4/nginx-open-source-platform +[3]: https://opensource.com/resources/what-are-linux-containers +[4]: https://opensource.com/article/18/5/edge-computing +[5]: https://opensource.com/resources/what-is-kubernetes +[6]: https://www.redhat.com/sysadmin/keepalived-basics +[7]: https://opensource.com/article/20/11/orchestration-vs-automation From 78ba86b67c3d97c969db8e8ce2862e93ff88f9f0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 16 Apr 2021 05:03:30 +0800 Subject: [PATCH 134/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210415=20?= =?UTF-8?q?Resolve=20systemd-resolved=20name-service=20failures=20with=20A?= =?UTF-8?q?nsible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md --- ...lved name-service failures with Ansible.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md diff --git a/sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md b/sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md new file mode 100644 index 0000000000..392d087922 --- /dev/null +++ b/sources/tech/20210415 Resolve systemd-resolved name-service failures with Ansible.md @@ -0,0 +1,140 @@ +[#]: subject: (Resolve systemd-resolved name-service failures with Ansible) +[#]: via: (https://opensource.com/article/21/4/systemd-resolved) +[#]: author: (David Both https://opensource.com/users/dboth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Resolve systemd-resolved name-service failures with Ansible +====== +Name resolution and the ever-changing networking landscape. +![People work on a computer server with devices][1] + +Most people tend to take name services for granted. They are necessary to convert human-readable names, such as `www.example.com`, into IP addresses, like `93.184.216.34`. It is easier for humans to recognize and remember names than IP addresses, and name services allow us to use names, and they also convert them to IP addresses for us. + +The [Domain Name System][2] (DNS) is the global distributed database that maintains the data required to perform these lookups and reverse lookups, in which the IP address is known and the domain name is needed. + +I [installed Fedora 33][3] the first day it became available in October 2020. One of the major changes was a migration from the ancient Name Service Switch (NSS) resolver to [systemd-resolved][4]. Unfortunately, after everything was up and running, I couldn't connect to or even ping any of the hosts on my network by name, although using IP addresses did work. + +### The problem + +I run my own name server using BIND on my network server, and all has been good for over 20 years. I've configured my DHCP server to provide the IP address of my name server to every workstation connected to my network, and that (along with a couple of backup name servers) is stored in `/etc/resolv.conf`. + +[Michael Catanzaro][5] describes how systemd-resolved is supposed to work, but the introduction of systemd-resolved caused various strange resolution problems on my network hosts. The symptoms varied depending upon the host's purpose. The trouble mostly presented as an inability to find IP addresses for hosts inside the network on most systems. On other systems, it failed to resolve any names at all. For example, even though nslookup sometimes returned the correct IP addresses for hosts inside and outside networks, ping would not contact the designated host, nor could I SSH to that same host. Most of the time, neither the lookup, the ping, nor SSH would work unless I used the IP address in the command. + +The new resolver allegedly has four operational modes, described in this [Fedora Magazine article][6]. None of the options seems to work correctly when the network has its own name server designed to perform lookups for internal and external hosts. + +In theory, systemd-resolved is supposed to fix some corner issues around the NSS resolver failing to use the correct name server when a host is connected to a VPN, which has become a common problem with so many more people working from home. + +The new resolver is supposed to use the fact that `/etc/resolv.conf` is now a symlink to determine how it is supposed to work based on which resolve file it is linked to. systemd-resolved's man page includes details about this behavior. The man page says that setting `/etc/resolv.conf` as a symlink to `/run/systemd/resolve/resolv.conf` should cause the new resolver to work the same way the old one does, but that didn't work for me. + +### My fix + +I have seen many options on the internet for resolving this problem, but the only thing that works reliably for me is to stop and disable the new resolver. First, I deleted the existing link for `resolv.conf`, copied my preferred `resolv.conf` file to `/run/NetworkManager/resolv.conf`, and added a new link to that file in `/etc`: + + +``` +# rm -f /etc/resolv.conf +# ln -s /run/NetworkManager/resolv.conf /etc/resolv.conf +``` + +These commands stop and disable the systemd-resolved service: + + +``` +# systemctl stop systemd-resolved.service ; systemctl disable systemd-resolved.service +Removed /etc/systemd/system/multi-user.target.wants/systemd-resolved.service. +Removed /etc/systemd/system/dbus-org.freedesktop.resolve1.service. +``` + +There's no reboot required. The old resolver takes over, and name services work as expected. + +### Make it easy with Ansible + +I set up this Ansible playbook to make the necessary changes if I install a new host or an update that reverts the resolver to systemd-resolved, or if an upgrade to the next release of Fedora reverts the resolver. The `resolv.conf` file you want for your network should be located in `/root/ansible/resolver/files/`: + + +``` +################################################################################ +#                              fixResolver.yml                                 # +#------------------------------------------------------------------------------# +#                                                                              # +# This playbook configures the old nss resolver on systems that have the new   # +# systemd-resolved service installed. It copies the resolv.conf file for my    # +# network to /run/NetworkManager/resolv.conf and places a link to that file    # +# as /etc/resolv.conf. It then stops and disables systemd-resolved which       # +# activates the old nss resolver.                                              # +#                                                                              # +#------------------------------------------------------------------------------# +#                                                                              # +# Change History                                                               # +# Date        Name         Version   Description                               # +# 2020/11/07  David Both   00.00     Started new code                          # +# 2021/03/26  David Both   00.50     Tested OK on multiple hosts.              # +#                                                                              # +################################################################################ +\--- +\- name: Revert to old NSS resolver and disable the systemd-resolved service +  hosts: all_by_IP + +################################################################################ + +  tasks: +    - name: Copy resolv.conf for my network +      copy: +        src: /root/ansible/resolver/files/resolv.conf +        dest: /run/NetworkManager/resolv.conf +        mode: 0644 +        owner: root +        group: root + +    - name: Delete existing /etc/resolv.conf file or link +      file: +        path: /etc/resolv.conf +        state: absent + +    - name: Create link from /etc/resolv.conf to /run/NetworkManager/resolv.conf +      file: +        src: /run/NetworkManager/resolv.conf +        dest: /etc/resolv.conf +        state: link + +    - name: Stop and disable systemd-resolved +      systemd: +        name: systemd-resolved +        state: stopped +        enabled: no +``` + +Whichever Ansible inventory you use must have a group that uses IP addresses instead of hostnames. This command runs the playbook and specifies the name of the inventory file I use for hosts by IP address: + + +``` +`# ansible-playbook -i /etc/ansible/hosts_by_IP fixResolver.yml` +``` + +### Final thoughts + +Sometimes the best answer to a tech problem is to fall back to what you know. When systemd-resolved is more robust, I'll likely give it another try, but for now I'm glad that open source infrastructure allows me to quickly identify and resolve network problems. Using Ansible to automate the process is a much appreciated bonus. The important lesson here is to do your research when troubleshooting, and to never be afraid to void your warranty. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/systemd-resolved + +作者:[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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://opensource.com/article/17/4/introduction-domain-name-system-dns +[3]: https://opensource.com/article/20/11/new-gnome +[4]: https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html +[5]: https://blogs.gnome.org/mcatanzaro/2020/12/17/understanding-systemd-resolved-split-dns-and-vpn-configuration/ +[6]: https://fedoramagazine.org/systemd-resolved-introduction-to-split-dns/ From 62c3346448b4a03d6ba0f541d3fa8bb453d66a1b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 16 Apr 2021 08:30:49 +0800 Subject: [PATCH 135/307] translating --- ...ur files with this open source software.md | 90 ------------------- ...ur files with this open source software.md | 89 ++++++++++++++++++ 2 files changed, 89 insertions(+), 90 deletions(-) delete mode 100644 sources/tech/20210412 Encrypt your files with this open source software.md create mode 100644 translated/tech/20210412 Encrypt your files with this open source software.md diff --git a/sources/tech/20210412 Encrypt your files with this open source software.md b/sources/tech/20210412 Encrypt your files with this open source software.md deleted file mode 100644 index 0aa7803a9c..0000000000 --- a/sources/tech/20210412 Encrypt your files with this open source software.md +++ /dev/null @@ -1,90 +0,0 @@ -[#]: subject: (Encrypt your files with this open source software) -[#]: via: (https://opensource.com/article/21/4/open-source-encryption) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Encrypt your files with this open source software -====== -VeraCrypt offers open source file-encryption with cross-platform -capabilities. -![Lock][1] - -Many years ago, there was encryption software called [TrueCrypt][2]. Its source code was available, although there were no major claims that anyone had ever audited or contributed to it. Its author was (and remains to this day) anonymous. Still, it was cross-platform, easy to use, and really, really useful. - -TrueCrypt allowed you to create an encrypted file "vault," where you could store sensitive information of any kind (text, audio, video, images, PDFs, and so on). Provided you had the correct passphrase, TrueCrypt could decrypt the vault and provide read and write access on any computer running TrueCrypt. It was a useful technique that essentially provided a virtual, portable, fully encrypted drive (except it was a file) where you could safely store your data. - -TrueCrypt eventually closed down, but a replacement project called VeraCrypt quickly sprang up to fill the void. [VeraCrypt][3] is based on TrueCrypt 7.1a and features many improvements over the original (including significant algorithm changes for standard encrypted volumes and boot volumes). With VeraCrypt 1.12 and later versions, you can use custom iterations for increased encryption security. Better yet, VeraCrypt can load old TrueCrypt volumes, so if you were a TrueCrypt user, it's easy to transfer them over to VeraCrypt. - -### Install VeraCrypt - -You can install VeraCrypt on all major platforms by downloading the appropriate installer file from the [VeraCrypt download page][4]. - -Alternately, you can build it yourself from source code. On Linux, it requires wxGTK3, makeself, and the usual development stack (Binutils, GCC, and so on). - -Once you have it installed, launch VeraCrypt from your application menu. - -### Create a VeraCrypt volume - -If you're new to VeraCrypt, you must create a VeraCrypt volume first (otherwise, you have nothing to decrypt). In the VeraCrypt window, click the **Create Volume** button on the left. - -![Creating a volume with VeraCrypt][5] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - -In VeraCrypt's **Volume Creator Wizard** window that appears, choose whether you want to create an encrypted file container or to encrypt an entire drive. The wizard steps you through creating a vault for your data, so follow along as prompted. - -For this article, I created a file container. A VeraCrypt container is a lot like any other file: it exists on a hard drive, external drive, in cloud storage, or anywhere else you can think to store data. Like other files, it can be moved, copied, and deleted. Unlike most other files, it can _contain_ more files, which is why I think of it as a "vault," and VeraCrypt developers refer to it as a "container." Its developers call a VeraCrypt file a "container" because it can contain other data objects; it has nothing to do with the container technology made popular by LXC, Kubernetes, and other modern IT mechanisms. - -#### Choose a filesystem - -During the volume-creation process, you're asked to select a filesystem to decide how the files you place inside your vault are stored. The Microsoft FAT format is archaic, non-journaled, and limits both volume and file sizes, but it's the one format all platforms can read from and write to. If you intend your VeraCrypt vault to cross platforms, FAT is your best bet. - -Aside from that, NTFS works for Windows and Linux. The open source EXT series works for Linux. - -### Mount a VeraCrypt volume - -Once you've created a VeraCrypt volume, you can mount it from within the VeraCrypt window. To mount an encrypted vault, click the **Select File** button on the right. Select your encrypted file, choose one of the numbered slots in the upper half of the VeraCrypt window, and then click the **Mount** button located in the lower-left corner of the VeraCrypt window. - -Your mounted volume is available in the list of available volumes in the VeraCrypt window, and you can access that volume through your file manager as if it were an external drive. For instance, on KDE, I open [Dolphin][7], navigate to `/media/veracrypt1`, and then I can copy files into my vault. - -As long as you have VeraCrypt on a device, you can always access your vault. It's encrypted until you manually mount it in VeraCrypt, where it remains decrypted until you close the volume again. - -### Close a VeraCrypt volume - -To keep your data safe, it's important to close a VeraCrypt volume when you don't need it open. That keeps it safe from prying eyes and crimes of opportunity. - -![Mounting a VeraCrypt volume][8] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - -Closing up the VeraCrypt container is about as easy as it is to open one: Select the listed volume in the VeraCrypt window, and click **Dismount**. You no longer have access to the files inside your vault, and neither does anyone else. - -### VeraCrypt for easy cross-platform encryption - -There are many ways to keep your data secure, and VeraCrypt tries to make it easy for you, regardless of what platform you need to use that data on. If you want to experience easy, open source file encryption, try VeraCrypt. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/open-source-encryption - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) -[2]: https://en.wikipedia.org/wiki/TrueCrypt -[3]: https://www.veracrypt.fr/en/Home.html -[4]: https://www.veracrypt.fr/en/Downloads.html -[5]: https://opensource.com/sites/default/files/uploads/veracrypt-create.jpg (Creating a volume with VeraCrypt) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://en.wikipedia.org/wiki/Dolphin_%28file_manager%29 -[8]: https://opensource.com/sites/default/files/uploads/veracrypt-volume.jpg (Mounting a VeraCrypt volume) diff --git a/translated/tech/20210412 Encrypt your files with this open source software.md b/translated/tech/20210412 Encrypt your files with this open source software.md new file mode 100644 index 0000000000..9bbb82ac9d --- /dev/null +++ b/translated/tech/20210412 Encrypt your files with this open source software.md @@ -0,0 +1,89 @@ +[#]: subject: (Encrypt your files with this open source software) +[#]: via: (https://opensource.com/article/21/4/open-source-encryption) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个开源软件加密你的文件 +====== +VeraCrypt 提供跨平台的开源文件加密功能。 +![Lock][1] + +许多年前,有一个名为 [TrueCrypt][2] 的加密软件。它的源码是可以得到的,尽管没有任何人声称曾对它进行过审计或贡献过。它的作者是(至今仍是)匿名的。不过,它是跨平台的,易于使用,而且真的非常有用。 + +TrueCrypt 允许你创建一个加密的文件“保险库”,在那里你可以存储任何类型的敏感信息(文本、音频、视频、图像、PDF 等)。只要你有正确的口令,TrueCrypt 就可以解密保险库,并在任何运行 TrueCrypt 的电脑上提供读写权限。这是一项有用的技术,它基本上提供了一个虚拟的、可移动的、完全加密的驱动器(除了文件以外),你可以在其中安全地存储你的数据。 + +TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴起,填补了这一空白。[VeraCrypt][3] 基于 TrueCrypt 7.1a,比原来的版本有许多改进(包括标准加密卷和引导卷的算法的重大变化)。在 VeraCrypt 1.12 及以后的版本中,你可以使用自定义迭代来提高加密安全性。更好的是,VeraCrypt 可以加载旧的 TrueCrypt 卷,所以如果你是 TrueCrypt 用户,可以很容易地将它们转移到 VeraCrypt 上。 + +### 安装 VeraCrypt + +你可以从 [VeraCrypt 下载页面][4]下载相应的安装文件,之后在所有主流平台上安装 VeraCrypt。 + +另外,你也可以自己从源码构建它。在 Linux 上,它需要 wxGTK3、makeself 和通常的开发栈(Binutils、GCC 等)。 + +当你安装后,从你的应用菜单中启动 VeraCrypt。 + +### 创建一个 VeraCrypt 卷 + +如果你刚接触 VeraCrypt,你必须先创建一个 VeraCrypt 加密卷(否则,你没有任何东西可以解密)。在 VeraCrypt 窗口中,点击左侧的 **Create Volume** 按钮。 + +![Creating a volume with VeraCrypt][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +在出现的 VeraCrypt 的**卷创建向导**窗口中,选择要创建一个加密文件容器还是要加密整个驱动器。向导将为你的数据创建一个保险库,所以请按照提示进行操作。 + +在本文中,我创建了一个文件容器。VeraCrypt 容器和其他文件很像:它保存在硬盘、外置硬盘、云存储或其他任何你能想到的存储数据的地方。与其他文件一样,它可以被移动、复制和删除。与大多数其他文件不同的是,它可以_容纳_更多的文件,这就是为什么我认为它是一个“保险库”,而 VeraCrypt 开发者将其称为“容器”。它的开发者将 VeraCrypt 文件称为“容器”,因为它可以包含其他数据对象;它与 LXC、Kubernetes 和其他现代 IT 机制所流行的容器技术无关。 + +#### 选择一个文件系统 + +在创建卷的过程中,你会被要求选择一个文件系统来决定你放在保险库中的文件的存储方式。微软 FAT 格式是过时的、非日志型,并且限制了卷和文件的大小,但它是所有平台都能读写的一种格式。如果你打算让你的 VeraCrypt 保险库跨平台,FAT 是你最好的选择。 + +除此之外,NTFS 适用于 Windows 和 Linux。开源的 EXT 系列适用于 Linux。 + +### 挂载 VeraCrypt 加密卷 + +当你创建了 VeraCrypt 卷,你就可以在 VeraCrypt 窗口中加载它。要挂载一个加密库,点击右侧的 **Select File** 按钮。选择你的加密文件,选择 VeraCrypt 窗口上半部分的一个编号栏,然后点击位于 VeraCrypt 窗口左下角的 **Mount** 按钮。 + +你挂载的卷在 VeraCrypt 窗口的可用卷列表中,你可以通过文件管理器访问该卷,就像访问一个外部驱动器一样。例如,在 KDE 上,我打开 [Dolphin][7],进入 `/media/veracrypt1`,然后我就可以把文件复制到我的保险库里。 + +只要你的设备上有 VeraCrypt,你就可以随时访问你的保险库。在你手动在 VeraCrypt 中挂载之前,文件都是加密的,在那里,文件会保持解密,直到你再次关闭卷。 + +### 关闭 VeraCrypt 卷 + +为了保证你的数据安全,当你不需要打开 VeraCrypt 卷时,关闭它是很重要的。这样可以保证数据的安全,不被人窥视,且不被人趁机犯罪。 + +![Mounting a VeraCrypt volume][8] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + +关闭 VeraCrypt 容器和打开容器一样简单。在 VeraCrypt 窗口中选择列出的卷,然后点击 **Dismount**。你就不再能访问保险库中的文件,其他人也不会再有访问权。 + +### VeraCrypt 轻松实现跨平台加密 + +有很多方法可以保证你的数据安全,VeraCrypt 试图为你提供方便,而无论你需要在什么平台上使用这些数据。如果你想体验简单、开源的文件加密,请尝试 VeraCrypt。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-encryption + +作者:[Seth Kenlon][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/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) +[2]: https://en.wikipedia.org/wiki/TrueCrypt +[3]: https://www.veracrypt.fr/en/Home.html +[4]: https://www.veracrypt.fr/en/Downloads.html +[5]: https://opensource.com/sites/default/files/uploads/veracrypt-create.jpg (Creating a volume with VeraCrypt) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://en.wikipedia.org/wiki/Dolphin_%28file_manager%29 +[8]: https://opensource.com/sites/default/files/uploads/veracrypt-volume.jpg (Mounting a VeraCrypt volume) From 7fe4cf285a094163190efacab762aa3cb4967bd9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 16 Apr 2021 08:35:58 +0800 Subject: [PATCH 136/307] translating --- .../20210413 Create and Edit EPUB Files on Linux With Sigil.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md index afa283e131..571cef2f5b 100644 --- a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/sigile-epub-editor/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 90ad01a37d8eadfa51e2cac0890affcb8f45ecda Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Apr 2021 08:57:44 +0800 Subject: [PATCH 137/307] PUB @wxy https://linux.cn/article-13301-1.html --- ...nt on your code freely with Git worktree.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) rename {translated/tech => published}/20210406 Experiment on your code freely with Git worktree.md (80%) diff --git a/translated/tech/20210406 Experiment on your code freely with Git worktree.md b/published/20210406 Experiment on your code freely with Git worktree.md similarity index 80% rename from translated/tech/20210406 Experiment on your code freely with Git worktree.md rename to published/20210406 Experiment on your code freely with Git worktree.md index ffffba7845..b684e0e46f 100644 --- a/translated/tech/20210406 Experiment on your code freely with Git worktree.md +++ b/published/20210406 Experiment on your code freely with Git worktree.md @@ -4,25 +4,25 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13301-1.html) 使用 Git 工作树对你的代码进行自由实验 ====== > 获得自由尝试的权利,同时在你的实验出错时可以安全地拥有一个新的、链接的克隆存储库。 -![带烧杯的科学实验室][1] +![](https://img.linux.net.cn/data/attachment/album/202104/16/085512x3auafu5uaymk52u.jpg) -Git 的设计部分是为了进行实验。如果你知道你的工作会被安全地跟踪,并且在出现严重错误时有安全状态存在,你就不会害怕尝试新的想法。不过,创新的部分代价是,你很可能会在过程中弄得一团糟。文件会被重新命名、移动、删除、更改、切割成碎片;新的文件被引入;你不打算跟踪的临时文件会在你的工作目录中占据一席之地等等。 +Git 的设计部分是为了进行实验。如果你知道你的工作会被安全地跟踪,并且在出现严重错误时有安全状态存在,你就不会害怕尝试新的想法。不过,创新的部分代价是,你很可能会在这个过程中弄得一团糟。文件会被重新命名、移动、删除、更改、切割成碎片;新的文件被引入;你不打算跟踪的临时文件会在你的工作目录中占据一席之地等等。 -简而言之,你的工作空间变成了纸牌屋,在“快好了!”和“哦,不,我做了什么?”之间岌岌可危地平衡着。那么,当你需要把仓库恢复到下午的一个已知状态,以便完成一些真正的工作时,该怎么办?我立刻想到了 `git branch` 和 [git stash][2] 这两个经典命令,但这两个命令都不是用来处理未被跟踪的文件的,而且文件路径的改变和其他重大的转变也会让人困惑,它们只能把工作藏(`stash`)起来以备后用。解决这个需求的答案是 Git 工作树。 +简而言之,你的工作空间变成了纸牌屋,在“快好了!”和“哦,不,我做了什么?”之间岌岌可危地平衡着。那么,当你需要把仓库恢复到下午的一个已知状态,以便完成一些真正的工作时,该怎么办?我立刻想到了 `git branch` 和 [git stash][2] 这两个经典命令,但这两个命令都不是用来处理未被跟踪的文件的,而且文件路径的改变和其他重大的转变也会让人困惑,它们只能把工作暂存(`stash`)起来以备后用。解决这个需求的答案是 Git 工作树。 ### 什么是 Git 工作树 -Git 工作树是 Git 仓库的一个链接副本,允许你同时签出多个分支。工作树与主工作副本的路径是分开的,它可以处于不同的状态和不同的分支上。在 Git 中新建工作树的好处是,你可以在不干扰当前工作环境的情况下,做出与当前任务无关的修改,提交修改,然后在以后再合并。 +Git 工作树worktree是 Git 仓库的一个链接副本,允许你同时签出多个分支。工作树与主工作副本的路径是分开的,它可以处于不同的状态和不同的分支上。在 Git 中新建工作树的好处是,你可以在不干扰当前工作环境的情况下,做出与当前任务无关的修改、提交修改,然后在以后合并。 -直接从 `git-worktree` 手册中找到了一个典型的例子:当你正在为一个项目做一个令人兴奋的新功能时,你的项目经理告诉你有一个紧急的修复工作。问题是你的工作仓库(你的“工作树”)处于混乱状态,因为你正在开发一个重要的新功能。你不想在当前的冲刺中“偷偷地”进行修复,而且你也不愿意把变更藏(`stash`)起来,为修复创建一个新的分支。相反,你决定创建一个新的工作树,这样你就可以在那里进行修复: +直接从 `git-worktree` 手册中找到了一个典型的例子:当你正在为一个项目做一个令人兴奋的新功能时,你的项目经理告诉你有一个紧急的修复工作。问题是你的工作仓库(你的“工作树”)处于混乱状态,因为你正在开发一个重要的新功能。你不想在当前的冲刺中“偷偷地”进行修复,而且你也不愿意把变更暂存起来,为修复创建一个新的分支。相反,你决定创建一个新的工作树,这样你就可以在那里进行修复: ``` $ git branch | tee @@ -75,7 +75,7 @@ $ git worktree list /home/seth/code/hotfix     09e585d [master] ``` -你可以在任何一个工作树中使用这个功能。工作树始终是链接的(除非你手动移动它们,破坏 Git 定位工作树的能力,从而切断链接)。 +你可以在任何一个工作树中使用这个功能。工作树始终是连接的(除非你手动移动它们,破坏 Git 定位工作树的能力,从而切断连接)。 ### 移动工作树 @@ -132,4 +132,4 @@ via: https://opensource.com/article/21/4/git-worktree [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/science_experiment_beaker_lab.png?itok=plKWRhlU (Science lab with beakers) -[2]: https://opensource.com/article/21/4/git-stash +[2]: https://linux.cn/article-13293-1.html From 14561c1cb9258ad81d2965e5960896536355c007 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Apr 2021 09:07:27 +0800 Subject: [PATCH 138/307] PRF @geekpi --- ...Install Steam on Fedora -Beginner-s Tip.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md index 2a51d86e0f..010070c0ef 100644 --- a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ b/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -3,26 +3,28 @@ [#]: author: (John Paul https://itsfoss.com/author/john/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -如何在 Fedora 上安装 Steam(入门技巧) +如何在 Fedora 上安装 Steam ====== -Steam 对 Linux 游戏玩家来说是最好的事情。由于 Steam,你可以在 Linux 上玩成百上千的游戏。 +![](https://img.linux.net.cn/data/attachment/album/202104/16/090703cg4t5npnseskhxhv.jpg) -如果你还不知道,Steam 是最流行的 PC 游戏平台。2013 年,它开始适用于 Linux。[Steam 最新的 Proton 项目][1]允许你在 Linux 上玩为 Windows 平台创建的游戏。这让 Linux 游戏库增强了许多倍。 +Steam 对 Linux 游戏玩家来说是最好的东西了。由于 Steam,你可以在 Linux 上玩成百上千的游戏。 + +如果你还不知道,Steam 是最流行的 PC 游戏平台。2013 年,它开始可以在 Linux 使用。[Steam 最新的 Proton 项目][1] 允许你在 Linux 上玩为 Windows 平台创建的游戏。这让 Linux 游戏库增强了许多倍。 ![][2] Steam 提供了一个桌面客户端,你可以用它从 Steam 商店下载或购买游戏,然后安装并玩它。 -过去我们曾讨论过[在 Ubuntu 上安装 Steam][3]。在这个初学者教程中,我将向你展示在 Fedora Linux 上安装 Steam 的步骤。 +过去我们曾讨论过 [在 Ubuntu 上安装 Steam][3]。在这个初学者教程中,我将向你展示在 Fedora Linux 上安装 Steam 的步骤。 ### 在 Fedora 上安装 Steam -要在 Fedora 上使用 Steam,你必须使用 RMPFusion 软件库。[RPMFusion][4] 是一系列第三方软件库,其中包含了 Fedora 选择不与它们的操作系统一起发布的软件。它们提供自由(开源)和非自由(闭源)的软件库。由于 Steam 在非自由软件库中,你将只安装那一个。 +要在 Fedora 上使用 Steam,你必须使用 RMPFusion 软件库。[RPMFusion][4] 是一套第三方软件库,其中包含了 Fedora 选择不与它们的操作系统一起发布的软件。它们提供自由(开源)和非自由(闭源)的软件库。由于 Steam 在非自由软件库中,你将只安装那一个。 我将同时介绍终端和图形安装方法。 @@ -44,15 +46,15 @@ sudo dnf install steam ![Install Steam via command line][5] -输入密码后按 “Y” 接受。安装完毕后,打开 Steam,玩一些游戏。 +输入密码后按 `Y` 接受。安装完毕后,打开 Steam,玩一些游戏。 #### 方法 2:通过 GUI 安装 Steam -你可以从软件中心[启用 Fedora 上的第三方仓库][6]。打开软件中心并点击菜单。 +你可以从软件中心 [启用 Fedora 上的第三方仓库][6]。打开软件中心并点击菜单。 ![][7] -在 Software Repositories 窗口中,你会看到顶部有一个 “Third Party Repositories”。点击 “Install” 按钮。当提示你输入密码时,就完成了。 +在 “软件仓库” 窗口中,你会看到顶部有一个 “第三方软件仓库”。点击 “安装” 按钮。当提示你输入密码时,就完成了。 ![][8] @@ -95,7 +97,7 @@ via: https://itsfoss.com/install-steam-fedora/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b7a3fff4f16fa335f0d329905873b5a46b688311 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 16 Apr 2021 09:08:04 +0800 Subject: [PATCH 139/307] PUB @geekpi https://linux.cn/article-13302-1.html --- ...20210410 How to Install Steam on Fedora -Beginner-s Tip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210410 How to Install Steam on Fedora -Beginner-s Tip.md (98%) diff --git a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md b/published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md similarity index 98% rename from translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md rename to published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md index 010070c0ef..9aa71925fa 100644 --- a/translated/tech/20210410 How to Install Steam on Fedora -Beginner-s Tip.md +++ b/published/20210410 How to Install Steam on Fedora -Beginner-s Tip.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13302-1.html) 如何在 Fedora 上安装 Steam ====== From 4dcfe5707d9b16ee6de9e25fce8f1461c3db6aad Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Fri, 16 Apr 2021 09:40:00 +0800 Subject: [PATCH 140/307] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...t tips for managing your home directory.md | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/sources/tech/20210405 7 Git tips for managing your home directory.md index 3d6beeb574..f79436921e 100644 --- a/sources/tech/20210405 7 Git tips for managing your home directory.md +++ b/sources/tech/20210405 7 Git tips for managing your home directory.md @@ -7,54 +7,50 @@ [#]: publisher: ( ) [#]: url: ( ) -7 Git tips for managing your home directory +7个管理家目录的 Git 技巧 ====== -Here is how I set up Git to manage my home directory. -![Houses in a row][1] +这是我怎样设置 Git 来管理我的家目录的方法。 +![一排房子][1] -I have several computers. I've got a laptop at work, a workstation at home, a Raspberry Pi (or four), a [Pocket CHIP][2], a [Chromebook running various forms of Linux][3], and so on. I used to set up my user environment on each computer by more or less following the same steps, and I often told myself that I enjoyed that each one was slightly unique. For instance, I use [Bash aliases][4] more often at work than at home, and the helper scripts I use at home might not be useful at work. +我有几台电脑。我有一台笔记本电脑在工作,一台工作站在家里,一台 Raspberry Pi(或四台),一台 [Pocket CHIP][2],一台 [运行各种不同的 Linux 的 Chromebook][3],等等。我过去常常按照相同的步骤或多或少地在每台计算机上设置我的用户环境,而且我经常告诉自己,我喜欢每台计算机都略微独特。例如,我在工作中比在家里更经常使用 [Bash 别名][4],并且我在家里使用的帮助脚本可能对工作没有用。 -Over the years, my expectations across devices began to merge, and I'd forget that a feature I'd built up on my home machine wasn't ported over to my work machine, and so on. I needed a way to standardize my customized toolkit. The answer, to my surprise, was Git. +这些年来,我对各种设备的期望开始相融,而我忘记了我在家用计算机上建立的功能没有移植到我的工作计算机上,诸如此类。我需要一种标准化我的自定义工具包的方法。使我感到意外的答案是 Git。 -Git is version-tracker software. It's famously used by the biggest and smallest open source projects and even by the largest proprietary software companies. But it was designed for source code—not a home directory filled with music and video files, games, photos, and so on. I'd heard of people managing their home directory with Git, but I assumed that it was a fringe experiment done by coders, not real-life users like me. +Git 是版本跟踪器软件。它著名于使用在最大和最小的开源项目,甚至最大的专利软件公司。但是它是为源代码设计的,而不是一个充满音乐和视频文件,游戏,照片等的家目录。我听说有人使用 Git 管理其家目录,但我认为这是编码人员进行的一项附带实验,而不是像我这样的现实生活中的用户。 -Managing my home directory with Git has been an evolving process. I've learned and adapted along the way. Here are the things you might want to keep in mind should you decide to manage your home directory with Git. +用 Git 管理我的家目录是一个不断发展的过程。随着时间的推移我一直在学习和适应。如果您决定使用 Git 管理家目录,则可能需要记住以下几点。 -### 1\. Text and binary locations +### 1\. 文本和二进制位置 -![home directory][5] +![家目录][5] (Seth Kenlon, [CC BY-SA 4.0][6]) -When managed by Git, your home directory becomes something of a no-man 's-land for everything but configuration files. That means when you open your home directory, you should see nothing but a list of predictable directories. There shouldn't be any stray photos or LibreOffice documents, and no "I'll put this here for just a minute" files. +当由 Git 管理时,除了配置文件之外,您的家目录对于所有内容而言都是"无人之地"。这意味着当您打开主目录时,除了可预见的目录的列表之外,您什么都看不到。不应有任何无主的照片或 LibreOffice 文档,也不应有 “我将其放在此处仅一分钟(临时)” 的文件。 -The reason for this is simple: when you manage your home directory with Git, everything in your home directory that's _not_ being committed becomes noise. Every time you do a `git status`, you'll have to scroll past any file that Git isn't tracking, so it's vital that you keep those files in subdirectories (which you add to your `.gitignore` file). +原因很简单:使用 Git 管理家目录时,家目录中所有 _未_ 提交的内容都会变得杂乱无章。每次执行 `git status` 时,您都必须滚动到过去任何 Git 未跟踪的文件,因此将这些文件保存在子目录(添加到 `.gitignore` 文件中)至关重要。 -Many Linux distributions provide a set of default directories: +许多 Linux 发行版提供了一组默认目录: - * Documents - * Downloads - * Music - * Photos - * Templates - * Videos + * 文档 + * 下载 + * 音乐 + * 相片 + * 模板 + * 视频 +如果需要,您可以创建更多。例如,我区分创作的音乐(音乐)和购买的聆听音乐(专辑)。同样,我的 Cinema (电影)目录包含其他人的电影,而 Videos (视频目录)包含我需要编辑的视频文件。换句话说,我的默认目录结构比大多数 Linux 发行版提供的默认集更详细,但是我认为这样做有好处。如果没有适合您的目录结构,由于缺少更好的存放位置,您将更有可能将其存放在家目录中,因此请提前考虑并计划适合您的工作目录。您以后总是可以添加更多,但是最好先开始擅长的。 +### 2\. 设置最优的 `.gitignore` -You can create more if you need them. For instance, I differentiate between the music I create (Music) and the music I purchase to listen to (Albums). Likewise, my Cinema directory contains movies by other people, while Videos contains video files I need for editing. In other words, my default directory structure has more granularity than the default set provided by most Linux distributions, but I think there's a benefit to that. Without a directory structure that works for you, you'll be more likely to just stash stuff in your home directory, for lack of a better place for it, so think ahead and plan out directories that work for you. You can always add more later, but it's best to start strong. - -### 2\. Setting up your very best .gitignore - -Once you've cleaned up your home directory, you can instantiate it as a Git repository as usual: - +清理家目录后,您可以像往常一样将其作为 Git 存储库实例化: ``` $ cd $ git init . ``` -Your Git repository contains nothing yet, so everything in your home directory is untracked. Your first job is to sift through the list of untracked files and determine what you want to remain untracked. To see untracked files: - +您的 Git 信息库还没有任何内容,因此您的家目录中的所有内容均未被跟踪。您的第一项工作是筛选未跟踪文件的列表,并确定要保持未跟踪状态的文件。要查看未跟踪的文件: ``` $ git status @@ -69,52 +65,51 @@ $ git status [...] ``` -Depending on how long you've been using your home directory, this list may be long. The easy ones are the directories you decided on in the first step. By adding these to a hidden file called `.gitignore`, you tell Git to stop listing them as untracked files and never to track them: - +根据您使用家目录的时间长短,此列表可能很长。简单的目录是您在第一步中确定的目录。通过将它们添加到名为 `.gitignore` 的隐藏文件中,您告诉 Git 停止将它们列为未跟踪文件,并且从不对其进行跟踪: ``` `$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore` ``` -With that done, go through the remaining untracked files shown by `git status` and determine whether any other files warrant exclusion. This process helped me discover several stale old configuration files and directories, which I ended up trashing altogether, but also some that were very specific to one computer. I was fairly strict here because many configuration files do better when they're auto-generated. For instance, I never commit my KDE configuration files because many contain information like recent documents and other elements that don't exist on another machine. +完成后,浏览 `git status` 所示的其余未跟踪文件,并确定是否有其他文件需要授权排除。这个过程帮助我发现了几个陈旧的配置文件和目录,这些文件和目录最终被我全部丢弃了,而且还发现了一些特定于一台计算机的文件和目录。我在这里非常严格,因为许多配置文件在自动生成时会做得更好。例如,我从未提交过 KDE 配置文件,因为许多文件包含诸如最新文档之类的信息以及其他机器上不存在的其他元素。 -I track my personalized configuration files, scripts and utilities, profile and Bash configs, and cheat sheets and other snippets of text that I refer to frequently. If the software is mostly responsible for maintaining a file, I ignore it. And when in doubt about a file, I ignore it. You can always un-ignore it later (by removing it from your `.gitignore` file). +我跟踪我的个性化配置文件,脚本和实用程序,配置文件和 Bash 配置以及速查表和我经常引用的其他文本片段。如果该软件主要负责维护文件,则将其忽略。当对文件有疑问时,我将其忽略。您以后总是可以取消忽略它(通过从 .gitignore 文件中删除它)。 -### 3\. Get to know your data +### 3\. 了解您的数据 -I'm on KDE, so I use the open source scanner [Filelight][7] to get an overview of my data. Filelight gives you a chart that lets you see the size of each directory. You can navigate through each directory to see what's taking up all the space and then backtrack to investigate elsewhere. It's a fascinating view of your system, and it lets you see your files in a completely new light. +我正在使用 KDE,因此我使用开源扫描程序 [Filelight][7] 来获取我的数据概述。Filelight 为您提供了一个图表,可让您查看每个目录的大小。您可以浏览每个目录以查看占用了所有空间的内容,然后回溯调查其他地方。这是您系统的迷人视图,它使您可以以全新的方式查看文件。 ![Filelight][8] (Seth Kenlon, [CC BY-SA 4.0][6]) -Use Filelight or a similar utility to find unexpected caches of data you don't need to commit. For instance, the KDE file indexer (Baloo) generates quite a lot of data specific to its host that I definitely wouldn't want to transport to another computer. +使用 Filelight 或类似的实用程序查找不需要提交的意外数据缓存。例如,KDE 文件索引器(Baloo)生成了大量特定于其主机的数据,我绝对不希望将其传输到另一台计算机。 -### 4\. Don't ignore your .gitignore file +### 4\. 不要忽略您的 .gitignore 文件 -On some projects, I tell Git to ignore my `.gitignore` file because what I want to ignore is sometimes specific to my working directory, and I don't presume other developers on the same project need me to tell them what their `.gitignore` file ought to look like. Because my home directory is for my use only, I do _not_ ignore my home's `.gitignore` file. I commit it along with other important files, so it's inherited across all of my systems. And of course, all of my systems are identical from the home directory's viewpoint: they have the same set of default folders and many of the same hidden configuration files. +在某些项目中,我告诉 Git 忽略我的`.gitignore`文件,因为有时我要忽略的内容特定于我的工作目录,并且我不认为同一项目中的其他开发人员需要我告诉他们的 `.gitignore` 文件的内容应该看起来像什么。因为我的家目录仅供我使用,所以我 _不_ 会忽略我的家目录的 `.gitignore` 文件。我将其与其他重要文件一起提交,因此它已在我的所有系统中被继承。当然,从家目录的角度来看,我所有的系统都是相同的:它们具有相同的默认文件夹集和许多相同的隐藏配置文件。 -### 5\. Don't fear the binary +### 5\. 不要担心二进制文件 -I put my system through weeks and weeks of rigorous testing, convinced that it was _never_ wise to commit binary files to Git. I tried GPG encrypted password files, I tried LibreOffice documents, JPEGs, PNGs, and more. I even had a script that unarchived LibreOffice files before adding them to Git, extracted the XML inside so I could commit just the XML, and then rebuilt the LibreOffice file so that I could work on it within LibreOffice. My theory was that committing XML would render a smaller Git repository than a ZIP file (which is all a LibreOffice document really is). +我对系统进行了数周的严格测试,确信将二进制文件提交到 Git 是绝对不明智的。我尝试了 GPG 加密的密码文件,尝试了 LibreOffice 文档,JPEG,PNG 等等。我甚至有一个脚本,可以在将 LibreOffice 文件添加到 Git 之前取消存档,然后提取其中的 XML,以便仅提交 XML,然后重新构建 LibreOffice 文件,以便可以在 LibreOffice 中继续工作。我的理论是,提交 XML 会比使用 ZIP 文件(这实际上是 LibreOffice 文档的全部)提供一个更小的 Git 存储库。 -To my great surprise, I found that committing a few binary files every now and then did not substantially increase the size of my Git repository. I've worked with Git long enough to know that if I were to commit gigabytes of binary data, my repository would suffer, but the occasional binary file isn't an emergency to avoid at all costs. +令我惊讶的是,我发现不时提交一些二进制文件并没有实质性地增加我的 Git 存储库的大小。我使用 Git 已经很长时间了,以至于如果我要提交千兆字节的二进制数据,我的存储库将会遭受损失,但是偶尔的二进制文件并不是不惜一切代价避免的紧急情况。 -Armed with this new confidence, I add font OTF and TTF files to my standard home repo, my `.face` file for GDM, and other incidental minor binary blobs. Don't overthink it, don't waste time trying to avoid it; just commit it. +有了这种信心,我将字体 OTF 和 TTF 文件添加到我的标准主存储库,GDM 的`.face`文件以及其他附带的次要二进制 Blob 文件。不要想太多,不要浪费时间去避免它。只需提交即可。 -### 6\. Use a private repo +### 6\. 使用私有存储库 -Don't commit your home directory to a public Git repository, even if the host offers private accounts. If you're like me, you have SSH keys and GPG keychains and GPG-encrypted files that ought not end up on anybody's server but my own. +即使主机提供私人帐户,也不要将您的主目录提交到公共 Git 存储库。如果您像我一样,拥有 SSH 密钥,GPG 密钥链和 GPG 加密的文件,这些属于自己的文件不应该出现在任何人的服务器上。 -I [run a local Git server][9] on a Raspberry Pi (it's easier than you think), so I can update any computer any time I'm home. I'm a remote worker, so that's usually good enough, but I can also reach the computer when traveling over my [VPN][10]. +我在 Raspberry Pi 上[运行本地 Git 服务器][9](这比您想象的要容易),因此我可以在家里时随时更新任何一台计算机。我是一名远程工作者,所以通常情况下就足够了,但是我也可以通过 [VPN][10] 访问计算机。 -### 7\. Remember to push +### 7\. 要记得推送 -The thing about Git is that it only pushes changes to your server when you tell it to. If you're a longtime Git user, this process is probably natural to you. For new users who might be accustomed to the automatic synchronization in Nextcloud or Syncthing, this may take some getting used to. +关于 Git ,仅当您通知服务器时,它才会将更改推送到您的服务器。如果您是 Git 的长期用户,则此过程可能对您很自然。对于可能习惯于 Nextcloud 或 Syncthing 自动同步的新用户,这可能需要一些时间来适应。 -### Git at home +### Git 家目录 -Managing my common files with Git hasn't just made life more convenient across devices. Knowing that I have a full history for all my configurations and utility scripts encourages me to try out new ideas because it's always easy to roll back my changes if they turn out to be _bad_ ideas. Git has rescued me from an ill-advised umask setting in `.bashrc`, a poorly executed late-night addition to my package management script, and an it-seemed-like-a-cool-idea-at-the-time change of my [rxvt][11] color scheme—and probably a few other mistakes in my past. Try Git in your home because a home that commits together merges together. +使用 Git 管理我的通用文件并没有使跨设备的生活更加便利。知道我对所有配置和实用程序脚本都有完整的历史记录,这会鼓励我尝试新的想法,因为如果结果变得 _很糟糕_,则很容易回滚我的更改。 Git 已将我从在 `.bashrc` 文件欠考虑的掩码设置中解救出来,对于我的软件包管理脚本糟糕的深夜附加物,并且更改 [rxvt][11] 配色方案以及过去的其他一些错误这时看起来像一个很酷的想法。在家(目录)中尝试 Git,因为一起提交的家(目录)会合并在一起。 -------------------------------------------------------------------------------- From da2e0675b6994fb38f6e2684bd4514e483abe8f0 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Fri, 16 Apr 2021 13:11:26 +0800 Subject: [PATCH 141/307] movefile --- .../tech/20210405 7 Git tips for managing your home directory.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210405 7 Git tips for managing your home directory.md (100%) diff --git a/sources/tech/20210405 7 Git tips for managing your home directory.md b/translated/tech/20210405 7 Git tips for managing your home directory.md similarity index 100% rename from sources/tech/20210405 7 Git tips for managing your home directory.md rename to translated/tech/20210405 7 Git tips for managing your home directory.md From b572776e77cc629fc53cd1ed9a3bf15973e16bfb Mon Sep 17 00:00:00 2001 From: Guoliang Han Date: Fri, 16 Apr 2021 14:02:50 +0800 Subject: [PATCH 142/307] translate complete and first commit of 20210212 Network address translation part 2 --- ...translation part 2 - the conntrack tool.md | 139 ------------------ ...translation part 2 - the conntrack tool.md | 135 +++++++++++++++++ 2 files changed, 135 insertions(+), 139 deletions(-) delete mode 100644 sources/tech/20210212 Network address translation part 2 - the conntrack tool.md create mode 100644 translated/tech/20210212 Network address translation part 2 - the conntrack tool.md diff --git a/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md b/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md deleted file mode 100644 index 60078eb4c5..0000000000 --- a/sources/tech/20210212 Network address translation part 2 - the conntrack tool.md +++ /dev/null @@ -1,139 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (cooljelly) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Network address translation part 2 – the conntrack tool) -[#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) -[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) - -Network address translation part 2 – the conntrack tool -====== - -![][1] - -This is the second article in a series about network address translation (NAT). The first article introduced [how to use the iptables/nftables packet tracing feature][2] to find the source of NAT-related connectivity problems. Part 2 introduces the “conntrack” command. conntrack allows you to inspect and modify tracked connections. - -### Introduction - -NAT configured via iptables or nftables builds on top of netfilters connection tracking facility. The _conntrack_ command is used to inspect and alter the state table. It is part of the “conntrack-tools” package. - -### Conntrack state table - -The connection tracking subsystem keeps track of all packet flows that it has seen. Run “_sudo conntrack -L_” to see its content: - -``` -tcp 6 43184 ESTABLISHED src=192.168.2.5 dst=10.25.39.80 sport=5646 dport=443 src=10.25.39.80 dst=192.168.2.5 sport=443 dport=5646 [ASSURED] mark=0 use=1 -tcp 6 26 SYN_SENT src=192.168.2.5 dst=192.168.2.10 sport=35684 dport=443 [UNREPLIED] src=192.168.2.10 dst=192.168.2.5 sport=443 dport=35684 mark=0 use=1 -udp 17 29 src=192.168.8.1 dst=239.255.255.250 sport=48169 dport=1900 [UNREPLIED] src=239.255.255.250 dst=192.168.8.1 sport=1900 dport=48169 mark=0 use=1 -``` - -Each line shows one connection tracking entry. You might notice that each line shows the addresses and port numbers twice and even with inverted address and port pairs! This is because each entry is inserted into the state table twice. The first address quadruple (source and destination address and ports) are those recorded in the original direction, i.e. what the initiator sent. The second quadruple is what conntrack expects to see when a reply from the peer is received. This solves two problems: - - 1. If a NAT rule matches, such as IP address masquerading, this is recorded in the reply part of the connection tracking entry and can then be automatically applied to all future packets that are part of the same flow. - 2. A lookup in the state table will be successful even if its a reply packet to a flow that has any form of network or port address translation applied. - - - -The original (first shown) quadruple stored never changes: Its what the initiator sent. NAT manipulation only alters the reply (second) quadruple because that is what the receiver will see. Changes to the first quadruple would be pointless: netfilter has no control over the initiators state, it can only influence the packet as it is received/forwarded. When a packet does not map to an existing entry, conntrack may add a new state entry for it. In the case of UDP this happens automatically. In the case of TCP conntrack can be configured to only add the new entry if the TCP packet has the [SYN bit][3] set. By default conntrack allows mid-stream pickups to not cause problems for flows that existed prior to conntrack becoming active. - -### Conntrack state table and NAT - -As explained in the previous section, the reply tuple listed contains the NAT information. Its possible to filter the output to only show entries with source or destination nat applied. This allows to see which kind of NAT transformation is active on a given flow. _“sudo conntrack -L -p tcp –src-nat_” might show something like this: - -``` -tcp 6 114 TIME_WAIT src=10.0.0.10 dst=10.8.2.12 sport=5536 dport=80 src=10.8.2.12 dst=192.168.1.2 sport=80 dport=5536 [ASSURED] -``` - -This entry shows a connection from 10.0.0.10:5536 to 10.8.2.12:80. But unlike the previous example, the reply direction is not just the inverted original direction: the source address is changed. The destination host (10.8.2.12) sends reply packets to 192.168.1.2 instead of 10.0.0.10. Whenever 10.0.0.10 sends another packet, the router with this entry replaces the source address with 192.168.1.2. When 10.8.2.12 sends a reply, it changes the destination back to 10.0.0.10. This source NAT is due to a [nft masquerade][4] rule: - -``` -inet nat postrouting meta oifname "veth0" masquerade -``` - -Other types of NAT rules, such as “dnat to” or “redirect to” would be shown in a similar fashion, with the reply tuples destination different from the original one. - -### Conntrack extensions - -Two useful extensions are conntrack accounting and timestamping. _“sudo sysctl net.netfilter.nf_conntrack_acct=1”_ makes _“sudo conntrack -L_” track byte and packet counters for each flow. - -_“sudo sysctl net.netfilter.nf_conntrack_timestamp=1”_ records a “start timestamp” for each connection. _“sudo conntrack -L”_ then displays the seconds elapsed since the flow was first seen. Add “_–output ktimestamp_” to see the absolute start date as well. - -### Insert and change entries - -You can add entries to the state table. For example: - -``` -sudo conntrack -I -s 192.168.7.10 -d 10.1.1.1 --protonum 17 --timeout 120 --sport 12345 --dport 80 -``` - -This is used by conntrackd for state replication. Entries of an active firewall are replicated to a standby system. The standby system can then take over without breaking connectivity even on established flows. Conntrack can also store metadata not related to the packet data sent on the wire, for example the conntrack mark and connection tracking labels. Change them with the “update” (-U) option: - -``` -sudo conntrack -U -m 42 -p tcp -``` - -This changes the connmark of all tcp flows to 42. - -### **Delete entries** - -In some cases, you want to delete enries from the state table. For example, changes to NAT rules have no effect on packets belonging to flows that are already in the table. For long-lived UDP sessions, such as tunneling protocols like VXLAN, it might make sense to delete the entry so the new NAT transformation can take effect. Delete entries via _“sudo conntrack -D_” followed by an optional list of address and port information. The following example removes the given entry from the table: - -``` -sudo conntrack -D -p udp --src 10.0.12.4 --dst 10.0.0.1 --sport 1234 --dport 53 -``` - -### Conntrack error counters - -Conntrack also exports statistics: - -``` -# sudo conntrack -S -cpu=0 found=0 invalid=130 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=10 -cpu=1 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 -cpu=2 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=1 -cpu=3 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 -``` - -Most counters will be 0. “Found” and “insert” will always be 0, they only exist for backwards compatibility. Other errors accounted for are: - - * invalid: packet does not match an existing connection and doesn’t create a new connection. - * insert_failed: packet starts a new connection, but insertion into the state table failed. This can happen for example when NAT engine happened to pick identical source address and port when Masquerading. - * drop: packet starts a new connection, but no memory is available to allocate a new state entry for it. - * early_drop: conntrack table is full. In order to accept the new connection existing connections that did not see two-way communication were dropped. - * error: icmp(v6) received icmp error packet that did not match a known connection - * search_restart: lookup interrupted by an insertion or deletion on another CPU. - * clash_resolve: Several CPUs tried to insert identical conntrack entry. - - - -These error conditions are harmless unless they occur frequently. Some can be mitigated by tuning the conntrack sysctls for the expected workload. _net.netfilter.nf_conntrack_buckets_ and _net.netfilter.nf_conntrack_max_ are typical candidates. See the [nf_conntrack-sysctl documentation][5] for a full list. - -Use “_sudo sysctl_ _net.netfilter.nf_conntrack_log_invalid=255″_ to get more information when a packet is invalid. For example, when conntrack logs the following when it encounters a packet with all tcp flags cleared: - -``` -nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 TOS=0x00 PREC=0x00 TTL=255 ID=0 PROTO=TCP SPT=5723 DPT=443 SEQ=1 ACK=0 -``` - -### Summary - -This article gave an introduction on how to inspect the connection tracking table and the NAT information stored in tracked flows. The next part in the series will expand on the conntrack tool and the connection tracking event framework. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/ - -作者:[Florian Westphal][a] -选题:[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/strlen/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/network-address-translation-part-2-816x345.jpg -[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ -[3]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure -[4]: https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Masquerading -[5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/nf_conntrack-sysctl.rst diff --git a/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md b/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md new file mode 100644 index 0000000000..992ab1e3c3 --- /dev/null +++ b/translated/tech/20210212 Network address translation part 2 - the conntrack tool.md @@ -0,0 +1,135 @@ +[#]: collector: (lujun9972) +[#]: translator: (cooljelly) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Network address translation part 2 – the conntrack tool) +[#]: via: (https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/) +[#]: author: (Florian Westphal https://fedoramagazine.org/author/strlen/) + +网络地址转换第二部分 - conntrack 工具 +====== + +![][1] + +这是有关网络地址转换network address translation(NAT)的系列文章中的第二篇。之前的第一篇文章介绍了 [如何使用 iptables/nftables 的报文跟踪功能][2] 来定位 NAT 相关的连接问题。作为第二部分,本文介绍 “conntrack” 命令。conntrack 命令允许您查看和修改被跟踪的连接。 + +### 引言 + +通过 iptables 或 nftables 配置的 NAT 建立在 netfilters 连接跟踪工具之上。_conntrack_ 命令作为 “conntrack-tools” 软件包的一部分,用于查看和更改连接状态表。 + +### Conntrack 连接状态表 + +连接跟踪子系统跟踪它看到的所有报文流。运行 “_sudo conntrack -L_” 可查看其内容: + +``` +tcp 6 43184 ESTABLISHED src=192.168.2.5 dst=10.25.39.80 sport=5646 dport=443 src=10.25.39.80 dst=192.168.2.5 sport=443 dport=5646 [ASSURED] mark=0 use=1 +tcp 6 26 SYN_SENT src=192.168.2.5 dst=192.168.2.10 sport=35684 dport=443 [UNREPLIED] src=192.168.2.10 dst=192.168.2.5 sport=443 dport=35684 mark=0 use=1 +udp 17 29 src=192.168.8.1 dst=239.255.255.250 sport=48169 dport=1900 [UNREPLIED] src=239.255.255.250 dst=192.168.8.1 sport=1900 dport=48169 mark=0 use=1 +``` + +上述显示结果中,每行表示一个连接跟踪项。您可能会注意到,每行相同的地址和端口号会出现两次,而且第二次出现的源地址/端口对和目标地址/端口对会与第一次正好相反!这是因为每个连接跟踪项会先后两次被插入连接状态表。第一个四元组(源地址,目标地址,源端口,目标端口)记录的是原始方向的连接信息,即发送者发送报文的方向。而第二个四元组则记录的是 conntrack 子系统期望收到的对端回复报文的连接信息。这解决了两个问题: + + 1. 如果报文匹配到一个 NAT 规则,例如 IP 地址伪装,相应的映射信息会记录在链接跟踪项的回复方向部分,并自动应用于同一条流的所有后续报文。 + 2. 即使一条流经过了地址或端口的转换,也可以成功在连接状态表中查找到回复报文的四元组信息。 + +原始方向的(第一个显示的)四元组信息永远不会改变:它就是发送者发送的连接信息。NAT 操作只会修改回复方向(第二个)四元组,因为这是接受者看到的连接信息。修改第一个四元组没有意义:netfilter 无法控制发起者的连接状态,它只能在收到/转发报文时对其施加影响。当一个报文未映射到现有连接表项时,conntrack 可以为其新建一个表项。对于 UDP 报文,该操作会自动进行。对于 TCP 报文,conntrack 可以配置为只有 TCP 报文设置了 [SYN 标志位][3] 才新建表项。默认情况下,conntrack 会允许从流的中间报文开始创建,这是为了避免对 conntrack 使能之前就存在的流处理出现问题。 + +### Conntrack 连接状态表和 NAT + +如上一节所述,回复方向的四元组包含 NAT 信息。您可以通过命令过滤输出经过源地址 NAT 或目标地址 NAT 的连接跟踪项。通过这种方式可以看到一个指定的流经过了哪种类型的 NAT 转换。例如,运行 “_sudo conntrack -L -p tcp –src-nat_” 可显示经过源 NAT 的连接跟踪项,输出结果类似于以下内容: + +``` +tcp 6 114 TIME_WAIT src=10.0.0.10 dst=10.8.2.12 sport=5536 dport=80 src=10.8.2.12 dst=192.168.1.2 sport=80 dport=5536 [ASSURED] +``` + +这个连接跟踪项表示一条从 10.0.0.10:5536 到 10.8.2.12:80 的连接。与前面示例不同的是,回复方向的四元组不是原始方向四元组的简单翻转:源地址已修改。目标主机(10.8.2.12)将回复数据包发送到 192.168.1.2,而不是 10.0.0.10。每当 10.0.0.10 发送新的报文时,具有此连接跟踪项的路由器会将源地址替换为 192.168.1.2。当 10.8.2.12 发送回复报文时,该路由器将目的地址修改回 10.0.0.10。上述源 NAT 行为源自一条 [NFT 伪装][4] 规则: + +``` +inet nat postrouting meta oifname "veth0" masquerade +``` + +其他类型的 NAT 规则,例如目标地址 DNAT 规则或重定向规则,其连接跟踪项也会以类似的方式显示,回复方向四元组的远端地址或端口与原始方向四元组的远端地址或端口不同。 + +### Conntrack 扩展 + +conntrack 的记帐功能和时间戳功能是两个有用的扩展功能。运行 “_sudo sysctl net.netfilter.nf_conntrack_acct=1_” 可以在运行 “_sudo conntrack -L_” 时显示每个流经过的字节数和报文数。运行 “_sudo sysctl net.netfilter.nf_conntrack_timestamp=1_” 为每个连接记录一个开始时间戳,之后每次运行 “_sudo conntrack -L_” 时都可以显示这个流从开始经过了多少秒。在上述命令中增加 “–output ktimestamp” 选项也可以看到流开始的绝对时间。 + + +### 插入和更改连接跟踪项 + +您可以手动为状态表添加连接跟踪项,例如: + +``` +sudo conntrack -I -s 192.168.7.10 -d 10.1.1.1 --protonum 17 --timeout 120 --sport 12345 --dport 80 +``` + +这项命令通常被 conntrackd 用于状态复制,即将主防火墙的连接跟踪项复制到备用防火墙系统。于是当切换发生的时候,备用系统可以接管已经建立的连接且不会造成中断。Conntrack 还可以存储报文的带外元数据,例如 conntrack 标记和连接跟踪标签。可以用 “update” (-U) 选项来修改它们: + +``` +sudo conntrack -U -m 42 -p tcp +``` + +这条命令将所有的 TCP 流的 connmark 修改为 42。 + +### **Delete entries** +### **删除连接跟踪项** + +在某些情况下,您可能想从状态表中删除条目。例如,对 NAT 规则的修改不会影响表中已存在流的经过报文。因此对 UDP 长连接(例如像 VXLAN 这样的隧道协议),删除表项可能很有意义,这样新的 NAT 转换规则才能生效。可以通过 “sudo conntrack -D” 命令附带可选的地址和端口列表选项,来删除相应的表项,如下例所示: + +``` +sudo conntrack -D -p udp --src 10.0.12.4 --dst 10.0.0.1 --sport 1234 --dport 53 +``` + +### Conntrack 错误计数 + +Conntrack 也可以输出统计数字: + +``` +# sudo conntrack -S +cpu=0 found=0 invalid=130 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=10 +cpu=1 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 +cpu=2 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=1 +cpu=3 found=0 invalid=0 insert=0 insert_failed=0 drop=0 early_drop=0 error=0 search_restart=0 +``` + +大多数计数器将为 0。“Found” 和 “insert” 数将始终为 0,它们只是为了后向兼容。其他错误计数包括: + + * invalid:报文既不匹配已有连接跟踪项,也未创建新连接。 + * insert_failed:报文新建了一个连接,但插入状态表时失败。这在 NAT 引擎在伪装时恰好选择了重复的源地址和端口时可能出现。 + * drop:报文新建了一个连接,但是没有可用的内存为其分配新的状态条目。 + * early_drop:conntrack 表已满。为了接受新的连接,已有的未看到双向报文的连接被丢弃。 + * error:icmp(v6) 收到与已知连接不匹配的 icmp 错误数据包。 + * search_restart:查找过程由于另一个 CPU 的插入或删除操作而中断。 + * clash_resolve:多个 CPU 试图插入相同的 conntrack 条目。 + +除非经常发生,这些错误条件通常无害。一些错误可以通过针对预期工作负载调整 conntrack 系统的参数来降低其发生概率,典型的配置包括 _net.netfilter.nf_conntrack_buckets_ 和 _net.netfilter.nf_conntrack_max_ 参数。可在 [nf_conntrack-sysctl 文档][5] 中查阅相应配置参数的完整列表。 + +当报文状态是 invalid 时,请使用 “_sudo sysctl net.netfilter.nf_conntrack_log_invalid=255_” 来获取更多信息。例如,当 conntrack 遇到一个所有 TCP 标志位均为 0 的报文时,将记录以下内容: + +``` +nf_ct_proto_6: invalid tcp flag combination SRC=10.0.2.1 DST=10.0.96.7 LEN=1040 TOS=0x00 PREC=0x00 TTL=255 ID=0 PROTO=TCP SPT=5723 DPT=443 SEQ=1 ACK=0 +``` + +### 总结 + +本文介绍了如何检查连接跟踪表和存储在跟踪流中的 NAT 信息。本系列的下一部分将延伸讨论 conntrack 工具和连接跟踪事件框架。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/network-address-translation-part-2-the-conntrack-tool/ + +作者:[Florian Westphal][a] +选题:[lujun9972][b] +译者:[cooljelly](https://github.com/cooljelly) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/strlen/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/network-address-translation-part-2-816x345.jpg +[2]: https://fedoramagazine.org/network-address-translation-part-1-packet-tracing/ +[3]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure +[4]: https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT)#Masquerading +[5]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/nf_conntrack-sysctl.rst From 1cff1ef1070d03f958a77e75bef6fe1afc14de1b Mon Sep 17 00:00:00 2001 From: tt67wq Date: Tue, 13 Apr 2021 16:59:34 +0800 Subject: [PATCH 143/307] translating by tt67wq --- ...07 Use systemd timers instead of cronjobs.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/sources/tech/20200707 Use systemd timers instead of cronjobs.md b/sources/tech/20200707 Use systemd timers instead of cronjobs.md index b09dc86034..b83d015d4c 100644 --- a/sources/tech/20200707 Use systemd timers instead of cronjobs.md +++ b/sources/tech/20200707 Use systemd timers instead of cronjobs.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tt67wq) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -7,20 +7,21 @@ [#]: via: (https://opensource.com/article/20/7/systemd-timers) [#]: author: (David Both https://opensource.com/users/dboth) -Use systemd timers instead of cronjobs +使用systemd定时器代替cronjobs ====== Timers provide finer-grained control of events than cronjobs. +定时器提供了比cronjob更为细粒度的事件控制。 ![Team checklist][1] -I am in the process of converting my [cron][2] jobs to systemd timers. I have used timers for a few years, but usually, I learned just enough to perform the task I was working on. While doing research for this [systemd series][3], I learned that systemd timers have some very interesting capabilities. +我正在致力于将我的[cron][2]jobs迁移到systemd定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。在我研究[systemd series][3]的过程中,我发现systemd定时器有一些非常有意思的能力。 -Like cron jobs, systemd timers can trigger events—shell scripts and programs—at specified time intervals, such as once a day, on a specific day of the month (perhaps only if it is a Monday), or every 15 minutes during business hours from 8am to 6pm. Timers can also do some things that cron jobs cannot. For example, a timer can trigger a script or program to run a specific amount of time after an event such as boot, startup, completion of a previous task, or even the previous completion of the service unit called by the timer. +与cronjobs类似,systemd定时器可以在特定的时间间隔触发事件--shell脚本和程序,例如每天一次,在一个月中的特定某一天(或许只有在周一生效),或在从上午8点到下午6点的工作时间内每隔15分钟一次。定时器也可以做到cronjob无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成。 -### System maintenance timers +### 系统维护的计时器 -When Fedora or any systemd-based distribution is installed on a new system, it creates several timers that are part of the system maintenance procedures that happen in the background of any Linux host. These timers trigger events necessary for common maintenance tasks, such as updating system databases, cleaning temporary directories, rotating log files, and more. +当在一个新系统上安装Fedora或者是任意一个基于systemd的发行版时,它会在Linux宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,和更多其他事件。 -As an example, I'll look at some of the timers on my primary workstation by using the `systemctl status *timer` command to list all the timers on my host. The asterisk symbol works the same as it does for file globbing, so this command lists all systemd timer units: +作为例子,我会查看一些我的主要工作站上的定时器,通过执行`systemctl status *timer`命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的systemd定时器单元。 ``` @@ -520,7 +521,7 @@ via: https://opensource.com/article/20/7/systemd-timers 作者:[David Both][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tt67wq](https://github.com/tt67wq) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 98efdac79c115fbc09c87c943e3bb4e0327c4d74 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Fri, 16 Apr 2021 15:35:51 +0800 Subject: [PATCH 144/307] translate done: 20200707 Use systemd timers instead of cronjobs.md --- ... Use systemd timers instead of cronjobs.md | 552 ----------------- ... Use systemd timers instead of cronjobs.md | 558 ++++++++++++++++++ 2 files changed, 558 insertions(+), 552 deletions(-) delete mode 100644 sources/tech/20200707 Use systemd timers instead of cronjobs.md create mode 100644 translated/tech/20200707 Use systemd timers instead of cronjobs.md diff --git a/sources/tech/20200707 Use systemd timers instead of cronjobs.md b/sources/tech/20200707 Use systemd timers instead of cronjobs.md deleted file mode 100644 index b83d015d4c..0000000000 --- a/sources/tech/20200707 Use systemd timers instead of cronjobs.md +++ /dev/null @@ -1,552 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tt67wq) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use systemd timers instead of cronjobs) -[#]: via: (https://opensource.com/article/20/7/systemd-timers) -[#]: author: (David Both https://opensource.com/users/dboth) - -使用systemd定时器代替cronjobs -====== -Timers provide finer-grained control of events than cronjobs. -定时器提供了比cronjob更为细粒度的事件控制。 -![Team checklist][1] - -我正在致力于将我的[cron][2]jobs迁移到systemd定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。在我研究[systemd series][3]的过程中,我发现systemd定时器有一些非常有意思的能力。 - -与cronjobs类似,systemd定时器可以在特定的时间间隔触发事件--shell脚本和程序,例如每天一次,在一个月中的特定某一天(或许只有在周一生效),或在从上午8点到下午6点的工作时间内每隔15分钟一次。定时器也可以做到cronjob无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成。 - -### 系统维护的计时器 - -当在一个新系统上安装Fedora或者是任意一个基于systemd的发行版时,它会在Linux宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,和更多其他事件。 - -作为例子,我会查看一些我的主要工作站上的定时器,通过执行`systemctl status *timer`命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的systemd定时器单元。 - - -``` -[root@testvm1 ~]# systemctl status *timer -● mlocate-updatedb.timer - Updates mlocate database every day -     Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● mlocate-updatedb.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Updates mlocate database every day. - -● logrotate.timer - Daily rotation of log files -     Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● logrotate.service -       Docs: man:logrotate(8) -             man:logrotate.conf(5) - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily rotation of log files. - -● sysstat-summary.timer - Generate summary of yesterday's process accounting -     Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left -   Triggers: ● sysstat-summary.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Generate summary of yesterday's process accounting. - -● fstrim.timer - Discard unused blocks once a week -     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left -   Triggers: ● fstrim.service -       Docs: man:fstrim - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Discard unused blocks once a week. - -● sysstat-collect.timer - Run system activity accounting tool every 10 minutes -     Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left -   Triggers: ● sysstat-collect.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Run system activity accounting tool every 10 minutes. - -● dnf-makecache.timer - dnf makecache --timer -     Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left -   Triggers: ● dnf-makecache.service - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started dnf makecache –timer. - -● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories -     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left -   Triggers: ● systemd-tmpfiles-clean.service -       Docs: man:tmpfiles.d(5) -             man:systemd-tmpfiles(8) - -Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary Directories. -``` - -Each timer has at least six lines of information associated with it: - - * The first line has the timer's file name and a short description of its purpose. - * The second line displays the timer's status, whether it is loaded, the full path to the timer unit file, and the vendor preset. - * The third line indicates its active status, which includes the date and time the timer became active. - * The fourth line contains the date and time the timer will be triggered next and an approximate time until the trigger occurs. - * The fifth line shows the name of the event or the service that is triggered by the timer. - * Some (but not all) systemd unit files have pointers to the relevant documentation. Three of the timers in my virtual machine's output have pointers to documentation. This is a nice (but optional) bit of data. - * The final line is the journal entry for the most recent instance of the service triggered by the timer. - - - -Depending upon your host, you will probably have a different set of timers. - -### Create a timer - -Although we can deconstruct one or more of the existing timers to learn how they work, let’s create our own [service unit][4] and a timer unit to trigger it. We will use a fairly trivial example in order to keep this simple. After we have finished this, it will be easier to understand how the other timers work and to determine what they are doing. - -First, create a simple service that will run something basic, such as the `free` command. For example, you may want to monitor free memory at regular intervals. Create the following `myMonitor.service` unit file in the `/etc/systemd/system` directory. It does not need to be executable: - - -``` -# This service unit is for testing timer units -# By David Both -# Licensed under GPL V2 -# - -[Unit] -Description=Logs system statistics to the systemd journal -Wants=myMonitor.timer - -[Service] -Type=oneshot -ExecStart=/usr/bin/free - -[Install] -WantedBy=multi-user.target -``` - -This is about the simplest service unit you can create. Now let’s look at the status and test our service unit to ensure that it works as we expect it to. - - -``` -[root@testvm1 system]# systemctl status myMonitor.service -● myMonitor.service - Logs system statistics to the systemd journal -     Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) -     Active: inactive (dead) -[root@testvm1 system]# systemctl start myMonitor.service -[root@testvm1 system]# -``` - -Where is the output? By default, the standard output (`STDOUT`) from programs run by systemd service units is sent to the systemd journal, which leaves a record you can view now or later—up to a point. (I will look at systemd journaling and retention strategies in a future article in this series.) Look at the journal specifically for your service unit and for today only. The `-S` option, which is the short version of `--since`, allows you to specify the time period that the `journalctl` tool should search for entries. This isn't because you don't care about previous results—in this case, there won't be any—it is to shorten the search time if your host has been running for a long time and has accumulated a large number of entries in the journal: - - -``` -[root@testvm1 system]# journalctl -S today -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- -Jun 11 09:12:09 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 09:12:09 testvm1.both.org free[377966]:               total        used        free      shared  buff/cache   available -Jun 11 09:12:09 testvm1.both.org free[377966]: Mem:       12635740      522868    11032860        8016     1080012    11821508 -Jun 11 09:12:09 testvm1.both.org free[377966]: Swap:       8388604           0     8388604 -Jun 11 09:12:09 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -[root@testvm1 system]# -``` - -A task triggered by a service can be a single program, a series of programs, or a script written in any scripting language. Add another task to the service by adding the following line to the end of the `[Service]` section of the `myMonitor.service` unit file: - - -``` -`ExecStart=/usr/bin/lsblk` -``` - -Start the service again and check the journal for the results, which should look like this. You should see the results from both commands in the journal: - - -``` -Jun 11 15:42:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 15:42:18 testvm1.both.org free[379961]:               total        used        free      shared  buff/cache   available -Jun 11 15:42:18 testvm1.both.org free[379961]: Mem:       12635740      531788    11019540        8024     1084412    11812272 -Jun 11 15:42:18 testvm1.both.org free[379961]: Swap:       8388604           0     8388604 -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda             8:0    0  120G  0 disk -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1          8:1    0    4G  0 part /boot -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2          8:2    0  116G  0 part -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0            11:0    1 1024M  0 rom -Jun 11 15:42:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 11 15:42:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -``` - -Now that you know your service works as expected, create the timer unit file, `myMonitor.timer` in `/etc/systemd/system`, and add the following: - - -``` -# This timer unit is for testing -# By David Both -# Licensed under GPL V2 -# - -[Unit] -Description=Logs some system statistics to the systemd journal -Requires=myMonitor.service - -[Timer] -Unit=myMonitor.service -OnCalendar=*-*-* *:*:00 - -[Install] -WantedBy=timers.target -``` - -The `OnCalendar` time specification in the `myMonitor.timer file`, `*-*-* *:*:00`, should trigger the timer to execute the `myMonitor.service` unit every minute. I will explore `OnCalendar` settings a bit later in this article. - -For now, observe any journal entries pertaining to running your service when it is triggered by the timer. You could also follow the timer, but following the service allows you to see the results in near real time. Run `journalctl` with the `-f` (follow) option: - - -``` -[root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- -``` - -Start but do not enable the timer, and see what happens after it runs for a while: - - -``` -[root@testvm1 ~]# systemctl start myMonitor.service -[root@testvm1 ~]# -``` - -One result shows up right away, and the next ones come at—sort of—one-minute intervals. Watch the journal for a few minutes and see if you notice the same things I did: - - -``` -[root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- -Jun 13 08:39:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:39:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:39:19 testvm1.both.org free[630566]:               total        used        free      shared  buff/cache   available -Jun 13 08:39:19 testvm1.both.org free[630566]: Mem:       12635740      556604    10965516        8036     1113620    11785628 -Jun 13 08:39:19 testvm1.both.org free[630566]: Swap:       8388604           0     8388604 -Jun 13 08:39:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda             8:0    0  120G  0 disk -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2          8:2    0  116G  0 part -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0            11:0    1 1024M  0 rom -Jun 13 08:40:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:40:46 testvm1.both.org free[630572]:               total        used        free      shared  buff/cache   available -Jun 13 08:40:46 testvm1.both.org free[630572]: Mem:       12635740      555228    10966836        8036     1113676    11786996 -Jun 13 08:40:46 testvm1.both.org free[630572]: Swap:       8388604           0     8388604 -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda             8:0    0  120G  0 disk -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2          8:2    0  116G  0 part -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0            11:0    1 1024M  0 rom -Jun 13 08:40:46 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:40:46 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -Jun 13 08:41:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:41:46 testvm1.both.org free[630580]:               total        used        free      shared  buff/cache   available -Jun 13 08:41:46 testvm1.both.org free[630580]: Mem:       12635740      553488    10968564        8036     1113688    11788744 -Jun 13 08:41:46 testvm1.both.org free[630580]: Swap:       8388604           0     8388604 -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda             8:0    0  120G  0 disk -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2          8:2    0  116G  0 part -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0            11:0    1 1024M  0 rom -Jun 13 08:41:47 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:41:47 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -``` - -Be sure to check the status of both the timer and the service. - -You probably noticed at least two things in the journal. First, you do not need to do anything special to cause the `STDOUT` from the `ExecStart` triggers in the `myMonitor.service` unit to be stored in the journal. That is all part of using systemd for running services. However, it does mean that you might need to be careful about running scripts from a service unit and how much `STDOUT` they generate. - -The second thing is that the timer does not trigger exactly on the minute at :00 seconds or even exactly one minute from the previous instance. This is intentional, but it can be overridden if necessary (or if it just offends your sysadmin sensibilities). - -The reason for this behavior is to prevent multiple services from triggering at exactly the same time. For example, you can use time specifications such as Weekly, Daily, and more. These shortcuts are all defined to trigger at 00:00:00 hours on the day they are triggered. When multiple timers are specified this way, there is a strong likelihood that they would attempt to start simultaneously. - -systemd timers are intentionally designed to trigger somewhat randomly around the specified time to try to prevent simultaneous triggers. They trigger semi-randomly within a time window that starts at the specified trigger time and ends at the specified time plus one minute. This trigger time is maintained at a stable position with respect to all other defined timer units, according to the `systemd.timer` man page. You can see in the journal entries above that the timer triggered immediately when it started and then about 46 or 47 seconds after each minute. - -Most of the time, such probabilistic trigger times are fine. When scheduling tasks such as backups to run, so long as they run during off-hours, there will be no problems. A sysadmin can select a deterministic start time, such as 01:05:00 in a typical cron job specification, to not conflict with other tasks, but there is a large range of time values that will accomplish that. A one-minute bit of randomness in a start time is usually irrelevant. - -However, for some tasks, exact trigger times are an absolute requirement. For those, you can specify greater trigger time-span accuracy (to within a microsecond) by adding a statement like this to the `Timer` section of the timer unit file: - - -``` -`AccuracySec=1us` -``` - -Time spans can be used to specify the desired accuracy as well as to define time spans for repeating or one-time events. It recognizes the following units: - - * usec, us, µs - * msec, ms - * seconds, second, sec, s - * minutes, minute, min, m - * hours, hour, hr, h - * days, day, d - * weeks, week, w - * months, month, M (defined as 30.44 days) - * years, year, y (defined as 365.25 days) - - - -All the default timers in `/usr/lib/systemd/system` specify a much larger range for accuracy because exact times are not critical. Look at some of the specifications in the system-created timers: - - -``` -[root@testvm1 system]# grep Accur /usr/lib/systemd/system/*timer -/usr/lib/systemd/system/fstrim.timer:AccuracySec=1h -/usr/lib/systemd/system/logrotate.timer:AccuracySec=1h -/usr/lib/systemd/system/logwatch.timer:AccuracySec=12h -/usr/lib/systemd/system/mlocate-updatedb.timer:AccuracySec=24h -/usr/lib/systemd/system/raid-check.timer:AccuracySec=24h -/usr/lib/systemd/system/unbound-anchor.timer:AccuracySec=24h -[root@testvm1 system]# -``` - -View the complete contents of some of the timer unit files in the `/usr/lib/systemd/system` directory to see how they are constructed. - -You do not have to enable the timer in this experiment to activate it at boot time, but the command to do so would be: - - -``` -`[root@testvm1 system]# systemctl enable myMonitor.timer` -``` - -The unit files you created do not need to be executable. You also did not enable the service unit because it is triggered by the timer. You can still trigger the service unit manually from the command line, should you want to. Try that and observe the journal. - -See the man pages for `systemd.timer` and `systemd.time` for more information about timer accuracy, event-time specifications, and trigger events. - -### Timer types - -systemd timers have other capabilities that are not found in cron, which triggers only on specific, repetitive, real-time dates and times. systemd timers can be configured to trigger based on status changes in other systemd units. For example, a timer might be configured to trigger a specific elapsed time after system boot, after startup, or after a defined service unit activates. These are called monotonic timers. Monotonic refers to a count or sequence that continually increases. These timers are not persistent because they reset after each boot. - -Table 1 lists the monotonic timers along with a short definition of each, as well as the `OnCalendar` timer, which is not monotonic and is used to specify future times that may or may not be repetitive. This information is derived from the `systemd.timer` man page with a few minor changes. - -Timer | Monotonic | Definition ----|---|--- -`OnActiveSec=` | X | This defines a timer relative to the moment the timer is activated. -`OnBootSec=` | X | This defines a timer relative to when the machine boots up. -`OnStartupSec=` | X | This defines a timer relative to when the service manager first starts. For system timer units, this is very similar to `OnBootSec=`, as the system service manager generally starts very early at boot. It's primarily useful when configured in units running in the per-user service manager, as the user service manager generally starts on first login only, not during boot. -`OnUnitActiveSec=` | X | This defines a timer relative to when the timer that is to be activated was last activated. -`OnUnitInactiveSec=` | X | This defines a timer relative to when the timer that is to be activated was last deactivated. -`OnCalendar=` | | This defines real-time (i.e., wall clock) timers with calendar event expressions. See `systemd.time(7)` for more information on the syntax of calendar event expressions. Otherwise, the semantics are similar to `OnActiveSec=` and related settings. This timer is the one most like those used with the cron service. - -_Table 1: systemd timer definitions_ - -The monotonic timers can use the same shortcut names for their time spans as the `AccuracySec` statement mentioned before, but systemd normalizes those names to seconds. For example, you might want to specify a timer that triggers an event one time, five days after the system boots; that might look like: `OnBootSec=5d`. If the host booted at `2020-06-15 09:45:27`, the timer would trigger at `2020-06-20 09:45:27` or within one minute after. - -### Calendar event specifications - -Calendar event specifications are a key part of triggering timers at desired repetitive times. Start by looking at some specifications used with the `OnCalendar` setting. - -systemd and its timers use a different style for time and date specifications than the format used in crontab. It is more flexible than crontab and allows fuzzy dates and times in the manner of the `at` command. It should also be familiar enough that it will be easy to understand. - -The basic format for systemd timers using `OnCalendar=` is `DOW YYYY-MM-DD HH:MM:SS`. DOW (day of week) is optional, and other fields can use an asterisk (*) to match any value for that position. All calendar time forms are converted to a normalized form. If the time is not specified, it is assumed to be 00:00:00. If the date is not specified but the time is, the next match might be today or tomorrow, depending upon the current time. Names or numbers can be used for the month and day of the week. Comma-separated lists of each unit can be specified. Unit ranges can be specified with `..` between the beginning and ending values. - -There are a couple interesting options for specifying dates. The Tilde (~) can be used to specify the last day of the month or a specified number of days prior to the last day of the month. The “/” can be used to specify a day of the week as a modifier. - -Here are some examples of some typical time specifications used in `OnCalendar` statements. - -Calendar event specification | Description ----|--- -DOW YYYY-MM-DD HH:MM:SS | -*-*-* 00:15:30 | Every day of every month of every year at 15 minutes and 30 seconds after midnight -Weekly | Every Monday at 00:00:00 -Mon *-*-* 00:00:00 | Same as weekly -Mon | Same as weekly -Wed 2020-*-* | Every Wednesday in 2020 at 00:00:00 -Mon..Fri 2021-*-* | Every weekday in 2021 at 00:00:00 -2022-6,7,8-1,15 01:15:00 | The 1st and 15th of June, July, and August of 2022 at 01:15:00am -Mon *-05~03 | The next occurrence of a Monday in May of any year which is also the 3rd day from the end of the month. -Mon..Fri *-08~04 | The 4th day preceding the end of August for any years in which it also falls on a weekday. -*-05~03/2 | The 3rd day from the end of the month of May and then again two days later. Repeats every year. Note that this expression uses the Tilde (~). -*-05-03/2 | The third day of the month of may and then every 2nd day for the rest of May. Repeats every year. Note that this expression uses the dash (-). - -_Table 2: Sample `OnCalendar` event specifications_ - -### Test calendar specifications - -systemd provides an excellent tool for validating and examining calendar time event specifications in a timer. The `systemd-analyze calendar` tool parses a calendar time event specification and provides the normalized form as well as other interesting information such as the date and time of the next "elapse," i.e., match, and the approximate amount of time before the trigger time is reached. - -First, look at a date in the future without a time (note that the times for `Next elapse` and `UTC` will differ based on your local time zone): - - -``` -[student@studentvm1 ~]$ systemd-analyze calendar 2030-06-17 -  Original form: 2030-06-17                 -Normalized form: 2030-06-17 00:00:00         -    Next elapse: Mon 2030-06-17 00:00:00 EDT -       (in UTC): Mon 2030-06-17 04:00:00 UTC -       From now: 10 years 0 months left     -[root@testvm1 system]# -``` - -Now add a time. In this example, the date and time are analyzed separately as non-related entities: - - -``` -[root@testvm1 system]# systemd-analyze calendar 2030-06-17 15:21:16 -  Original form: 2030-06-17                 -Normalized form: 2030-06-17 00:00:00         -    Next elapse: Mon 2030-06-17 00:00:00 EDT -       (in UTC): Mon 2030-06-17 04:00:00 UTC -       From now: 10 years 0 months left     - -  Original form: 15:21:16                   -Normalized form: *-*-* 15:21:16             -    Next elapse: Mon 2020-06-15 15:21:16 EDT -       (in UTC): Mon 2020-06-15 19:21:16 UTC -       From now: 3h 55min left               -[root@testvm1 system]# -``` - -To analyze the date and time as a single unit, enclose them together in quotes. Be sure to remove the quotes when using them in the `OnCalendar=` event specification in a timer unit or you will get errors: - - -``` -[root@testvm1 system]# systemd-analyze calendar "2030-06-17 15:21:16" -Normalized form: 2030-06-17 15:21:16         -    Next elapse: Mon 2030-06-17 15:21:16 EDT -       (in UTC): Mon 2030-06-17 19:21:16 UTC -       From now: 10 years 0 months left     -[root@testvm1 system]# -``` - -Now test the entries in Table 2. I like the last one, especially: - - -``` -[root@testvm1 system]# systemd-analyze calendar "2022-6,7,8-1,15 01:15:00" -  Original form: 2022-6,7,8-1,15 01:15:00 -Normalized form: 2022-06,07,08-01,15 01:15:00 -    Next elapse: Wed 2022-06-01 01:15:00 EDT -       (in UTC): Wed 2022-06-01 05:15:00 UTC -       From now: 1 years 11 months left -[root@testvm1 system]# -``` - -Let’s look at one example in which we list the next five elapses for the timestamp expression. - - -``` -[root@testvm1 ~]# systemd-analyze calendar --iterations=5 "Mon *-05~3" -  Original form: Mon *-05~3                 -Normalized form: Mon *-05~03 00:00:00       -    Next elapse: Mon 2023-05-29 00:00:00 EDT -       (in UTC): Mon 2023-05-29 04:00:00 UTC -       From now: 2 years 11 months left     -       Iter. #2: Mon 2028-05-29 00:00:00 EDT -       (in UTC): Mon 2028-05-29 04:00:00 UTC -       From now: 7 years 11 months left     -       Iter. #3: Mon 2034-05-29 00:00:00 EDT -       (in UTC): Mon 2034-05-29 04:00:00 UTC -       From now: 13 years 11 months left     -       Iter. #4: Mon 2045-05-29 00:00:00 EDT -       (in UTC): Mon 2045-05-29 04:00:00 UTC -       From now: 24 years 11 months left     -       Iter. #5: Mon 2051-05-29 00:00:00 EDT -       (in UTC): Mon 2051-05-29 04:00:00 UTC -       From now: 30 years 11 months left     -[root@testvm1 ~]# -``` - -This should give you enough information to start testing your `OnCalendar` time specifications. The `systemd-analyze` tool can be used for other interesting analyses, which I will begin to explore in the next article in this series. - -### Summary - -systemd timers can be used to perform the same kinds of tasks as the cron tool but offer more flexibility in terms of the calendar and monotonic time specifications for triggering events. - -Even though the service unit you created for this experiment is usually triggered by the timer, you can also use the `systemctl start myMonitor.service` command to trigger it at any time. Multiple maintenance tasks can be scripted in a single timer; these can be Bash scripts or Linux utility programs. You can run the service triggered by the timer to run all the scripts, or you can run individual scripts as needed. - -I will explore systemd's use of time and time specifications in much more detail in the next article. - -I have not yet seen any indication that `cron` and `at` will be deprecated. I hope that does not happen because `at`, at least, is much easier to use for one-off task scheduling than systemd timers. - -### Resources - -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. - - * The Fedora Project has a good, practical [guide to systemd][5]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][6] that cross-references the old SystemV commands to comparable systemd ones. - * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][7]'s [description of systemd][8]. - * [Linux.com][9]'s "More systemd fun" offers more advanced systemd [information and tips][10]. - - - -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. - - * [Rethinking PID 1][11] - * [systemd for Administrators, Part I][12] - * [systemd for Administrators, Part II][13] - * [systemd for Administrators, Part III][14] - * [systemd for Administrators, Part IV][15] - * [systemd for Administrators, Part V][16] - * [systemd for Administrators, Part VI][17] - * [systemd for Administrators, Part VII][18] - * [systemd for Administrators, Part VIII][19] - * [systemd for Administrators, Part IX][20] - * [systemd for Administrators, Part X][21] - * [systemd for Administrators, Part XI][22] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/7/systemd-timers - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/article/17/11/how-use-cron-linux -[3]: https://opensource.com/users/dboth -[4]: https://opensource.com/article/20/5/manage-startup-systemd -[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html -[6]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet -[7]: http://Freedesktop.org -[8]: http://www.freedesktop.org/wiki/Software/systemd -[9]: http://Linux.com -[10]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ -[11]: http://0pointer.de/blog/projects/systemd.html -[12]: http://0pointer.de/blog/projects/systemd-for-admins-1.html -[13]: http://0pointer.de/blog/projects/systemd-for-admins-2.html -[14]: http://0pointer.de/blog/projects/systemd-for-admins-3.html -[15]: http://0pointer.de/blog/projects/systemd-for-admins-4.html -[16]: http://0pointer.de/blog/projects/three-levels-of-off.html -[17]: http://0pointer.de/blog/projects/changing-roots -[18]: http://0pointer.de/blog/projects/blame-game.html -[19]: http://0pointer.de/blog/projects/the-new-configuration-files.html -[20]: http://0pointer.de/blog/projects/on-etc-sysinit.html -[21]: http://0pointer.de/blog/projects/instances.html -[22]: http://0pointer.de/blog/projects/inetd.html diff --git a/translated/tech/20200707 Use systemd timers instead of cronjobs.md b/translated/tech/20200707 Use systemd timers instead of cronjobs.md new file mode 100644 index 0000000000..3b65f723db --- /dev/null +++ b/translated/tech/20200707 Use systemd timers instead of cronjobs.md @@ -0,0 +1,558 @@ +[#]: collector: (lujun9972) +[#]: translator: (tt67wq) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use systemd timers instead of cronjobs) +[#]: via: (https://opensource.com/article/20/7/systemd-timers) +[#]: author: (David Both https://opensource.com/users/dboth) + +使用 systemd 定时器代替 cronjobs +====== +定时器提供了比 cronjob 更为细粒度的事件控制。 +![Team checklist][1] + +我正在致力于将我的 [cron][2]jobs 迁移到 systemd 定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。但在我研究 [systemd series][3] 的过程中,我发现 systemd 定时器有一些非常有意思的能力。 + +与 cronjobs 类似,systemd 定时器可以在特定的时间间隔触发事件 --shell 脚本和程序,例如每天一次或在一个月中的特定某一天(或许只有在周一生效),或在从上午 8 点到下午 6 点的工作时间内每隔 15 分钟一次。定时器也可以做到 cronjob 无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成的时刻。 + +### 操作系统维护的计时器 + +当在一个新系统上安装 Fedora 或者是任意一个基于 systemd 的发行版时,它会在 Linux 宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,以及更多其他事件。 + +作为示例,我会查看一些我的主要工作站上的定时器,通过执行 `systemctl status *timer` 命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的 systemd 定时器单元。 + + +``` +[root@testvm1 ~]# systemctl status *timer +● mlocate-updatedb.timer - Updates mlocate database every day +     Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left +   Triggers: ● mlocate-updatedb.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Updates mlocate database every day. + +● logrotate.timer - Daily rotation of log files +     Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left +   Triggers: ● logrotate.service +       Docs: man:logrotate(8) +             man:logrotate.conf(5) + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily rotation of log files. + +● sysstat-summary.timer - Generate summary of yesterday's process accounting +     Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left +   Triggers: ● sysstat-summary.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Generate summary of yesterday's process accounting. + +● fstrim.timer - Discard unused blocks once a week +     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left +   Triggers: ● fstrim.service +       Docs: man:fstrim + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Discard unused blocks once a week. + +● sysstat-collect.timer - Run system activity accounting tool every 10 minutes +     Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left +   Triggers: ● sysstat-collect.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Run system activity accounting tool every 10 minutes. + +● dnf-makecache.timer - dnf makecache --timer +     Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left +   Triggers: ● dnf-makecache.service + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started dnf makecache –timer. + +● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories +     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) +     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago +    Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left +   Triggers: ● systemd-tmpfiles-clean.service +       Docs: man:tmpfiles.d(5) +             man:systemd-tmpfiles(8) + +Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary Directories. +``` + +每个定时器至少有六行相关信息: + + * 定时器的第一行有定时器名字和定时器目的的简短介绍 + * 第二行展示了定时器的状态,是否有被加载,定时器 unit 文件的绝对路径以及预设信息。 + * 但三行指明了其活动状态,包括该定时器已激活的日期和时间。 + * 第四行包括了该定时器下次将要被触发的日期和时间和距离触发的大概时间。 + * 第五行展示了事件名称或被定时器触发的服务名称。 + * 部分(不是全部 )systemd unit 文件有相关文档的指引。我虚拟机上输出中有三个定时器有文档指引。这是一个优秀(但非必要)的信息。 + * 最后一行是计时器触发服务的最近的日志实例。 + + +你也许有一些不一样的定时器,取决于你的物理机。 + +### 创建一个定时器 + +尽管我们可以解构一个或多个现有的计时器来了解其工作原理,我们还是要创建我们自己的[服务单元 ][4] 和一个定时器去触发它。我们将举一个相当简单的例子来让这个过程保持简单。当我们完成这个实验之后,就能更容易理解其他定时器的工作原理以及发现它们正在做什么。 + +首先,创建一个运行基础东西的简单的服务,例如 `free` 命令。举个例子,你可能想定时监控空余内存。在 `/etc/systemd/system` 目录下创建如下的 `myMonitor.server` 单元文件。它不一定是可执行的: + + +``` +# This service unit is for testing timer units +# By David Both +# Licensed under GPL V2 +# + +[Unit] +Description=Logs system statistics to the systemd journal +Wants=myMonitor.timer + +[Service] +Type=oneshot +ExecStart=/usr/bin/free + +[Install] +WantedBy=multi-user.target +``` + +这大概是你能创建的最简单的服务单元了。现在我们查看一下服务状态同时测试一下服务单元确保它和我们预期一样可用。 + + +``` +[root@testvm1 system]# systemctl status myMonitor.service +● myMonitor.service - Logs system statistics to the systemd journal +     Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) +     Active: inactive (dead) +[root@testvm1 system]# systemctl start myMonitor.service +[root@testvm1 system]# +``` + +输出在哪里呢?默认情况下,systemd 服务单元执行程序的标准输出 (`STDOUT`) 被发送到系统日志中,它保留了记录供现在或者之后某个时间点查看。(在本系列的后续文章中,我将介绍系统日志的记录和保留策略)。查看今天的该服务单元的专属日志。`-S` 选项,即 `--since` 的缩写,允许你指定 `journalctl` 工具搜索条目的时间段。这并不代表你不关心过往结果--在这个案例中,不会有过往记录--如果你的机器以及运行了很长时间且堆积了大量的日志,它可以缩短搜索时间。 + + +``` +[root@testvm1 system]# journalctl -S today -u myMonitor.service +\-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- +Jun 11 09:12:09 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 11 09:12:09 testvm1.both.org free[377966]:               total        used        free      shared  buff/cache   available +Jun 11 09:12:09 testvm1.both.org free[377966]: Mem:       12635740      522868    11032860        8016     1080012    11821508 +Jun 11 09:12:09 testvm1.both.org free[377966]: Swap:       8388604           0     8388604 +Jun 11 09:12:09 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +[root@testvm1 system]# +``` + +一个服务触发的任务可以是单个程序,一组程序或者是一个脚本语言写的脚本。通过在 `myMonitor.service` 单元文件里的 `[Service]` 块末尾中添加如下行可以为服务添加另一个任务: + + +``` +`ExecStart=/usr/bin/lsblk` +``` + +再次启动服务,查看日志检查结果,结果应该看上去像这样。你应该在日志中看到两条命令的结果输出: + + +``` +Jun 11 15:42:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 11 15:42:18 testvm1.both.org free[379961]:               total        used        free      shared  buff/cache   available +Jun 11 15:42:18 testvm1.both.org free[379961]: Mem:       12635740      531788    11019540        8024     1084412    11812272 +Jun 11 15:42:18 testvm1.both.org free[379961]: Swap:       8388604           0     8388604 +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda             8:0    0  120G  0 disk +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1          8:1    0    4G  0 part /boot +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2          8:2    0  116G  0 part +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0            11:0    1 1024M  0 rom +Jun 11 15:42:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 11 15:42:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +``` + +现在你知道了你的服务是可用的,在 `/etc/systemd/system` 目录下创建 `myMonitor.timer` 定时器单元文件,添加如下代码: + + +``` +# This timer unit is for testing +# By David Both +# Licensed under GPL V2 +# + +[Unit] +Description=Logs some system statistics to the systemd journal +Requires=myMonitor.service + +[Timer] +Unit=myMonitor.service +OnCalendar=*-*-* *:*:00 + +[Install] +WantedBy=timers.target +``` + +在 `myMonitor.timer` 文件中的 `OnCalendar` 时间格式,`*-*-* *:*:00`,应该会每分钟触发一次定时器去执行 `myMonitor.service` 单元。我会在文章的后面进一步探索 `OnCalendar` 设置。 + +到目前为止,在服务被计时器触发运行时观察任意与之有关的日志记录。你也可以跟踪计时器,跟踪服务可以让你接近实时的看到结果。执行 `journalctl` 时带上 `-f` 选项: + + +``` +[root@testvm1 system]# journalctl -S today -f -u myMonitor.service +\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +``` + +执行但是不启用该定时器,看看它运行一段时间后发生了什么: + + +``` +[root@testvm1 ~]# systemctl start myMonitor.service +[root@testvm1 ~]# +``` + +一条结果立即就显示出来了,下一条大概在一分钟后出来。观察几分钟日志,看看你有没有跟我发现同样的事情: + + +``` +[root@testvm1 system]# journalctl -S today -f -u myMonitor.service +\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +Jun 13 08:39:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 13 08:39:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 13 08:39:19 testvm1.both.org free[630566]:               total        used        free      shared  buff/cache   available +Jun 13 08:39:19 testvm1.both.org free[630566]: Mem:       12635740      556604    10965516        8036     1113620    11785628 +Jun 13 08:39:19 testvm1.both.org free[630566]: Swap:       8388604           0     8388604 +Jun 13 08:39:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda             8:0    0  120G  0 disk +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1          8:1    0    4G  0 part /boot +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2          8:2    0  116G  0 part +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0            11:0    1 1024M  0 rom +Jun 13 08:40:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 13 08:40:46 testvm1.both.org free[630572]:               total        used        free      shared  buff/cache   available +Jun 13 08:40:46 testvm1.both.org free[630572]: Mem:       12635740      555228    10966836        8036     1113676    11786996 +Jun 13 08:40:46 testvm1.both.org free[630572]: Swap:       8388604           0     8388604 +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda             8:0    0  120G  0 disk +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1          8:1    0    4G  0 part /boot +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2          8:2    0  116G  0 part +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0            11:0    1 1024M  0 rom +Jun 13 08:40:46 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 13 08:40:46 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +Jun 13 08:41:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... +Jun 13 08:41:46 testvm1.both.org free[630580]:               total        used        free      shared  buff/cache   available +Jun 13 08:41:46 testvm1.both.org free[630580]: Mem:       12635740      553488    10968564        8036     1113688    11788744 +Jun 13 08:41:46 testvm1.both.org free[630580]: Swap:       8388604           0     8388604 +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda             8:0    0  120G  0 disk +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1          8:1    0    4G  0 part /boot +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2          8:2    0  116G  0 part +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-root 253:0    0    5G  0 lvm  / +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-var  253:4    0   20G  0 lvm  /var +Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   └─VG01-home 253:5    0   10G  0 lvm  /home +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0            11:0    1 1024M  0 rom +Jun 13 08:41:47 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. +Jun 13 08:41:47 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. +``` + +别忘了检查下计时器和服务的状态。 + +你在日志里大概至少注意到两件事。第一,你不需要特地做什么来让 `myMonitor.service` 单元中 `ExecStart` 触发器的 `STDOUT` 存储到日志里。这都是用 systemd 来托管服务的一部分功能。然而,它确实意味着你需要小心对待服务单元里面执行的脚本和它们能产生多少 `STDOUT`。 + +第二,定时器并不是在每分钟的 :00 秒执行的,甚至每次执行的时间间隔都不是刚好一分钟。这是特意的设计,但是有必要的话可以被改写(如果只是它挑战了你的系统管理员的敏感神经)。 + +这样设计的初衷是为了防止多个服务在同个时刻被触发。举个例子,你可以用例如 Weekly,Daily 或者跟多其他的时间格式。这些快捷写法都被定义为在某一天的 00:00:00 执行。当多个定时器都这样定义的话,有很大可能它们会同时执行。 + +systemd 定时器被故意设计成在规定时间附近随机波动的时间点触发来避免同一时间触发。它们在一个时间窗口内半随机触发,时间窗口开始于预设的触发时间,结束于预设时间加一分钟。根据 `systemd.timer` 的 man 手册,相对于其他已经定义的定时器单元,这个触发时间保持在稳定的位置。你可以在日志条目中看到,定时器在启动后立即触发,然后在每分钟后的 46 或 47 秒触发。 + +大部分情况下,这种概率抖动的定时器是没事的。当调度类似执行备份的任务,只需要它们在下班时间运行,这样是没问题的。系统管理员可以选择确定的开始时间来确保不和其他任务冲突,例如 01:05:00 这样典型的 cron 工作时间,但是有很大范围的时间值可以满足这一点。在开始时间上一个分钟级别的随机往往是无关紧要的。 + +然而,对某些任务来说,确定的触发时间是个硬性要求。对于这类任务,你可以向单元文件的 `Timer` 块中添加如下声明来指定更高的触发时间跨度精确度(一微秒以内): + + +``` +`AccuracySec=1us` +``` + +时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别一下单位: + + * usec,us,µs + * msec,ms + * seconds,second,sec,s + * minutes,minute,min,m + * hours,hour,hr,h + * days,day,d + * weeks,week,w + * months,month,M (定义为 30.44 天) + * years,year,y (定义为 365.25 天) + + +所有 `/usr/lib/systemd/system` 中的定时器都指定了一个更宽松的时间精度,因为精准时间没那么重要。看看这些系统创建的定时器的时间格式: + + +``` +[root@testvm1 system]# grep Accur /usr/lib/systemd/system/*timer +/usr/lib/systemd/system/fstrim.timer:AccuracySec=1h +/usr/lib/systemd/system/logrotate.timer:AccuracySec=1h +/usr/lib/systemd/system/logwatch.timer:AccuracySec=12h +/usr/lib/systemd/system/mlocate-updatedb.timer:AccuracySec=24h +/usr/lib/systemd/system/raid-check.timer:AccuracySec=24h +/usr/lib/systemd/system/unbound-anchor.timer:AccuracySec=24h +[root@testvm1 system]# +``` + + +看下 `/usr/lib/systemd/system` 目录下部分定时器单元文件的完整内容,看看它们是如何构建的。 + +你没有必要在实验中设置开机启动这个定时器,下面这个命令会设置开机自启: + + +``` +[root@testvm1 system]# systemctl enable myMonitor.timer +``` + +你创建的单元文件不一定是可执行的。你同样不需要启用服务因为它是被定时器触发的。如果你需要的话,你仍然可以在命令行里手动触发该服务单元。尝试一下,然后观察日志。 + +翻阅 `Systemd.timer` 和 `Systemd.time` 的 man 手册查看更多有关精确度,时间格式和触发事件相关信息。 + +### 定时器类型 + +systemd 定时器还有一些在 cron 中找不到的功能,仅在确定的,重复的,实时的日期和时间触发。systemd 定时器可以被配置成在其他 systemd 单元状态发生改变时触发。举个例子,一个定时器可以配置成在系统开机,启动,或是某个确定的服务单元激活之后的一段时间被触发。这些被称为单调计时器。单调指的是一个持续增长的计数器或序列。这些定时器没有持久化因为它们在每次 boot 后被重置。 + +表格 1 列出了一些单调定时器以及每个定时器的简短定义,同时有 `OnCalendar` 定时器,这些不是单调的,它们被用于未来有可能重复的某个确定时间。这个信息来自于 `systemd.timer` 的 man 手册,有一些不重要的修改。 + + +定时器 | 单调性 | 定义 +---|---|--- +`OnActiveSec=` | X | 定义了一个与定时器被激活的那一刻相关的定时器。 +`OnBootSec=` | X | 定义了一个与机器启动时间相关的计时器。 +`OnStartupSec=` | X | 定义了一个与服务管理器首次启动相关的计时器。对于系统定时器来说,这个定时器与 OnBootSec= 类似,因为系统服务管理器在机器启动后很短的时间后就会启动。当以在每个用户服务管理器中运行的单元进行配置时,它尤其有用,因为用户的服务管理器通常在首次登录后启动,而不是机器启动后。 +`OnUnitActiveSec=` | X | 定义了一个与将要激活的定时器上次激活时间相关的定时器。 +`OnUnitInactiveSec=` | X | 定义了一个与将要激活的定时器上次停用时间相关的定时器。 +`OnCalendar=` | | 定义了一个有日期事件表达式语法的实时(即时钟)定时器。查看 systemd.time(7) 的 man 手册获取更多与日历事件表达式相关的语法信息。除此以外,它的语义和 `OnActiveSec=` 类似。 + +_Table 1: systemd 定时器定义_ + + +单调计时器课使用同样的简写名作为它们的时间跨度,即我们之前提到的 `AccuracySec` 表达式,但是 systemd 将这些名字统一转换成了秒。举个例子,比如你想规定某个定时器在系统启动后五天触发一次一个事件;它可能看起来像 `OnBootSec=5d`。如果机器启动于 `2020-06-15 09:45:27`,这个定时器会在 `2020-06-20 09:45:27` 或在这之后的一分钟内触发。这个定时器最类似于 cron 服务所使用的计时器。 + + + +### 日历事件格式 + +日历事件格式是定时器在所需重复的时间触发的关键。我们开始看下一些 `OnCalendar` 设置一起使用的格式。 + +与 crontab 中的格式相比,systemd 及其计时器使用的时间和日历格式风格不同。它比 crontab 更为灵活,而且可以使用类似 "at" 命令的方式允许模糊的日期和时间。它还应该足够熟悉使其易于理解。 + +systemd 定时器使用 `OnCalendar=` 的基础格式是 `DOW YYYY-MM-DD HH:MM:SS`。DOW( 天或星期)是选填的,其他字段可以用一个星号(*)来匹配此位置的任意值。所有的日历时间格式会被转换成标准格式。如果时间没有指定,它会被设置为 00:00:00。如果日期没有指定但是时间指定了,那么下次匹配的时间可能是今天或者明天,取决于当前的时间。名字或数字可被用于月份或者星期几。每个单元的逗号分隔列表都可以被指定。单元范围可以在开始值和结束值之间用`。。.`指定。 + + +指定日期有一些有趣的选项,波浪号(~)可以指定月份的最后一条或者最后一天之前的某几天。"/"可以用来指定星期几作为修饰符。 + +这里有几个在 `OnCalendar` 表达式中使用的典型时间格式例子。 + + +日期事件格式 | 描述 +---|--- +DOW YYYY-MM-DD HH:MM:SS | +*-*-* 00:15:30 | 每年每月每天的 0 点 15 分 30 秒 +Weekly | 每个周一的 00:00:00 +Mon *-*-* 00:00:00 | 同上 +Mon | 参考 Weekly +Wed 2020-*-* | 2020 年每个周三的 00:00:00 +Mon。.Fri 2021-*-* | 2021 年的每个工作日的 00:00:00 +2022-6,7,8-1,15 01:15:00 | 2022 年 6,7,8 月的 1 到 15 号的 01:15:00 +Mon *-05~03 | 每年五月份的下个周一发生,同时这也是距离月末的第三天。 +Mon。.Fri *-08~04 | 任何年份 8 月末前的第四天(工作日也算) +*-05~03/2 | 五月末的第三天,然后 2 天后再来一次。每年重复一次。注意这个表达式使用了波浪号(~)。 +*-05-03/2 | 五月的第三天,然后每两天重复一次直到 5 月底。注意这个表达式使用了破折号(-)。 + + +_Table 2: `OnCalendar` 事件时间格式例子_ + + +### 测试日历格式 + +systemd 提供了一个绝佳的工具用于检测和测试定时器中日历时间事件的格式。`systemd-analyze calendar` 工具解析一个时间事件格式,提供标准格式和其他有趣的信息,例如下次"经过"(即匹配)的日期和时间,以及距离下次触发之前大概时间。 + +首先,看看未来没有时间的日期(注意 `Next elapse` 和 `UTC` 的时间会根据你当地时区改变): + + +``` +[student@studentvm1 ~]$ systemd-analyze calendar 2030-06-17 +  Original form: 2030-06-17                 +Normalized form: 2030-06-17 00:00:00         +    Next elapse: Mon 2030-06-17 00:00:00 EDT +       (in UTC): Mon 2030-06-17 04:00:00 UTC +       From now: 10 years 0 months left     +[root@testvm1 system]# +``` + +现在添加一个时间,在这个例子中,日期和时间是当作无关的部分分开解析的: + + +``` +[root@testvm1 system]# systemd-analyze calendar 2030-06-17 15:21:16 +  Original form: 2030-06-17                 +Normalized form: 2030-06-17 00:00:00         +    Next elapse: Mon 2030-06-17 00:00:00 EDT +       (in UTC): Mon 2030-06-17 04:00:00 UTC +       From now: 10 years 0 months left     + +  Original form: 15:21:16                   +Normalized form: *-*-* 15:21:16             +    Next elapse: Mon 2020-06-15 15:21:16 EDT +       (in UTC): Mon 2020-06-15 19:21:16 UTC +       From now: 3h 55min left               +[root@testvm1 system]# +``` + +为了把日期和时间当作一个单元来分析,可以把它们包在引号里。你在定时器单元里 `OnCalendar=` 时间格式中使用的时候记得把引号去掉,否则会报错: + + +``` +[root@testvm1 system]# systemd-analyze calendar "2030-06-17 15:21:16" +Normalized form: 2030-06-17 15:21:16         +    Next elapse: Mon 2030-06-17 15:21:16 EDT +       (in UTC): Mon 2030-06-17 19:21:16 UTC +       From now: 10 years 0 months left     +[root@testvm1 system]# +``` + +现在我们测试下 Table2 里的例子。我尤其喜欢最后一个: + + +``` +[root@testvm1 system]# systemd-analyze calendar "2022-6,7,8-1,15 01:15:00" +  Original form: 2022-6,7,8-1,15 01:15:00 +Normalized form: 2022-06,07,08-01,15 01:15:00 +    Next elapse: Wed 2022-06-01 01:15:00 EDT +       (in UTC): Wed 2022-06-01 05:15:00 UTC +       From now: 1 years 11 months left +[root@testvm1 system]# +``` + +让我们看一个例子,这个例子里我们列出了时间表达式的五个经过时间。 + + +``` +[root@testvm1 ~]# systemd-analyze calendar --iterations=5 "Mon *-05~3" +  Original form: Mon *-05~3                 +Normalized form: Mon *-05~03 00:00:00       +    Next elapse: Mon 2023-05-29 00:00:00 EDT +       (in UTC): Mon 2023-05-29 04:00:00 UTC +       From now: 2 years 11 months left     +       Iter. #2: Mon 2028-05-29 00:00:00 EDT +       (in UTC): Mon 2028-05-29 04:00:00 UTC +       From now: 7 years 11 months left     +       Iter. #3: Mon 2034-05-29 00:00:00 EDT +       (in UTC): Mon 2034-05-29 04:00:00 UTC +       From now: 13 years 11 months left     +       Iter. #4: Mon 2045-05-29 00:00:00 EDT +       (in UTC): Mon 2045-05-29 04:00:00 UTC +       From now: 24 years 11 months left     +       Iter. #5: Mon 2051-05-29 00:00:00 EDT +       (in UTC): Mon 2051-05-29 04:00:00 UTC +       From now: 30 years 11 months left     +[root@testvm1 ~]# +``` + +这些应该为你提供了足够的信息去开始测试你的 `OnCalendar` 时间格式。`systemd-analyze` 工具可用于其他有趣的分析,我会在这个系列的下一篇文章来探索这些。 + +### 总结 + +systemd 定时器可以用于执行和 cron 工具相同的任务,但是通过按照日历和单调时间格式去触发事件的方法提供了更多的灵活性。 + +虽然你为此次实验创建的服务单元通常被定时器调用,你也可以随时使用 `systemctl start myMonitor.service` 命令去触发它。多个需要维护的任务可以被写成脚本放在单个定时器中;它们可以是 Bash 脚本或者其他 Linux 程序。你可以通过触发定时器来运行所有的脚本来运行服务,也可以按照需要执行单独的脚本。 + +我会在下篇文章中更加深入的探索 systemd 时间格式的用处。 + +我还没看到任何 `cron` 和 `at` 要被弃用的迹象。我希望这一切不会发生因为 `at` 至少在执行一次性调度任务的时候要比 systemd 定时器容易的多。 + +### 参考资料 + +网上有大量的关于 systemd 的参考资料,但是大部分都有点幼稚,粗略甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 + + * Fedora 项目有切实好用的 [systemd 入门 ][5]。它囊括了几乎所有你需要知道的关于如何使用 systemd 配置,管理和维护 Fedora 计算机。 + * Fedora 项目也有一个不错的[备忘录 ][6],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 + * 关于 systemd 和为创建这个项目原因的技术细节,查看 [Freedesktop.org][7]'s [systemd 描述 ][8]。 + * [Linux.com][9] 的"更多 systemd 的乐趣"栏目提供了跟多 systemd 进阶的[内幕和技巧 ][10]。 + + + +还有一系列 Lennart Poettering 撰写的 Linux 系统管理相关的深度的技术文章,他是 systemd 的设计者和主要实现者。这些文章写在 2010 年 4 月至 2011 年 9 月,但是它们如同现在一样贴切。systemd 及其生态相关的几乎一些优秀的产出基本都是基于这些论文。 + + * [Rethinking PID 1][11] + * [systemd for Administrators,Part I][12] + * [systemd for Administrators,Part II][13] + * [systemd for Administrators,Part III][14] + * [systemd for Administrators,Part IV][15] + * [systemd for Administrators,Part V][16] + * [systemd for Administrators,Part VI][17] + * [systemd for Administrators,Part VII][18] + * [systemd for Administrators,Part VIII][19] + * [systemd for Administrators,Part IX][20] + * [systemd for Administrators,Part X][21] + * [systemd for Administrators,Part XI][22] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/7/systemd-timers + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[tt67wq](https://github.com/tt67wq) +校对:[校对者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://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/article/17/11/how-use-cron-linux +[3]: https://opensource.com/users/dboth +[4]: https://opensource.com/article/20/5/manage-startup-systemd +[5]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[6]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[7]: http://Freedesktop.org +[8]: http://www.freedesktop.org/wiki/Software/systemd +[9]: http://Linux.com +[10]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[11]: http://0pointer.de/blog/projects/systemd.html +[12]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[13]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[14]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[16]: http://0pointer.de/blog/projects/three-levels-of-off.html +[17]: http://0pointer.de/blog/projects/changing-roots +[18]: http://0pointer.de/blog/projects/blame-game.html +[19]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[20]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[21]: http://0pointer.de/blog/projects/instances.html +[22]: http://0pointer.de/blog/projects/inetd.html From 2de987a63057504b4739bd267f4cc198ed5683e7 Mon Sep 17 00:00:00 2001 From: tt67wq Date: Fri, 16 Apr 2021 16:03:30 +0800 Subject: [PATCH 145/307] translating by tt67wq --- ...617 How to handle dynamic and static libraries in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md b/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md index abd312b1e1..24cce91127 100644 --- a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ b/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (tt67wq) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -281,7 +281,7 @@ via: https://opensource.com/article/20/6/linux-libraries 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[tt67wq](https://github.com/tt67wq) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a078a740469c44291bcc80da9f25f2ead7fae68c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:02:33 +0800 Subject: [PATCH 146/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416=20?= =?UTF-8?q?Use=20the=20DNF=20local=20plugin=20to=20speed=20up=20your=20hom?= =?UTF-8?q?e=20lab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md --- ... local plugin to speed up your home lab.md | 436 ++++++++++++++++++ 1 file changed, 436 insertions(+) create mode 100644 sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md diff --git a/sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md b/sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md new file mode 100644 index 0000000000..cf802d3894 --- /dev/null +++ b/sources/tech/20210416 Use the DNF local plugin to speed up your home lab.md @@ -0,0 +1,436 @@ +[#]: subject: (Use the DNF local plugin to speed up your home lab) +[#]: via: (https://fedoramagazine.org/use-the-dnf-local-plugin-to-speed-up-your-home-lab/) +[#]: author: (Brad Smith https://fedoramagazine.org/author/buckaroogeek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Use the DNF local plugin to speed up your home lab +====== + +![][1] + +Photo by [Sven Hornburg][2] on [Unsplash][3] + +### Introduction + +If you are a Fedora Linux enthusiast or a developer working with multiple instances of Fedora Linux then you might benefit from the [DNF local][4] plugin. An example of someone who would benefit from the DNF local plugin would be an enthusiast who is running a cluster of Raspberry Pis. Another example would be someone running several virtual machines managed by Vagrant. The DNF local plugin reduces the time required for DNF transactions. It accomplishes this by transparently creating and managing a local RPM repository. Because accessing files on a local file system is significantly faster than downloading them repeatedly, multiple Fedora Linux machines will see a significant performance improvement when running _dnf_ with the DNF local plugin enabled. + +I recently started using this plugin after reading a tip from Glenn Johnson (aka glennzo) in [a 2018 fedoraforum.org post][5]. While working on a Raspberry Pi based Kubernetes cluster running Fedora Linux and also on several container-based services, I winced with every DNF update on each Pi or each container that downloaded a duplicate set of rpms across my expensive internet connection. In order to improve this situation, I searched for a solution that would cache rpms for local reuse. I wanted something that would not require any changes to repository configuration files on every machine. I also wanted it to continue to use the network of Fedora Linux mirrors. I didn’t want to use a single mirror for all updates. + +### Prior art + +An internet search yields two common solutions that eliminate or reduce repeat downloads of the same RPM set – create a private Fedora Linux mirror or set up a caching proxy. + +Fedora provides guidance on setting up a [private mirror][6]. A mirror requires a lot of bandwidth and disk space and significant work to maintain. A full private mirror would be too expensive and it would be overkill for my purposes. + +The most common solution I found online was to implement a caching proxy using Squid. I had two concerns with this type of solution. First, I would need to edit repository definitions stored in _/etc/yum.repo.d_ on each virtual and physical machine or container to use the same mirror. Second, I would need to use _http_ and not _https_ connections which would introduce a security risk. + +After reading Glenn’s 2018 post on the DNF local plugin, I searched for additional information but could not find much of anything besides the sparse documentation for the plugin on the DNF documentation web site. This article is intended to raise awareness of this plugin. + +### About the DNF local plugin + +The [online documentation][4] provides a succinct description of the plugin: “Automatically copy all downloaded packages to a repository on the local filesystem and generating repo metadata”. The magic happens when there are two or more Fedora Linux machines configured to use the plugin and to share the same local repository. These machines can be virtual machines or containers running on a host and all sharing the host filesystem, or separate physical hardware on a local area network sharing the file system using a network-based file system sharing technology. The plugin, once configured, handles everything else transparently. Continue to use _dnf_ as before. _dnf_ will check the plugin repository for rpms, then proceed to download from a mirror if not found. The plugin will then cache all rpms in the local repository regardless of their upstream source – an official Fedora Linux repository or a third-party RPM repository – and make them available for the next run of _dnf_. + +### Install and configure the DNF local plugin + +Install the plugin using _dnf_. The _createrepo_c_ packages will be installed as a dependency. The latter is used, if needed, to create the local repository. + +``` +sudo dnf install python3-dnf-plugin-local +``` + +The plugin configuration file is stored at /_etc/dnf/plugins/local.conf_. An example copy of the file is provided below. The only change required is to set the _repodir_ option. The _repodir_ option defines where on the local filesystem the plugin will keep the RPM repository. + +``` +[main] +enabled = true +# Path to the local repository. +# repodir = /var/lib/dnf/plugins/local + +# Createrepo options. See man createrepo_c +[createrepo] +# This option lets you disable createrepo command. This could be useful +# for large repositories where metadata is priodically generated by cron +# for example. This also has the side effect of only copying the packages +# to the local repo directory. +enabled = true + +# If you want to speedup createrepo with the --cachedir option. Eg. +# cachedir = /tmp/createrepo-local-plugin-cachedir + +# quiet = true + +# verbose = false +``` + +Change _repodir_ to the filesystem directory where you want the RPM repository stored. For example, change _repodir_ to _/srv/repodir_ as shown below. + +``` +... +# Path to the local repository. +# repodir = /var/lib/dnf/plugins/local +repodir = /srv/repodir +... +``` + +Finally, create the directory if it does not already exist. If this directory does not exist, _dnf_ will display some errors when it first attempts to access the directory. The plugin will create the directory, if necessary, despite the initial errors. + +``` +sudo mkdir -p /srv/repodir +``` + +Repeat this process on any virtual machine or container that you want to share the local repository. See the use cases below for more information. An alternative configuration using NFS (network file system) is also provided below. + +### How to use the DNF local plugin + +After you have installed the plugin, you do not need to change how you use _dnf_. The plugin will cause a few additional steps to run transparently behind the scenes whenever _dnf_ is called. After _dnf_ determines which rpms to update or install, the plugin will try to retrieve them from the local repository before trying to download them from a mirror. After _dnf_ has successfully completed the requested updates, the plugin will copy any rpms downloaded from a mirror to the local repository and then update the local repository’s metadata. The downloaded rpms will then be available in the local repository for the next _dnf_ client. + +There are two points to be aware of. First, benefits from the local repository only occur if multiple machines share the same architecture (for example, x86_64 or aarch64). Virtual machines and containers running on a host will usually share the same architecture as the host. But if there is only one aarch64 device and one x86_64 device there is little real benefit to a shared local repository unless one of the devices is constantly reset and updated which is common when developing with a virtual machine or container. Second, I have not explored how robust the local repository is to multiple _dnf_ clients updating the repository metadata concurrently. I therefore run _dnf_ from multiple machines serially rather than in parallel. This may not be a real concern but I want to be cautious. + +The use cases outlined below assume that work is being done on Fedora Workstation. Other desktop environments can work as well but may take a little extra effort. I created a GitHub repository with examples to help with each use case. Click the _Code_ button at to clone the repository or to download a zip file. + +#### Use case 1: networked physical machines + +The simplest use case is two or more Fedora Linux computers on the same network. Install the DNF local plugin on each Fedora Linux machine and configure the plugin to use a repository on a network-aware file system. There are many network-aware file systems to choose from. Which file system you will use will probably be influenced by the existing devices on your network. + +For example, I have a small Synology Network Attached Storage device (NAS) on my home network. The web admin interface for the Synology makes it very easy to set up a NFS server and export a file system share to other devices on the network. NFS is a shared file system that is well supported on Fedora Linux. I created a share on my NAS named _nfs-dnf_ and exported it to all the Fedora Linux machines on my network. For the sake of simplicity, I am omitting the details of the security settings. However, please keep in mind that security is always important even on your own local network. If you would like more information about NFS, the online Red Hat Enable Sysadmin magazine has an [informative post][7] that covers both client and server configurations on Red Hat Enterprise Linux. They translate well to Fedora Linux. + +I configured the NFS client on each of my Fedora Linux machines using the steps shown below. In the below example, _quga.lan_ is the hostname of my NAS device. + +Install the NFS client on each Fedora Linux machine. + +``` +$ sudo dnf install nfs-utils +``` + +Get the list of exports from the NFS server: + +``` +$ showmount -e quga.lan +Export list for quga.lan: +/volume1/nfs-dnf pi*.lan +``` + +Create a local directory to be used as a mount point on the Fedora Linux client: + +``` +$ sudo mkdir -p /srv/repodir +``` + +Mount the remote file system on the local directory. See _man mount_ for more information and options. + +``` +$ sudo mount -t nfs -o vers=4 quga.lan:/nfs-dnf /srv/repodir +``` + +The DNF local plugin will now work until as long as the client remains up. If you want the NFS export to be automatically mounted when the client is rebooted, then you must to edit /_etc/fstab_ as demonstrated below. I recommend making a backup of _/etc/fstab_ before editing it. You can substitute _vi_ with _nano_ or another editor of your choice if you prefer. + +``` +$ sudo vi /etc/fstab +``` + +Append the following line at the bottom of _/etc/fstab_, then save and exit. + +``` +quga.lan:/volume1/nfs-dnf /srv/repodir nfs defaults,timeo=900,retrans=5,_netdev 0 0 +``` + +Finally, notify systemd that it should rescan _/etc/fstab_ by issuing the following command. + +``` +$ sudo systemctl daemon-reload +``` + +NFS works across the network and, like all network traffic, may be blocked by firewalls on the client machines. Use _firewall-cmd_ to allow NFS-related network traffic through each Fedora Linux machine’s firewall. + +``` +$ sudo firewall-cmd --permanent --zone=public --allow-service=nfs +``` + +As you can imagine, replicating these steps correctly on multiple Fedora Linux machines can be challenging and tedious. Ansible automation solves this problem. + +In the _rpi-example_ directory of the github repository I’ve included an example Ansible playbook (_configure.yaml_) that installs and configures both the DNF plugin and the NFS client on all Fedora Linux machines on my network. There is also a playbook (_update.yaml)_ that runs a DNF update across all devices. See this [recent post in Fedora Magazine][8] for more information about Ansible. + +To use the provided Ansible examples, first update the inventory file (_inventory_) to include the list of Fedora Linux machines on your network that you want to managed. Next, install two Ansible roles in the roles subdirectory (or another suitable location). + +``` +$ ansible-galaxy install --roles-path ./roles -r requirements.yaml +``` + +Run the _configure.yaml_ playbook to install and configure the plugin and NFS client on all hosts defined in the inventory file. The role that installs and configures the NFS client does so via _/etc/fstab_ but also takes it a step further by creating an automount for the NFS share in systemd. The automount is configured to mount the share only when needed and then to automatically unmount. This saves network bandwidth and CPU cycles which can be important for low power devices like a Raspberry Pi. See the github repository for the role and for more information. + +``` +$ ansible-playbook -i inventory configure.yaml +``` + +Finally, Ansible can be configured to execute _dnf update_ on all the systems serially by using the _update.yaml_ playbook. + +``` +$ ansible-playbook -i inventory update.yaml +``` + +Ansible and other automation tools such as Puppet, Salt, or Chef can be big time savers when working with multiple virtual or physical machines that share many characteristics. + +#### Use case 2: virtual machines running on the same host + +Fedora Linux has excellent built-in support for virtual machines. The Fedora Project also provides [Fedora Cloud][9] base images for use as virtual machines. [Vagrant][10] is a tool for managing virtual machines. Fedora Magazine has [instructions][11] on how to set up and configure Vagrant. Add the following line in your _.bashrc_ (or other comparable shell configuration file) to inform Vagrant to use _libvirt_ automatically on your workstation instead of the default VirtualBox. + +``` +export VAGRANT_DEFAULT_PROVIDER=libvirt +``` + +In your project directory initialize Vagrant and the Fedora Cloud image (use 34-cloud-base for Fedora Linux 34 when available): + +``` +$ vagrant init fedora/33-cloud-base +``` + +This creates a Vagrant file in the project directory. Edit the Vagrant file to look like the example below. DNF will likely fail with the default memory settings for _libvirt_. So the example Vagrant file below provides additional memory to the virtual machine. The example below also shares the host _/srv/repodir_ with the virtual machine. The shared directory will have the same path in the virtual machine – _/srv/repodir_. The Vagrant file can be downloaded from [github][12]. + +``` +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# define repo directory; same name on host and vm +REPO_DIR = "/srv/repodir" + +Vagrant.configure("2") do |config| + + config.vm.box = "fedora/33-cloud-base" + + config.vm.provider :libvirt do |v| + v.memory = 2048 + # v.cpus = 2 + end + + # share the local repository with the vm at the same location + config.vm.synced_folder REPO_DIR, REPO_DIR + + # ansible provisioner - commented out by default + # the ansible role is installed into a path defined by + # ansible.galaxy_roles-path below. The extra_vars are ansible + # variables passed to the playbook. + # +# config.vm.provision "ansible" do |ansible| +# ansible.verbose = "v" +# ansible.playbook = "ansible/playbook.yaml" +# ansible.extra_vars = { +# repo_dir: REPO_DIR, +# dnf_update: false +# } +# ansible.galaxy_role_file = "ansible/requirements.yaml" +# ansible.galaxy_roles_path = "ansible/roles" +# end +end +``` + +Once you have Vagrant managing a Fedora Linux virtual machine, you can install the plugin manually. SSH into the virtual machine: + +``` +$ vagrant ssh +``` + +When you are at a command prompt in the virtual machine, repeat the steps from the _Install and configure the DNF local plugin_ section above. The Vagrant configuration file should have already made _/srv/repodir_ from the host available in the virtual machine at the same path. + +If you are working with several virtual machines or repeatedly re-initiating a new virtual machine then some simple automation becomes useful. As with the network example above, I use ansible to automate this process. + +In the [vagrant-example directory][12] on github, you will see an _ansible_ subdirectory. Edit the Vagrant file and remove the comment marks under the _ansible provisioner_ section. Make sure the _ansible_ directory and its contents (_playbook.yaml_, _requirements.yaml_) are in the project directory. + +After you’ve uncommented the lines, the _ansible provisioner_ section in the Vagrant file should look similar to the following: + +``` +.... + # ansible provisioner + # the ansible role is installed into a path defined by + # ansible.galaxy_roles-path below. The extra_vars are ansible + # variables passed to the playbook. + # + config.vm.provision "ansible" do |ansible| + ansible.verbose = "v" + ansible.playbook = "ansible/playbook.yaml" + ansible.extra_vars = { + repo_dir: REPO_DIR, + dnf_update: false + } + ansible.galaxy_role_file = "ansible/requirements.yaml" + ansible.galaxy_roles_path = "ansible/roles" + end +.... +``` + +Ansible must be installed (_sudo dnf install ansible_). Note that there are significant changes to how Ansible is packaged beginning with Fedora Linux 34 (use _sudo dnf install ansible-base ansible-collections*_). + +If you run Vagrant now (or reprovision: _vagrant provision_), Ansible will automatically download an Ansible role that installs the DNF local plugin. It will then use the downloaded role in a playbook. You can _vagrant ssh_ into the virtual machine to verify that the plugin is installed and to verify that rpms are coming from the DNF local repository instead of a mirror. + +#### Use case 3: container builds + +Container images are a common way to distribute and run applications. If you are a developer or enthusiast using Fedora Linux containers as a foundation for applications or services, you will likely use _dnf_ to update the container during the development/build process. Application development is iterative and can result in repeated executions of _dnf_ pulling the same RPM set from Fedora Linux mirrors. If you cache these rpms locally then you can speed up the container build process by retrieving them from the local cache instead of re-downloading them over the network each time. One way to accomplish this is to create a custom Fedora Linux container image with the DNF local plugin installed and configured to use a local repository on the host workstation. Fedora Linux offers _podman_ and _buildah_ for managing the container build, run and test life cycle. See the Fedora Magazine post [_How to build Fedora container images_][13] for more about managing containers on Fedora Linux. + +Note that the _fedora_minimal_ container uses _microdnf_ by default which does not support plugins. The _fedora_ container, however, uses _dnf_. + +A script that uses _buildah_ and _podman_ to create a custom Fedora Linux image named _myFedora_ is provided below. The script creates a mount point for the local repository at _/srv/repodir_. The below script is also available in the [_container-example_][14] directory of the github repository. It is named _base-image-build.sh_. + +``` +#!/bin/bash +set -x + +# bash script that creates a 'myfedora' image from fedora:latest. +# Adds dnf-local-plugin, points plugin to /srv/repodir for local +# repository and creates an external mount point for /srv/repodir +# that can be used with a -v switch in podman/docker + +# custom image name +custom_name=myfedora + +# scratch conf file name +tmp_name=local.conf + +# location of plugin config file +configuration_name=/etc/dnf/plugins/local.conf + +# location of repodir on container +container_repodir=/srv/repodir + +# create scratch plugin conf file for container +# using repodir location as set in container_repodir +cat < "$tmp_name" +[main] +enabled = true +repodir = $container_repodir +[createrepo] +enabled = true +# If you want to speedup createrepo with the --cachedir option. Eg. +# cachedir = /tmp/createrepo-local-plugin-cachedir +# quiet = true +# verbose = false +EOF + +# pull registry.fedoraproject.org/fedora:latest +podman pull registry.fedoraproject.org/fedora:latest + +#start the build +mkdev=$(buildah from fedora:latest) + +# tag author +buildah config --author "$USER" "$mkdev" + +# install dnf-local-plugin, clean +# do not run update as local repo is not operational +buildah run "$mkdev" -- dnf --nodocs -y install python3-dnf-plugin-local createrepo_c +buildah run "$mkdev" -- dnf -y clean all + +# create the repo dir +buildah run "$mkdev" -- mkdir -p "$container_repodir" + +# copy the scratch plugin conf file from host +buildah copy "$mkdev" "$tmp_name" "$configuration_name" + +# mark container repodir as a mount point for host volume +buildah config --volume "$container_repodir" "$mkdev" + +# create myfedora image +buildah commit "$mkdev" "localhost/$custom_name:latest" + +# clean up working image +buildah rm "$mkdev" + +# remove scratch file +rm $tmp_name +``` + +Given normal security controls for containers, you usually run this script with _sudo_ and when you use the _myFedora_ image in your development process. + +``` +$ sudo ./base_image_build.sh +``` + +To list the images stored locally and see both _fedora:latest_ and _myfedora:latest_ run: + +``` +$ sudo podman images +``` + +To run the _myFedora_ image as a container and get a bash prompt in the container run: + +``` +$ sudo podman run -ti -v /srv/repodir:/srv/repodir:Z myfedora /bin/bash +``` + +Podman also allows you to run containers rootless (as an unprivileged user). Run the script without _sudo_ to create the _myfedora_ image and store it in the unprivileged user’s image repository: + +``` +$ ./base-image-build.sh +``` + +In order to run the _myfedora_ image as a rootless container on a Fedora Linux host, an additional flag is needed. Without the extra flag, SELinux will block access to _/srv/repodir_ on the host. + +``` +$ podman run --security-opt label=disable -ti -v /srv/repodir:/srv/repodir:Z myfedora /bin/bash +``` + +By using this custom image as the base for your Fedora Linux containers, the iterative building and development of applications or services on them will be faster. + +**Bonus Points** – for even better _dnf_ performance, Dan Walsh describes how to share _dnf_ metadata between a host and container using a file overlay (see . redhat.com/sysadmin/speeding-container-buildah). This technique will work in combination with a shared local repository only if the host and the container use the same local repository. The _dnf_ metadata cache includes metadata for the local repository under the name __dnf_local_. + +I have created a container file that uses _buildah_ to do a _dnf_ update on a _fedora:latest_ image. I’ve also created a container file to repeat the process using a _myfedora_ image. There are 53 MB and 111 rpms in the _dnf_ update. The only difference between the images is that _myfedora_ has the DNF local plugin installed. Using the local repository cut the elapse time by more than half in this example and saves 53MB of internet bandwidth consumption. + +With the _fedora:latest_ image the command and elapsed time is: + +``` +# sudo time -f "Elapsed Time: %E" buildah bud -v /var/cache/dnf:/var/cache/dnf:O - f Containerfile.3 . +128 Elapsed Time: 0:48.06 +``` + +With the _myfedora_ image the command and elapsed time is less than half of the base run. The **:Z** on the **-v** volume below is required when running the container on a SELinux-enabled host. + +``` +# sudo time -f "Elapsed Time: %E" buildah bud -v /var/cache/dnf:/var/cache/dnf:O -v /srv/repodir:/srv/repodir:Z -f Containerfile.4 . +133 Elapsed Time: 0:19.75 +``` + +### Repository management + +The local repository will accumulate files over time. Among the files will be many versions of rpms that change frequently. The kernel rpms are one such example. A system upgrade (for example upgrading from Fedora Linux 33 to Fedora Linux 34) will copy many rpms into the local repository. The _dnf repomanage_ command can be used to remove outdated rpm archives. I have not used the plugin long enough to explore this. The interested and knowledgeable reader is welcome to write an article about the _dnf repomanage_ command for Fedora Magazine. + +Finally, I keep the _x86_64_ rpms for my workstation, virtual machines and containers in a local repository that is separate from the _aarch64_ local repository for the Raspberry Pis and (future) containers hosting my Kubernetes cluster. I have separated them for reasons of convenience and happenstance. A single repository location should work across all architectures. + +### An important note about Fedora Linux system upgrades + +Glenn Johnson has more than four years experience with the DNF local plugin. On occasion he has experienced problems when upgrading to a new release of Fedora Linux with the DNF local plugin enabled. Glenn strongly recommends that the _enabled_ attribute in the plugin configuration file _/etc/dnf/plugins/local.conf_ be set to **false** before upgrading your systems to a new Fedora Linux release. After the system upgrade, re-enable the plugin. Glenn also recommends using a separate local repository for each Fedora Linux release. For example, a NFS server might export _/volume1/dnf-repo/33_ for Fedora Linux 33 systems only. Glenn hangs out on fedoraforum.org – an independent online resource for Fedora Linux users. + +### Summary + +The DNF local plugin has been beneficial to my ongoing work with a Fedora Linux based Kubernetes cluster. The containers and virtual machines running on my Fedora Linux desktop have also benefited. I appreciate how it supplements the existing DNF process and does not dictate any changes to how I update my systems or how I work with containers and virtual machines. I also appreciate not having to download the same set of rpms multiple times which saves me money, frees up bandwidth, and reduces the load on the Fedora Linux mirror hosts. Give it a try and see if the plugin will help in your situation! + +Thanks to Glenn Johnson for his post on the DNF local plugin which started this journey, and for his helpful reviews of this post. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-the-dnf-local-plugin-to-speed-up-your-home-lab/ + +作者:[Brad Smith][a] +选题:[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/buckaroogeek/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/dnf-local-816x345.jpg +[2]: https://unsplash.com/@_s9h8_?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://dnf-plugins-core.readthedocs.io/en/latest/local.html +[5]: https://forums.fedoraforum.org/showthread.php?318812-dnf-plugin-local +[6]: https://fedoraproject.org/wiki/%20Infrastructure/Mirroring#How_can_someone_make_a_private_mirror +[7]: https://www.redhat.com/sysadmin/nfs-server-client +[8]: https://fedoramagazine.org/using-ansible-setup-workstation/ +[9]: https://alt.fedoraproject.org/cloud/ +[10]: https://vagrantup.com/ +[11]: https://fedoramagazine.org/vagrant-qemukvm-fedora-devops-sysadmin/ +[12]: https://github.com/buckaroogeek/dnf-local-plugin-examples/tree/main/vagrant-example +[13]: https://fedoramagazine.org/how-to-build-fedora-container-images/ +[14]: https://github.com/buckaroogeek/dnf-local-plugin-examples/tree/main/container-example From 7327eb05eb35790de1c49346fdc9482af2e495a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:03:00 +0800 Subject: [PATCH 147/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416=20?= =?UTF-8?q?WASI,=20Bringing=20WebAssembly=20Way=20Beyond=20Browsers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md --- ...ringing WebAssembly Way Beyond Browsers.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md diff --git a/sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md b/sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md new file mode 100644 index 0000000000..83b6c0ba38 --- /dev/null +++ b/sources/tech/20210416 WASI, Bringing WebAssembly Way Beyond Browsers.md @@ -0,0 +1,87 @@ +[#]: subject: (WASI, Bringing WebAssembly Way Beyond Browsers) +[#]: via: (https://www.linux.com/news/wasi-bringing-webassembly-way-beyond-browsers/) +[#]: author: (Dan Brown https://training.linuxfoundation.org/announcements/wasi-bringing-webassembly-way-beyond-browsers/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +WASI, Bringing WebAssembly Way Beyond Browsers +====== + +_By Marco Fioretti_ + +[WebAssembly (Wasm)][1] is a binary software format that all browsers can run directly, [safely][2] and at near-native speeds, on any operating system (OS). Its biggest promise, however, is to eventually work in the same way [everywhere][3], from IoT devices and edge servers, to mobile devices and traditional desktops. This post introduces the main interface that should make this happen. The next post in this series will describe some of the already available, real-world implementations and applications of the same interface. + +**What is portability, again?** + +To be safe and portable, software code needs, as a minimum:  + + 1. guarantees that users and programs can do only what they actually _have_ the right to do, and only do it without creating problems to other programs or users + 2. standard, platform-independent methods to declare and apply those guarantees + + + +Traditionally, these services are provided by libraries of “system calls” for each language, that is functions with which a software program can ask its host OS to perform some low-level, or sensitive task. When those libraries follow standards like [POSIX][4], any compiler can automatically combine them with the source code, to produce a binary file that can run on _some_ combination of OSes and processors. + +**The next level: BINARY compatibility** + +System calls only make _source code_ portable across platforms. As useful as they are, they still force developers to generate platform-specific executable files, all too often from more or less different combinations of source code. + +WebAssembly instead aims to get to the next level: use any language you want, then compile it once, to produce one binary file that will _just run_, securely, in any environment that recognizes WebAssembly.  + +**What Wasm does not need to work outside browsers** + +Since WebAssembly already “compiles once” for all major browsers, the easiest way to expand its reach may seem to create, for every target environment, a full virtual machine (runtime) that provides everything a Wasm module expects from Firefox or Chrome. + +Work like that however would be _really_ complex, and above all simply unnecessary, if not impossible, in many cases (e.g. on IoT devices). Besides, there are better ways to secure Wasm modules than dumping them in one-size-fits-all sandboxes as browsers do today. + +**The solution? A virtual operating system and runtime** + +Fully portable Wasm modules cannot happen until, to give one practical example, accesses to webcams or websites can be written only with system calls that generate platform-dependent machine code. + +Consequently, the most practical way to have such modules, from _any_ programming language, seems to be that of the [WebAssembly System interface (WASI) project][5]: write and compile code for only _one, obviously virtual,_ but complete operating system. + +On one hand WASI gives to all the developers of [Wasm runtimes][6] one single OS to emulate. On the other, WASI gives to all programming languages one set of system calls to talk to that same OS. + +In this way, even if you loaded it on ten different platforms, a _binary_ Wasm module calling a certain WASI function would still get – from the runtime that launched it – a different binary object every time. But since all those objects would interact with that single Wasm module in exactly the same way, it would not matter! + +This approach would work also in the first use case of WebAssembly, that is with the JavaScript virtual machines inside web browsers. To run Wasm modules that use WASI calls, those machines should only load the JavaScript versions of the corresponding libraries. + +This OS-level emulation is also more secure than simple sandboxing. With WASI, any runtime can implement different versions of each system call – with different security privileges – as long as they all follow the specification. Then that runtime could place every instance of every Wasm module it launches into a separate sandbox, containing only the smallest, and least privileged combination of functions that that specific instance really needs. + +This “principle of least privilege”, or “[capability-based security model][7]“, is everywhere in WASI. A WASI runtime can pass into a sandbox an instance of the “open” system call that is only capable of opening the specific files, or folders, that were _pre-selected_ by the runtime itself. This is a more robust, much more granular control on what programs can do than it would be possible with traditional file permissions, or even with chroot systems. + +Coding-wise, functions for things like basic management of files, folders, network connections or time are needed by almost any program. Therefore the corresponding WASI interfaces are designed as similar as possible to their POSIX equivalents, and all packaged into one “wasi-core” module, that every WASI-compliant runtime must contain. + +A version of the [libc][8] standard C library, rewritten usi wasi-core functions, is already available and, [according to its developers][9], already “sufficiently stable and usable for many purposes”.  + +All the other virtual interfaces that WASI includes, or will include over time, are standardized and packaged as separate modules,  without forcing any runtime to support all of them. In the next article we will see how some of these WASI components are already used today. + +The post [WASI, Bringing WebAssembly Way Beyond Browsers][10] appeared first on [Linux Foundation – Training][11]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/wasi-bringing-webassembly-way-beyond-browsers/ + +作者:[Dan 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://training.linuxfoundation.org/announcements/wasi-bringing-webassembly-way-beyond-browsers/ +[b]: https://github.com/lujun9972 +[1]: https://training.linuxfoundation.org/announcements/an-introduction-to-webassembly/ +[2]: https://training.linuxfoundation.org/announcements/webassembly-security-now-and-in-the-future/ +[3]: https://webassembly.org/docs/non-web/ +[4]: https://www.gnu.org/software/libc/manual/html_node/POSIX.html#POSIX +[5]: https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ +[6]: https://github.com/appcypher/awesome-wasm-runtimes +[7]: https://github.com/WebAssembly/WASI/blob/main/docs/WASI-overview.md#capability-oriented +[8]: https://en.wikipedia.org/wiki/C_standard_library +[9]: https://github.com/WebAssembly/wasi-libc +[10]: https://training.linuxfoundation.org/announcements/wasi-bringing-webassembly-way-beyond-browsers/ +[11]: https://training.linuxfoundation.org/ From 3129efac664d8860173a27e97ea39b94261dc87d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:03:40 +0800 Subject: [PATCH 148/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210417=20?= =?UTF-8?q?How=20to=20Download=20Ubuntu=20via=20Torrent=20[Absolute=20Begi?= =?UTF-8?q?nner=E2=80=99s=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md --- ...tu via Torrent -Absolute Beginner-s Tip.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md diff --git a/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md new file mode 100644 index 0000000000..a14a44fffd --- /dev/null +++ b/sources/tech/20210417 How to Download Ubuntu via Torrent -Absolute Beginner-s Tip.md @@ -0,0 +1,79 @@ +[#]: subject: (How to Download Ubuntu via Torrent [Absolute Beginner’s Tip]) +[#]: via: (https://itsfoss.com/download-ubuntu-via-torrent/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Download Ubuntu via Torrent [Absolute Beginner’s Tip] +====== + +Downloading Ubuntu is pretty straightforward. You go to its [official website][1]. Click on the [desktop download section][2], select the appropriate Ubuntu version and hit the download button. + +![][3] + +Ubuntu is available as a single image of more than 2.5 GB in size. The direct download works well for people with high-speed internet connection. + +However, if you have a slow or inconsistent internet connection, you’ll have a difficult time downloading such a big file. The download may be interrupted several times in the process or may take several hours. + +![Direct download may take several hours for slow internet connections][4] + +### Downloading Ubuntu via Torrent + +If you also suffer from limited data or slow internet connection, using a download manager or torrent would be a better option. I am not going to discuss what torrent is in this quick tutorial. Just know that with torrents, you can download a large file in a number of sessions. + +The Good thing is that Ubuntu actually provides downloads via torrents. The bad thing is that it is hidden on the website and difficult to guess if you are not familiar with it. + +If you want to download Ubuntu via torrent, go to your chosen Ubuntu version’s section and look for **alternative downloads**. + +![][5] + +**Click on this “alternative downloads” link** and it will open a new web page. **Scroll down** on this page to see the BitTorrent section. You’ll see the option to download the torrent files for all the available versions. If you are going to use Ubuntu on your personal computer or laptop, you should go with the desktop version. + +![][6] + +Read [this article to get some guidance on which Ubuntu version][7] you should be using. Considering that you are going to use this distribution, having some ideas about [Ubuntu LTS and non-LTS release would be helpful][8]. + +#### How do you use the download torrent file for getting Ubuntu? + +I presumed that you know how to use torrent. If not, let me quickly summarize it for you. + +You have downloaded a .torrent file of a few KB in size. You need to download and install a Torrent application like uTorrent or Deluge or BitTorrent. + +I recommend using [uTorrent][9] on Windows. If you are using some Linux distribution, you should already have a [torrent client like Transmission][10]. If not, you can install it from your distribution’s software manager. + +Once you have installed the torrent application, run it. Now drag and drop the .torrent file you had downloaded from the website of Ubuntu. You may also use the open with option from the menu. + +Once the torrent file has been added to the Torrent application, it starts downloading the file. If you turn off the system, the download is paused. Start the Torrent application again and the download resumes from the same point. + +When the download is 100% complete, you can use it to [install Ubuntu afresh][11] or in [dual boot with Windows][12]. + +Enjoy Ubuntu :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/download-ubuntu-via-torrent/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntu.com +[2]: https://ubuntu.com/download/desktop +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/download-ubuntu.png?resize=800%2C325&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/slow-direct-download-ubuntu.png?resize=800%2C365&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download.png?resize=800%2C505&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/ubuntu-torrent-download-option.png?resize=800%2C338&ssl=1 +[7]: https://itsfoss.com/which-ubuntu-install/ +[8]: https://itsfoss.com/long-term-support-lts/ +[9]: https://www.utorrent.com/ +[10]: https://itsfoss.com/best-torrent-ubuntu/ +[11]: https://itsfoss.com/install-ubuntu/ +[12]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ From 002db69e4c4b67230fb50546d2ede5be4df90ac7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:03:57 +0800 Subject: [PATCH 149/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416=20?= =?UTF-8?q?Play=20a=20fun=20math=20game=20with=20Linux=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 Play a fun math game with Linux commands.md --- ...lay a fun math game with Linux commands.md | 209 ++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 sources/tech/20210416 Play a fun math game with Linux commands.md diff --git a/sources/tech/20210416 Play a fun math game with Linux commands.md b/sources/tech/20210416 Play a fun math game with Linux commands.md new file mode 100644 index 0000000000..6a179e1ba6 --- /dev/null +++ b/sources/tech/20210416 Play a fun math game with Linux commands.md @@ -0,0 +1,209 @@ +[#]: subject: (Play a fun math game with Linux commands) +[#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Play a fun math game with Linux commands +====== +Play the numbers game from the popular British game show "Countdown" at +home. +![Math formulas in green writing][1] + +Like many people, I've been exploring lots of new TV shows during the pandemic. I recently discovered a British game show called _[Countdown][2]_, where contestants play two types of games: a _words_ game, where they try to make the longest word out of a jumble of letters, and a _numbers_ game, where they calculate a target number from a random selection of numbers. Because I enjoy mathematics, I've found myself drawn to the numbers game. + +The numbers game can be a fun addition to your next family game night, so I wanted to share my own variation of it. You start with a collection of random numbers, divided into "small" numbers from 1 to 10 and "large" numbers that are 15, 20, 25, and so on until 100. You pick any combination of six numbers from both large and small numbers. + +Next, you generate a random "target" number between 200 and 999. Then use simple arithmetic operations with your six numbers to try to calculate the target number using each "small" and "large" number no more than once. You get the highest number of points if you calculate the target number exactly and fewer points if you can get within 10 of the target number. + +For example, if your random numbers were 75, 100, 2, 3, 4, and 1, and your target number was 505, you might say _2+3=5_, _5×100=500_, _4+1=5_, and _5+500=505_. Or more directly: (**2**+**3**)×**100** \+ **4** \+ **1** = **505**. + +### Randomize lists on the command line + +I've found the best way to play this game at home is to pull four "small" numbers from a pool of 1 to 10 and two "large" numbers from multiples of five from 15 to 100. You can use the Linux command line to create these random numbers for you. + +Let's start with the "small" numbers. I want these to be in the range of 1 to 10. You can generate a sequence of numbers using the Linux `seq` command. You can run `seq` a few different ways, but the simplest form is to provide the starting and ending numbers for the sequence. To generate a list from 1 to 10, you might run this command: + + +``` +$ seq 1 10 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +``` + +To randomize this list, you can use the Linux `shuf` ("shuffle") command. `shuf` will randomize the order of whatever you give it, usually a file. For example, if you send the output of the `seq` command to the `shuf` command, you will receive a randomized list of numbers between 1 and 10: + + +``` +$ seq 1 10 | shuf +3 +6 +8 +10 +7 +4 +5 +2 +1 +9 +``` + +To select just four random numbers from a list of 1 to 10, you can send the output to the `head` command, which prints out the first few lines of its input. Use the `-4` option to specify that `head` should print only the first four lines: + + +``` +$ seq 1 10 | shuf | head -4 +6 +1 +8 +4 +``` + +Note that this list is different from the earlier example because `shuf` will generate a random order every time. + +Now you can take the next step to generate the random list of "large" numbers. The first step is to generate a list of possible numbers starting at 15, incrementing by five, until you reach 100. You can generate this list with the Linux `seq` command. To increment each number by five, insert another option for the `seq` command to indicate the _step_: + + +``` +$ seq 15 5 100 +15 +20 +25 +30 +35 +40 +45 +50 +55 +60 +65 +70 +75 +80 +85 +90 +95 +100 +``` + +And just as before, you can randomize this list and select two of the "large" numbers: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +40 +``` + +### Generate a random number with Bash + +I suppose you could use a similar method to select the game's target number from the range 200 to 999. But the simplest solution to generate a single random value is to use the `RANDOM` variable directly in Bash. When you reference this built-in variable, Bash generates a large random number. To put this in the range of 200 to 999, you need to put the random number into the range 0 to 799 first, then add 200. + +To put a random number into a specific range starting at 0, you can use the **modulo** arithmetic operation. Modulo calculates the _remainder_ after dividing two numbers. If I started with 801 and divided by 800, the result is 1 _with a remainder of_ 1 (the modulo is 1). Dividing 800 by 800 gives 1 _with a remainder of_ 0 (the modulo is 0). And dividing 799 by 800 results in 0 _with a remainder of_ 799 (the modulo is 799). + +Bash supports arithmetic expansion with the `$(( ))` construct. Between the double parentheses, Bash will perform arithmetic operations on the values you provide. To calculate the modulo of 801 divided by 800, then add 200, you would type: + + +``` +$ echo $(( 801 % 800 + 200 )) +201 +``` + +With that operation, you can calculate a random target number between 200 and 999: + + +``` +$ echo $(( RANDOM % 800 + 200 )) +673 +``` + +You might wonder why I used `RANDOM` instead of `$RANDOM` in my Bash statement. In arithmetic expansion, Bash will automatically expand any variables within the double parentheses. You don't need the `$` on the `$RANDOM` variable to reference the value of the variable because Bash will do it for you. + +### Playing the numbers game + +Let's put all that together to play the numbers game. Generate two random "large" numbers, four random "small" values, and the target value: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +100 +$ seq 1 10 | shuf | head -4 +4 +3 +10 +2 +$ echo $(( RANDOM % 800 + 200 )) +868 +``` + +My numbers are **75**, **100**, **4**, **3**, **10**, and **2**, and my target number is **868**. + +I can get close to the target number if I do these arithmetic operations using each of the "small" and "large" numbers no more than once: + + +``` +10×75 = 750 +750+100 = 850 + +and: + +4×3 = 12 +850+12 = 862 +862+2 = 864 +``` + +That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: + + +``` +4×2 = 8 +8×100 = 800 + +and: + +75-10+3 = 68 +800+68 = 868 +``` + +Or I could perform _these_ calculations to get the target number exactly. This uses only five of the six random numbers: + + +``` +4×3 = 12 +75+12 = 87 + +and: + +87×10 = 870 +870-2 = 868 +``` + +Give the _Countdown_ numbers game a try, and let us know how well you did in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/math-game-linux-commands + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/edu_math_formulas.png?itok=B59mYTG3 (Math formulas in green writing) +[2]: https://en.wikipedia.org/wiki/Countdown_%28game_show%29 From 93756d2452b1b4347e718dcc9b9d05b50ac9feb1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 17 Apr 2021 05:04:29 +0800 Subject: [PATCH 150/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210416=20?= =?UTF-8?q?Notes=20on=20building=20debugging=20puzzles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210416 Notes on building debugging puzzles.md --- ...416 Notes on building debugging puzzles.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 sources/tech/20210416 Notes on building debugging puzzles.md diff --git a/sources/tech/20210416 Notes on building debugging puzzles.md b/sources/tech/20210416 Notes on building debugging puzzles.md new file mode 100644 index 0000000000..593526933a --- /dev/null +++ b/sources/tech/20210416 Notes on building debugging puzzles.md @@ -0,0 +1,228 @@ +[#]: subject: (Notes on building debugging puzzles) +[#]: via: (https://jvns.ca/blog/2021/04/16/notes-on-debugging-puzzles/) +[#]: author: (Julia Evans https://jvns.ca/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Notes on building debugging puzzles +====== + +Hello! This week I started building some choose-your-own-adventure-style puzzles about debugging networking problems. I’m pretty excited about it and I’m trying to organize my thoughts so here’s a blog post! + +The two I’ve made so far are: + + * [The Case of the Connection Timeout][1] + * [The Case of the Slow Website][2] + + + +I’ll talk about how I came to this idea, design decisions I made, how it works, what I think is hard about making these puzzles, and some feedback I’ve gotten so far. + +### why this choose-your-own-adventure format? + +I’ve been thinking a lot about DNS recently, and how to help people troubleshoot their DNS issues. So on Tuesday I was sitting in a park with a couple of friends chatting about this. + +We started out by talking about the idea of flowcharts (“here’s a flowchart that will help you debug any DNS problem”). I’ve don’t think I’ve ever seen a flowchart that I found helpful in solving a problem, so I found it really hard to imagine creating one – there are so many possibilities! It’s hard to be exhaustive! It would be disappointing if the flowchart failed and didn’t give you your answer! + +But then someone mentioned choose-your-own-adventure games, and I thought about something I **could** relate to – debugging a problem together with someone who knows things that I don’t! + +So I thought – what if I made a choose-your-own-adventure game where you’re given the symptoms of a specific networking bug, and you have to figure out how to diagnose it? + +I got really excited about this and immediately went home and started putting something together in Twine. + +Here are some design decisions I’ve made so far. Some of them might change. + +### design decision: the mystery has 1 specific bug + +Each mystery has one very specific bug, ideally a bug that I’ve actually run into in the past. Your mission is to figure out the cause of the bug and fix it. + +### design decision: show people the actual output of the tools they’re using + +All of the bugs I’m starting with are networking issues, and the way you solve them is to use various tools (like dig, curl, tcpdump, ping, etc) to get more information. + +Originally I thought of writing the game like this: + + 1. You choose “Use curl” + 2. It says “You run ``. You see that the output tells you ``“ + + + +But I realized that immediately interpreting the output of a command for someone is extremely unrealistic – one of the biggest problems with using some of these command line networking tools is that their output is hard to interpret! + +So instead, the puzzle: + + 1. Asks what tool you want to use + 2. Tells you what command they ran, and shows you the output of the command + 3. Asks you to interpret the output (you type it in in a freeform text box) + 4. Tells you the “correct” interpretation of the output and shows you how you could have figured it out (by highlighting the relevant parts of the output) + + + +This really lines up with how I’ve learned about these tools in real life – I don’t learn about how to read all of the output all at once, I learn it in bits and pieces by debugging real problems. + +### design decision: make the output realistic + +This is sort of obvious, but in order to give someone output to help them diagnose a bug, the output needs to be a realistic representation of what would actually happen. + +I’ve been doing this by reproducing the bug in a virtual machine (or on my laptop), and then running the commands in the same way I would to fix the bug in real life and paste their output. + +Reproducing the bug isn’t always easy, but once I’ve reproduced it it makes building the puzzle much more straightforward than trying to imagine what tcpdump would theoretically output in a given situation. + +### design decision: let people collect “knowledge” throughout the mystery + +When I debug, I think about it as slowly collecting new pieces of information as I go. So in this mystery, every time you figure out a new piece of information, you get a little box that looks like this: + +![][3] + +And in the sidebar, you have a sort of “inventory” that lists all of the knowledge you’ve collected so far. It looks like this: + +![][4] + +### design decision: you always figure out the bug + +My friend Sumana pointed out an interesting difference between this and normal choose-your-own-adventure games: in the choose-your-own-adventure games I grew up reading, you lose a lot! You make the wrong choice, and you fall into a pit and die. + +But that’s not how debugging works in my experience. When debugging, if you make a “wrong” choice (for example by making a guess about the bug that isn’t correct), there’s no cost except your time! So you can always go back, keep trying, and eventually figure out what’s going on. + +I think that “you always win” is sort of realistic in the sense that with any bug you can always figure out what the bug is, given: + + 1. enough time + 2. enough understanding of how the systems you’re debugging work + 3. tools that can give you information about what’s happening + + + +I’m still not sure if I want all bugs to result in “you fix the bug!” – sometimes bugs are impossible to fix if they’re caused by a system that’s outside of your control! One really interesting idea Sumana had was to have the resolution sometimes be “you submit a really clear and convincing bug report and someone else fixes it”. + +### design decision: include red herrings sometimes + +In debugging in real life, there are a lot of red herrings! Sometimes you see something that looks weird, and you spend three hours looking into it, and then you realize that wasn’t it at all. + +One of the mysteries right now has a red herring, and the way I came up with it was that I ran a command and I thought “wait, the output of that is pretty confusing, it’s not clear how to interpret that”. So I just included the confusing output in the mystery and said “hey, what do you think it means?”. + +One thing I like about including red herrings is that it lets me show how you can prove what the cause of the bug **isn’t** which is even harder than proving what the cause of the bug is. + +### design decision: use free form text boxes + +Here’s an example of what it looks like to be asked to interpret some output. You’re asked a question and you fill in the answer in a text box. + +![][5] + +I think I like using free form text boxes instead of multiple choice because it feels a little more realistic to me – in real life, when you see some output like this, you don’t get a list of choices! + +### design decision: don’t do anything with what you enter in the text box + +No matter what you enter in the text box (or if you say “I don’t know”), exactly the same thing happens. It’ll send you to a page that tells you the answer and explains the reasoning. So you have to think about what you think the answer might be, but if you get it “wrong”, it’s no big deal. + +The reason I’m doing this is basically “it’s very easy to implement”, but I think there’s maybe also something nice about it for the person using it – if you don’t know, it’s totally okay! You can learn something new and keep moving! You don’t get penalized for your “wrong” answers in any way. + +### design decision: the epilogue + +At the end of the game, there’s a very short epilogue where it talks about how likely you are to run into this bug in real life / how realistic this is. I think I need to expand on this to answer other questions people might have had while going through it, but I think it’s going to be a nice place to wrap up loose ends. + +### how long each one takes to play: 5 minutes + +People seem to report so far that each mystery takes about 5 minutes to play, which feels reasonable to me. I think I’m most likely to extend this by making lots of different 5-minute mysteries rather than making one really long mystery, but we’ll see. + +### what’s hard: reproducing the bug + +Figuring out how to reproduce a given bug is actually not that easy – I think I want to include some pretty weird bugs, and setting up a computer where that bug is happening in a realistic way isn’t actually that easy. I think this just takes some work and creativity though. + +### what’s hard: giving realistic options + +The most common critique I got was of the form “In this situation I would have done X but you didn’t include X as an option”. Some examples of X: “ping the problem host”, “ssh to the problem host and run tcpdump there”, “look at the log file”, “use netstat”, etc. + +I think it’s possible to make a lot of progress on this with playtesting – if I playtest a mystery with a bunch of people and ask them to tell me when there was an option they wish they had, I can add that option pretty easily! + +Because I can actually reproduce the bug, providing an option like “run netstat” is pretty straightforward – all I have to do is go to the VM where I’ve reproduced the bug, run `netstat`, and put the output into the game. + +A couple of people also said that the game felt too “linear” or didn’t branch enough. I’m curious about whether that will naturally come out of having more realistic options. + +### how it works: it’s a Twine game! + +I felt like Twine was the obvious choice for this even though I’d never used it before – I’d heard so many good things about it over the years. + +You can see all of the source code for The Case of the Connection Timeout in [connection-timeout.twee][6] and [common.twee][7], which has some shared code between all the games. + +A few notes about using Twine: + + * I’m using SugarCube, the [sugarcube docs are very good][8] + * I’m using [tweego][9] to translate the `.twee` files in to a HTML page. I started out using the visual Twine editor to do my editing but switched to `tweego` pretty quickly because I wanted to use version control and have a more text-based workflow. + * The final output is one big HTML file that includes all the images and CSS and Javascript inline. The final HTML files are about 800K which seems reasonable to me. + * I base64-encode all the images in the game and include them inline in the file + * The [Twine wiki][10] and forums have a lot of great information and between the Twine wiki, the forums, and the Sugarcube docs I could pretty easily find answers to all my questions. + + + +I used pretty much the exact Twine workflow from Em Lazerwalker’s great post [A Modern Developer’s Workflow For Twine][11]. + +I won’t explain how Twine works because it has great documentation and it would make this post way too long. + +### some feedback so far + +I posted this on Twitter and asked for feedback. Some common pieces of feedback I got: + +things people liked: + + * maybe 180 “I love this, this was so fun, I learned something new” + * A bunch of people specifically said that they liked learning how to interpret tcpdump’s output format + * A few people specifically mentioned that they liked the “what you know” list and the mechanic of hunting for clues and how it breaks down the debugging process. + + + +some suggestions for improvements: + + * Like I mentioned before, lots of people said “I wanted to try X but it wasn’t an option” + * One of the puzzles had a resolution to the bug that some people found unsatisfying (they felt it was more of a workaround than a fix, which I agreed with). I updated it to add a different resolution that was more satisfying. + * There were some technical issues (it could be more mobile-friendly, one of the images was hard to read, I needed to add a “Submit” button to one of the forms) + * Right now the way the text boxes work is that no matter what you type, the exact same thing happens. Some people found this a bit confusing, like “why did it act like I answered correctly if my answer was wrong”. This definitely needs some work. + + + +### some goals of this project + +Here’s what I think the goals of this project are: + + 1. help people learn about **tools** (like tcpcdump, dig, and curl). How do you use each tool? What questions can they be used to answer? How do you interpret their output? + 2. help people learn about **bugs**. There are some super common bugs that we run into over and over, and once you see a bug once it’s easier to recognize the same bug in the future. + 3. help people get better at the **debugging process** (gathering data, asking questions) + + + +### what experience is this trying to imitate? + +Something I try to keep in mind with all my projects is – what real-life experience does this reproduce? For example, I kind of think of my zines as being the experience “your coworker explains something to you in a really clear way”. + +I think the experience here might be “you’re debugging a problem together with your coworker and they’re really knowledgeable about the tools you’re using”. + +### that’s all! + +I’m pretty excited about this project right now – I’m going to build at least a couple more of these and see how it goes! If things go well I might make this into my first non-zine thing for sale – maybe it’ll be a collection of 12 small debugging mysteries! We’ll see. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/04/16/notes-on-debugging-puzzles/ + +作者:[Julia Evans][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://mysteries.wizardzines.com/connection-timeout.html +[2]: https://mysteries.wizardzines.com/slow-website.html +[3]: https://jvns.ca/images/newinfo.png +[4]: https://jvns.ca/images/sidebar-mystery.png +[5]: https://jvns.ca/images/textboxes.png +[6]: https://github.com/jvns/twine-stories/blob/2914c4326e3ff760a0187b2cfb15161928d6335b/connection-timeout.twee +[7]: https://github.com/jvns/twine-stories/blob/2914c4326e3ff760a0187b2cfb15161928d6335b/common.twee +[8]: https://www.motoslave.net/sugarcube/2/docs/ +[9]: https://www.motoslave.net/tweego/ +[10]: https://twinery.org/wiki/ +[11]: https://dev.to/lazerwalker/a-modern-developer-s-workflow-for-twine-4imp From 654f9429155869f10ab3897a67495e95e5cd3062 Mon Sep 17 00:00:00 2001 From: Weitian LI Date: Sat, 17 Apr 2021 10:10:27 +0800 Subject: [PATCH 151/307] Translated: 5 signs you're a groff programmer --- ...10410 5 signs you-re a groff programmer.md | 77 ------------------- ...10410 5 signs you-re a groff programmer.md | 76 ++++++++++++++++++ 2 files changed, 76 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20210410 5 signs you-re a groff programmer.md create mode 100644 translated/tech/20210410 5 signs you-re a groff programmer.md diff --git a/sources/tech/20210410 5 signs you-re a groff programmer.md b/sources/tech/20210410 5 signs you-re a groff programmer.md deleted file mode 100644 index 9cb584d1bc..0000000000 --- a/sources/tech/20210410 5 signs you-re a groff programmer.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: subject: (5 signs you're a groff programmer) -[#]: via: (https://opensource.com/article/21/4/groff-programmer) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (liweitianux) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -5 signs you're a groff programmer -====== -Learning groff, an old-school text processor, is like learning to ride a -bicycle. -![Typewriter in the grass][1] - -I first discovered Unix systems in the early 1990s, when I was an undergraduate at university. I liked it so much that I replaced the MS-DOS system on my home computer with the Linux operating system. - -One thing that Linux didn't have in the early to mid-1990s was a word processor. A standard office application on other desktop operating systems, a word processor lets you edit text easily. I often used a word processor on DOS to write my papers for class. I wouldn't find a Linux-native word processor until the late 1990s. Until then, word processing was one of the rare reasons I maintained dual-boot on my first computer, so I could occasionally boot back into DOS to write papers. - -Then I discovered that Linux provided kind of a word processor. GNU troff, better known as [groff][2], is a modern implementation of a classic text processing system called troff, short for "typesetter roff," which is an improved version of the nroff system. And nroff was meant to be a new implementation of the original roff (which stood for "run off," as in to "run off" a document). - -With text processing, you edit text in a plain text editor, and you add formatting through macros or other processing commands. You then process that text file through a text-processing system such as groff to generate formatted output suitable for a printer. Another well-known text processing system is LaTeX, but groff was simple enough for my needs. - -With a little practice, I found I could write my class papers just as easily in groff as I could using a word processor on Linux. While I don't use groff to write documents today, I still remember the macros and commands to generate printed documents with it. And if you're the same and you learned how to write with groff all those years ago, you probably recognize these five signs that you're a groff writer. - -### 1\. You have a favorite macro set - -You format a document in groff by writing plain text interspersed with macros. A macro in groff is a short command that starts with a single period at the beginning of a line. For example: if you want to insert a few lines into your output, the `.sp 2` macro command adds two blank lines. groff supports other basic macros for all kinds of formatting. - -To make formatting a document easier for the writer, groff also provides different _macro sets_, collections of macros that let you format documents your own way. The first macro set I learned was the `-me` macro set. Really, the macro set is called the `e` macro set, and you specify the `e` macro set when you process a file using the `-me` option. - -groff includes other macro sets, too. For example, the `-man` macro set used to be the standard macro set to format the built-in _manual_ pages on Unix systems, and the `-ms` macro set is often used to format certain other technical documents. If you learned to write with groff, you probably have a favorite macro set. - -### 2\. You want to focus on your content, not the formatting - -One great feature of writing with groff is that you can focus on your _content_ and not worry too much about what it looks like. That is a handy feature for technical writers. groff is a great "distraction-free" environment for professional writers. At least, as long as you don't mind delivering your output in any of the formats that groff supports with the `-T` command-line option, including PDF, PostScript, HTML, and plain text. You can't generate a LibreOffice ODT file or Word DOC file directly from groff. - -Once you get comfortable writing in groff, the macros start to _disappear_. The formatting macros become part of the background, and you focus purely on the text in front of you. I've done enough writing in groff that I don't even see the macros anymore. Maybe it's like writing programming code, and your mind just switches gears, so you think like a computer and see the code as a set of instructions. For me, writing in groff is like that; I just see my text, and my mind interprets the macros automatically into formatting. - -### 3\. You like the old-school feel - -Sure, it might be _easier_ to write your documents with a more typical word processor like LibreOffice Writer or even Google Docs or Microsoft Word. And for certain kinds of documents, a desktop word processor is the right fit. But if you want the "old-school" feel, it's hard to beat writing in groff. - -I'll admit that I do most of my writing with LibreOffice Writer, which does an outstanding job. But when I get that itch to do it "old-school," I'll open an editor and write my document using groff. - -### 4\. You like that you can use it anywhere - -groff (and its cousins) are a standard package on almost any Unix system. And with groff, the macros don't change. For example, the `-me` macros should be the same from system to system. So once you've learned to use the macros on one system, you can use them on the next system. - -And because groff documents are just plain text, you can use any editor you like to edit your documents for groff. I like to use GNU Emacs to edit my groff documents, but you can use GNOME Gedit, Vim, or your [favorite text editor][3]. Most editors include some kind of "mode" that will highlight the groff macros in a different color from the rest of your text to help you spot errors before processing the file. - -### 5\. You wrote this article in -me - -When I decided to write this article, I thought the best way would be to use groff directly. I wanted to demonstrate how flexible groff was in preparing documents. So even though you're reading this on a website, the article was originally written using groff. - -I hope this has interested you in learning how to use groff to write documents. If you'd like to use more advanced functions in the `-me` macro set, refer to Eric Allman's _Writing papers with groff using -me_, which you should find on your system as **meintro.me** in groff's documentation. It's a great reference document that explains other ways to format papers using the `-me` macros. - -I've also included a copy of the original draft of my article that uses the `-me` macros. Save the file to your system as **five-signs-groff.me**, and run it through groff to view it. The `-T` option sets the output type, such as `-Tps` to generate PostScript output or `-Thtml` to create an HTML file. For example: - -groff -me -Thtml five-signs-groff.me > five-signs-groff.html - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/groff-programmer - -作者:[Jim Hall][a] -选题:[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/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) -[2]: https://en.wikipedia.org/wiki/Groff_(software) -[3]: https://opensource.com/article/21/2/open-source-text-editors diff --git a/translated/tech/20210410 5 signs you-re a groff programmer.md b/translated/tech/20210410 5 signs you-re a groff programmer.md new file mode 100644 index 0000000000..8fd7d28acf --- /dev/null +++ b/translated/tech/20210410 5 signs you-re a groff programmer.md @@ -0,0 +1,76 @@ +[#]: subject: (5 signs you're a groff programmer) +[#]: via: (https://opensource.com/article/21/4/groff-programmer) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (liweitianux) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +你是 groff 程序员的 5 个标志 +====== +学习 groff,一款老派的文本处理软件,类似于学习骑自行车。 +![Typewriter in the grass][1] + +我第一次发现 Unix 系统是在 90 年代早期,当时我还在大学读本科。我太喜欢这个系统了,所以我将家里电脑上的 MS-DOS 也换成了 Linux 系统。 + +在 90 年代早期至中期,Linux 所缺失的一个东西是字处理软件word processor。在其他桌面操作系统上,这是一套标准的办公软件,其中的字处理软件能让你轻松地编辑文本。我经常在 DOS 上使用字处理软件来撰写课程论文。直到 90 年代末,我都没能找到一款 Linux 原生的字处理软件。也直到那时,文字处理是我在第一台电脑上保留双启动的个别原因之一,那样我可以偶尔切换到 DOS 系统写论文。 + +后来,我发现 Linux 提供了一款文字处理软件。GNU troff,一般称为 [groff][2],是经典的文本处理系统 troff 的一个现代实现。troff 是 typesetter roff 的简称,是 nroff 系统的改进版本,而 nroff 又是最初的 roff 系统的新实现。roff 表示快速印出run off,比如“快速印出”一份文档。 + +利用文本处理系统,你在纯文本编辑器里编辑内容,通过macro或其他处理命令来添加格式。然后将文件输入文本处理系统,比如 groff,来生成适合打印的格式化输出。另一个知名的文本处理系统是 LaTeX,但是 groff 已经满足我的需求,而且足够简单。 + +经过一点实践,我发现在 Linux 上使用 groff 来撰写课程论文与使用字处理软件一样容易。尽管我现在不再使用 groff 来写文档了,我依然记得它的那些宏和命令。如果你也是这样并且在那么多年之前学会了使用 groff 写作,你可能会认出这 5 个你是 groff 程序员的标志。 + +### 1\. 你有一个最喜欢的宏集 + +输入由宏点缀的纯文本,你便能在 groff 里对文档进行格式化。groff 里的宏是行首为单个句点的短命令。例如:如果你想在输出里插入几行,宏命令 `.sp 2` 会添加两个空行。groff 还具有其他一些基本的宏,支持各种各样的格式化。 + +为了能让作者更容易地格式化文档,groff 还提供了不同的 _宏集macro set_,即一组能够让你以自己的方式格式化文档的宏的集合。我学会的第一个宏集是 `-me` 宏集。这个宏集的名称其实是 `e`,而且你在处理文件时使用 `-me` 选项来指定这个 `e` 宏集。 + +groff 还包含其他宏集。例如,`-man` 宏集以前是用于格式化 Unix 系统内置 _手册页manual page_ 的标准宏集,`-ms` 宏集经常用于格式化其他一些技术文档。如果你学会了使用 groff 写作,你可能有一个最喜欢的宏集。 + +### 2\. 你想专注于内容而非格式 + +使用 groff 写作的一个很好的特点是你能专注于你的 _内容_,而不用太担心它看起来会怎么样。对于技术作者而言这是一个很实用的特点。对专业作家来说,groff 是一个很好的、“不会分心”的写作环境。至少,你不必在意使用 groff `-T` 选项所支持的任何格式来交付内容,包括 PDF、PostScript、HTML、以及纯文本。不过,你无法直接从 groff 生成 LibreOffice ODT 文件或者 Word DOC 文件。 + +一旦你使用 groff 写作变得有信心之后,宏便开始 _消失_。用于格式化的宏变成了背景,而你纯粹地专注于眼前的文本内容。我已经使用 groff 写了足够多,以至于我甚至不再看见那些宏。也许,这就像写代码,而你的大脑随意换档,于是你就像计算机一样思考,看到的代码就是一组指令。对我而言,使用 groff 写作就像那样:我仅仅看到文本,而我的大脑将宏自动地翻译成格式。 + +### 3\. 你喜欢怀旧复古的感觉 + +当然,使用一个更典型的字处理软件来写你的文档可能更 _简单_,比如 LibreOffice Writer、甚至 Google Docs 或 Microsoft Word。而且对于某些种类的文档,桌面型字处理软件才是正确的选择。但是,如果你想要这种怀旧复古的感觉,使用 groff 写作很难被打败。 + +我会承认我大部分的写作是用 LibreOffice Writer 完成的,它的表现很出色。但是当我渴望以一种怀旧复古的方式去做时,我会打开编辑器用 groff 来写文档。 + +### 4\. 你希望能到处使用它 + +groff 及其同类软件在几乎所有的 Unix 系统上都是一个标准软件包。此外,groff 宏不会随系统而变化。比如,`-me` 宏集在不同系统上都应该相同。因此,一旦你在一个系统上学会使用宏,你能在下一个系统上同样地使用它们。 + +另外,因为 groff 文档就是纯文本,所以你能使用任何你喜欢的编辑器来编辑文档。我喜欢使用 GNU Emacs 来编辑我的 groff 文档,但是你可能使用 GNOME Gedit、Vim、其他你[最喜欢的文本编辑器][3]。大部分编辑器会支持这样一种模式,其中 groff 宏会以不同的颜色高亮显示,帮助你在处理文件之前便能发现错误。 + +### 5\. 你使用 -me 写了这篇文章 + +当我决定要写这篇文章时,我认为最佳的方式便是直接使用 groff。我想要演示 groff 在编写文档方面是多么的灵活。所以,虽然你正在网上读这篇文章,但是它最初是用 groff 写的。 + +我希望这激发了你学习如何使用 groff 撰写文档的兴趣。如果你想学习 `-me` 宏集里更高级的函数,参考 Eric Allman 的《Writing papers with groff using -me》,你应该能在系统的 groff 文档找到,文件名为 **meintro.me**。这是一份很好的参考资料,还解释了使用 `-me` 宏集格式化论文的其他方式。 + +我还提供了这篇文章的原始草稿,其中使用了 `-me` 宏集。下载这个文件并保存为 **five-signs-groff.me**,然后输入 groff 处理来查看。`-T` 选项设置输出类型,比如 `-Tps` 用于生成 PostScript 输出,`-Thtml` 用于生成 HTML 文件。比如: + +groff -me -Thtml five-signs-groff.me > five-signs-groff.html + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/groff-programmer + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[liweitianux](https://github.com/liweitianux) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/doc-dish-lead.png?itok=h3fCkVmU (Typewriter in the grass) +[2]: https://en.wikipedia.org/wiki/Groff_(software) +[3]: https://opensource.com/article/21/2/open-source-text-editors From 2d781092bc8abd49ee1b7d05893077bab3f13855 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 11:03:12 +0800 Subject: [PATCH 152/307] PRF --- ...ur files with this open source software.md | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210412 Encrypt your files with this open source software.md b/translated/tech/20210412 Encrypt your files with this open source software.md index 9bbb82ac9d..0257479d34 100644 --- a/translated/tech/20210412 Encrypt your files with this open source software.md +++ b/translated/tech/20210412 Encrypt your files with this open source software.md @@ -3,14 +3,16 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -用这个开源软件加密你的文件 +用开源的 VeraCrypt 加密你的文件 ====== -VeraCrypt 提供跨平台的开源文件加密功能。 -![Lock][1] + +> VeraCrypt 提供跨平台的开源文件加密功能。 + +![](https://img.linux.net.cn/data/attachment/album/202104/17/110244p1g4tbpnw00tqwq3.jpg) 许多年前,有一个名为 [TrueCrypt][2] 的加密软件。它的源码是可以得到的,尽管没有任何人声称曾对它进行过审计或贡献过。它的作者是(至今仍是)匿名的。不过,它是跨平台的,易于使用,而且真的非常有用。 @@ -20,7 +22,7 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ### 安装 VeraCrypt -你可以从 [VeraCrypt 下载页面][4]下载相应的安装文件,之后在所有主流平台上安装 VeraCrypt。 +你可以从 [VeraCrypt 下载页面][4] 下载相应的安装文件,之后在所有主流平台上安装 VeraCrypt。 另外,你也可以自己从源码构建它。在 Linux 上,它需要 wxGTK3、makeself 和通常的开发栈(Binutils、GCC 等)。 @@ -28,15 +30,13 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ### 创建一个 VeraCrypt 卷 -如果你刚接触 VeraCrypt,你必须先创建一个 VeraCrypt 加密卷(否则,你没有任何东西可以解密)。在 VeraCrypt 窗口中,点击左侧的 **Create Volume** 按钮。 +如果你刚接触 VeraCrypt,你必须先创建一个 VeraCrypt 加密卷(否则,你没有任何东西可以解密)。在 VeraCrypt 窗口中,点击左侧的 “Create Volume” 按钮。 ![Creating a volume with VeraCrypt][5] -(Seth Kenlon, [CC BY-SA 4.0][6]) +在出现的 VeraCrypt 的卷创建向导窗口中,选择要创建一个加密文件容器还是要加密整个驱动器或分区。向导将为你的数据创建一个保险库,所以请按照提示进行操作。 -在出现的 VeraCrypt 的**卷创建向导**窗口中,选择要创建一个加密文件容器还是要加密整个驱动器。向导将为你的数据创建一个保险库,所以请按照提示进行操作。 - -在本文中,我创建了一个文件容器。VeraCrypt 容器和其他文件很像:它保存在硬盘、外置硬盘、云存储或其他任何你能想到的存储数据的地方。与其他文件一样,它可以被移动、复制和删除。与大多数其他文件不同的是,它可以_容纳_更多的文件,这就是为什么我认为它是一个“保险库”,而 VeraCrypt 开发者将其称为“容器”。它的开发者将 VeraCrypt 文件称为“容器”,因为它可以包含其他数据对象;它与 LXC、Kubernetes 和其他现代 IT 机制所流行的容器技术无关。 +在本文中,我创建了一个文件容器。VeraCrypt 容器和其他文件很像:它保存在硬盘、外置硬盘、云存储或其他任何你能想到的存储数据的地方。与其他文件一样,它可以被移动、复制和删除。与大多数其他文件不同的是,它可以_容纳_更多的文件,这就是为什么我认为它是一个“保险库”,而 VeraCrypt 开发者将其称为“容器”。它的开发者将 VeraCrypt 文件称为“容器”,是因为它可以包含其他数据对象;它与 LXC、Kubernetes 和其他现代 IT 机制所流行的容器技术无关。 #### 选择一个文件系统 @@ -46,7 +46,7 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ### 挂载 VeraCrypt 加密卷 -当你创建了 VeraCrypt 卷,你就可以在 VeraCrypt 窗口中加载它。要挂载一个加密库,点击右侧的 **Select File** 按钮。选择你的加密文件,选择 VeraCrypt 窗口上半部分的一个编号栏,然后点击位于 VeraCrypt 窗口左下角的 **Mount** 按钮。 +当你创建了 VeraCrypt 卷,你就可以在 VeraCrypt 窗口中加载它。要挂载一个加密库,点击右侧的 “Select File” 按钮。选择你的加密文件,选择 VeraCrypt 窗口上半部分的一个编号栏,然后点击位于 VeraCrypt 窗口左下角的 “Mount” 按钮。 你挂载的卷在 VeraCrypt 窗口的可用卷列表中,你可以通过文件管理器访问该卷,就像访问一个外部驱动器一样。例如,在 KDE 上,我打开 [Dolphin][7],进入 `/media/veracrypt1`,然后我就可以把文件复制到我的保险库里。 @@ -58,9 +58,7 @@ TrueCrypt 最终关闭了,但一个名为 VeraCrypt 的替代项目迅速兴 ![Mounting a VeraCrypt volume][8] -(Seth Kenlon, [CC BY-SA 4.0][6]) - -关闭 VeraCrypt 容器和打开容器一样简单。在 VeraCrypt 窗口中选择列出的卷,然后点击 **Dismount**。你就不再能访问保险库中的文件,其他人也不会再有访问权。 +关闭 VeraCrypt 容器和打开容器一样简单。在 VeraCrypt 窗口中选择列出的卷,然后点击 “Dismount”。你就不能访问保险库中的文件了,其他人也不会再有访问权。 ### VeraCrypt 轻松实现跨平台加密 @@ -73,7 +71,7 @@ via: https://opensource.com/article/21/4/open-source-encryption 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a4a08e464ecabdd1cfda61ffac67f854fe0f5037 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 11:03:57 +0800 Subject: [PATCH 153/307] PUB @geekpi https://linux.cn/article-13304-1.html --- ...10412 Encrypt your files with this open source software.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210412 Encrypt your files with this open source software.md (98%) diff --git a/translated/tech/20210412 Encrypt your files with this open source software.md b/published/20210412 Encrypt your files with this open source software.md similarity index 98% rename from translated/tech/20210412 Encrypt your files with this open source software.md rename to published/20210412 Encrypt your files with this open source software.md index 0257479d34..bf2e9d9fd2 100644 --- a/translated/tech/20210412 Encrypt your files with this open source software.md +++ b/published/20210412 Encrypt your files with this open source software.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13304-1.html) 用开源的 VeraCrypt 加密你的文件 ====== From f062ae86a7e1df1e339e101c3d6e3398bed27113 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 17:45:01 +0800 Subject: [PATCH 154/307] PRF @wxy --- ...asons I use the Git cherry-pick command.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md index 01c228978c..183bdb85fe 100644 --- a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ b/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md @@ -3,36 +3,36 @@ [#]: author: (Manaswini Das https://opensource.com/users/manaswinidas) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 我使用 Git cherry-pick 命令的 3 个理由 ====== -> “挑选”可以解决 Git 仓库中的很多问题。以下是用 `git cherry-pick` 修复错误的三种方法。 +> “遴选”可以解决 Git 仓库中的很多问题。以下是用 `git cherry-pick` 修复错误的三种方法。 -![测量和烘烤樱桃派配方][1] +![](https://img.linux.net.cn/data/attachment/album/202104/17/174429qw1im6if6mf6zi9i.jpg) 在版本控制系统中摸索前进是一件很棘手的事情。对于一个新手来说,这可能是非常难以应付的,但熟悉版本控制系统(如 Git)的术语和基础知识是开始为开源贡献的第一步。 熟悉 Git 也能帮助你在开源之路上走出困境。Git 功能强大,让你感觉自己在掌控之中 —— 没有哪一种方法会让你无法恢复到工作版本。 -这里有一个例子可以帮助你理解“挑选”的重要性。假设你已经在一个分支上做了好几个提交,但你意识到这是个错误的分支!你现在该怎么办?你现在要做什么?要么在正确的分支上重复所有的修改,然后重新提交,要么把这个分支合并到正确的分支上。等等,前者太过繁琐,而你可能不想做后者。那么,有没有办法呢?是的,Git 已经为你准备好了。这就是挑选的作用。顾名思义,你可以用它从一个分支中手工挑选一个提交,然后转移到另一个分支。 +这里有一个例子可以帮助你理解“遴选cherry-pick”的重要性。假设你已经在一个分支上做了好几个提交,但你意识到这是个错误的分支!你现在该怎么办?你现在要做什么?要么在正确的分支上重复所有的变更,然后重新提交,要么把这个分支合并到正确的分支上。等一下,前者太过繁琐,而你可能不想做后者。那么,还有没有办法呢?有的,Git 已经为你准备好了。这就是“遴选”的作用。顾名思义,你可以用它从一个分支中手工遴选一个提交,然后转移到另一个分支。 -使用挑选的原因有很多。以下是其中的三个原因。 +使用遴选的原因有很多。以下是其中的三个原因。 ### 避免重复性工作 -如果你可以直接将相同的提交复制到另一个分支,就没有必要在不同的分支中重做相同的修改。请注意,挑选出来的提交会在另一个分支中创建带有新哈希的新提交,所以如果你看到不同的提交哈希,请不要感到困惑。 +如果你可以直接将相同的提交复制到另一个分支,就没有必要在不同的分支中重做相同的变更。请注意,遴选出来的提交会在另一个分支中创建带有新哈希的新提交,所以如果你看到不同的提交哈希,请不要感到困惑。 -如果您想知道什么是提交的哈希,以及它是如何生成的,这里有一个说明可以帮助你。提交哈希是用 [SHA-1][2] 算法生成的字符串。SHA-1 算法接收一个输入,然后输出一个唯一的 40 个字符的哈希值。如果你使用的是 [POSIX][3] 系统,请尝试在您的终端上运行这个程序: +如果您想知道什么是提交的哈希,以及它是如何生成的,这里有一个说明可以帮助你。提交哈希是用 [SHA-1][2] 算法生成的字符串。SHA-1 算法接收一个输入,然后输出一个唯一的 40 个字符的哈希值。如果你使用的是 [POSIX][3] 系统,请尝试在您的终端上运行这个命令: ``` $ echo -n "commit" | openssl sha1 ``` -这将输出一个唯一的 40 个字符的哈希值 `4015b57a143aec5156fd1444a017a32137a3fd0f`。这个哈希表示字符串 `commit`。 +这将输出一个唯一的 40 个字符的哈希值 `4015b57a143aec5156fd1444a017a32137a3fd0f`。这个哈希代表了字符串 `commit`。 Git 在提交时生成的 SHA-1 哈希值不仅仅代表一个字符串。它代表的是: @@ -48,24 +48,24 @@ sha1( ) ``` -这就解释了为什么你对代码所做的任何细微改动都会得到一个独特的提交哈希值。哪怕是一个微小的改动都会被发现。这是因为Git具有完整性。 +这就解释了为什么你对代码所做的任何细微改动都会得到一个独特的提交哈希值。哪怕是一个微小的改动都会被发现。这是因为 Git 具有完整性。 ### 撤销/恢复丢失的更改 -当你想恢复到工作版本时,挑选就很方便。当多个开发人员在同一个代码库上工作时,很可能会丢失更改,最新的版本会被转移到一个陈旧的或非工作版本上。这时,挑选提交到工作版本就可以成为救星。 +当你想恢复到工作版本时,遴选就很方便。当多个开发人员在同一个代码库上工作时,很可能会丢失更改,最新的版本会被转移到一个陈旧的或非工作版本上。这时,遴选提交到工作版本就可以成为救星。 #### 它是如何工作的? -假设有两个分支,`feature1` 和 `feature2`,你想把 `feature1` 中的提交应用到 `feature2`。 +假设有两个分支:`feature1` 和 `feature2`,你想把 `feature1` 中的提交应用到 `feature2`。 -在 `feature1` 分支上,运行 `git log` 命令,复制你想挑选的提交哈希值。你可以看到一系列类似于下面代码示例的提交。`commit` 后面的字母数字代码就是你需要复制的提交哈希。为了方便起见,您可以选择复制前六个字符(本例中为 `966cf3`)。 +在 `feature1` 分支上,运行 `git log` 命令,复制你想遴选的提交哈希值。你可以看到一系列类似于下面代码示例的提交。`commit` 后面的字母数字代码就是你需要复制的提交哈希。为了方便起见,您可以选择复制前六个字符(本例中为 `966cf3`)。 ``` -commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) -Author: manaswinidas <[me@example.com][4]> -Date:   Mon Mar 8 09:20:21 2021 +1300 +commit 966cf3d08b09a2da3f2f58c0818baa37184c9778 (HEAD -> master) +Author: manaswinidas +Date: Mon Mar 8 09:20:21 2021 +1300 -   add instructions + add instructions ``` 然后切换到 `feature2` 分支,在刚刚从日志中得到的哈希值上运行 `git cherry-pick`: @@ -103,7 +103,7 @@ Date: Mon Mar 8 09:20:21 2021 +1300 这将打开你的默认编辑器,允许你编辑提交信息。如果你没有什么要补充的,可以保存现有的信息。 -就这样,你完成了你的第一次挑选。如上所述,如果你在分支 `feature2` 上运行 `git log`,你会看到一个不同的提交哈希。下面是一个例子: +就这样,你完成了你的第一次遴选。如上所述,如果你在分支 `feature2` 上运行 `git log`,你会看到一个不同的提交哈希。下面是一个例子: ``` commit afb6fcb87083c8f41089cad58deb97a5380cb2c2 (HEAD -> feature2) @@ -114,9 +114,9 @@ Date:   Mon Mar 8 09:20:21 2021 +1300 不要对不同的提交哈希感到困惑。这只是区分 `feature1` 和 `feature2` 的提交。 -### 挑选多个提交 +### 遴选多个提交 -但如果你想挑选多个提交的内容呢?你可以使用: +但如果你想遴选多个提交的内容呢?你可以使用: ``` git cherry-pick ... @@ -124,7 +124,7 @@ git cherry-pick ... 请注意,你不必使用整个提交的哈希值,你可以使用前五到六个字符。 -同样,这也是很繁琐的。如果你想挑选的提交是一系列的连续提交呢?这种方法太费劲了。别担心,有一个更简单的方法。 +同样,这也是很繁琐的。如果你想遴选的提交是一系列的连续提交呢?这种方法太费劲了。别担心,有一个更简单的方法。 假设你有两个分支: @@ -137,23 +137,23 @@ git cherry-pick ... 2. 获取 `commitA` 和 `commitB` 的哈希值。 3. 输入 `git checkout `。 4. 输入 `git cherry-pick ^..` (请注意,这包括 `commitA` 和 `commitB`)。 - 5. 如果遇到合并冲突,[像往常一样解决][5],然后输入 `git cherry-pick --continue` 恢复挑选过程。 + 5. 如果遇到合并冲突,[像往常一样解决][5],然后输入 `git cherry-pick --continue` 恢复遴选过程。 -### 重要的挑选选项 +### 重要的遴选选项 以下是 [Git 文档][6] 中的一些有用的选项,你可以在 `cherry-pick` 命令中使用。 * `-e`、`--edit`:用这个选项,`git cherry-pick` 可以让你在提交前编辑提交信息。 * `-s`、`--signoff`:在提交信息的结尾添加 `Signed-off by` 行。更多信息请参见 `git-commit(1)` 中的 signoff 选项。 - * `-S[]`、`--pgg-sign[=]`:这些是 GPG 签名的提交。`keyid` 参数是可选的,默认为提交者身份;如果指定了,则必须卡在选项中,不加空格。 - * `--ff`:如果当前 HEAD 与挑选的提交的父级提交相同,则会对该提交进行快进操作。 + * `-S[]`、`--pgg-sign[=]`:这些是 GPG 签名的提交。`keyid` 参数是可选的,默认为提交者身份;如果指定了,则必须嵌在选项中,不加空格。 + * `--ff`:如果当前 HEAD 与遴选的提交的父级提交相同,则会对该提交进行快进操作。 下面是除了 `--continue` 外的一些其他的后继操作子命令: - * `--quit`:你可以忘记当前正在进行的操作。这可以用来清除挑选或撤销失败后的后继操作状态。 + * `--quit`:你可以忘记当前正在进行的操作。这可以用来清除遴选或撤销失败后的后继操作状态。 * `--abort`:取消操作并返回到操作序列前状态。 -下面是一些关于挑选的例子: +下面是一些关于遴选的例子: * `git cherry-pick master`:应用 `master` 分支顶端的提交所引入的变更,并创建一个包含该变更的新提交。 * `git cherry-pick master~4 master~2':应用 `master` 指向的第五个和第三个最新提交所带来的变化,并根据这些变化创建两个新的提交。 @@ -167,7 +167,7 @@ via: https://opensource.com/article/21/3/git-cherry-pick 作者:[Manaswini Das][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ec47aefdd621748c3f76e51bd638928b4a94365e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 17:45:51 +0800 Subject: [PATCH 155/307] PUB @wxy https://linux.cn/article-13305-1.html --- .../20210331 3 reasons I use the Git cherry-pick command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210331 3 reasons I use the Git cherry-pick command.md (99%) diff --git a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md b/published/20210331 3 reasons I use the Git cherry-pick command.md similarity index 99% rename from translated/tech/20210331 3 reasons I use the Git cherry-pick command.md rename to published/20210331 3 reasons I use the Git cherry-pick command.md index 183bdb85fe..5f87ecc61e 100644 --- a/translated/tech/20210331 3 reasons I use the Git cherry-pick command.md +++ b/published/20210331 3 reasons I use the Git cherry-pick command.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13305-1.html) 我使用 Git cherry-pick 命令的 3 个理由 ====== From b62c01cd9f84dca6ad5f8f9638199a83aa1c7297 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 21:20:40 +0800 Subject: [PATCH 156/307] APL --- .../tech/20201109 Getting started with Stratis encryption.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201109 Getting started with Stratis encryption.md b/sources/tech/20201109 Getting started with Stratis encryption.md index 1aa0df1c7b..effb4222f1 100644 --- a/sources/tech/20201109 Getting started with Stratis encryption.md +++ b/sources/tech/20201109 Getting started with Stratis encryption.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9859ce5d4db739577cc32ce19a2be9eee2f739ef Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 17 Apr 2021 22:20:53 +0800 Subject: [PATCH 157/307] TSL --- ...Getting started with Stratis encryption.md | 201 ------------------ ...Getting started with Stratis encryption.md | 201 ++++++++++++++++++ 2 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 sources/tech/20201109 Getting started with Stratis encryption.md create mode 100644 translated/tech/20201109 Getting started with Stratis encryption.md diff --git a/sources/tech/20201109 Getting started with Stratis encryption.md b/sources/tech/20201109 Getting started with Stratis encryption.md deleted file mode 100644 index effb4222f1..0000000000 --- a/sources/tech/20201109 Getting started with Stratis encryption.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting started with Stratis encryption) -[#]: via: (https://fedoramagazine.org/getting-started-with-stratis-encryption/) -[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) - -Getting started with Stratis encryption -====== - -![][1] - -Stratis is described on its [official website][2] as an “_easy to use local storage management for Linux_.” See this [short video][3] for a quick demonstration of the basics. The video was recorded on a Red Hat Enterprise Linux 8 system. The concepts shown in the video also apply to Stratis in Fedora. - -Stratis version 2.1 introduces support for encryption. Continue reading to learn how to get started with encryption in Stratis. - -### Prerequisites - -Encryption requires Stratis version 2.1 or greater. The examples in this post use a pre-release of Fedora 33. Stratis 2.1 will be available in the final release of Fedora 33. - -You’ll also need at least one available block device to create an encrypted pool. The examples shown below were done on a KVM virtual machine with a 5 GB virtual disk drive _(/dev/vdb_). - -### Create a key in the kernel keyring - -The Linux kernel keyring is used to store the encryption key. For more information on the kernel keyring, refer to the _keyrings_ manual page (_man keyrings_).   - -Use the _stratis key set_ command to set up the key within the kernel keyring.  You must specify where the key should be read from. To read the key from standard input, use the _–capture-key_ option. To retrieve the key from a file, use the _–keyfile-path <file>_ option. The last parameter is a key description. It will be used later when you create the encrypted Stratis pool. - -For example, to create a key with the description _pool1key_, and to read the key from standard input, you would enter: - -``` -# stratis key set --capture-key pool1key -Enter desired key data followed by the return key: -``` - -The command prompts us to type the key data / passphrase, and the key is then created within the kernel keyring.   - -To verify that the key was created, run _stratis key list_: - -``` -# stratis key list -Key Description -pool1key -``` - -This verifies that the _pool1key_ was created. Note that these keys are not persistent. If the host is rebooted, the key will need to be provided again before the encrypted Stratis pool can be accessed (this process is covered later). - -If you have multiple encrypted pools, they can have a separate keys, or they can share the same key. - -The keys can also be viewed using the following _keyctl_ commands: - -``` -# keyctl get_persistent @s -318044983 -# keyctl show -Session Keyring - 701701270 --alswrv 0 0 keyring: _ses - 649111286 --alswrv 0 65534 \_ keyring: _uid.0 - 318044983 ---lswrv 0 65534 \_ keyring: _persistent.0 -1051260141 --alswrv 0 0 \_ user: stratis-1-key-pool1key -``` - -### Create the encrypted Stratis pool - -Now that a key has been created for Stratis, the next step is to create the encrypted Stratis pool. Encrypting a pool can only be done at pool creation. It isn’t currently possible to encrypt an existing pool. - -Use the _stratis pool create_ command to create a pool. Add _–key-desc_ and the key description that you provided in the previous step (_pool1key_). This will signal to Stratis that the pool should be encrypted using the provided key. The below example creates the Stratis pool on _/dev/vdb_, and names it _pool1_. Be sure to specify an empty/available device on your system. - -``` -# stratis pool create --key-desc pool1key pool1 /dev/vdb -``` - -You can verify that the pool has been created with the _stratis pool list_ command: - -``` -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 37.63 MiB / 4.95 GiB ~Ca, Cr -``` - -In the sample output shown above, _~Ca_ indicates that caching is disabled (the tilde negates the property). _Cr_ indicates that encryption is enabled.  Note that caching and encryption are mutually exclusive. Both features cannot be simultaneously enabled. - -Next, create a filesystem. The below example, demonstrates creating a filesystem named _filesystem1_, mounting it at the _/filesystem1_ mountpoint, and creating a test file in the new filesystem: - -``` -# stratis filesystem create pool1 filesystem1 -# mkdir /filesystem1 -# mount /stratis/pool1/filesystem1 /filesystem1 -# cd /filesystem1 -# echo "this is a test file" > testfile -``` - -### Access the encrypted pool after a reboot - -When you reboot you’ll notice that Stratis no longer shows your encrypted pool or its block device: - -``` -# stratis pool list -Name Total Physical Properties -``` - -``` -# stratis blockdev list -Pool Name Device Node Physical Size Tier -``` - -To access the encrypted pool, first re-create the key with the same key description and key data / passphrase that you used previously: - -``` -# stratis key set --capture-key pool1key -Enter desired key data followed by the return key: -``` - -Next, run the _stratis pool unlock_ command, and verify that you can now see the pool and its block device: - -``` -# stratis pool unlock -# stratis pool list -Name Total Physical Properties -pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr -# stratis blockdev list -Pool Name Device Node Physical Size Tier -pool1 /dev/dm-2 4.98 GiB Data -``` - -Next, mount the filesystem and verify that you can access the test file you created previously: - -``` -# mount /stratis/pool1/filesystem1 /filesystem1/ -# cat /filesystem1/testfile -this is a test file -``` - -### Use a systemd unit file to automatically unlock a Stratis pool at boot - -It is possible to automatically unlock your Stratis pool at boot without manual intervention. However, a file containing the key must be available. Storing the key in a file might be a security concern in some environments. - -The systemd unit file shown below provides a simple method to unlock a Stratis pool at boot and mount the filesystem. Feedback on a better/alternative methods is welcome. You can provide suggestions in the comment section at the end of this article. - -Start by creating your key file with the following command. Be sure to substitute _passphrase_ with the same key data / passphrase you entered previously. - -``` -# echo -n passphrase > /root/pool1key -``` - -Make sure that the file is only readable by root: - -``` -# chmod 400 /root/pool1key -# chown root:root /root/pool1key -``` - -Create a systemd unit file at _/etc/systemd/system/stratis-filesystem1.service_ with the following content: - -``` -[Unit] -Description = stratis mount pool1 filesystem1 file system -After = stratisd.service - -[Service] -ExecStartPre=sleep 2 -ExecStartPre=stratis key set --keyfile-path /root/pool1key pool1key -ExecStartPre=stratis pool unlock -ExecStartPre=sleep 3 -ExecStart=mount /stratis/pool1/filesystem1 /filesystem1 -RemainAfterExit=yes - -[Install] -WantedBy = multi-user.target -``` - -Next, enable the service so that it will run at boot: - -``` -# systemctl enable stratis-filesystem1.service -``` - -Now reboot and verify that the Stratis pool has been automatically unlocked and that its filesystem is mounted. - -### Summary and conclusion - -In today’s environment, encryption is a must for many people and organizations. This post demonstrated how to enable encryption in Stratis 2.1. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/getting-started-with-stratis-encryption/ - -作者:[briansmith][a] -选题:[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/briansmith/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2020/11/stratis-encryption-2-816x345.jpg -[2]: https://stratis-storage.github.io/ -[3]: https://www.youtube.com/watch?v=CJu3kmY-f5o diff --git a/translated/tech/20201109 Getting started with Stratis encryption.md b/translated/tech/20201109 Getting started with Stratis encryption.md new file mode 100644 index 0000000000..fef944a41e --- /dev/null +++ b/translated/tech/20201109 Getting started with Stratis encryption.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting started with Stratis encryption) +[#]: via: (https://fedoramagazine.org/getting-started-with-stratis-encryption/) +[#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) + +Stratis 加密入门 +====== + +![][1] + +Stratis 在其 [官方网站][2] 上被描述为“_易于使用的 Linux 本地存储管理”。请看这个 [短视频][3],快速演示基础知识。该视频是在 Red Hat Enterprise Linux 8 系统上录制的。视频中显示的概念也适用于 Fedora 中的 Stratis。 + +Stratis 2.1 版本引入了对加密的支持。继续阅读以了解如何在 Stratis 中开始加密。 + +### 先决条件 + +加密需要 Stratis 2.1 或更高版本。这篇文章中的例子使用的是 Fedora 33 的预发布版本。 Stratis 2.1 将用在 Fedora 33 的最终版本中。 + +你还需要至少一个可用的块设备来创建一个加密池。下面的例子是在 KVM 虚拟机上完成的,虚拟磁盘驱动器为 5GB(`/dev/vdb`)。 + +### 在内核密钥环中创建一个密钥 + +Linux 内核密钥环keyring用于存储加密密钥。关于内核密钥环的更多信息,请参考 `keyrings` 手册页(`man keyrings`)。   + +使用 `stratis key set` 命令在内核钥匙圈中设置密钥。你必须指定从哪里读取密钥。要从标准输入中读取密钥,使用 `-capture-key` 选项。要从文件中读取密钥,使用 `-keyfile-path ` 选项。最后一个参数是一个密钥描述。它将稍后你创建加密的 Stratis 池时使用。 + +例如,要创建一个描述为 `pool1key` 的密钥,并从标准输入中读取密钥,可以输入: + +``` +# stratis key set --capture-key pool1key +Enter desired key data followed by the return key: +``` + +该命令提示我们输入密钥数据/密码,然后密钥就创建在内核密钥环中了。 + +要验证密钥是否已被创建,运行 `stratis key list`: + +``` +# stratis key list +Key Description +pool1key +``` + +这将验证是否创建了 `pool1key`。请注意,这些密钥不是持久的。如果主机重启,在访问加密的 Stratis 池之前,需要再次提供密钥(此过程将在后面介绍)。 + +如果你有多个加密池,它们可以有一个单独的密钥,也可以共享同一个密钥。 + +也可以使用以下 `keyctl` 命令查看密钥: + +``` +# keyctl get_persistent @s +318044983 +# keyctl show +Session Keyring + 701701270 --alswrv 0 0 keyring: _ses + 649111286 --alswrv 0 65534 \_ keyring: _uid.0 + 318044983 ---lswrv 0 65534 \_ keyring: _persistent.0 +1051260141 --alswrv 0 0 \_ user: stratis-1-key-pool1key +``` + +### 创建加密的 Stratis 池 + +现在已经为 Stratis 创建了一个密钥,下一步是创建加密的 Stratis 池。加密池只能在创建池时进行。目前不可能对现有的池进行加密。 + +使用 `stratis pool create` 命令创建一个池。添加 `-key-desc` 和你在上一步提供的密钥描述(`pool1key`)。这将向 Stratis 发出信号,池应该使用提供的密钥进行加密。下面的例子是在 `/dev/vdb` 上创建 Stratis 池,并将其命名为 `pool1`。确保在你的系统中指定一个空的/可用的设备。 + +``` +# stratis pool create --key-desc pool1key pool1 /dev/vdb +``` + +你可以使用 `stratis pool list` 命令验证该池是否已经创建: + +``` +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 37.63 MiB / 4.95 GiB ~Ca, Cr +``` + +在上面显示的示例输出中,`~Ca` 表示禁用了缓存(`~` 否定了该属性)。`Cr` 表示启用了加密。请注意,缓存和加密是相互排斥的。这两个功能不能同时启用。 + +接下来,创建一个文件系统。下面的例子演示了创建一个名为 `filesystem1` 的文件系统,将其挂载在 `/filesystem1` 挂载点上,并在新文件系统中创建一个测试文件: + +``` +# stratis filesystem create pool1 filesystem1 +# mkdir /filesystem1 +# mount /stratis/pool1/filesystem1 /filesystem1 +# cd /filesystem1 +# echo "this is a test file" > testfile +``` + +### 重启后访问加密池 + +当重新启动时,你会发现 Stratis 不再显示你的加密池或它的块设备: + +``` +# stratis pool list +Name Total Physical Properties +``` + +``` +# stratis blockdev list +Pool Name Device Node Physical Size Tier +``` + +要访问加密池,首先要用之前使用的相同的密钥描述和密钥数据/口令重新创建密钥: + +``` +# stratis key set --capture-key pool1key +Enter desired key data followed by the return key: +``` + +接下来,运行 `stratis pool unlock` 命令,并验证现在可以看到池和它的块设备: + +``` +# stratis pool unlock +# stratis pool list +Name Total Physical Properties +pool1 4.98 GiB / 583.65 MiB / 4.41 GiB ~Ca, Cr +# stratis blockdev list +Pool Name Device Node Physical Size Tier +pool1 /dev/dm-2 4.98 GiB Data +``` + +接下来,挂载文件系统并验证是否可以访问之前创建的测试文件: + +``` +# mount /stratis/pool1/filesystem1 /filesystem1/ +# cat /filesystem1/testfile +this is a test file +``` + +### 使用 systemd 单元文件在启动时自动解锁 Stratis 池 + +可以在启动时自动解锁 Stratis 池,无需手动干预。但是,必须有一个包含密钥的文件。在某些环境下,将密钥存储在文件中可能会有安全问题。 + +下图所示的 systemd 单元文件提供了一个简单的方法来在启动时解锁 Stratis 池并挂载文件系统。欢迎提供更好的/替代方法的反馈。你可以在文章末尾的评论区提供建议。 + +首先用下面的命令创建你的密钥文件。确保用之前输入的相同的密钥数据/密码来代替`passphrase`。 + +``` +# echo -n passphrase > /root/pool1key +``` + +确保该文件只能由 root 读取: + +``` +# chmod 400 /root/pool1key +# chown root:root /root/pool1key +``` + +在 `/etc/systemd/system/stratis-filesystem1.service` 创建包含以下内容的 systemd 单元文件: + +``` +[Unit] +Description = stratis mount pool1 filesystem1 file system +After = stratisd.service + +[Service] +ExecStartPre=sleep 2 +ExecStartPre=stratis key set --keyfile-path /root/pool1key pool1key +ExecStartPre=stratis pool unlock +ExecStartPre=sleep 3 +ExecStart=mount /stratis/pool1/filesystem1 /filesystem1 +RemainAfterExit=yes + +[Install] +WantedBy = multi-user.target +``` + +接下来,启用服务,使其在启动时运行: + +``` +# systemctl enable stratis-filesystem1.service +``` + +现在重新启动并验证 Stratis 池是否已自动解锁,其文件系统是否已挂载。 + +### 结语 + +在今天的环境中,加密是很多人和组织的必修课。本篇文章演示了如何在 Stratis 2.1 中启用加密功能。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/getting-started-with-stratis-encryption/ + +作者:[briansmith][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/briansmith/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/11/stratis-encryption-2-816x345.jpg +[2]: https://stratis-storage.github.io/ +[3]: https://www.youtube.com/watch?v=CJu3kmY-f5o From eed90a20ded326cbf69dcb5781cc4d0fdf872c9e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Apr 2021 05:02:39 +0800 Subject: [PATCH 158/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210418=20?= =?UTF-8?q?Hyperbola=20Linux=20Review:=20Systemd-Free=20Arch=20With=20Linu?= =?UTF-8?q?x-libre=20Kernel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md --- ...stemd-Free Arch With Linux-libre Kernel.md | 181 ++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md diff --git a/sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md b/sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md new file mode 100644 index 0000000000..4e12dcd583 --- /dev/null +++ b/sources/tech/20210418 Hyperbola Linux Review- Systemd-Free Arch With Linux-libre Kernel.md @@ -0,0 +1,181 @@ +[#]: subject: (Hyperbola Linux Review: Systemd-Free Arch With Linux-libre Kernel) +[#]: via: (https://itsfoss.com/hyperbola-linux-review/) +[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Hyperbola Linux Review: Systemd-Free Arch With Linux-libre Kernel +====== + +In the last month of 2019, the Hyperbola project took a [major decision][1] of ditching Linux in favor of OpenBSD. We also had a [chat][2] with Hyperbola co-founder Andre Silva, who detailed the reason for dropping Hyperbola OS and starting a new HyperbolaBSD. + +HyperbolaBSD is still under development and its alpha release will be ready by September 2021 for initial testing. The current Hyperbola GNU/Linux-libre v0.3.1 Milky Way will be supported until the legacy [Linux-libre kernel][3] reaches the end of life in 2022. + +I thought of giving it a try before it goes away and switches to BSD completely. + +### What is Hyperbola GNU/Linux-libre? + +![][4] + +Back in April 2017, the Hyperbola project was started by its [six co-founders][5] with an aim to deliver a lightweight, stable, secure, software freedom, and privacy focussed operating system.  + +Subsequently, the first stable version of Hyperbola GNU/Linux-libre arrived in July 2017. It was based on Arch Linux snapshots combining Debian development. + +But, unlike Arch having a rolling release model, Hyperbola GNU/Linux-libre follows a Long Term Support (LTS) model. + +Also, instead of a generic Linux kernel, it includes GNU operating system components and the Linux-libre kernel. Most importantly, Hyperbola is also one of the distributions without Systemd init system. + +Even though the Systemd is widely adopted by major Linux distributions like Ubuntu, Hyperbola replaced it with OpenRC as the default init system. v0.1 of Hyperbola was the first and the last version to support Systemd. + +Moreover, Hyperbola put high emphasis on Keep It Simple Stupid (KISS) methodology. It provides packages for i686 and x86_64 architecture that meets GNU Free System Distribution Guidelines (GNU FSDG). + +Not just that, but it also has its own social contract and packaging guidelines that follow the philosophy of the Free Software Movement. + +Hence, Free Software Foundation [recognized][6] Hyperbola GNU/Linux-libre as the first completely free Brazilian operating system in 2018. + +### Downloading Hyperbola GNU/Linux-libre 0.3.1 Milky Way + +The hyperbola project provides [two live images][7] for installation: one is the regular Hyperbola and the other is Hypertalking. Hypertalking is the ISO optimized and adapted for blind and visually impaired users. + +Interestingly, if you already use Arch Linux or Arch-based distribution like Parabola, you don’t need to download a live image. You can easily migrate to Hyperbola by following the official [Arch][8] or [Parabola][9] migration guide. + +The ISO image sizes around 650MB containing only essential packages (excluding desktop environment) to boot only in a command line interface. + +### Hardware requirements for Hyperbola + +For v0.3.1 (x86_64), you require a minimum of any 64-bit processor, 47MiB (OS installed) and 302MiB (Live image) of RAM for text mode only with no desktop environment. + +While for v0.3.1 (i686), you require a minimum of Intel Pentium II or AMD Athlon CPU model, 33MiB (OS installed), and 252MiB (Live image) of RAM for text mode only with no desktop environment. + +### Installing Hyperbola Linux from scratch + +Currently, I don’t use Arch or Parabola distribution. Hence, instead of migration, I chose to install Hyperbola Linux from scratch. + +I also mostly don’t dual boot unknown (to me) distribution on my hardware as it may create undetermined problems. So, I decided to use the wonderful GNOME Boxes app for setting up a Hyperbola virtual machine with up to 2 GB of RAM and 22 GB of free disk space. + +Similar to Arch, Hyperbola also does not come with a graphical user interface (GUI) installer. It means you need to set up almost everything from scratch using a command line interface (CLI). + +Here, it also concludes that Hyperbola is definitely not for beginners and those afraid of the command line. + +However, Hyperbola does provide separate [installation instruction][10], especially for beginners. But I think it still misses several steps that can trouble beginners during the installation process. + +For instance, it does not guide you to connect to the network, set up a new user account, and install a desktop environment. + +Hence, there is also another Hyperbola [installation guide][11] that you need to refer to in case you’re stuck at any step. + +As I booted the live image, the boot menu showed the option to install for both 64-bit or 32-bit architecture. + +![Live Image Boot Menu][12] + +Next, following the installation instruction, I went through setting up disk partition, DateTime, language, and password for the root user. + +![Disk partition][13] + +Once everything set up, I then installed the most common [Grub bootloader][14] and rebooted the system. Phew! until now, all went well as I could log in to my Hyperbola system. + +![text mode][15] + +### Installing Xfce desktop in Hyperbola Linux + +The command-line interface was working fine for me. But now, to have a graphical user interface, I need to manually choose and install a new [desktop environment][16] as Hyperbola does not come with any default DE. + +For the sake of simplicity and lightweight, I chose to get the popular [Xfce desktop][17]. But before installing it, I also needed a Xorg [display server][18]. So, I installed it along with other important packages using the default pacman package manager. + +![Install X.Org][19] + +Later, I installed LightDM cross-desktop [display manager][20], Xfce desktop, and other necessary packages like elogind for managing user logins. + +![Install Xfce desktop environment][21] + +After the Xfce installation, you also need to add LightDM service at the default run level to automatically switch to GUI mode. You can use the below command and reboot the system: + +``` +rc-update add lightdm default +reboot +``` + +![Add LightDM at runlevel][22] + +#### Pacman Signature Error In Hyperbola Linux + +While installing Xorg and Xfce in the latest Hyperbola v0.3.1, I encountered the signature error for some packages showing “signature is marginal trust” or “invalid or corrupted package.” + +![Signature Error In Hyperbola Linux][23] + +After searching the solution, I came to know from Hyperbola [Forum][24] that the main author Emulatorman’s keys expired on 1st Feb 2021. + +Hence, until the author upgrades the key or a new version 0.4 arrives sooner or later, you can change the `SigLevel` from “SigLevel=Required DatabaseOptional” to “SigLevel=Never” in`/etc/pacman.conf` file to avoid this error. + +![][25] + +### Hyperbola Linux with Xfce desktop + +![Hyperbola Linux With Xfce desktop][26] + +Hyperbola GNU/Linux-libre with Xfce 4.12 desktop gives a very clean, light, and smooth user experience. At the core, it contains Linux-libre 4.9 and OpenRC 0.28 service manager. + +![][27] + +As Hyperbola does not come with customized desktops and tons of bloated software, it definitely gives flexibility and freedom to choose, install, and configure the services you want. + +On the memory usage side, it takes around 205MB of RAM (approx. 10%) while running no applications (except terminal). + +![][28] + +### Is Hyperbola a suitable distribution for you? + +As per my experience, it definitely not a [Linux distribution that I would like to suggest to complete beginners][29]. Well, the Hyperbola project does not even claim to be beginners-friendly. + +If you’re well-versed with the command line and have quite a good knowledge of Linux concepts like disk partition, you can give it a try and decide yourself. Spending time hacking around the installation and configuration process can teach you a lot. + +Another thing that might matter in choosing Hyperbola Linux is also the default init system. If you’re looking for Systemd-free distribution with complete customization control from scratch, what can be better than it. + +Last but not least, you should also consider the future of Hyperbola, which will no longer contain Linux Kernel as it will turn into a HyperbolaBSD with OpenBSD Linux and userspace. + +If you’ve already tried or currently using Hyperbola Linux, let us know your experience in the comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/hyperbola-linux-review/ + +作者:[Sarvottam Kumar][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/sarvottam/ +[b]: https://github.com/lujun9972 +[1]: https://www.hyperbola.info/news/announcing-hyperbolabsd-roadmap/ +[2]: https://itsfoss.com/hyperbola-linux-bsd/ +[3]: https://www.fsfla.org/ikiwiki/selibre/linux-libre/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/hyperbola-gnu-linux.png?resize=800%2C450&ssl=1 +[5]: https://www.hyperbola.info/members/founders/ +[6]: https://www.fsf.org/news/fsf-adds-hyperbola-gnu-linux-libre-to-list-of-endorsed-gnu-linux-distributions +[7]: https://wiki.hyperbola.info/doku.php?id=en:main:downloads&redirect=1 +[8]: https://wiki.hyperbola.info/doku.php?id=en:migration:from_arch +[9]: https://wiki.hyperbola.info/doku.php?id=en:migration:from_parabola +[10]: https://wiki.hyperbola.info/doku.php?id=en:guide:beginners +[11]: https://wiki.hyperbola.info/doku.php?id=en:guide:installation +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Live-Image-Boot-Menu.png?resize=640%2C480&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Disk-partition.png?resize=600%2C450&ssl=1 +[14]: https://itsfoss.com/what-is-grub/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/text-mode.png?resize=600%2C450&ssl=1 +[16]: https://itsfoss.com/what-is-desktop-environment/ +[17]: https://xfce.org/ +[18]: https://itsfoss.com/display-server/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Install-xorg-package.png?resize=600%2C450&ssl=1 +[20]: https://itsfoss.com/display-manager/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Install-Xfce-desktop-environment-800x600.png?resize=600%2C450&ssl=1 +[22]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Add-LightDM-at-runlevel.png?resize=600%2C450&ssl=1 +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Signature-Error-In-Hyperbola-Linux.png?resize=600%2C450&ssl=1 +[24]: https://forums.hyperbola.info/viewtopic.php?id=493 +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/Configure-pacman-SigLevel.png?resize=600%2C450&ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Hyperbola-Linux-With-Xfce-desktop.jpg?resize=800%2C450&ssl=1 +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/Hyperbola-System-Information.jpg?resize=800%2C450&ssl=1 +[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/Memory-Usage.jpg?resize=800%2C450&ssl=1 +[29]: https://itsfoss.com/best-linux-beginners/ From 73236246aa018f0e5718b785a091274daf3fb373 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 18 Apr 2021 05:03:00 +0800 Subject: [PATCH 159/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210417=20?= =?UTF-8?q?How=20I=20digitized=20my=20CD=20collection=20with=20open=20sour?= =?UTF-8?q?ce=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210417 How I digitized my CD collection with open source tools.md --- ...my CD collection with open source tools.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210417 How I digitized my CD collection with open source tools.md diff --git a/sources/tech/20210417 How I digitized my CD collection with open source tools.md b/sources/tech/20210417 How I digitized my CD collection with open source tools.md new file mode 100644 index 0000000000..608e564933 --- /dev/null +++ b/sources/tech/20210417 How I digitized my CD collection with open source tools.md @@ -0,0 +1,101 @@ +[#]: subject: (How I digitized my CD collection with open source tools) +[#]: via: (https://opensource.com/article/21/4/digitize-cd-open-source-tools) +[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I digitized my CD collection with open source tools +====== +Clean off your shelves by ripping your CDs and tagging them for easy +playback across your home network. +![11 CDs in a U shape][1] + +The restrictions on getting out and about during the pandemic occasionally remind me that time is slipping by—although some days, "slipping" doesn't quite feel like the right word. But it also reminds me there are more than a few tasks around the house that can be great for restoring the sense of accomplishment that so many of us have missed. + +One such task, in my home anyway, is converting our CD collection to [FLAC][2] and storing the files on our music server's hard drive. Considering we don't have a huge collection (at least, by some people's standards), I'm surprised we still have so many CDs awaiting conversion—even excluding all the ones that fail to impress and therefore don't merit the effort. + +As for that ticking clock—who knows how much longer the CD player will continue working or the CD-ROM drive in the old computer will remain in service? Plus, I'd rather have the CDs shelved in the basement storage instead of cluttering up the family room. + +So, here I sit on a rainy Sunday afternoon with a pile of classical music CDs, ready to go… + +### Ripping CDs + +I like using the open source [Asunder CD ripper][3]. It's a simple and straightforward tool that uses the [cdparanoia][4] tool to handle the conversion chores. This image shows it working away on an album. + +![Asunder][5] + +(Chris Hermansen, [CC BY-SA 4.0][6]) + +When I fired up Asunder, I was surprised that its Compact Disc Database (CDDB) lookup feature didn't seem to find any matching info. A quick online search led me to a Linux Mint forum discussion that [offered alternatives][7] for the freedb.freedb.org online service, which apparently is no longer working. I first tried using gnudb.gnudb.org with no appreciably better result; plus, the suggested link to gnudb.org/howto.php upset Firefox due to an expired certificate. + +Next, I tried the freedb.freac.org service (note that it is on port 80, not 8880, as was freedb.freedb.org), which worked well for me… with one notable exception: The contributed database entries don't seem to understand the difference between "artist" (or "performer") and "composer." This isn't a huge problem for popular music, but having JS Bach as the "artist" seems a bit incongruous since he never made it to a recording studio, as far as I know. + +Quite a few of the tracks I converted identified the composer in the track title, but if there's one thing I've learned, your metadata can never be too correct. This leads me to the issue of tag editing, or curating the collection. + +Oh wait, there's another reason for tag editing, too, at least when using Asunder to rip: getting the albums' cover images. + +### Editing tags and curating the collection + +My open source go-to tool for [music tag editing continues to be EasyTag][8]. I use it a lot, both for downloads I purchase (it's amazing how messed up their tags can be, and some download services offer untagged WAV format files) and for tidying up the CDs I rip. + +Take a look at what Asunder has (and hasn't) accomplished from EasyTag's perspective. One of the CDs I ripped included Ravel's _Daphnis et Chloé Suites 1 and 2_ and Strauss' _Don Quixote_. The freedb.freac.org database seemed to think that the composers Maurice Ravel and Richard Strauss were the artists performing the work, but the artist on this album is the wonderful London Symphony Orchestra led by André Previn. In Asunder, I clicked the "single artist" checkbox and changed the artist name to the LSO. Here's what it looks like in EasyTag: + +![EasyTag][9] + +(Chris Hermansen, [CC BY-SA 4.0][6]) + +It's not quite there! But in EasyTag, I can select the first six tracks, tagging the composer on all the files by clicking on that little "A" icon on the right of the Composer field: + +![Editing tags in EasyTag][10] + +(Chris Hermansen, [CC BY-SA 4.0][6]) + +I can set the remaining 13 similarly, then select the whole lot and set the Album Artist as well. Finally, I can flip to the Images tab and find and set the album cover image. + +Speaking of images, I've found it wise to always name the image "cover.jpg" and make sure it's in the directory with the FLAC files… some players aren't happy with PNG files, some want the file in the same directory, and some are just plain difficult to get along with, as far as images go. + +What is your favorite open source CD ripping tool? How about the open source tool you like to use to fix your metadata? Let me know in the comments below! + +### And speaking of music… + +I haven't been as regular with my music and open source column over the past year as I was in previous years. Although I didn't acquire a lot of new music in 2020 and 2021, a few jewels still came my way… + +As always, [Erased Tapes][11] continues to develop an amazing collection of hmmm… what would you call it, anyway? The site uses the terms "genre-defying" and "avant-garde," which don't seem overblown for once. A recent favorite is Rival Consoles' [_Night Melody Articulation_][12], guaranteed to transport me from the day-to-day grind to somewhere else. + +I've been a huge fan of [Gustavo Santaolalla][13] since I first heard his music on a road trip from Coyhaique to La Tapera in Chile's Aysén Region. You might be familiar with his film scores to _Motorcycle Diaries_ or _Brokeback Mountain_. I recently picked up [_Qhapaq Ñan_, music about the Inca Trail][14], on the Linux-friendly music site [7digital][15], which has a good selection of his work. + +Finally, and continuing with the Latin American theme, The Queen's Six recording [_Journeys to the New World_][16] is not to be missed. It is available in FLAC format (including high-resolution versions) from the Linux-friendly [Signum Classics][17] site. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/digitize-cd-open-source-tools + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life_cd_dvd.png?itok=RBwVIzmi (11 CDs in a U shape) +[2]: https://en.wikipedia.org/wiki/FLAC +[3]: https://opensource.com/article/17/2/open-music-tagging +[4]: https://www.xiph.org/paranoia/ +[5]: https://opensource.com/sites/default/files/uploads/asunsder.png (Asunder) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://forums.linuxmint.com/viewtopic.php?t=322415 +[8]: https://opensource.com/article/17/5/music-library-tag-management-tools +[9]: https://opensource.com/sites/default/files/uploads/easytag.png (EasyTag) +[10]: https://opensource.com/sites/default/files/uploads/easytag_editing-tags.png (Editing tags in EasyTag) +[11]: https://www.erasedtapes.com/about +[12]: https://www.erasedtapes.com/release/eratp139-rival-consoles-night-melody-articulation +[13]: https://en.wikipedia.org/wiki/Gustavo_Santaolalla +[14]: https://ca.7digital.com/artist/gustavo-santaolalla/release/qhapaq-%C3%B1an-12885504?f=20%2C19%2C12%2C16%2C17%2C9%2C2 +[15]: https://ca.7digital.com/search/release?q=gustavo%20santaolalla&f=20%2C19%2C12%2C16%2C17%2C9%2C2 +[16]: https://signumrecords.com/product/journeys-to-the-new-world-hispanic-sacred-music-from-the-16th-17th-centuries/SIGCD626/ +[17]: https://signumrecords.com/ From 731236451910d8c9608a3a4cceb16dcbc7543c95 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 10:46:38 +0800 Subject: [PATCH 160/307] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @tt76wq 翻译的很认真,辛苦了! --- ... Use systemd timers instead of cronjobs.md | 375 ++++++++---------- 1 file changed, 173 insertions(+), 202 deletions(-) diff --git a/translated/tech/20200707 Use systemd timers instead of cronjobs.md b/translated/tech/20200707 Use systemd timers instead of cronjobs.md index 3b65f723db..6f1c34e46d 100644 --- a/translated/tech/20200707 Use systemd timers instead of cronjobs.md +++ b/translated/tech/20200707 Use systemd timers instead of cronjobs.md @@ -1,88 +1,89 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use systemd timers instead of cronjobs) [#]: via: (https://opensource.com/article/20/7/systemd-timers) [#]: author: (David Both https://opensource.com/users/dboth) -使用 systemd 定时器代替 cronjobs +使用 systemd 定时器代替 cron 作业 ====== -定时器提供了比 cronjob 更为细粒度的事件控制。 -![Team checklist][1] -我正在致力于将我的 [cron][2]jobs 迁移到 systemd 定时器上。我已经使用定时器多年了,通常来说,我的学识足以支撑我当前的工作。但在我研究 [systemd series][3] 的过程中,我发现 systemd 定时器有一些非常有意思的能力。 +> 定时器提供了比 cron 作业更为细粒度的事件控制。 -与 cronjobs 类似,systemd 定时器可以在特定的时间间隔触发事件 --shell 脚本和程序,例如每天一次或在一个月中的特定某一天(或许只有在周一生效),或在从上午 8 点到下午 6 点的工作时间内每隔 15 分钟一次。定时器也可以做到 cronjob 无法做到的一些事情。举个例子,一个定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机,启动,上个任务完成,甚至于定时器调用的上个服务单元的完成的时刻。 +![](https://img.linux.net.cn/data/attachment/album/202104/18/104406dgszkj3eeibkea55.jpg) + +我正在致力于将我的 [cron][2] 作业迁移到 systemd 定时器上。我已经使用定时器多年了,但通常来说,我的学识只足以支撑我当前的工作。但在我研究 [systemd 系列][3] 的过程中,我发现 systemd 定时器有一些非常有意思的能力。 + +与 cron 作业类似,systemd 定时器可以在特定的时间间隔触发事件(shell 脚本和程序),例如每天一次或在一个月中的特定某一天(或许只有在周一生效),或在从上午 8 点到下午 6 点的工作时间内每隔 15 分钟一次。定时器也可以做到 cron 作业无法做到的一些事情。举个例子,定时器可以在特定事件发生后的一段时间后触发一段脚本或者程序去执行,例如开机、启动、上个任务完成,甚至于定时器调用的上个服务单元的完成的时刻。 ### 操作系统维护的计时器 -当在一个新系统上安装 Fedora 或者是任意一个基于 systemd 的发行版时,它会在 Linux 宿主机的后台中创建多个定时器作为系统维护过程的一部分。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库,清理临时目录,轮转日志文件,以及更多其他事件。 - -作为示例,我会查看一些我的主要工作站上的定时器,通过执行 `systemctl status *timer` 命令来展示所有主机上的定时器。星号的作用于文件遍历相同,所以这个命令会列出所有的 systemd 定时器单元。 +当在一个新系统上安装 Fedora 或者是任意一个基于 systemd 的发行版时,作为系统维护过程的一部分,它会在 Linux 宿主机的后台中创建多个定时器。这些定时器会触发事件来执行必要的日常维护任务,比如更新系统数据库、清理临时目录、轮换日志文件,以及更多其他事件。 +作为示例,我会查看一些我的主要工作站上的定时器,通过执行 `systemctl status *timer` 命令来展示主机上的所有定时器。星号的作用与文件通配相同,所以这个命令会列出所有的 systemd 定时器单元。 ``` [root@testvm1 ~]# systemctl status *timer ● mlocate-updatedb.timer - Updates mlocate database every day -     Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● mlocate-updatedb.service + Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left + Triggers: ● mlocate-updatedb.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Updates mlocate database every day. ● logrotate.timer - Daily rotation of log files -     Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left -   Triggers: ● logrotate.service -       Docs: man:logrotate(8) -             man:logrotate.conf(5) + Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 00:00:00 EDT; 15h left + Triggers: ● logrotate.service + Docs: man:logrotate(8) + man:logrotate.conf(5) Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily rotation of log files. ● sysstat-summary.timer - Generate summary of yesterday's process accounting -     Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left -   Triggers: ● sysstat-summary.service + Loaded: loaded (/usr/lib/systemd/system/sysstat-summary.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 00:07:00 EDT; 15h left + Triggers: ● sysstat-summary.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Generate summary of yesterday's process accounting. ● fstrim.timer - Discard unused blocks once a week -     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left -   Triggers: ● fstrim.service -       Docs: man:fstrim + Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Mon 2020-06-08 00:00:00 EDT; 3 days left + Triggers: ● fstrim.service + Docs: man:fstrim Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Discard unused blocks once a week. ● sysstat-collect.timer - Run system activity accounting tool every 10 minutes -     Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left -   Triggers: ● sysstat-collect.service + Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Thu 2020-06-04 08:50:00 EDT; 41s left + Triggers: ● sysstat-collect.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Run system activity accounting tool every 10 minutes. ● dnf-makecache.timer - dnf makecache --timer -     Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left -   Triggers: ● dnf-makecache.service + Loaded: loaded (/usr/lib/systemd/system/dnf-makecache.timer; enabled; vendor preset: enabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Thu 2020-06-04 08:51:00 EDT; 1min 41s left + Triggers: ● dnf-makecache.service Jun 02 08:02:33 testvm1.both.org systemd[1]: Started dnf makecache –timer. ● systemd-tmpfiles-clean.timer - Daily Cleanup of Temporary Directories -     Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) -     Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago -    Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left -   Triggers: ● systemd-tmpfiles-clean.service -       Docs: man:tmpfiles.d(5) -             man:systemd-tmpfiles(8) + Loaded: loaded (/usr/lib/systemd/system/systemd-tmpfiles-clean.timer; static; vendor preset: disabled) + Active: active (waiting) since Tue 2020-06-02 08:02:33 EDT; 2 days ago + Trigger: Fri 2020-06-05 08:19:00 EDT; 23h left + Triggers: ● systemd-tmpfiles-clean.service + Docs: man:tmpfiles.d(5) + man:systemd-tmpfiles(8) Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary Directories. ``` @@ -90,22 +91,20 @@ Jun 02 08:02:33 testvm1.both.org systemd[1]: Started Daily Cleanup of Temporary 每个定时器至少有六行相关信息: * 定时器的第一行有定时器名字和定时器目的的简短介绍 - * 第二行展示了定时器的状态,是否有被加载,定时器 unit 文件的绝对路径以及预设信息。 - * 但三行指明了其活动状态,包括该定时器已激活的日期和时间。 - * 第四行包括了该定时器下次将要被触发的日期和时间和距离触发的大概时间。 - * 第五行展示了事件名称或被定时器触发的服务名称。 - * 部分(不是全部 )systemd unit 文件有相关文档的指引。我虚拟机上输出中有三个定时器有文档指引。这是一个优秀(但非必要)的信息。 - * 最后一行是计时器触发服务的最近的日志实例。 + * 第二行展示了定时器的状态,是否已加载,定时器单元文件的完整路径以及预设信息。 + * 第三行指明了其活动状态,包括该定时器激活的日期和时间。 + * 第四行包括了该定时器下次被触发的日期和时间和距离触发的大概时间。 + * 第五行展示了被定时器触发的事件或服务名称。 + * 部分(不是全部)systemd 单元文件有相关文档的指引。我虚拟机上输出中有三个定时器有文档指引。这是一个很好(但非必要)的信息。 + * 最后一行是计时器最近触发的服务实例的日志条目。 - -你也许有一些不一样的定时器,取决于你的物理机。 +你也许有一些不一样的定时器,取决于你的主机。 ### 创建一个定时器 -尽管我们可以解构一个或多个现有的计时器来了解其工作原理,我们还是要创建我们自己的[服务单元 ][4] 和一个定时器去触发它。我们将举一个相当简单的例子来让这个过程保持简单。当我们完成这个实验之后,就能更容易理解其他定时器的工作原理以及发现它们正在做什么。 - -首先,创建一个运行基础东西的简单的服务,例如 `free` 命令。举个例子,你可能想定时监控空余内存。在 `/etc/systemd/system` 目录下创建如下的 `myMonitor.server` 单元文件。它不一定是可执行的: +尽管我们可以解构一个或多个现有的计时器来了解其工作原理,但让我们创建我们自己的 [服务单元][4] 和一个定时器去触发它。为了保持简单,我们将使用一个相当简单的例子。当我们完成这个实验之后,就能更容易理解其他定时器的工作原理以及发现它们正在做什么。 +首先,创建一个运行基础东西的简单的服务,例如 `free` 命令。举个例子,你可能想定时监控空余内存。在 `/etc/systemd/system` 目录下创建如下的 `myMonitor.server` 单元文件。它不需要是可执行文件: ``` # This service unit is for testing timer units @@ -131,58 +130,54 @@ WantedBy=multi-user.target ``` [root@testvm1 system]# systemctl status myMonitor.service ● myMonitor.service - Logs system statistics to the systemd journal -     Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) -     Active: inactive (dead) + Loaded: loaded (/etc/systemd/system/myMonitor.service; disabled; vendor preset: disabled) + Active: inactive (dead) [root@testvm1 system]# systemctl start myMonitor.service [root@testvm1 system]# ``` -输出在哪里呢?默认情况下,systemd 服务单元执行程序的标准输出 (`STDOUT`) 被发送到系统日志中,它保留了记录供现在或者之后某个时间点查看。(在本系列的后续文章中,我将介绍系统日志的记录和保留策略)。查看今天的该服务单元的专属日志。`-S` 选项,即 `--since` 的缩写,允许你指定 `journalctl` 工具搜索条目的时间段。这并不代表你不关心过往结果--在这个案例中,不会有过往记录--如果你的机器以及运行了很长时间且堆积了大量的日志,它可以缩短搜索时间。 - +输出在哪里呢?默认情况下,systemd 服务单元执行程序的标准输出(`STDOUT`)会被发送到系统日志中,它保留了记录供现在或者之后(直到某个时间点)查看。(在本系列的后续文章中,我将介绍系统日志的记录和保留策略)。专门查看你的服务单元的日志,而且只针对今天。`-S` 选项,即 `--since` 的缩写,允许你指定 `journalctl` 工具搜索条目的时间段。这并不代表你不关心过往结果 —— 在这个案例中,不会有过往记录 —— 如果你的机器以及运行了很长时间且堆积了大量的日志,它可以缩短搜索时间。 ``` [root@testvm1 system]# journalctl -S today -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- +-- Logs begin at Mon 2020-06-08 07:47:20 EDT, end at Thu 2020-06-11 09:40:47 EDT. -- Jun 11 09:12:09 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 09:12:09 testvm1.both.org free[377966]:               total        used        free      shared  buff/cache   available -Jun 11 09:12:09 testvm1.both.org free[377966]: Mem:       12635740      522868    11032860        8016     1080012    11821508 -Jun 11 09:12:09 testvm1.both.org free[377966]: Swap:       8388604           0     8388604 +Jun 11 09:12:09 testvm1.both.org free[377966]: total used free shared buff/cache available +Jun 11 09:12:09 testvm1.both.org free[377966]: Mem: 12635740 522868 11032860 8016 1080012 11821508 +Jun 11 09:12:09 testvm1.both.org free[377966]: Swap: 8388604 0 8388604 Jun 11 09:12:09 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. [root@testvm1 system]# ``` -一个服务触发的任务可以是单个程序,一组程序或者是一个脚本语言写的脚本。通过在 `myMonitor.service` 单元文件里的 `[Service]` 块末尾中添加如下行可以为服务添加另一个任务: - +由服务触发的任务可以是单个程序、一组程序或者是一个脚本语言写的脚本。通过在 `myMonitor.service` 单元文件里的 `[Service]` 块末尾中添加如下行可以为服务添加另一个任务: ``` -`ExecStart=/usr/bin/lsblk` +ExecStart=/usr/bin/lsblk ``` 再次启动服务,查看日志检查结果,结果应该看上去像这样。你应该在日志中看到两条命令的结果输出: - ``` Jun 11 15:42:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 11 15:42:18 testvm1.both.org free[379961]:               total        used        free      shared  buff/cache   available -Jun 11 15:42:18 testvm1.both.org free[379961]: Mem:       12635740      531788    11019540        8024     1084412    11812272 -Jun 11 15:42:18 testvm1.both.org free[379961]: Swap:       8388604           0     8388604 -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda             8:0    0  120G  0 disk -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1          8:1    0    4G  0 part /boot -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2          8:2    0  116G  0 part -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 11 15:42:18 testvm1.both.org lsblk[379962]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0            11:0    1 1024M  0 rom +Jun 11 15:42:18 testvm1.both.org free[379961]: total used free shared buff/cache available +Jun 11 15:42:18 testvm1.both.org free[379961]: Mem: 12635740 531788 11019540 8024 1084412 11812272 +Jun 11 15:42:18 testvm1.both.org free[379961]: Swap: 8388604 0 8388604 +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sda 8:0 0 120G 0 disk +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─sda1 8:1 0 4G 0 part /boot +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─sda2 8:2 0 116G 0 part +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 11 15:42:18 testvm1.both.org lsblk[379962]: sr0 11:0 1 1024M 0 rom Jun 11 15:42:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. Jun 11 15:42:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. ``` -现在你知道了你的服务是可用的,在 `/etc/systemd/system` 目录下创建 `myMonitor.timer` 定时器单元文件,添加如下代码: - +现在你知道了你的服务可以按预期工作了,在 `/etc/systemd/system` 目录下创建 `myMonitor.timer` 定时器单元文件,添加如下代码: ``` # This timer unit is for testing @@ -204,17 +199,15 @@ WantedBy=timers.target 在 `myMonitor.timer` 文件中的 `OnCalendar` 时间格式,`*-*-* *:*:00`,应该会每分钟触发一次定时器去执行 `myMonitor.service` 单元。我会在文章的后面进一步探索 `OnCalendar` 设置。 -到目前为止,在服务被计时器触发运行时观察任意与之有关的日志记录。你也可以跟踪计时器,跟踪服务可以让你接近实时的看到结果。执行 `journalctl` 时带上 `-f` 选项: - +到目前为止,在服务被计时器触发运行时观察与之有关的日志记录。你也可以跟踪计时器,跟踪服务可以让你接近实时的看到结果。执行 `journalctl` 时带上 `-f` 选项: ``` [root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- ``` 执行但是不启用该定时器,看看它运行一段时间后发生了什么: - ``` [root@testvm1 ~]# systemctl start myMonitor.service [root@testvm1 ~]# @@ -222,98 +215,94 @@ WantedBy=timers.target 一条结果立即就显示出来了,下一条大概在一分钟后出来。观察几分钟日志,看看你有没有跟我发现同样的事情: - ``` [root@testvm1 system]# journalctl -S today -f -u myMonitor.service -\-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- +-- Logs begin at Mon 2020-06-08 07:47:20 EDT. -- Jun 13 08:39:18 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... Jun 13 08:39:18 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. -Jun 13 08:39:19 testvm1.both.org free[630566]:               total        used        free      shared  buff/cache   available -Jun 13 08:39:19 testvm1.both.org free[630566]: Mem:       12635740      556604    10965516        8036     1113620    11785628 -Jun 13 08:39:19 testvm1.both.org free[630566]: Swap:       8388604           0     8388604 +Jun 13 08:39:19 testvm1.both.org free[630566]: total used free shared buff/cache available +Jun 13 08:39:19 testvm1.both.org free[630566]: Mem: 12635740 556604 10965516 8036 1113620 11785628 +Jun 13 08:39:19 testvm1.both.org free[630566]: Swap: 8388604 0 8388604 Jun 13 08:39:18 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda             8:0    0  120G  0 disk -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2          8:2    0  116G  0 part -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:39:19 testvm1.both.org lsblk[630567]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0            11:0    1 1024M  0 rom +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sda 8:0 0 120G 0 disk +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─sda1 8:1 0 4G 0 part /boot +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─sda2 8:2 0 116G 0 part +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 13 08:39:19 testvm1.both.org lsblk[630567]: sr0 11:0 1 1024M 0 rom Jun 13 08:40:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:40:46 testvm1.both.org free[630572]:               total        used        free      shared  buff/cache   available -Jun 13 08:40:46 testvm1.both.org free[630572]: Mem:       12635740      555228    10966836        8036     1113676    11786996 -Jun 13 08:40:46 testvm1.both.org free[630572]: Swap:       8388604           0     8388604 -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda             8:0    0  120G  0 disk -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2          8:2    0  116G  0 part -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:40:46 testvm1.both.org lsblk[630574]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0            11:0    1 1024M  0 rom +Jun 13 08:40:46 testvm1.both.org free[630572]: total used free shared buff/cache available +Jun 13 08:40:46 testvm1.both.org free[630572]: Mem: 12635740 555228 10966836 8036 1113676 11786996 +Jun 13 08:40:46 testvm1.both.org free[630572]: Swap: 8388604 0 8388604 +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sda 8:0 0 120G 0 disk +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─sda1 8:1 0 4G 0 part /boot +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─sda2 8:2 0 116G 0 part +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 13 08:40:46 testvm1.both.org lsblk[630574]: sr0 11:0 1 1024M 0 rom Jun 13 08:40:46 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. Jun 13 08:40:46 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. Jun 13 08:41:46 testvm1.both.org systemd[1]: Starting Logs system statistics to the systemd journal... -Jun 13 08:41:46 testvm1.both.org free[630580]:               total        used        free      shared  buff/cache   available -Jun 13 08:41:46 testvm1.both.org free[630580]: Mem:       12635740      553488    10968564        8036     1113688    11788744 -Jun 13 08:41:46 testvm1.both.org free[630580]: Swap:       8388604           0     8388604 -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda             8:0    0  120G  0 disk -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1          8:1    0    4G  0 part /boot -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2          8:2    0  116G  0 part -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-root 253:0    0    5G  0 lvm  / -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-swap 253:1    0    8G  0 lvm  [SWAP] -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-usr  253:2    0   30G  0 lvm  /usr -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-tmp  253:3    0   10G  0 lvm  /tmp -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   ├─VG01-var  253:4    0   20G  0 lvm  /var -Jun 13 08:41:47 testvm1.both.org lsblk[630581]:   └─VG01-home 253:5    0   10G  0 lvm  /home -Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0            11:0    1 1024M  0 rom +Jun 13 08:41:46 testvm1.both.org free[630580]: total used free shared buff/cache available +Jun 13 08:41:46 testvm1.both.org free[630580]: Mem: 12635740 553488 10968564 8036 1113688 11788744 +Jun 13 08:41:46 testvm1.both.org free[630580]: Swap: 8388604 0 8388604 +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sda 8:0 0 120G 0 disk +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─sda1 8:1 0 4G 0 part /boot +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─sda2 8:2 0 116G 0 part +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-root 253:0 0 5G 0 lvm / +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-swap 253:1 0 8G 0 lvm [SWAP] +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-usr 253:2 0 30G 0 lvm /usr +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-tmp 253:3 0 10G 0 lvm /tmp +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: ├─VG01-var 253:4 0 20G 0 lvm /var +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: └─VG01-home 253:5 0 10G 0 lvm /home +Jun 13 08:41:47 testvm1.both.org lsblk[630581]: sr0 11:0 1 1024M 0 rom Jun 13 08:41:47 testvm1.both.org systemd[1]: myMonitor.service: Succeeded. Jun 13 08:41:47 testvm1.both.org systemd[1]: Finished Logs system statistics to the systemd journal. ``` 别忘了检查下计时器和服务的状态。 -你在日志里大概至少注意到两件事。第一,你不需要特地做什么来让 `myMonitor.service` 单元中 `ExecStart` 触发器的 `STDOUT` 存储到日志里。这都是用 systemd 来托管服务的一部分功能。然而,它确实意味着你需要小心对待服务单元里面执行的脚本和它们能产生多少 `STDOUT`。 +你在日志里大概至少注意到两件事。第一,你不需要特地做什么来让 `myMonitor.service` 单元中 `ExecStart` 触发器产生的 `STDOUT` 存储到日志里。这都是用 systemd 来运行服务的一部分功能。然而,它确实意味着你需要小心对待服务单元里面执行的脚本和它们能产生多少 `STDOUT`。 -第二,定时器并不是在每分钟的 :00 秒执行的,甚至每次执行的时间间隔都不是刚好一分钟。这是特意的设计,但是有必要的话可以被改写(如果只是它挑战了你的系统管理员的敏感神经)。 +第二,定时器并不是精确在每分钟的 :00 秒执行的,甚至每次执行的时间间隔都不是刚好一分钟。这是特意的设计,但是有必要的话可以改变这种行为(如果只是它挑战了你的系统管理员的敏感神经)。 -这样设计的初衷是为了防止多个服务在同个时刻被触发。举个例子,你可以用例如 Weekly,Daily 或者跟多其他的时间格式。这些快捷写法都被定义为在某一天的 00:00:00 执行。当多个定时器都这样定义的话,有很大可能它们会同时执行。 +这样设计的初衷是为了防止多个服务在完全相同的时刻被触发。举个例子,你可以用例如 Weekly,Daily 等时间格式。这些快捷写法都被定义为在某一天的 00:00:00 执行。当多个定时器都这样定义的话,有很大可能它们会同时执行。 -systemd 定时器被故意设计成在规定时间附近随机波动的时间点触发来避免同一时间触发。它们在一个时间窗口内半随机触发,时间窗口开始于预设的触发时间,结束于预设时间加一分钟。根据 `systemd.timer` 的 man 手册,相对于其他已经定义的定时器单元,这个触发时间保持在稳定的位置。你可以在日志条目中看到,定时器在启动后立即触发,然后在每分钟后的 46 或 47 秒触发。 +systemd 定时器被故意设计成在规定时间附近随机波动的时间点触发,以避免同一时间触发。它们在一个时间窗口内半随机触发,时间窗口开始于预设的触发时间,结束于预设时间后一分钟。根据 `systemd.timer` 的手册页,这个触发时间相对于其他已经定义的定时器单元保持在稳定的位置。你可以在日志条目中看到,定时器在启动后立即触发,然后在每分钟后的 46 或 47 秒触发。 -大部分情况下,这种概率抖动的定时器是没事的。当调度类似执行备份的任务,只需要它们在下班时间运行,这样是没问题的。系统管理员可以选择确定的开始时间来确保不和其他任务冲突,例如 01:05:00 这样典型的 cron 工作时间,但是有很大范围的时间值可以满足这一点。在开始时间上一个分钟级别的随机往往是无关紧要的。 - -然而,对某些任务来说,确定的触发时间是个硬性要求。对于这类任务,你可以向单元文件的 `Timer` 块中添加如下声明来指定更高的触发时间跨度精确度(一微秒以内): +大部分情况下,这种概率抖动的定时器是没事的。当调度类似执行备份的任务,只需要它们在下班时间运行,这样是没问题的。系统管理员可以选择确定的开始时间来确保不和其他任务冲突,例如 01:05:00 这样典型的 cron 作业时间,但是有很大范围的时间值可以满足这一点。在开始时间上的一个分钟级别的随机往往是无关紧要的。 +然而,对某些任务来说,精确的触发时间是个硬性要求。对于这类任务,你可以向单元文件的 `Timer` 块中添加如下声明来指定更高的触发时间跨度精确度(精确到微秒以内): ``` -`AccuracySec=1us` +AccuracySec=1us ``` -时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别一下单位: - - * usec,us,µs - * msec,ms - * seconds,second,sec,s - * minutes,minute,min,m - * hours,hour,hr,h - * days,day,d - * weeks,week,w - * months,month,M (定义为 30.44 天) - * years,year,y (定义为 365.25 天) +时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别以下单位: + * `usec`,`us`,`µs` + * `msec`,`ms` + * `seconds`,`second`,`sec`,`s` + * `minutes`,`minute`,`min`,`m` + * `hours`,`hour`,`hr`,`h` + * `days`,`day`,`d` + * `weeks`,`week`,`w` + * `months`,`month`,`M`(定义为 30.44 天) + * `years`,`year`,`y`(定义为 365.25 天) 所有 `/usr/lib/systemd/system` 中的定时器都指定了一个更宽松的时间精度,因为精准时间没那么重要。看看这些系统创建的定时器的时间格式: - ``` [root@testvm1 system]# grep Accur /usr/lib/systemd/system/*timer /usr/lib/systemd/system/fstrim.timer:AccuracySec=1h @@ -325,82 +314,72 @@ systemd 定时器被故意设计成在规定时间附近随机波动的时间点 [root@testvm1 system]# ``` - 看下 `/usr/lib/systemd/system` 目录下部分定时器单元文件的完整内容,看看它们是如何构建的。 -你没有必要在实验中设置开机启动这个定时器,下面这个命令会设置开机自启: - +在本实验中不必让这个定时器在启动时激活,但下面这个命令可以设置开机自启: ``` [root@testvm1 system]# systemctl enable myMonitor.timer ``` -你创建的单元文件不一定是可执行的。你同样不需要启用服务因为它是被定时器触发的。如果你需要的话,你仍然可以在命令行里手动触发该服务单元。尝试一下,然后观察日志。 +你创建的单元文件不需要是可执行的。你同样不需要启用服务,因为它是被定时器触发的。如果你需要的话,你仍然可以在命令行里手动触发该服务单元。尝试一下,然后观察日志。 -翻阅 `Systemd.timer` 和 `Systemd.time` 的 man 手册查看更多有关精确度,时间格式和触发事件相关信息。 +关于定时器精度、事件时间规格和触发事件的详细信息,请参见 systemd.timer 和 systemd.time 的手册页。 ### 定时器类型 -systemd 定时器还有一些在 cron 中找不到的功能,仅在确定的,重复的,实时的日期和时间触发。systemd 定时器可以被配置成在其他 systemd 单元状态发生改变时触发。举个例子,一个定时器可以配置成在系统开机,启动,或是某个确定的服务单元激活之后的一段时间被触发。这些被称为单调计时器。单调指的是一个持续增长的计数器或序列。这些定时器没有持久化因为它们在每次 boot 后被重置。 - -表格 1 列出了一些单调定时器以及每个定时器的简短定义,同时有 `OnCalendar` 定时器,这些不是单调的,它们被用于未来有可能重复的某个确定时间。这个信息来自于 `systemd.timer` 的 man 手册,有一些不重要的修改。 +systemd 定时器还有一些在 cron 中找不到的功能,cron 只在确定的、重复的、具体的日期和时间触发。systemd 定时器可以被配置成根据其他 systemd 单元状态发生改变时触发。举个例子,定时器可以配置成在系统开机、启动后,或是某个确定的服务单元激活之后的一段时间被触发。这些被称为单调计时器。“单调”指的是一个持续增长的计数器或序列。这些定时器不是持久的,因为它们在每次启动后都会重置。 +表格 1 列出了一些单调定时器以及每个定时器的简短定义,同时有 `OnCalendar` 定时器,这些不是单调的,它们被用于指定未来有可能重复的某个确定时间。这个信息来自于 `systemd.timer` 的手册页,有一些不重要的修改。 定时器 | 单调性 | 定义 ---|---|--- `OnActiveSec=` | X | 定义了一个与定时器被激活的那一刻相关的定时器。 `OnBootSec=` | X | 定义了一个与机器启动时间相关的计时器。 -`OnStartupSec=` | X | 定义了一个与服务管理器首次启动相关的计时器。对于系统定时器来说,这个定时器与 OnBootSec= 类似,因为系统服务管理器在机器启动后很短的时间后就会启动。当以在每个用户服务管理器中运行的单元进行配置时,它尤其有用,因为用户的服务管理器通常在首次登录后启动,而不是机器启动后。 +`OnStartupSec=` | X | 定义了一个与服务管理器首次启动相关的计时器。对于系统定时器来说,这个定时器与 `OnBootSec=` 类似,因为系统服务管理器在机器启动后很短的时间后就会启动。当以在每个用户服务管理器中运行的单元进行配置时,它尤其有用,因为用户的服务管理器通常在首次登录后启动,而不是机器启动后。 `OnUnitActiveSec=` | X | 定义了一个与将要激活的定时器上次激活时间相关的定时器。 `OnUnitInactiveSec=` | X | 定义了一个与将要激活的定时器上次停用时间相关的定时器。 -`OnCalendar=` | | 定义了一个有日期事件表达式语法的实时(即时钟)定时器。查看 systemd.time(7) 的 man 手册获取更多与日历事件表达式相关的语法信息。除此以外,它的语义和 `OnActiveSec=` 类似。 +`OnCalendar=` | | 定义了一个有日期事件表达式语法的实时(即时钟)定时器。查看 `systemd.time(7)` 的手册页获取更多与日历事件表达式相关的语法信息。除此以外,它的语义和 `OnActiveSec=` 类似。 _Table 1: systemd 定时器定义_ - -单调计时器课使用同样的简写名作为它们的时间跨度,即我们之前提到的 `AccuracySec` 表达式,但是 systemd 将这些名字统一转换成了秒。举个例子,比如你想规定某个定时器在系统启动后五天触发一次一个事件;它可能看起来像 `OnBootSec=5d`。如果机器启动于 `2020-06-15 09:45:27`,这个定时器会在 `2020-06-20 09:45:27` 或在这之后的一分钟内触发。这个定时器最类似于 cron 服务所使用的计时器。 - - +单调计时器可使用同样的简写名作为它们的时间跨度,即我们之前提到的 `AccuracySec` 表达式,但是 systemd 将这些名字统一转换成了秒。举个例子,比如你想规定某个定时器在系统启动后五天触发一次事件;它可能看起来像 `OnBootSec=5d`。如果机器启动于 `2020-06-15 09:45:27`,这个定时器会在 `2020-06-20 09:45:27` 或在这之后的一分钟内触发。 ### 日历事件格式 -日历事件格式是定时器在所需重复的时间触发的关键。我们开始看下一些 `OnCalendar` 设置一起使用的格式。 +日历事件格式是定时器在所需的重复时间触发的关键。我们开始看下一些 `OnCalendar` 设置一起使用的格式。 -与 crontab 中的格式相比,systemd 及其计时器使用的时间和日历格式风格不同。它比 crontab 更为灵活,而且可以使用类似 "at" 命令的方式允许模糊的日期和时间。它还应该足够熟悉使其易于理解。 +与 crontab 中的格式相比,systemd 及其计时器使用的时间和日历格式风格不同。它比 crontab 更为灵活,而且可以使用类似 `at` 命令的方式允许模糊的日期和时间。它还应该足够熟悉使其易于理解。 -systemd 定时器使用 `OnCalendar=` 的基础格式是 `DOW YYYY-MM-DD HH:MM:SS`。DOW( 天或星期)是选填的,其他字段可以用一个星号(*)来匹配此位置的任意值。所有的日历时间格式会被转换成标准格式。如果时间没有指定,它会被设置为 00:00:00。如果日期没有指定但是时间指定了,那么下次匹配的时间可能是今天或者明天,取决于当前的时间。名字或数字可被用于月份或者星期几。每个单元的逗号分隔列表都可以被指定。单元范围可以在开始值和结束值之间用`。。.`指定。 +systemd 定时器使用 `OnCalendar=` 的基础格式是 `DOW YYYY-MM-DD HH:MM:SS`。DOW(星期几)是选填的,其他字段可以用一个星号(`*`)来匹配此位置的任意值。所有的日历时间格式会被转换成标准格式。如果时间没有指定,它会被设置为 `00:00:00`。如果日期没有指定但是时间指定了,那么下次匹配的时间可能是今天或者明天,取决于当前的时间。月份和星期可以使用名称或数字。每个单元都可以使用逗号分隔的列表。单元范围可以在开始值和结束值之间用 `..` 指定。 - -指定日期有一些有趣的选项,波浪号(~)可以指定月份的最后一条或者最后一天之前的某几天。"/"可以用来指定星期几作为修饰符。 +指定日期有一些有趣的选项,波浪号(`~`)可以指定月份的最后一天或者最后一天之前的某几天。`/` 可以用来指定星期几作为修饰符。 这里有几个在 `OnCalendar` 表达式中使用的典型时间格式例子。 - 日期事件格式 | 描述 ---|--- -DOW YYYY-MM-DD HH:MM:SS | -*-*-* 00:15:30 | 每年每月每天的 0 点 15 分 30 秒 -Weekly | 每个周一的 00:00:00 -Mon *-*-* 00:00:00 | 同上 -Mon | 参考 Weekly -Wed 2020-*-* | 2020 年每个周三的 00:00:00 -Mon。.Fri 2021-*-* | 2021 年的每个工作日的 00:00:00 -2022-6,7,8-1,15 01:15:00 | 2022 年 6,7,8 月的 1 到 15 号的 01:15:00 -Mon *-05~03 | 每年五月份的下个周一发生,同时这也是距离月末的第三天。 -Mon。.Fri *-08~04 | 任何年份 8 月末前的第四天(工作日也算) -*-05~03/2 | 五月末的第三天,然后 2 天后再来一次。每年重复一次。注意这个表达式使用了波浪号(~)。 -*-05-03/2 | 五月的第三天,然后每两天重复一次直到 5 月底。注意这个表达式使用了破折号(-)。 - +`DOW YYYY-MM-DD HH:MM:SS` | +`*-*-* 00:15:30` | 每年每月每天的 0 点 15 分 30 秒 +`Weekly` | 每个周一的 00:00:00 +`Mon *-*-* 00:00:00` | 同上 +`Mon` | 同上 +`Wed 2020-*-*` | 2020 年每个周三的 00:00:00 +`Mon..Fri 2021-*-*` | 2021 年的每个工作日(周一到周五)的 00:00:00 +`2022-6,7,8-1,15 01:15:00` | 2022 年 6、7、8 月的 1 到 15 号的 01:15:00 +`Mon *-05~03` | 每年五月份的下个周一同时也是月末的倒数第三天 +`Mon..Fri *-08~04` | 任何年份 8 月末的倒数第四天,同时也须是工作日 +`*-05~03/2` | 五月末的倒数第三天,然后 2 天后再来一次。每年重复一次。注意这个表达式使用了波浪号(`~`)。 +`*-05-03/2` | 五月的第三天,然后每两天重复一次直到 5 月底。注意这个表达式使用了破折号(`-`)。 _Table 2: `OnCalendar` 事件时间格式例子_ ### 测试日历格式 -systemd 提供了一个绝佳的工具用于检测和测试定时器中日历时间事件的格式。`systemd-analyze calendar` 工具解析一个时间事件格式,提供标准格式和其他有趣的信息,例如下次"经过"(即匹配)的日期和时间,以及距离下次触发之前大概时间。 - -首先,看看未来没有时间的日期(注意 `Next elapse` 和 `UTC` 的时间会根据你当地时区改变): +systemd 提供了一个绝佳的工具用于检测和测试定时器中日历时间事件的格式。`systemd-analyze calendar` 工具解析一个时间事件格式,提供标准格式和其他有趣的信息,例如下次“经过”(即匹配)的日期和时间,以及距离下次触发之前大概时间。 +首先,看看未来没有时间的日(注意 `Next elapse` 和 `UTC` 的时间会根据你当地时区改变): ``` [student@studentvm1 ~]$ systemd-analyze calendar 2030-06-17 @@ -414,7 +393,6 @@ Normalized form: 2030-06-17 00:00:00         现在添加一个时间,在这个例子中,日期和时间是当作无关的部分分开解析的: - ``` [root@testvm1 system]# systemd-analyze calendar 2030-06-17 15:21:16   Original form: 2030-06-17                 @@ -433,7 +411,6 @@ Normalized form: *-*-* 15:21:16             为了把日期和时间当作一个单元来分析,可以把它们包在引号里。你在定时器单元里 `OnCalendar=` 时间格式中使用的时候记得把引号去掉,否则会报错: - ``` [root@testvm1 system]# systemd-analyze calendar "2030-06-17 15:21:16" Normalized form: 2030-06-17 15:21:16         @@ -445,7 +422,6 @@ Normalized form: 2030-06-17 15:21:16         现在我们测试下 Table2 里的例子。我尤其喜欢最后一个: - ``` [root@testvm1 system]# systemd-analyze calendar "2022-6,7,8-1,15 01:15:00"   Original form: 2022-6,7,8-1,15 01:15:00 @@ -458,7 +434,6 @@ Normalized form: 2022-06,07,08-01,15 01:15:00 让我们看一个例子,这个例子里我们列出了时间表达式的五个经过时间。 - ``` [root@testvm1 ~]# systemd-analyze calendar --iterations=5 "Mon *-05~3"   Original form: Mon *-05~3                 @@ -487,24 +462,22 @@ Normalized form: Mon *-05~03 00:00:00       systemd 定时器可以用于执行和 cron 工具相同的任务,但是通过按照日历和单调时间格式去触发事件的方法提供了更多的灵活性。 -虽然你为此次实验创建的服务单元通常被定时器调用,你也可以随时使用 `systemctl start myMonitor.service` 命令去触发它。多个需要维护的任务可以被写成脚本放在单个定时器中;它们可以是 Bash 脚本或者其他 Linux 程序。你可以通过触发定时器来运行所有的脚本来运行服务,也可以按照需要执行单独的脚本。 +虽然你为此次实验创建的服务单元通常是由定时器调用的,你也可以随时使用 `systemctl start myMonitor.service` 命令去触发它。可以在一个定时器中编写多个维护任务的脚本;它们可以是 Bash 脚本或者其他 Linux 程序。你可以通过触发定时器来运行所有的脚本来运行服务,也可以按照需要执行单独的脚本。 我会在下篇文章中更加深入的探索 systemd 时间格式的用处。 -我还没看到任何 `cron` 和 `at` 要被弃用的迹象。我希望这一切不会发生因为 `at` 至少在执行一次性调度任务的时候要比 systemd 定时器容易的多。 +我还没有看到任何迹象表明 cron 和 at 将被废弃。我希望这种情况不会发生,因为至少 `at` 在执行一次性调度任务的时候要比 systemd 定时器容易的多。 ### 参考资料 -网上有大量的关于 systemd 的参考资料,但是大部分都有点幼稚,粗略甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 +网上有大量的关于 systemd 的参考资料,但是大部分都有点简略、晦涩甚至有误导性。除了本文中提到的资料,下列的网页提供了跟多可靠且详细的 systemd 入门信息。 - * Fedora 项目有切实好用的 [systemd 入门 ][5]。它囊括了几乎所有你需要知道的关于如何使用 systemd 配置,管理和维护 Fedora 计算机。 - * Fedora 项目也有一个不错的[备忘录 ][6],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 - * 关于 systemd 和为创建这个项目原因的技术细节,查看 [Freedesktop.org][7]'s [systemd 描述 ][8]。 - * [Linux.com][9] 的"更多 systemd 的乐趣"栏目提供了跟多 systemd 进阶的[内幕和技巧 ][10]。 + * Fedora 项目有一篇切实好用的 [systemd 入门][5],它囊括了几乎所有你需要知道的关于如何使用 systemd 配置、管理和维护 Fedora 计算机的信息。 + * Fedora 项目也有一个不错的 [备忘录][6],交叉引用了过去 SystemV 命令和 systemd 命令做对比。 + * 关于 systemd 的技术细节和创建这个项目的原因,请查看 [Freedesktop.org][7] 上的 [systemd 描述][8]。 + * [Linux.com][9] 的“更多 systemd 的乐趣”栏目提供了更多高级的 systemd [信息和技巧][10]。 - - -还有一系列 Lennart Poettering 撰写的 Linux 系统管理相关的深度的技术文章,他是 systemd 的设计者和主要实现者。这些文章写在 2010 年 4 月至 2011 年 9 月,但是它们如同现在一样贴切。systemd 及其生态相关的几乎一些优秀的产出基本都是基于这些论文。 +此外,还有一系列深度的技术文章,是由 systemd 的设计者和主要实现者 Lennart Poettering 为 Linux 系统管理员撰写的。这些文章写于 2010 年 4 月至 2011 年 9 月间,但它们现在和当时一样具有现实意义。关于 systemd 及其生态的许多其他好文章都是基于这些文章: * [Rethinking PID 1][11] * [systemd for Administrators,Part I][12] @@ -519,8 +492,6 @@ systemd 定时器可以用于执行和 cron 工具相同的任务,但是通过 * [systemd for Administrators,Part X][21] * [systemd for Administrators,Part XI][22] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/7/systemd-timers @@ -528,7 +499,7 @@ via: https://opensource.com/article/20/7/systemd-timers 作者:[David Both][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9616c24fb5fa79211690ef2a4b079116fa9c6cd5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 10:47:15 +0800 Subject: [PATCH 161/307] PUB @tt76wq https://linux.cn/article-13307-1.html --- .../20200707 Use systemd timers instead of cronjobs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200707 Use systemd timers instead of cronjobs.md (99%) diff --git a/translated/tech/20200707 Use systemd timers instead of cronjobs.md b/published/20200707 Use systemd timers instead of cronjobs.md similarity index 99% rename from translated/tech/20200707 Use systemd timers instead of cronjobs.md rename to published/20200707 Use systemd timers instead of cronjobs.md index 6f1c34e46d..5b80ac5816 100644 --- a/translated/tech/20200707 Use systemd timers instead of cronjobs.md +++ b/published/20200707 Use systemd timers instead of cronjobs.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13307-1.html) [#]: subject: (Use systemd timers instead of cronjobs) [#]: via: (https://opensource.com/article/20/7/systemd-timers) [#]: author: (David Both https://opensource.com/users/dboth) From 90c6430bf46bcc1cd3c9453628acea2ce2b97ad1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 11:05:11 +0800 Subject: [PATCH 162/307] PRF --- ...7 Use systemd timers instead of cronjobs.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/published/20200707 Use systemd timers instead of cronjobs.md b/published/20200707 Use systemd timers instead of cronjobs.md index 5b80ac5816..81e4553369 100644 --- a/published/20200707 Use systemd timers instead of cronjobs.md +++ b/published/20200707 Use systemd timers instead of cronjobs.md @@ -291,15 +291,15 @@ AccuracySec=1us 时间跨度可用于指定所需的精度,以及定义重复事件或一次性事件的时间跨度。它能识别以下单位: - * `usec`,`us`,`µs` - * `msec`,`ms` - * `seconds`,`second`,`sec`,`s` - * `minutes`,`minute`,`min`,`m` - * `hours`,`hour`,`hr`,`h` - * `days`,`day`,`d` - * `weeks`,`week`,`w` - * `months`,`month`,`M`(定义为 30.44 天) - * `years`,`year`,`y`(定义为 365.25 天) + * `usec`、`us`、`µs` + * `msec`、`ms` + * `seconds`、`second`、`sec`、`s` + * `minutes`、`minute`、`min`、`m` + * `hours`、`hour`、`hr`、`h` + * `days`、`day`、`d` + * `weeks`、`week`、`w` + * `months`、`month`、`M`(定义为 30.44 天) + * `years`、`year`、`y`(定义为 365.25 天) 所有 `/usr/lib/systemd/system` 中的定时器都指定了一个更宽松的时间精度,因为精准时间没那么重要。看看这些系统创建的定时器的时间格式: From c3bd8a7b61c4b0e10c8498bede84d49b87494913 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 11:46:59 +0800 Subject: [PATCH 163/307] PRF --- ...using bspwm for my Linux window manager.md | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md index e7d89c9782..de925e533e 100644 --- a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ b/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md @@ -3,14 +3,16 @@ [#]: author: (Stephen Adams https://opensource.com/users/stevehnh) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 为什么我喜欢用 bspwm 来做我的 Linux 窗口管理器 ====== -在 Fedora Linux 上安装、配置并开始使用 bspwm 窗口管理器。 -![Tall building with windows][1] + +> 在 Fedora Linux 上安装、配置并开始使用 bspwm 窗口管理器。 + +![](https://img.linux.net.cn/data/attachment/album/202104/18/114637hxvqp4hfvbbhihb4.jpg) 有些人喜欢重新布置家具。还有的人喜欢尝试新鞋或定期重新装修他们的卧室。我呢,则是尝试 Linux 桌面。 @@ -18,47 +20,38 @@ ![bspwm desktop][3] -(Stephen Adams, [CC BY-SA 4.0][4]) - 我喜欢 [i3][5] 窗口管理器已经有一段时间了,我很喜欢它的布局方式和上手的便捷性。但 bspwm 的某些特性吸引了我。有几个原因让我决定尝试一下: - * 它_只是_一个窗口管理器。 + * 它_只是_一个窗口管理器(WM)。 * 它由几个易于配置的脚本管理。 * 它默认支持窗口之间的间隙。 - - -可能是最需要指出的第一个原因是它只是一个窗口管理器。和 i3 一样,默认情况下没有任何图形化的功能。你当然可以随心所欲地定制它,但_你_需要付出努力来使它看起来像你想要的。这也是它吸引我的部分原因。 - +可能是最需要指出的第一个原因是它只是一个窗口管理器。和 i3 一样,默认情况下没有任何图形化的那些花哨东西。你当然可以随心所欲地定制它,但_你_需要付出努力来使它看起来像你想要的。这也是它吸引我的部分原因。 虽然它可以在许多发行版上使用,但在我这个例子中使用的是 Fedora Linux。 ### 安装 bspwm -bspwm 在大多数常见的发行版中都有打包,所以你可以用系统的包管理器安装它。这个命令还会安装 [sxkhd][6],一个 X 窗口系统的守护程序,它“通过执行命令对输入事件做出反应”,还有 [dmenu][7],一个通用的 X 窗口菜单: - +bspwm 在大多数常见的发行版中都有打包,所以你可以用系统的包管理器安装它。下面这个命令还会安装 [sxkhd][6],这是一个 X 窗口系统的守护程序,它“通过执行命令对输入事件做出反应”;还有 [dmenu][7],这是一个通用的 X 窗口菜单: ``` -`dnf install bspwm sxkhd dmenu` +dnf install bspwm sxkhd dmenu ``` -因为 bspwm 只是一个窗口管理器,所以没有任何内置的快捷键或键盘命令。这也是它与 i3 等软件的不同之处。所以,在你第一次启动窗口管理器之前,请先配置一下 sxkhd: - +因为 bspwm 只是一个窗口管理器,所以没有任何内置的快捷键或键盘命令。这也是它与 i3 等软件的不同之处。所以,在你第一次启动窗口管理器之前,请先配置一下 `sxkhd`: ``` systemctl start sxkhd systemctl enable sxkhd ``` -这样就可以在登录时启用 sxkhd,但你还需要一些基本功能的配置: - +这样就可以在登录时启用 `sxkhd`,但你还需要一些基本功能的配置: ``` -`curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc` +curl https://raw.githubusercontent.com/baskerville/bspwm/master/examples/sxhkdrc --output ~/.config/sxkhd/sxkhdrc ``` -在你深入了解之前,不妨先看看这个文件,因为有些脚本调用的命令可能在你的系统中并不存在。一个很好的例子是调用 `urxvt` 的 `super + Return` 快捷键。把它改成你喜欢的终端,尤其是当你没有安装 urxvt 的时候: - +在你深入了解之前,不妨先看看这个文件,因为有些脚本调用的命令可能在你的系统中并不存在。一个很好的例子是调用 `urxvt` 的 `super + Return` 快捷键。把它改成你喜欢的终端,尤其是当你没有安装 `urxvt` 的时候: ``` # @@ -74,19 +67,19 @@ super + @space         dmenu_run ``` -如果你使用的是 GDM、LightDM 或其他显示管理器,只要在登录前选择 bspwm 即可。 +如果你使用的是 GDM、LightDM 或其他显示管理器(DM),只要在登录前选择 `bspwm` 即可。 ### 配置 bspwm -当你登录后,你会看到屏幕上什么都没有。这不是你感觉到的空虚感。而是可能性!你现在可以开始摆弄桌面环境的所有部分了。你现在可以开始摆弄这些年你认为理所当然的桌面环境的所有部分了。从头开始构建并不容易,但一旦你掌握了诀窍,就会非常有收获。 +当你登录后,你会看到屏幕上什么都没有。这不是你感觉到的空虚感。而是无限可能性!你现在可以开始摆弄桌面环境的所有部分了。你现在可以开始摆弄这些年你认为理所当然的桌面环境的所有部分了。从头开始构建并不容易,但一旦你掌握了诀窍,就会非常有收获。 -任何窗口管理器最困难的是掌握快捷键。你开始会很慢,但在很短的时间内,你会只使用键盘在系统中到处操作,在你的朋友和家人面前看起来像一个终极黑客。 +任何窗口管理器最困难的是掌握快捷键。你开始会很慢,但在很短的时间内,你就可以只使用键盘在系统中到处操作,在你的朋友和家人面前看起来像一个终极黑客。 -你可以通过编辑 `~/.config/bspwm/bspwmrc`,在启动时添加应用,设置桌面和显示器,并为你的窗口应该如何表现设置规则,随心所欲地定制系统。有一些默认设置的例子可以让你开始使用。键盘快捷键都是由 **sxkhdrc** 文件管理的。 +你可以通过编辑 `~/.config/bspwm/bspwmrc`,在启动时添加应用,设置桌面和显示器,并为你的窗口应该如何表现设置规则,随心所欲地定制系统。有一些默认设置的例子可以让你开始使用。键盘快捷键都是由 `sxkhdrc` 文件管理的。 -还有更多的开源项目可以安装,让你的电脑看起来更漂亮,比如用于桌面背景的 [Feh][8] ,状态栏的 [Polybar][9] ,应用启动器的 [Rofi][10] ,还有 [Compton][11] 可以给你提供阴影和透明度,让你的电脑看起来更漂亮更有光泽。 +还有更多的开源项目可以安装,让你的电脑看起来更漂亮,比如用于桌面背景的 [Feh][8]、状态栏的 [Polybar][9]、应用启动器的 [Rofi][10],还有 [Compton][11] 可以给你提供阴影和透明度,可以让你的电脑看起来焕然一新。 -玩得愉快! +玩得愉快! -------------------------------------------------------------------------------- @@ -95,7 +88,7 @@ via: https://opensource.com/article/21/4/bspwm-linux 作者:[Stephen Adams][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9cd2f37b6f99074434e319a894e625723fc1a79f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 18 Apr 2021 11:47:45 +0800 Subject: [PATCH 164/307] PUB @geekpi https://linux.cn/article-13308-1.html --- ...0407 Why I love using bspwm for my Linux window manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210407 Why I love using bspwm for my Linux window manager.md (98%) diff --git a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md b/published/20210407 Why I love using bspwm for my Linux window manager.md similarity index 98% rename from translated/tech/20210407 Why I love using bspwm for my Linux window manager.md rename to published/20210407 Why I love using bspwm for my Linux window manager.md index de925e533e..8050039891 100644 --- a/translated/tech/20210407 Why I love using bspwm for my Linux window manager.md +++ b/published/20210407 Why I love using bspwm for my Linux window manager.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13308-1.html) 为什么我喜欢用 bspwm 来做我的 Linux 窗口管理器 ====== From d0b60bc9b9df4f84dfb5ea75f95a642e36b0df7f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 19 Apr 2021 05:02:36 +0800 Subject: [PATCH 165/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419=20?= =?UTF-8?q?How=20to=20Deploy=20Seafile=20Server=20with=20Docker=20to=20Hos?= =?UTF-8?q?t=20Your=20Own=20File=20Synchronization=20and=20Sharing=20Solut?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md --- ...le Synchronization and Sharing Solution.md | 282 ++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md diff --git a/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md b/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md new file mode 100644 index 0000000000..97fd223969 --- /dev/null +++ b/sources/tech/20210419 How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution.md @@ -0,0 +1,282 @@ +[#]: subject: (How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution) +[#]: via: (https://itsfoss.com/deploy-seafile-server-docker/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Deploy Seafile Server with Docker to Host Your Own File Synchronization and Sharing Solution +====== + +First off, what is Seafile? + +[Seafile][1] is a self-hosted file synchronization program that works with the server-client model, as in you have several devices like your laptop and phone that connect to a central server. + +Unlike some more popular alternatives like [Nextcloud or ownCloud][2], Seafile tries to follow the philosophy of “do one thing only, but do it well”. Likewise, Seafile doesn’t have extra goodies built in like Contacts or Calendar integration. + +Seafile instead focuses solely on file syncing, sharing, and the things surrounding it, and that’s it. As a result of that though, it ends up doing so _extremely_ well. + +### Deploying Seafile Server with Docker and NGINX + +Advanced tutorial + +Most tutorials on It’s FOSS are focused on beginners. This one is not. It is intended for advanced users who tinker a lot with DIY projects and prefer to self-host. +This tutorial presumes that you are comfortable using the command line, and that you are at least decently knowledgeable with the programs we’ll be using. + +While the whole process could be done without using NGINX at all, using NGINX will allow for an easier setup, as well as making it significantly easier to self-host more services in the future. + +If you want to use a full-on Docker setup, you could set up [NGINX inside of Docker][3] as well, but it will only make things more complex and doesn’t add too much of a benefit, and likewise won’t be covered in this tutorial. + +#### Installing and Setting Up NGINX + +_**I will be using Ubuntu in this tutorial and will thus be using apt to install packages. If you use Fedora or some other non-Debian distribution, please use your distribution’s [package manager][4].**_ + +[NGINX][5], as well as being a web server, is what’s known as a proxy. It will function as the connection between the Seafile server and the internet, whilst also making several tasks easier to deal with. + +To install NGINX, use the following command: + +``` +sudo apt install nginx +``` + +If you want to use HTTPS (that little padlock in your browser), you will also need to install [Certbot][6]: + +``` +sudo apt install certbot python3-certbot-nginx +``` + +Next, you need to configure NGINX to connect to the Seafile instance that we set up later. + +First, run the following command: + +``` +sudo nano /etc/nginx/sites-available/seafile.conf +``` + +Enter the following text into the file: + +``` +server { + server_name localhost; + location / { + proxy_pass http://localhost:8080; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } +} +``` + +**Important**: Replace **localhost** on the **server_name** line with the address you’ll be accessing your server from (i.e. **seafile.example.com** or **192.168.0.0**). Not sure what to put? + + * If you are testing just for the sake of it, use localhost. This setup will **only allow you to access the server from your computer**, and that’s it. + * If you want to use Seafile across your local WiFi connection(any device on the same WiFi network as you), you should enter [your computer’s IP address][7]. You may also want to look into [setting a static IP address][8], though it isn’t necessary. + * If you have a public IP address that you know points to your system, use that. + * If you have a domain name(i.e. **example.com**, **example.org**) _and_ a public IP address for your system, change your DNS settings to point the domain name to your system’s IP address. This will also require the public IP address to point to your system. + + + +Now you need to copy the config file to the directory NGINX looks at for files, then restart NGINX: + +``` +sudo ln -s /etc/nginx/sites-available/seafile.conf /etc/nginx/sites-enabled/seafile.conf +sudo systemctl restart nginx +``` + +If you set up Certbot, you’ll also need to run the following to set up HTTPS: + +``` +sudo certbot +``` + +If asked to redirect HTTP traffic to HTTPS, choose **2**. + +Now would be a good time to make sure everything we’ve set up so far is working. If you visit your site, you should get a screen that says something on the lines of `502 Bad Gateway`. + +![][9] + +#### Install Docker and Docker Compose + +Now to get into the fun stuff! + +First things first, you need to have [Docker][10] and [Docker Compose][11] installed. Docker Compose is needed to utilize a docker-compose.yml file, which will make managing the various Docker [containers][12] Seafile needs easier. + +Docker and Docker Compose can be installed with the following command: + +``` +sudo apt install docker.io docker-compose +``` + +To check if Docker is installed and running, run the following: + +``` +sudo docker run --rm hello-world +``` + +You should see something along the lines of this in your terminal if it completed successfully: + +![][13] + +If you would like to avoid adding `sudo` to the beginning of the `docker` command, you can run the following commands to add yourself to the `docker` group: + +``` +sudo groupadd docker +sudo usermod -aG docker $USER +``` + +The rest of this tutorial assumes you ran the above two commands. If you didn’t, add `sudo` to all commands that start with `docker` or `docker-compose`. + +#### Installing Seafile Server + +This part is significantly easier than the part before this. All you need to do is put some text into a file and run a few commands. + +Open up a terminal. Then create a directory where you’d like the contents of the Seafile server to be stored and enter the directory: + +``` +mkdir ~/seafile-server && cd ~/seafile-server +``` + +![][14] + +Go to the directory you created and run the following: + +``` +nano docker-compose.yml +``` + +Next, enter the text below into the window that pops up: + +``` +version: '2.0' +services: + db: + image: mariadb + container_name: seafile-mysql + environment: + - MYSQL_ROOT_PASSWORD=password + - MYSQL_LOG_CONSOLE=true + volumes: + - ./data/mariadb:/var/lib/mysql + networks: + - seafile-net + + memcached: + image: memcached + container_name: seafile-memcached + entrypoint: memcached -m 256 + networks: + - seafile-net + + seafile: + image: seafileltd/seafile-mc + container_name: seafile + ports: + - "8080:80" + volumes: + - ./data/app:/shared + environment: + - DB_HOST=db + - DB_ROOT_PASSWD=password + - TIME_ZONE=Etc/UTC + - [email protected] + - SEAFILE_ADMIN_PASSWORD=password + - SEAFILE_SERVER_LETSENCRYPT=false + - SEAFILE_SERVER_HOSTNAME=docs.seafile.com + depends_on: + - db + - memcached + networks: + - seafile-net + +networks: + seafile-net: +``` + +Before saving the file, a few things will need to be changed: + + * **MYSQL_ROOT_PASSWORD**: Change to a stronger password, you _don’t_ need to remember this, so don’t try to pick anything easy. If you need help making one, use a [password generator][15]. I’d recommend 20 characters long and avoiding any special characters(all the **[[email protected]][16]#$%^&*** symbols). + * **DB_ROOT_PASSWD**: Change to the value you set for ****MYSQL_ROOT_PASSWORD****. + * ****SEAFILE_ADMIN_EMAIL****: Sets the email address for the admin account. + * **SEAFILE_ADMIN_PASSWORD**: Sets the password for the admin account. Avoid making this the same as **MYSQL_ROOT_PASSWORD** or **DB_ROOT_PASSWD**. + * **SEAFILE_SERVER_HOSTNAME**: Set to the address you set in the NGINX configuration. + + + +With that done, you can bring up the whole thing with `docker-compose`: + +``` +docker-compose up -d +``` + +It might take a minute or two depending on your internet connection, as it has to pull down several containers that Seafile needs to run. + +After it’s done, give it a few more minutes to finish up. You can also check the status of it by running the following: + +``` +docker logs seafile +``` + +When it’s done, you’ll see the following output: + +![][17] + +Next, just type the address you set for ****SEAFILE_SERVER_HOSTNAME**** into your browser, and you should be at a login screen. + +![][18] + +And there you go! Everything’s now fully functional and ready to be used with the clients. + +#### Installing the Seafile Clients + +Seafile on mobile is available on [Google Play][19], [F-Droid][20], and on the [iOS App Store][21]. Seafile also has desktop clients available for Linux, Windows, and Mac, available [here][22]. + +Seafile is readily available on Ubuntu systems via the `seafile-gui` package: + +``` +sudo apt install seafile-gui +``` + +Seafile is also in the AUR for Arch users via the `seafile-client` package. + +### Closing Up + +Feel free to explore the clients and all they have to offer. I’ll go into all of what the Seafile clients are capable of in a future article (stay tuned 😃). + +If something’s not working right, or you just have a question in general, feel free to leave it in the comments below – I’ll try to respond whenever I can! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/deploy-seafile-server-docker/ + +作者:[Hunter Wittenborn][a] +选题:[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/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://www.seafile.com/en/home/ +[2]: https://itsfoss.com/nextcloud-vs-owncloud/ +[3]: https://linuxhandbook.com/nginx-reverse-proxy-docker/ +[4]: https://itsfoss.com/package-manager/ +[5]: https://www.nginx.com/ +[6]: https://certbot.eff.org/ +[7]: https://itsfoss.com/check-ip-address-ubuntu/ +[8]: https://itsfoss.com/static-ip-ubuntu/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/nginx_bad_gateway.png?resize=489%2C167&ssl=1 +[10]: https://www.docker.com/ +[11]: https://docs.docker.com/compose/ +[12]: https://www.docker.com/resources/what-container +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-docker-helloworld.png?resize=752%2C416&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-dir.png?resize=731%2C174&ssl=1 +[15]: https://itsfoss.com/password-generators-linux/ +[16]: https://itsfoss.com/cdn-cgi/l/email-protection +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-running.png?resize=752%2C484&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/seafile-login.jpg?resize=800%2C341&ssl=1 +[19]: https://play.google.com/store/apps/details?id=com.seafile.seadroid2 +[20]: https://f-droid.org/repository/browse/?fdid=com.seafile.seadroid2 +[21]: https://itunes.apple.com/cn/app/seafile-pro/id639202512?l=en&mt=8 +[22]: https://www.seafile.com/en/download/ From 073b11079b80602bb2700aaa97d4483ae9258069 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 19 Apr 2021 08:51:12 +0800 Subject: [PATCH 166/307] translated --- ...oss-friendly with this open source tool.md | 114 ------------------ ...oss-friendly with this open source tool.md | 113 +++++++++++++++++ 2 files changed, 113 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20210414 Make your data boss-friendly with this open source tool.md create mode 100644 translated/tech/20210414 Make your data boss-friendly with this open source tool.md diff --git a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md b/sources/tech/20210414 Make your data boss-friendly with this open source tool.md deleted file mode 100644 index a6b86444f9..0000000000 --- a/sources/tech/20210414 Make your data boss-friendly with this open source tool.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: (Make your data boss-friendly with this open source tool) -[#]: via: (https://opensource.com/article/21/4/visualize-data-eda) -[#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Make your data boss-friendly with this open source tool -====== -Enterprise Data Analytics aims to bring data visualization to everyday -business users. -![metrics and data shown on a computer screen][1] - -Enterprise Data Analytics ([EDA][2]) is a web application that enables access to information through a simple, clear interface. - -After several years of working for Barcelona open source analytics company [Jortilles][3], we realized that the modern world collects data compulsively but there was no easy way for average people to see or interpret that data. There are some powerful open source tools for this purpose, but they are very complex. We couldn't identify a tool designed to be easy to use by common people with little technical skill. - -We developed EDA because we consider access to information to be a requirement and obligation for modern organizations and wanted to provide everyone with access to information. - -![EDA interface][4] - -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - -### Visualize your data - -EDA offers a data model using business terms that people already understand. You choose the information you want, and you can view it how you want. It aims to be user friendly and still powerful. - -EDA visualizes and enriches the information in a database through a metadata model. It can read data from BigQuery, Postgres, [MariaDB, MySQL][6], and several other databases. This transforms the technical database model into familiar business concepts. - -It is also designed to speed up information propagation because it taps into the data already stored in a database. EDA discovers the database's topology and proposes a business model. If you've designed a good database model, you have a good business model. EDA can also connect to production servers to provide real-time analysis. - -This combination of data and a data model mean you and anyone in your organization can analyze its data. However, to protect the data, you can define data security, down to the row, to grant access to the right data to the right people. - -Some of EDA's features include: - - * Automatic data-model generation - * A consistent data model that prevents inconsistent queries - * SQL mode for advanced users - * Data visualizations: - * Standard charts (e.g., bar charts, pie charts, line charts, treemaps) - * Map integration (e.g., geoJSON shapefiles, latitude, longitude) - * Email alerts, which can be defined though key performance indicators (KPIs) - * Private and public information controls to enable private and public dashboards, which you can share with a link - * Data caches and programatic refreshes - - - -### How to use EDA - -The first step in visualizing data with EDA is to create a data model. - -#### Create a data model - -First, select **New Datasource** in the left-hand menu. - -Next, choose the database system where your data is stored (e.g., Postgres, MariaDB, MySQL, Vertica, SqlServer, Oracle, Big Query) and provide the connection parameters. - -EDA will automatically generate the data model for you. It reads tables and columns and defines names for them as well as the relationships between tables. You can also enrich your data model by adding virtual views or geoJSON maps. - -#### Make a dashboard - -Now you are ready to make your first dashboard. On the main page of EDA's interface, you should see a **New dashboard** button. Click it, name your dashboard, and select the data model you created. A new dashboard will appear with a panel for you to configure. - -To configure a panel, click the **Configuration** button in the top-right corner and choose what you want to do. In **Edit query**, select the data you want to show. A new window will appear with your data model represented by entities and attributes for the entities. Choose the entity you want to see and the attributes you want to use. For example, for an entity named **Customers** you might show **Customer Name**, and for a **Sales** entity, you might want to show **Total Sales**. - -Next, run a query, and choose the visualization you want. - -![EDA interface][7] - -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - -You can add as many panels, filters, and text fields as you want, all with explanations. Once you save your dashboard, you can view it, share it with colleagues, and even publish it to the internet. - -### Getting EDA - -The quickest way to take a look at EDA is with the [public demo][8]. But if you want to give it a try on your own, you can get the latest EDA release with Docker: - - -``` -`$ docker run -p 80:80 jortilles / eda: latest` -``` - -We also have a cloud software-as-a-service option for anyone who wants to use EDA without having to do setup, configuration, and ongoing updates. You can review the [cloud options][9] on our website. - -If you want to see it in action, you can watch some [demonstrations][10] on YouTube. - -EDA is in continuous development, and you can find its [source code on GitHub][11]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/visualize-data-eda - -作者:[Juanjo Ortilles][a] -选题:[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/jortilles -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://eda.jortilles.com/en/jortilles-english/ -[3]: https://www.jortilles.com/ -[4]: https://opensource.com/sites/default/files/uploads/eda-display.jpeg (EDA interface) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/article/20/10/mariadb-mysql-cheat-sheet -[7]: https://opensource.com/sites/default/files/uploads/eda-chart.jpeg (EDA interface) -[8]: https://demoeda.jortilles.com/ -[9]: https://eda.jortilles.com -[10]: https://youtu.be/cBAAJbohHXQ -[11]: https://github.com/jortilles/EDA diff --git a/translated/tech/20210414 Make your data boss-friendly with this open source tool.md b/translated/tech/20210414 Make your data boss-friendly with this open source tool.md new file mode 100644 index 0000000000..3bfc85d88a --- /dev/null +++ b/translated/tech/20210414 Make your data boss-friendly with this open source tool.md @@ -0,0 +1,113 @@ +[#]: subject: (Make your data boss-friendly with this open source tool) +[#]: via: (https://opensource.com/article/21/4/visualize-data-eda) +[#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用这个开源工具让你的数据对老板友好起来 +====== +企业数据分析 (Enterprise Data Analytics) 旨在将数据可视化带给日常商务用户。 +![metrics and data shown on a computer screen][1] + +企业数据分析 ([EDA][2]) 是一个网络应用,它可以通过一个简单、清晰的界面来获取信息。 + +在巴塞罗那开源分析公司 [Jortilles][3] 工作几年后,我们意识到,现代世界强制性地收集数据,但普通人没有简单的方法来查看或解释这些数据。有一些强大的开源工具可用于此目的,但它们非常复杂。我们找不到一个工具设计成能让没有什么技术能力的普通人轻松使用。 + +我们之所以开发 EDA,是因为我们认为获取信息是现代组织的要求和义务,并希望为每个人提供获取信息的机会。 + +![EDA interface][4] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +### 可视化你的数据 + +EDA 使用人们已经理解的商业术语提供了一个数据模型。你可以选择你想要的信息,并可以以你想要的方式查看它。它的目标是对用户友好,同时又功能强大。 + +EDA 通过元数据模型将数据库中的信息可视化和丰富化。它可以从 BigQuery、Postgres、[MariaDB、MySQL][6] 和其他一些数据库中读取数据。这就把技术性的数据库模型转化为熟悉的商业概念。 + +它还设计为加快信息传播的速度,因为它可以利用已经存储在数据库中的数据。EDA 发现数据库的拓扑结构,并提出业务模型。如果你设计了一个好的数据库模型,你就有了一个好的业务模型。EDA 还可以连接到生产服务器,提供实时分析。 + +这种数据和数据模型的结合意味着你和你组织中的任何人都可以分析其数据。然而,为了保护数据,你可以定义数据安全,可以精确到行,以授予正当的人访问正当的数据。 + +EDA 的一些功能包括: + + * 自动生成数据模型 + * 一致的数据模型,防止出现不一致的查询 + * 高级用户的 SQL 模式 + * 数据可视化: + * 标准图表(如柱状图、饼状图、线状图、树状图) + * 地图整合(如 geoJSON shapefile、纬度、经度) + * 电子邮件提醒,可通过关键绩效指标 (KPI) 来定义 + * 私人和公共信息控制,以启用私人和公共仪表板,你可以通过链接分享它。 + * 数据缓存和程序刷新。 + + + +### 如何使用 EDA + +用 EDA 实现数据可视化的第一步是创建数据模型。 + +#### 创建数据模型 + +首先,在左侧菜单中选择 **New Datasource**。 + +接下来,选择你的数据存储的数据库系统(如 Postgres、MariaDB、MySQL、Vertica、SqlServer、Oracle、Big Query),并提供连接参数。 + +EDA 将自动为你生成数据模型。它读取表和列,并为它们定义名称以及表之间的关系。你还可以通过添加虚拟视图或 geoJSON 图来丰富你的数据模型。 + +#### 制作仪表板 + +现在你已经准备好制作第一个仪表板了。在 EDA 界面的主页面上,你应该会看到一个 **New dashboard** 按钮。点击它,命名你的仪表板,并选择你创建的数据模型。新的仪表板将出现一个面板供你配置。 + +要配置面板,请单击右上角的 **Configuration** 按钮,并选择你要做的事情。在 **Edit query** 中,选择你要显示的数据。这将出现一个新的窗口,你的数据模型由实体和实体的属性表示。选择你要查看的实体和你要使用的属性。例如,对于名为 **Customers** 的实体,你可能会显示 **Customer Name**,对于 **Sales** 实体,你可能希望显示 **Total Sales**。 + +接下来,运行一个查询,并选择你想要的可视化。 + +![EDA interface][7] + +(Juanjo Ortilles, [CC BY-SA 4.0][5]) + +你可以添加任意数量的面板、过滤器和文本字段,所有这些都有说明。当你保存仪表板后,你可以查看它,与同事分享,甚至发布到互联网上。 + +### 获取 EDA + +最快的方法是用[公开演示][8]来查看 EDA。但如果你想自己试一试,可以用 Docker 获取最新的 EDA 版本: + + +``` +`$ docker run -p 80:80 jortilles / eda: latest` +``` + +我们还有一个 SaaS 选项,适用于任何想要使用 EDA 而无需进行安装、配置和持续更新的用户。你可以在我们的网站上查看[云选项][9]。 + +如果你想看看它的实际运行情况,你可以在 YouTube 上观看一些[演示][10]。 + +EDA 正在持续开发中,你可以在 GitHub 上找到它的[源代码][11]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/visualize-data-eda + +作者:[Juanjo Ortilles][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/jortilles +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://eda.jortilles.com/en/jortilles-english/ +[3]: https://www.jortilles.com/ +[4]: https://opensource.com/sites/default/files/uploads/eda-display.jpeg (EDA interface) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/20/10/mariadb-mysql-cheat-sheet +[7]: https://opensource.com/sites/default/files/uploads/eda-chart.jpeg (EDA interface) +[8]: https://demoeda.jortilles.com/ +[9]: https://eda.jortilles.com +[10]: https://youtu.be/cBAAJbohHXQ +[11]: https://github.com/jortilles/EDA From b2fe7a96eaa4fea1e7f8797683b6d98a3443868e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 19 Apr 2021 08:54:23 +0800 Subject: [PATCH 167/307] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chensanle @amwps290 @MZqk @mengxinayan @scvoet @Tracygcz @MjSeven @RiaXu 请注意,申请文件已经超期回收。如果您还在此篇文章上工作,请重新申请并完成。 --- sources/tech/20200223 The Zen of Go.md | 2 +- ...10104 Network address translation part 1 - packet tracing.md | 2 +- ...ew of Container-to-Container Communications in Kubernetes.md | 2 +- ...04 A guide to understanding Linux software libraries in C.md | 2 +- ...Fingerprint Login in Ubuntu and Other Linux Distributions.md | 2 +- sources/tech/20210214 Why programmers love Linux packaging.md | 2 +- ...222 A friendly guide to the syntax of C-- method pointers.md | 2 +- .../20210308 Cast your Android device with a Raspberry Pi.md | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sources/tech/20200223 The Zen of Go.md b/sources/tech/20200223 The Zen of Go.md index 249c3790cd..c4143aed32 100644 --- a/sources/tech/20200223 The Zen of Go.md +++ b/sources/tech/20200223 The Zen of Go.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( chensanle ) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210104 Network address translation part 1 - packet tracing.md b/sources/tech/20210104 Network address translation part 1 - packet tracing.md index a1cfd4de2c..850b4f9e1c 100644 --- a/sources/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/sources/tech/20210104 Network address translation part 1 - packet tracing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (amwps290) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md b/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md index c79503bbc9..0c18578a9c 100644 --- a/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md +++ b/sources/tech/20210115 Review of Container-to-Container Communications in Kubernetes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (MZqk) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md index fe977cd22f..bfb9d0a880 100644 --- a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (mengxinayan) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index dcf6c9a3ae..c2cea8fdcc 100644 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (scvoet) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210214 Why programmers love Linux packaging.md b/sources/tech/20210214 Why programmers love Linux packaging.md index bb82a93193..837b4a2aed 100644 --- a/sources/tech/20210214 Why programmers love Linux packaging.md +++ b/sources/tech/20210214 Why programmers love Linux packaging.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (Tracygcz) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md index 36600f7f63..2f059ce95e 100644 --- a/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md +++ b/sources/tech/20210222 A friendly guide to the syntax of C-- method pointers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (MjSeven) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md index 189ed359d4..218bdb488e 100644 --- a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/3/android-raspberry-pi) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( RiaXu) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 53c51fd9e87484ae8cfdf3132f5d20001fffb513 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 19 Apr 2021 09:02:20 +0800 Subject: [PATCH 168/307] translating --- ...Fingerprint Login in Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index c2cea8fdcc..1fd15cf3ac 100644 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b539588eb79797d193a0143e2789c9724935dae8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 19 Apr 2021 09:29:24 +0800 Subject: [PATCH 169/307] PRF&PUB @geekpi https://linux.cn/article-13310-1.html --- ...oss-friendly with this open source tool.md | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) rename {translated/tech => published}/20210414 Make your data boss-friendly with this open source tool.md (70%) diff --git a/translated/tech/20210414 Make your data boss-friendly with this open source tool.md b/published/20210414 Make your data boss-friendly with this open source tool.md similarity index 70% rename from translated/tech/20210414 Make your data boss-friendly with this open source tool.md rename to published/20210414 Make your data boss-friendly with this open source tool.md index 3bfc85d88a..5104978e55 100644 --- a/translated/tech/20210414 Make your data boss-friendly with this open source tool.md +++ b/published/20210414 Make your data boss-friendly with this open source tool.md @@ -3,16 +3,18 @@ [#]: author: (Juanjo Ortilles https://opensource.com/users/jortilles) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13310-1.html) 用这个开源工具让你的数据对老板友好起来 ====== -企业数据分析 (Enterprise Data Analytics) 旨在将数据可视化带给日常商务用户。 -![metrics and data shown on a computer screen][1] -企业数据分析 ([EDA][2]) 是一个网络应用,它可以通过一个简单、清晰的界面来获取信息。 +> 企业数据分析旨在将数据可视化带给日常商务用户。 + +![](https://img.linux.net.cn/data/attachment/album/202104/19/092617elri0ff4r6lr06rr.jpg) + +企业数据分析Enterprise Data Analytics([EDA][2]) 是一个网页应用,它可以通过一个简单、清晰的界面来获取信息。 在巴塞罗那开源分析公司 [Jortilles][3] 工作几年后,我们意识到,现代世界强制性地收集数据,但普通人没有简单的方法来查看或解释这些数据。有一些强大的开源工具可用于此目的,但它们非常复杂。我们找不到一个工具设计成能让没有什么技术能力的普通人轻松使用。 @@ -20,15 +22,13 @@ ![EDA interface][4] -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - ### 可视化你的数据 EDA 使用人们已经理解的商业术语提供了一个数据模型。你可以选择你想要的信息,并可以以你想要的方式查看它。它的目标是对用户友好,同时又功能强大。 EDA 通过元数据模型将数据库中的信息可视化和丰富化。它可以从 BigQuery、Postgres、[MariaDB、MySQL][6] 和其他一些数据库中读取数据。这就把技术性的数据库模型转化为熟悉的商业概念。 -它还设计为加快信息传播的速度,因为它可以利用已经存储在数据库中的数据。EDA 发现数据库的拓扑结构,并提出业务模型。如果你设计了一个好的数据库模型,你就有了一个好的业务模型。EDA 还可以连接到生产服务器,提供实时分析。 +它还设计为加快信息传播的速度,因为它可以利用已经存储在数据库中的数据。EDA 可以发现数据库的拓扑结构,并提出业务模型。如果你设计了一个好的数据库模型,你就有了一个好的业务模型。EDA 还可以连接到生产服务器,提供实时分析。 这种数据和数据模型的结合意味着你和你组织中的任何人都可以分析其数据。然而,为了保护数据,你可以定义数据安全,可以精确到行,以授予正当的人访问正当的数据。 @@ -39,20 +39,18 @@ EDA 的一些功能包括: * 高级用户的 SQL 模式 * 数据可视化: * 标准图表(如柱状图、饼状图、线状图、树状图) - * 地图整合(如 geoJSON shapefile、纬度、经度) + * 地图整合(如 geoJSON shapefile、纬度、经度) * 电子邮件提醒,可通过关键绩效指标 (KPI) 来定义 * 私人和公共信息控制,以启用私人和公共仪表板,你可以通过链接分享它。 * 数据缓存和程序刷新。 - - ### 如何使用 EDA 用 EDA 实现数据可视化的第一步是创建数据模型。 #### 创建数据模型 -首先,在左侧菜单中选择 **New Datasource**。 +首先,在左侧菜单中选择 “New Datasource”。 接下来,选择你的数据存储的数据库系统(如 Postgres、MariaDB、MySQL、Vertica、SqlServer、Oracle、Big Query),并提供连接参数。 @@ -60,32 +58,29 @@ EDA 将自动为你生成数据模型。它读取表和列,并为它们定义 #### 制作仪表板 -现在你已经准备好制作第一个仪表板了。在 EDA 界面的主页面上,你应该会看到一个 **New dashboard** 按钮。点击它,命名你的仪表板,并选择你创建的数据模型。新的仪表板将出现一个面板供你配置。 +现在你已经准备好制作第一个仪表板了。在 EDA 界面的主页面上,你应该会看到一个 “New dashboard” 按钮。点击它,命名你的仪表板,并选择你创建的数据模型。新的仪表板将出现一个面板供你配置。 -要配置面板,请单击右上角的 **Configuration** 按钮,并选择你要做的事情。在 **Edit query** 中,选择你要显示的数据。这将出现一个新的窗口,你的数据模型由实体和实体的属性表示。选择你要查看的实体和你要使用的属性。例如,对于名为 **Customers** 的实体,你可能会显示 **Customer Name**,对于 **Sales** 实体,你可能希望显示 **Total Sales**。 +要配置面板,请单击右上角的 “Configuration” 按钮,并选择你要做的事情。在 “Edit query” 中,选择你要显示的数据。这将出现一个新的窗口,你的数据模型由实体和实体的属性表示。选择你要查看的实体和你要使用的属性。例如,对于名为 “Customers” 的实体,你可能会显示 “Customer Name”,对于 “Sales” 实体,你可能希望显示 “Total Sales”。 接下来,运行一个查询,并选择你想要的可视化。 ![EDA interface][7] -(Juanjo Ortilles, [CC BY-SA 4.0][5]) - 你可以添加任意数量的面板、过滤器和文本字段,所有这些都有说明。当你保存仪表板后,你可以查看它,与同事分享,甚至发布到互联网上。 ### 获取 EDA -最快的方法是用[公开演示][8]来查看 EDA。但如果你想自己试一试,可以用 Docker 获取最新的 EDA 版本: - +最快的方法是用 [公开演示][8] 来查看 EDA。但如果你想自己试一试,可以用 Docker 获取最新的 EDA 版本: ``` -`$ docker run -p 80:80 jortilles / eda: latest` +$ docker run -p 80:80 jortilles / eda: latest ``` -我们还有一个 SaaS 选项,适用于任何想要使用 EDA 而无需进行安装、配置和持续更新的用户。你可以在我们的网站上查看[云选项][9]。 +我们还有一个 SaaS 选项,适用于任何想要使用 EDA 而无需进行安装、配置和持续更新的用户。你可以在我们的网站上查看 [云选项][9]。 -如果你想看看它的实际运行情况,你可以在 YouTube 上观看一些[演示][10]。 +如果你想看看它的实际运行情况,你可以在 YouTube 上观看一些 [演示][10]。 -EDA 正在持续开发中,你可以在 GitHub 上找到它的[源代码][11]。 +EDA 正在持续开发中,你可以在 GitHub 上找到它的 [源代码][11]。 -------------------------------------------------------------------------------- @@ -94,7 +89,7 @@ via: https://opensource.com/article/21/4/visualize-data-eda 作者:[Juanjo Ortilles][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c628b6941e3632b9b36be5bd20bdd12269333705 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 19 Apr 2021 09:51:06 +0800 Subject: [PATCH 170/307] PRF&PUB @wxy https://linux.cn/article-13311-1.html --- ...1109 Getting started with Stratis encryption.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) rename {translated/tech => published}/20201109 Getting started with Stratis encryption.md (92%) diff --git a/translated/tech/20201109 Getting started with Stratis encryption.md b/published/20201109 Getting started with Stratis encryption.md similarity index 92% rename from translated/tech/20201109 Getting started with Stratis encryption.md rename to published/20201109 Getting started with Stratis encryption.md index fef944a41e..6708bdaea5 100644 --- a/translated/tech/20201109 Getting started with Stratis encryption.md +++ b/published/20201109 Getting started with Stratis encryption.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13311-1.html) [#]: subject: (Getting started with Stratis encryption) [#]: via: (https://fedoramagazine.org/getting-started-with-stratis-encryption/) [#]: author: (briansmith https://fedoramagazine.org/author/briansmith/) @@ -10,15 +10,15 @@ Stratis 加密入门 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202104/19/094919orzaxwl5axiqqfiu.jpg) -Stratis 在其 [官方网站][2] 上被描述为“_易于使用的 Linux 本地存储管理”。请看这个 [短视频][3],快速演示基础知识。该视频是在 Red Hat Enterprise Linux 8 系统上录制的。视频中显示的概念也适用于 Fedora 中的 Stratis。 +Stratis 在其 [官方网站][2] 上被描述为“_易于使用的 Linux 本地存储管理_”。请看这个 [短视频][3],快速演示基础知识。该视频是在 Red Hat Enterprise Linux 8 系统上录制的。视频中显示的概念也适用于 Fedora 中的 Stratis。 Stratis 2.1 版本引入了对加密的支持。继续阅读以了解如何在 Stratis 中开始加密。 ### 先决条件 -加密需要 Stratis 2.1 或更高版本。这篇文章中的例子使用的是 Fedora 33 的预发布版本。 Stratis 2.1 将用在 Fedora 33 的最终版本中。 +加密需要 Stratis 2.1 或更高版本。这篇文章中的例子使用的是 Fedora 33 的预发布版本。Stratis 2.1 将用在 Fedora 33 的最终版本中。 你还需要至少一个可用的块设备来创建一个加密池。下面的例子是在 KVM 虚拟机上完成的,虚拟磁盘驱动器为 5GB(`/dev/vdb`)。 @@ -190,7 +190,7 @@ via: https://fedoramagazine.org/getting-started-with-stratis-encryption/ 作者:[briansmith][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4af099eee475696da4453116cf3ebad19d2e9358 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Mon, 19 Apr 2021 13:23:52 +0800 Subject: [PATCH 171/307] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...utions You Can Rely on for Your Ancient 32-bit Computer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index 54608a245e..0552d641e5 100644 --- a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -172,7 +172,7 @@ via: https://itsfoss.com/32-bit-linux-distributions/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ed76ed350649c484ab634e4c75594332bae111ba Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:02:35 +0800 Subject: [PATCH 172/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419=20?= =?UTF-8?q?Something=20bugging=20you=20in=20Fedora=20Linux=3F=20Let?= =?UTF-8?q?=E2=80=99s=20get=20it=20fixed!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md --- ...you in Fedora Linux- Let-s get it fixed.md | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md diff --git a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md new file mode 100644 index 0000000000..312a0c4b1b --- /dev/null +++ b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -0,0 +1,70 @@ +[#]: subject: (Something bugging you in Fedora Linux? Let’s get it fixed!) +[#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Something bugging you in Fedora Linux? Let’s get it fixed! +====== + +![][1] + +Software has bugs. Any complicated system is guaranteed to have at least some bits that don’t work as planned. Fedora Linux is a _very_ complicated system. It contains thousands of packages created by countless independent upstream projects around the world. There are also hundreds of updates every week. So, it’s inevitable that problems creep in. This article addresses the bug fixing process and how some bugs may be prioritized. + +### The release development process + +As a Linux distribution project, we want to deliver a polished, “everything just works” experience to our users. Our release process starts with “Rawhide”. This is our development area where we integrate new versions of all that updated free and open source software. We’re constantly improving our ongoing testing and continuous integration processes to make even Rawhide safe to use for the adventurous. By its nature, however, Rawhide will always be a little bit rough. + +Twice a year we take that rough operating system and branch it for a beta release, and then a final release. As we do that, we make a concerted effort to find problems. We run Test Days to check on specific areas and features. “Candidate builds” are made which are checked against our [release validation test plan][2]. We then enter a “freeze” state where only approved changes go into the candidates. This isolates the candidate from the constant development (which still goes into Rawhide!) so new problems are not introduced. + +Many bugs, big and small, are squashed as part of the release process. When all goes according to plan, we have a shiny new on-schedule Fedora Linux release for all of our users. (We’ve done this reliably and repeatedly for the last few years — thanks, everyone who works so hard to make it so!) If something is really wrong, we can mark it as a “release blocker”. That means we won’t ship until it’s fixed. This is often appropriate for big issues, and definitely turns up the heat and attention that bug gets. + +Sometimes, we have issues that are persistent. Perhaps something that’s been going on for a release or two, or where we don’t have an agreed solution. Some issues are really annoying and frustrating to many users, but individually don’t rise to the level we’d normally block a release for. We _can_ mark these things as blockers. But that is a really big sledgehammer. A blocker may cause the bug to get finally smashed, but it can also cause disruption all around. If the schedule slips, all the _other_ bug fixes and improvements, as well as features people have been working on, don’t get to users. + +### The Prioritized Bugs process + +So, we have another way to address annoying bugs! The [Prioritized Bugs process][3] is a different way to highlight issues that result in unpleasantness for a large number of users. There’s no hammer here, but something more like a spotlight. Unlike the release blocker process, the Prioritized Bugs process does not have a strictly-defined set of criteria. Each bug is evaluated based on the breadth and severity of impact. + +A team of interested contributors helps curate a short list of issues that need attention. We then work to connect those issues to people who can fix them. This helps take pressure off of the release process, by not tying the issues to any specific deadlines. Ideally, we find and fix things before we even get to the beta stage. We try to keep the list short, no more than a handful, so there truly is a focus. This helps the teams and individuals addressing problems because they know we’re respectful of their often-stretched-thin time and energy. + +Through this process, Fedora has resolved dozens of serious and annoying problems. This includes everything from keyboard input glitches to SELinux errors to that thing where gigabytes of old, obsolete package updates would gradually fill up your disk. But we can do a lot more — we actually aren’t getting as many nominations as we can handle. So, if there’s something _you_ know that’s causing long-term frustration or affecting a lot of people and yet which seems to not be reaching a resolution, follow the [Prioritized Bugs process][3] and let _us_ know. + +#### **You can help** + +All Fedora contributors are invited to participate in the Prioritized Bugs process. Evaluation meetings occur every two weeks on IRC. Anyone is welcome to join and help us evaluate the nominated bugs. See the [calendar][4] for meeting time and location. The Fedora Program Manager sends an agenda to the [triage][5] and [devel][6] mailing lists the day before meetings. + +### Bug reports welcome + +Big or small, when you find a bug, we really appreciate it if you report it. In many cases, the best place to do that is with the project that creates the software. For example, lets say there is a problem with the way the Darktable photography software renders images from your digital camera. It’s best to take that to the Darktable developers. For another example, say there’s a problem with the GNOME or KDE desktop environments or with the software that is part of them. Taking these issues to those projects will usually get you the best results. + +However, if it’s a Fedora-specific problem, like something with our build or configuration of the software, or a problem with how it’s integrated, don’t hesitate to [file a bug with us][7]. This is also true when there is a problem which you know has a fix that we just haven’t included yet. + +I know this is kind of complex… it’d be nice to have a one-stop place to handle all of the bugs. But remember that Fedora packagers — the people who do the work of taking upstream software and configuring it to build in our system — are largely volunteers. They are not always the deepest experts in the code for the software they’re working with. When in doubt, you can always file a [Fedora bug][7]. The folks in Fedora responsible for the corresponding package can help with their connections to the upstream software project. + +Remember, when you find a bug that’s gone through diagnosis and doesn’t yet have a good fix, when you see something that affects a lot of people, or when there’s a long-standing problem that just isn’t getting attention, please nominate it as a Prioritized Bug. We’ll take a look and see what can be done! + +_PS: The famous image in the header is, of course, from the logbook of the Mark II computer at Harvard where Rear Admiral Grace Murray Hopper worked. But contrary to popular belief about the story, this isn’t the first use of the term “bug” for a systems problem — it was already common in engineering, which is why it was funny to find a literal bug as the cause of an issue. #nowyouknow #jokeexplainer_ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/ + +作者:[Matthew Miller][a] +选题:[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/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/bugging_you-816x345.jpg +[2]: https://fedoraproject.org/wiki/QA:Release_validation_test_plan +[3]: https://docs.fedoraproject.org/en-US/program_management/prioritized_bugs/ +[4]: https://calendar.fedoraproject.org/base/ +[5]: https://lists.fedoraproject.org/archives/list/triage%40lists.fedoraproject.org/ +[6]: https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ From 83279dc445d9e0c7cd3e181ff63230e8317a993e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:02:55 +0800 Subject: [PATCH 173/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420=20?= =?UTF-8?q?Blanket:=20Ambient=20Noise=20App=20With=20Variety=20of=20Sounds?= =?UTF-8?q?=20to=20Stay=20Focused?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md --- ... With Variety of Sounds to Stay Focused.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md diff --git a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md new file mode 100644 index 0000000000..27bfbe6d37 --- /dev/null +++ b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -0,0 +1,88 @@ +[#]: subject: (Blanket: Ambient Noise App With Variety of Sounds to Stay Focused) +[#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Blanket: Ambient Noise App With Variety of Sounds to Stay Focused +====== + +_**Brief: An open-source ambient noise player offering a variety of sounds to help you focus or fall asleep.**_ + +With the increase in the number of activities around you, it is often tough to keep calm and stay focused. + +Sometimes music helps, but it also distracts in some cases. But, ambient noise? That is always soothing to hear. Who doesn’t want to hear birds chirping, rain falling and crowd chattering in a restaurant? Okay, may be not the last one but listening to natural sound could help in relaxing and focusing. This indirectly boots your productivity. + +Recently, I came across a dedicated player which includes different sounds that could help anyone focus. + +### Play Different Ambient Sounds Using Blanket + +Blanket is an impressive ambient noise player that features different sounds that can help you fall asleep or just regain focus by helping you forget about the surrounding distractions. + +It includes nature sounds like rain, waves, birds chirping, storm, wind, water stream, and summer night. + +![][1] + +Also, if you are a commuter or someone comfortable in a mildly busy environment, you can find sounds for trains, boat, city, coffee shop, or a fireplace. + +If you are fond of white noise or pink noise, which combines all sound frequencies that humans can hear, that is available here too. + +It also lets you autostart every time you boot, if that is what you prefer. + +![][2] + +### Install Blanket on Linux + +The best way to install Blanket is from [Flathub][3]. Considering that you have [Flatpak][4] enabled, all you have to type in the terminal to install it is: + +``` +flatpak install flathub com.rafaelmardojai.Blanket +``` + +In case you’re new to Flatpak, you might want to go through our [Flatpak guide][5]. + +If you do not prefer using Flatpaks, you can install it using a PPA maintained by a contributor in the project. For Arch Linux users, you can find it in [AUR][6] to easily install it. + +In addition, you can also find packages for Fedora and openSUSE. To explore all the available packages, you can head to its [GitHub page][7]. + +**Recommended Read:** + +![][8] + +#### [Relax With Natural Sounds By Using Ambient Noise Music Player In Ubuntu][9] + +Listen to natural white noise music with Ambient Noise Music Player application In Ubuntu. + +### Closing Thoughts + +The user experience for a simple ambient noise player is pretty good. I have a pair of HyperX Alpha S headphones and I must mention that the quality of the sounds is good to hear. + +In other words, it is soothing to hear, and I will recommend you to try it out if you wanted to experience Ambient sounds to focus, get rid of your anxiety or just fall asleep. + +Have you tried it yet? Feel free to share your thoughts below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/blanket-ambient-noise-app/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-screenshot.png?resize=614%2C726&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-autostart-1.png?resize=514%2C214&ssl=1 +[3]: https://flathub.org/apps/details/com.rafaelmardojai.Blanket +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://itsfoss.com/flatpak-guide/ +[6]: https://itsfoss.com/aur-arch-linux/ +[7]: https://github.com/rafaelmardojai/blanket +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/04/Ambient_Noise_Ubuntu.jpeg?fit=700%2C350&ssl=1 +[9]: https://itsfoss.com/ambient-noise-music-player-ubuntu/ From 15a332a0826c7baf07e41c6d5e937cee02c8c4f2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:03:12 +0800 Subject: [PATCH 174/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419=20?= =?UTF-8?q?21=20reasons=20why=20I=20think=20everyone=20should=20try=20Linu?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 21 reasons why I think everyone should try Linux.md --- ...s why I think everyone should try Linux.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/tech/20210419 21 reasons why I think everyone should try Linux.md diff --git a/sources/tech/20210419 21 reasons why I think everyone should try Linux.md b/sources/tech/20210419 21 reasons why I think everyone should try Linux.md new file mode 100644 index 0000000000..fc2dffba07 --- /dev/null +++ b/sources/tech/20210419 21 reasons why I think everyone should try Linux.md @@ -0,0 +1,189 @@ +[#]: subject: (21 reasons why I think everyone should try Linux) +[#]: via: (https://opensource.com/article/21/4/linux-reasons) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +21 reasons why I think everyone should try Linux +====== +Gaming, business, budgeting, art, programming, and more. These are just +a few of the many ways anyone can use Linux. +![Linux keys on the keyboard for a desktop computer][1] + +When I go on holiday, I often end up at one or more used bookstores. I always find a good book I've been meaning to read, and I always justify the inevitable purchase by saying, "I'm on vacation; I should treat myself to this book." It works well, and I've acquired some of my favorite books this way. Yet, like so many traditions in life, it doesn't hold up to scrutiny. In reality, I don't need an excuse to buy a good book. All things being equal, I can do it any time I want. But having a reason does seem to make the process more enjoyable, somehow. + +In my everyday life, I get a lot of questions about Linux. When caught unaware, I sometimes awkwardly ramble on about the history of open source software or the intellectual and economic benefits of sharing resources. Sometimes, I manage to mention some of my favorite features I enjoy on Linux and then end up reverse-engineering those benefits so they can be enjoyed on another operating system. These discussions are usually enjoyable and informative, but there's just one problem: None of it answers the question that people are really asking. + +When a person asks you about Linux, they're often asking you to give them a reason to try it. There are exceptions, of course. People who have never heard the term "Linux" are probably asking for a literal definition of the word. But when your friends and colleagues confide that they're a little dissatisfied with their current operating system, it's probably safe to explain why you enjoy Linux, rather than lecturing them on why Linux is a better option than proprietary systems. In other words, you don't need a sales presentation; you need vacation photos (or used books you bought on vacation, if you're a bookworm). + +To that end, the links below connect to 21 reasons I enjoy Linux, given to 21 separate people on 21 separate occasions. + +### Gaming + +![Gaming on Linux][2] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +When it comes to enjoying a computer, one of the most obvious activities is gaming, and when it comes to gaming, I love it all. I'm happy to spend an evening playing an 8-bit puzzler or a triple-A studio epic. Other times, I settle in for a board game or a tabletop role-playing game (RPG). + +And I [do it all on a Linux computer][4]. + +### Office + +![LibreOffice][5] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +One size doesn't fit all. This is as true for hats as it is for office work. It pains me to see colleagues locked into a singular workflow that doesn't suit them, and I enjoy the way Linux encourages users to find tools they love. I've used office applications ranging from big suites (like LibreOffice and OpenOffice) to lightweight word processors (such as Abiword) to minimal text editors (with Pandoc for conversion). + +Regardless of what users around me are locked into, I have [the freedom to use the tools that work best][6] on my computer and with the way I want to work. + +### Choice + +![Linux login screen][7] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +One of open source's most valuable traits is the trust it allows users to have in the software they use. This trust is derived from a network of friends who can read the source code of the applications and operating systems they use. That means, even if you don't know good source code from bad, you can make friends within the [open source community][8] who do. These are important connections that Linux users can make as they explore the distribution they run. If you don't trust the community that builds and maintains a distribution, you can and should move to a different distribution. Many of us have done it, and it's one of the strengths of having many distros to choose from. + +[Linux offers choice][9] as a feature. A strong community, filled with real human connections, combined with the freedom of choice that Linux provides all give users confidence in the software they run. Because I've read some source code, and because I trust the people who maintain the code I haven't read, [I trust Linux][10]. + +### Budgeting + +![Skrooge][11] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Budgeting isn't fun, but it's important. I learned early, while working menial jobs as I learned a _free_ operating system (Linux!) in my free time, that a budget isn't meant to track your money so much as it tracks your habits. That means that whether you're living paycheck to paycheck or you're well on the way to planning your retirement, you should [maintain a budget][12]. + +If you're in the United States, you can even [pay your taxes on Linux][13]. + +### Art + +![MyPaint][14] + +(Dogchicken, [CC BY-SA 4.0][3]) + +It doesn't matter whether you paint or do pixel art, [edit video][15], or scratch records, you can create great content on Linux. Some of the best art I've seen has been casually made with tools that aren't "industry standard," and it might surprise you just how much of the content you see is made the same way. Linux is a quiet engine, but it's a powerful one that drives indie artists as well as big producers. + +Try using Linux [to create some art][16]. + +### Programming + +![NetBeans][17] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Look, using Linux to program is almost a foregone conclusion. Second only to server administration, open source code and Linux are an obvious combination. There are [many reasons for this][18], but the one I cite is that it's just more fun. I run into plenty of roadblocks when inventing something new, so the last thing I need is for an operating system or software development kit (SDK) to be the reason for failure. On Linux, I have access to everything. Literally everything. + +### Packaging + +![Packaging GNOME software][19] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +The thing nobody talks about when they tell you about programming is _packaging_. As a developer, you have to get your code to your users, or you won't have any users. Linux makes it easy for developers [to deliver apps][20] and easy for users to [install those applications][21]. + +It surprises many people, but [Linux can run many Windows applications][22] as if they were native apps. You shouldn't expect a Windows application to be executable on Linux. Still, many of the major common applications either already exist natively on Linux or else can be run through a compatibility layer called Wine. + +### Technology + +![Data center][23] + +([Taylor Vick][24], [Unsplash License][25]) + +If you're looking for a career in IT, Linux is a great first step. As a former art student who stumbled into Linux to render video faster, I speak from experience! + +Cutting-edge technology happens on Linux. Linux drives most of the internet, most of the world's fastest supercomputers, and the cloud itself. Today, Linux drives [edge computing][26], combining the power of cloud data centers with decentralized nodes for quick response. + +You don't have to start at the top, though. You can learn to [automate][27] tasks on your laptop or desktop and remotely control systems with a [good terminal][28]. + +Linux is open to your new ideas and [available for customization][29]. + +### Share files + +![Beach with cloudy sky][30] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Whether you're a fledgling sysadmin or just a housemate with files to distribute to friends, Linux makes [file sharing a breeze][31]. + +### Media + +![Waterfall][32] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +With all the talk about programming and servers, people sometimes envision Linux as just a black screen filled with green 1's and 0's. Unsurprisingly to those of us who use it, Linux [plays all your media][33], too. + +### Easy install + +![CentOS installation][34] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +Never installed an operating system before? Linux is shockingly easy. Step-by-step, Linux installers hold your hand through an operating system installation to make you feel like a computer expert in under an hour. + +[Go install Linux][35]! + +### Try Linux + +![Porteus][36] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +If you're not ready to install Linux, then you can _try_ Linux instead. No idea where to start? It's less intimidating than you may think. Here are some [things you should consider first][37]. Then take your pick, download a distro, and come up with your own 21 reasons to use Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-reasons + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/sites/default/files/uploads/game_0ad-egyptianpyramids.jpg (Gaming on Linux) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/21/2/linux-gaming +[5]: https://opensource.com/sites/default/files/uploads/office_libreoffice.jpg (LibreOffice) +[6]: https://opensource.com/article/21/2/linux-workday +[7]: https://opensource.com/sites/default/files/uploads/trust_sddm.jpg (Linux login screen) +[8]: https://opensource.com/article/21/2/linux-community +[9]: https://opensource.com/article/21/2/linux-choice +[10]: https://opensource.com/article/21/2/open-source-security +[11]: https://opensource.com/sites/default/files/uploads/skrooge_1.jpg (Skrooge) +[12]: https://opensource.com/article/21/2/linux-skrooge +[13]: https://opensource.com/article/21/2/linux-tax-software +[14]: https://opensource.com/sites/default/files/uploads/art_mypaint.jpg (MyPaint) +[15]: https://opensource.com/article/21/2/linux-python-video +[16]: https://opensource.com/article/21/2/linux-art-design +[17]: https://opensource.com/sites/default/files/uploads/programming_java-netbeans.jpg (NetBeans) +[18]: https://opensource.com/article/21/2/linux-programming +[19]: https://opensource.com/sites/default/files/uploads/packaging_gnome-software.png (Packaging GNOME software) +[20]: https://opensource.com/article/21/2/linux-packaging +[21]: https://opensource.com/article/21/2/linux-package-management +[22]: https://opensource.com/article/21/2/linux-wine +[23]: https://opensource.com/sites/default/files/uploads/edge_taylorvick-unsplash.jpg (Data center) +[24]: https://unsplash.com/@tvick +[25]: https://unsplash.com/license +[26]: https://opensource.com/article/21/2/linux-edge-computing +[27]: https://opensource.com/article/21/2/linux-automation +[28]: https://opensource.com/article/21/2/linux-terminals +[29]: https://opensource.com/article/21/2/linux-technology +[30]: https://opensource.com/sites/default/files/uploads/cloud_beach-sethkenlon.jpg (Beach with cloudy sky) +[31]: https://opensource.com/article/21/3/linux-server +[32]: https://opensource.com/sites/default/files/uploads/media_waterfall.jpg (Waterfall) +[33]: https://opensource.com/article/21/2/linux-media-players +[34]: https://opensource.com/sites/default/files/uploads/install_centos8.jpg (CentOS installation) +[35]: https://opensource.com/article/21/2/linux-installation +[36]: https://opensource.com/sites/default/files/uploads/porteus_0.jpg (Porteus) +[37]: https://opensource.com/article/21/2/try-linux From 0de54cbb94c109b2cf0f3fcba4ffce10cefa3270 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:03:24 +0800 Subject: [PATCH 175/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419=20?= =?UTF-8?q?4=20steps=20to=20customizing=20your=20Mac=20terminal=20theme=20?= =?UTF-8?q?with=20open=20source=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md --- ...c terminal theme with open source tools.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md diff --git a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md new file mode 100644 index 0000000000..94daa8e70a --- /dev/null +++ b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -0,0 +1,100 @@ +[#]: subject: (4 steps to customizing your Mac terminal theme with open source tools) +[#]: via: (https://opensource.com/article/21/4/zsh-mac) +[#]: author: (Bryant Son https://opensource.com/users/brson) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +4 steps to customizing your Mac terminal theme with open source tools +====== +Make your terminal window pretty on your Mac with open source tools. +![4 different color terminal windows with code][1] + +Do you ever get bored with seeing the same old terminal window on your macOS computer? If so, add some bells and whistles to your view with the open source Oh My Zsh framework and Powerlevel10k theme. + +This basic step-by-step walkthrough (including a video tutorial at the end) will get you started customizing your macOS terminal. If you're a Linux user, check out Seth Kenlon's guide to [Adding themes and plugins to Zsh][2] for in-depth guidance. + +### Step 1: Install Oh My Zsh + +[Oh My Zsh][3] is an open source, community-driven framework for managing your Z shell (Zsh) configuration. + +![Oh My Zsh][4] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Oh My Zsh is released under the MIT License. Install it with: + + +``` +`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` +``` + +### Step 2: Install Powerlevel10k fonts + +![Powerlevel10k][6] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Powerlevel10k is an MIT-Licensed Zsh theme. Before installing Powerlevel10k, you will want to install custom fonts for your terminal. + +Go to the [Powerlevel10 GitHub][7] page, and search for "fonts" in the README. The steps for installing the custom fonts will vary depending on your operating system; the video at the bottom of this page explains how to do it on macOS. It should be just a simple click–download–install series of operations. + +![Powerlevel10k fonts][8] + +(Bryant Son, [CC BY-SA 4.0][5]) + +### Step 3: Install the Powerlevel10k theme + +Next, install Powerlevel10k by running: + + +``` +`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` +``` + +After you finish, open a `~/.zshrc` configuration file with a text editor, such as [Vim][9], set the line `ZSH_THEME="powerlevel10k/powerlevel10k`, then save the file. + +### Step 4: Finalize your Powerlevel10k setup + +Open a new terminal, and you should see the Powerlevel10k configuration wizard. If not, run `p10k configure` to bring up the configuration wizard. If you installed the custom fonts in Step 2, the icons and symbols should display correctly. Change the default font to **MeslowLG NF** (see the video below for instructions). + +![Powerlevel10k configuration][10] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Once you complete the configuration, you should see a beautiful terminal. + +![Oh My Zsh/Powerlevel10k theme][11] + +(Bryant Son, [CC BY-SA 4.0][5]) + +If you want to see an interactive tutorial, please check out this video: + +That's it! You should be ready to enjoy your beautiful new terminal. Be sure to check out other Opensource.com articles for more tips and articles on using the shell, Linux administration, and more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/zsh-mac + +作者:[Bryant Son][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://opensource.com/article/19/9/adding-plugins-zsh +[3]: https://ohmyz.sh/ +[4]: https://opensource.com/sites/default/files/uploads/1_ohmyzsh.jpg (Oh My Zsh) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/2_powerlevel10k.jpg (Powerlevel10k) +[7]: https://github.com/romkatv/powerlevel10k +[8]: https://opensource.com/sites/default/files/uploads/3_downloadfonts.jpg (Powerlevel10k fonts) +[9]: https://opensource.com/resources/what-vim +[10]: https://opensource.com/sites/default/files/uploads/4_p10kconfiguration.jpg (Powerlevel10k configuration) +[11]: https://opensource.com/sites/default/files/uploads/5_finalresult.jpg (Oh My Zsh/Powerlevel10k theme) From ebbd67db7b142d7c094d3e57796cb78192e29df7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 20 Apr 2021 05:03:37 +0800 Subject: [PATCH 176/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210419=20?= =?UTF-8?q?13=20ways=20to=20get=20involved=20with=20your=20favorite=20open?= =?UTF-8?q?=20source=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210419 13 ways to get involved with your favorite open source project.md --- ... with your favorite open source project.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210419 13 ways to get involved with your favorite open source project.md diff --git a/sources/tech/20210419 13 ways to get involved with your favorite open source project.md b/sources/tech/20210419 13 ways to get involved with your favorite open source project.md new file mode 100644 index 0000000000..809d8c4319 --- /dev/null +++ b/sources/tech/20210419 13 ways to get involved with your favorite open source project.md @@ -0,0 +1,116 @@ +[#]: subject: (13 ways to get involved with your favorite open source project) +[#]: via: (https://opensource.com/article/21/4/open-source-project-level) +[#]: author: (Mike Bursell https://opensource.com/users/mikecamel) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +13 ways to get involved with your favorite open source project +====== +Apply GET/SET principles to connecting with open source projects. +![Looking at a map for career journey][1] + +Many of my [blog][2]'s readers already know lots about open source, but I'm also aware that many know little, if anything, about it. I'm a big, big proponent of open source software (and beyond, such as open hardware), and there are lots of great resources you can find to learn more about it. + +One very good starting point is the one you're now reading, Opensource.com. It's run by a bunch of brilliant people for the broader community by my current employer, Red Hat. (I should add a disclaimer that I'm not only employed by Red Hat but also a [Correspondent][3] at Opensource.com—a kind of frequent contributor/Elder Thing.) It has articles on pretty much every aspect of open source that you can imagine. + +I was thinking about APIs today (they're [in the news][4] as I'm writing this, after a US Supreme Court judgment on an argument between Google and Oracle), and it occurred to me that if I were interested in understanding how to interact with open source at the project level but didn't know much about it, then a quick guide might be useful. The same goes if I were involved in an open source project (e.g., [Enarx][5]) interested in attracting contributors (particularly techie contributors) who aren't already knowledgeable about open source. + +Given that most programmers will understand what GET and SET methods do (one reads data, the other writes data), I thought this might be a useful framework for considering engagement.[1][6] I'll start with GET, as that's how you're likely to be starting off—finding out more about the project—and then move to SET methods for getting involved with an open source project. + +This is far from an exhaustive list, but I hope that I've hit most of the key ways you're most likely to start getting involved or encouraging others to get involved. The order I've chosen reflects what I suspect is a fairly typical approach to finding out more about a project, particularly for those who aren't open source savvy already but, as they say, YMMV.[3][7] + +I've managed to stop myself from using Enarx (which I co-founded) as the sole source of examples and have tried to find a variety of projects to give you a taster. Disclaimer: their inclusion here does not mean that I am a user or contributor to the project, nor is it any guarantee of their open source credentials, code quality, up to date-ness, project maturity, or community health.[4][8] + +### GET methods + + * **Landing page:** The first encounter you have with a project will probably be its landing page. Some projects go for something basic, others apply more design, but you should be able to use this as the starting point for your adventures around the project. You'd generally hope to find links to various of the other resources listed below from the landing page. + * See [Sigstore][9]'s landing page. + * **Wiki:** In many cases, the project will have a wiki. This could be simple, or it could be complex. It may allow editing by anyone or only by a select band of contributors to the project, and its relevance as a source of truth may be impacted by how up to date it is. Still, the wiki is usually an excellent place to start. + * See the [Fedora Project][10] wiki. + * **Videos:** Some projects maintain a set of videos about their project. These may include introductions to the concepts, talking-head interviews with team members, conference sessions, demos, how-tos, and more. It's also worth looking for videos put up by contributors to the project but not necessarily officially owned by the project. + * See [Rust Language][11] videos. + * **Code of conduct:** Many projects insist that their project members follow a code of conduct to reduce harassment, reduce friction, and generally make the project a friendly, more inclusive, and more diverse place to be. + * See the [Linux kernel][12]'s CoC. + * **Binary downloads:** As projects get more mature, they may choose to provide precompiled binary downloads for users. More technically inclined users may choose to compile their own binaries from the codebase (see below), but binary downloads can be a quick way to try out a project and see whether it does what you want. + * See the binaries from [Chocolate Doom][13] (a Doom port). + * **Design documentation:** Without design documentation, it can be very difficult to get really into a project. (I've written about the [importance of architecture diagrams][14] before.) This documentation is likely to include everything from an API definition to complex use cases and threat models. + * See [Kubernetes][15]' design docs. + * **Codebase:** You've found out all you need to get going: It's time to look at the code! This may vary from a few lines to many thousands, include documentation in comments, or include test cases, but if the code is not there, then the project can't legitimately call itself open source. + * See [Rocket Rust web framework][16]'s code.[5][17] + * **Email/chat:** Most projects like to have a way for contributors to discuss matters asynchronously. The preferred medium varies among projects, but most will choose an email list, a chat server, or both. These are where to get to know other users and contributors, ask questions, celebrate successful compiles, and just hang out. + * See [Enarx chat][18]. + * **Meetups, videoconferences, calls, etc.:** Although in-person meetings are tricky for many at the moment (I'm writing as COVID-19 still reduces travel opportunities), having ways for community members and contributors to get together synchronously can be really helpful for everybody. Sometimes these are scheduled on a daily, weekly, or monthly basis; sometimes, they coincide with other, larger meetups, sometimes a project gets big enough to have its own meetups; sometimes, it's so big that there are meetups of subprojects or internal interest groups. + * See the [Linux Security Summit Europe][19]. + + + +### PUT methods + + * **Bug reports:** The first time many of us contribute anything substantive back to an open source project is when we file a bug report. Bug reports from new users can be really helpful for projects, as they not only expose bugs that may not already be known to the project, but they also give clues as to how actual users of the project are trying to use the code. If the project already publishes binary downloads (see above), you don't even need to compile the code to try it and submit a bug report. But bug reports related to compilation and build can also be extremely useful to the project. Sometimes, the mechanism for bug reporting also provides a way to ask more general questions about the project or to ask for new features. + * See the issues page for [exa][20] (a replacement for the _ls_ command). + * **Tests:** Once you've started using the project, another way to get involved (particularly once you start contributing code) can be to design and submit tests for how the project _ought_ to work. This can be a great way to unearth both your assumptions (and lack of knowledge!) about the project and the project's design assumptions (some of which may well be flawed). Tests are often part of the code repository, but not always. + * See [GNOME Shell][21]'s test repository. + * **Wiki:** A wiki can be a great way to contribute to the project, whether you're coding or not. Many projects don't have as much information available as they should, and that information may not be aimed at people coming to the project "fresh." If this is what you've done, then you're in a great position to write material that will help other "newbs" get into the project faster, as you'll know what would have helped you if it had been there. + * See the wiki for [Wine][22] (Windows Emulator for Linux). + * **Code:** Last but not least, you can write code. You may take hours, months, or years to get to this stage—or you may never reach it—but open source software is nothing without its code. If you've paid enough attention to the other steps, gotten involved in the community, understood what the project aims to do, and have the technical expertise (which you may well develop as you go!), then writing code may be the way you want to contribute. + * See [Enarx][23] (again). + + + +* * * + + 1. I did consider standard RESTful verbs—GET, PUT, POST, and DELETE—but that felt rather contrived.[2][24] + 2. And I don't like the idea of DELETE in this context! + 3. "Your Mileage May Vary," meaning, basically, that your experience may be different, and that's to be expected. + 4. That said, I do use lots of them! + 5. I included this one because I've spent _far_ too much of my time looking at this over the past few months… + + + +* * * + +_This article was originally published on [Alice, Eve, and Bob][25] and is reprinted with the author's permission._ + +Six non-code opportunities for contributing to open source software code and communities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-project-level + +作者:[Mike Bursell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/career_journey_road_gps_path_map_520.png?itok=PpL6jJgY (Looking at a map for career journey) +[2]: https://aliceevebob.com/ +[3]: https://opensource.com/correspondent-program +[4]: https://www.eff.org/deeplinks/2021/04/victory-fair-use-supreme-court-reverses-federal-circuit-oracle-v-google +[5]: https://enarx.dev/ +[6]: tmp.WF7h0s934j#1 +[7]: tmp.WF7h0s934j#3 +[8]: tmp.WF7h0s934j#4 +[9]: https://sigstore.dev/ +[10]: https://fedoraproject.org/wiki/Fedora_Project_Wiki +[11]: https://www.youtube.com/channel/UCaYhcUwRBNscFNUKTjgPFiA +[12]: https://www.kernel.org/doc/html/latest/process/code-of-conduct.html +[13]: https://www.chocolate-doom.org/wiki/index.php/Downloads +[14]: https://opensource.com/article/20/5/diagrams-documentation +[15]: https://kubernetes.io/docs/reference/ +[16]: https://github.com/SergioBenitez/Rocket/tree/v0.4 +[17]: tmp.WF7h0s934j#5 +[18]: https://chat.enarx.dev/ +[19]: https://events.linuxfoundation.org/linux-security-summit-europe/ +[20]: https://github.com/ogham/exa/issues +[21]: https://gitlab.gnome.org/GNOME/gnome-shell/tree/master/tests/interactive +[22]: https://wiki.winehq.org/Main_Page +[23]: https://github.com/enarx +[24]: tmp.WF7h0s934j#2 +[25]: https://aliceevebob.com/2021/04/06/get-set-methods-for-open-source-projects/ From fb4376abc785bc797dabdc2f5f73e6372313d365 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 20 Apr 2021 08:36:10 +0800 Subject: [PATCH 177/307] Rename sources/tech/20210419 13 ways to get involved with your favorite open source project.md to sources/talk/20210419 13 ways to get involved with your favorite open source project.md --- ...ways to get involved with your favorite open source project.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210419 13 ways to get involved with your favorite open source project.md (100%) diff --git a/sources/tech/20210419 13 ways to get involved with your favorite open source project.md b/sources/talk/20210419 13 ways to get involved with your favorite open source project.md similarity index 100% rename from sources/tech/20210419 13 ways to get involved with your favorite open source project.md rename to sources/talk/20210419 13 ways to get involved with your favorite open source project.md From 01bae48b5cb6f47f8986e82dee09d3434ec50925 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 20 Apr 2021 08:36:15 +0800 Subject: [PATCH 178/307] translated --- ...and Edit EPUB Files on Linux With Sigil.md | 101 ----------------- ...and Edit EPUB Files on Linux With Sigil.md | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md create mode 100644 translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md diff --git a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md deleted file mode 100644 index 571cef2f5b..0000000000 --- a/sources/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: (Create and Edit EPUB Files on Linux With Sigil) -[#]: via: (https://itsfoss.com/sigile-epub-editor/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Create and Edit EPUB Files on Linux With Sigil -====== - -Sigil is an open source EPUB editor available for Linux, Windows and macOS. With Sigil, you can create a new ebook in EPUB file format or edit an existing EPUB ebook (file ending in .epub extension). - -In case you are wondering, EPUB is a standard ebook file format endorsed by several digital publishing groups. It is well-supported on a range of devices and ebook readers except Amazon Kindle. - -### Sigil lets you create or edit EPUB files - -[Sigil][1] is an open source software that allows you to edit EPUB files. You may, of course, create a new EPUB file from scratch. - -![][2] - -Many people swear by [Calibre for creating ebooks][3] or editing them. It is indeed a complete tool with lots of features and supports more than just EPUB file format. However, Calibre could be heavy on resources at times. - -Sigil is focused on just the EPUB books with the following features: - - * Support for EPUB 2 and EPUB 3 (with some limitations) - * Provides a preview along with the code view - * Editing EPUB syntax - * Table of content generator with mult-level heading - * Edit metadat - * Spell checking - * REGEX support for find and replace feature - * Supports import of EPUB and HTML files, images, and style sheets - * Additional plugins - * Multiple language support for the interface - * Supports Linux, Windows and macOS - - - -Sigil is not [WYSIWYG][4] type of editor where you can type the chapters of new book. It is focused on code as EPUB depends on XML. Consider it a [code editor like VS Code][5] for EPUB files. For this reason, you should use some other [open source tool for writing][6], export your files in .epub format (if possible) and then edit it in Sigil. - -![][7] - -Sigil does have a [Wiki][8] to provide you some documentation on installing and using Sigil. - -### Installing Sigil on Linux - -Sigil is a cross-platform application with support for Windows and macOS along with Linux. It is a popular software with more than a decade of existence. This is why you should find it in the repositories of your Linux distributions. Just look for it in the software center application of your distribution. - -![Sigil in Ubuntu Software Center][9] - -You may need to enable the universe repository beforehand. You may also use the apt command in Ubuntu-based distributions: - -``` -sudo apt install sigil -``` - -Sigil has a lot of dependencies on Python libraries and modules and hence it downloads and installs a good number of packages. - -![][10] - -I am not going to list commands for Fedora, SUSE, Arch and other distributions. You probably already know how to use your distribution’s package manager, right? - -The version provided by your distribution may not always be the latest. If you want the latest version of Sigil, you can check out its GitHub repositories. - -[Sigil on GitHub][11] - -### Not for everyone, certianly not for reading ePUB books - -I wouldn’t recommend using Sigil for reading ebooks. There are [other dedicated applications on Linux to read .epub files][12]. - -If you are a writer who has to deal with EPUB books or if you are digitizing old books and converting them in various formats, Sigil could be worth a try. - -I haven’t used Sigil extensively so I cannot provide a review of it. I let it up to you to explore it and share your experienced with the rest of us here. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/sigile-epub-editor/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://sigil-ebook.com/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-epub-sigil.png?resize=800%2C621&ssl=1 -[3]: https://itsfoss.com/create-ebook-calibre-linux/ -[4]: https://www.computerhope.com/jargon/w/wysiwyg.htm -[5]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ -[6]: https://itsfoss.com/open-source-tools-writers/ -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-epub-editor-800x621.png?resize=800%2C621&ssl=1 -[8]: https://github.com/Sigil-Ebook/Sigil/wiki -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-software-center-ubuntu.png?resize=800%2C424&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/installing-sigil-ubuntu.png?resize=800%2C547&ssl=1 -[11]: https://github.com/Sigil-Ebook/Sigil -[12]: https://itsfoss.com/open-epub-books-ubuntu-linux/ diff --git a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md new file mode 100644 index 0000000000..1f0780b0ec --- /dev/null +++ b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -0,0 +1,102 @@ +[#]: subject: (Create and Edit EPUB Files on Linux With Sigil) +[#]: via: (https://itsfoss.com/sigile-epub-editor/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Sigil 在 Linux 上创建和编辑 EPUB 文件 +====== + +Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你可以使用 Sigil 创建一个新的 EPUB 格式的电子书,或编辑现有的 EPUB 电子书(以 .epub 扩展结尾的文件)。 + +如果你感到好奇,EPUB 是一个标准的电子书格式,并被几个数字出版集团认可。它被许多设备和电子阅读器支持,除了 亚马逊的 Kindle。 + +### Sigil 让你创建或编辑 EPUB 文件 + +[Sigil][1] 是一个允许你编辑 EPUB 文件的开源软件。当然,你可以从头开始创建一个新的 EPUB 文件。 + +![][2] + +很多人在[创建或编辑电子书时非常相信 Calibre][3]。它确实是一个完整的工具,它有很多的功能并支持不仅仅是 EPUB 格式。然而,Calibre 有时可能是沉重的资源。 + + +Sigil 只专注于 EPUB 书籍,它有以下功能: + + * 支持 EPUB 2 和 EPUB 3(有一定的限制) + * 提供代码视图预览 + * 编辑 EPUB 语法 + * 带有多级标题的内容表生成器 + * 编辑元数据 + * 拼写检查 + * 支持正则查找和替换 + * 支持导入 EPUB、HTML 文件、图像和样式表 + * 额外插件 + * 多语言支持的接口 + * 支持 Linux、Windows 和 MacOS + + + +Sigil 不是你可以直接输入新书章节的 [WYSIWYG][4] 类型的编辑器。由于 EPUB 依赖于 XML,因此它专注于代码。 将其视为用于 EPUB 文件的[类似于 VS Code 的代码编辑器][5]。出于这个原因,你应该使用一些其他[开源写作工具][6],以 epub 格式导出你的文件(如果可能的话),然后在 Sigil 中编辑它。 + +![][7] + +Sigil 有一个 [Wiki][8] 来提供一些安装和使用 Sigil 的文档。 + +### 在 Linux 上安装 Sigil + +Sigil 是一款跨平台应用,支持 Windows 和 macOS 以及 Linux。它是一个流行的软件,有超过十年的历史。这就是为什么你应该会在你的 Linux 发行版仓库中找到它。只要在你的发行版的软件中心应用中寻找它就可以了。 + +![Sigil in Ubuntu Software Center][9] + +你可能需要事先启用 universe 仓库。你也可以在 Ubuntu发行版中使用 apt 命令: + +``` +sudo apt install sigil +``` + +Sigil 有很多对 Python 库和模块的依赖,因此它下载和安装了大量的包。 + +![][10] + +我不会列出 Fedora、SUSE、Arch 和其他发行版的命令。你可能已经知道如何使用你的发行版的软件包管理器,对吧? + +你的发行版提供的版本不一定是最新的。如果你想要 Sigil 的最新版本,你可以查看它的 GitHub 仓库。 + +[Sigil on GitHub][11] + +### 并不适合所有人,当然也不适合用于阅读 ePUB 电子书 + +我不建议使用 Sigil 阅读电子书。Linux 上有[其他专门的应用来阅读 .epub 文件][12]。 + +如果你是一个必须处理 EPUB 书籍的作家,或者如果你在数字化旧书,并在各种格式间转换,Sigil 可能是值得一试。 + +我还没有广泛使用 Sigil,所以我不提供对它的评论。我让你去探索它,并在这里与我们分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sigile-epub-editor/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://sigil-ebook.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/open-epub-sigil.png?resize=800%2C621&ssl=1 +[3]: https://itsfoss.com/create-ebook-calibre-linux/ +[4]: https://www.computerhope.com/jargon/w/wysiwyg.htm +[5]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[6]: https://itsfoss.com/open-source-tools-writers/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-epub-editor-800x621.png?resize=800%2C621&ssl=1 +[8]: https://github.com/Sigil-Ebook/Sigil/wiki +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/sigil-software-center-ubuntu.png?resize=800%2C424&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/installing-sigil-ubuntu.png?resize=800%2C547&ssl=1 +[11]: https://github.com/Sigil-Ebook/Sigil +[12]: https://itsfoss.com/open-epub-books-ubuntu-linux/ From 94af7bcfa6ab3c8296263d7591a1230b7d88d5b7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 20 Apr 2021 08:37:16 +0800 Subject: [PATCH 179/307] Rename sources/tech/20210419 21 reasons why I think everyone should try Linux.md to sources/talk/20210419 21 reasons why I think everyone should try Linux.md --- .../20210419 21 reasons why I think everyone should try Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210419 21 reasons why I think everyone should try Linux.md (100%) diff --git a/sources/tech/20210419 21 reasons why I think everyone should try Linux.md b/sources/talk/20210419 21 reasons why I think everyone should try Linux.md similarity index 100% rename from sources/tech/20210419 21 reasons why I think everyone should try Linux.md rename to sources/talk/20210419 21 reasons why I think everyone should try Linux.md From f5f0229201e29ca47d344f9d62bd715651f0bec3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 20 Apr 2021 08:43:49 +0800 Subject: [PATCH 180/307] translating --- ...ustomizing your Mac terminal theme with open source tools.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md index 94daa8e70a..60ac7ea7e6 100644 --- a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/zsh-mac) [#]: author: (Bryant Son https://opensource.com/users/brson) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c13c02c6117434ef432f4f6325e44023c2e19986 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 20 Apr 2021 09:42:48 +0800 Subject: [PATCH 181/307] =?UTF-8?q?=E8=AF=91=E6=96=87=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ely on for Your Ancient 32-bit Computer.md | 224 ------------------ ...ely on for Your Ancient 32-bit Computer.md | 224 ++++++++++++++++++ 2 files changed, 224 insertions(+), 224 deletions(-) delete mode 100644 sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md create mode 100644 translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md diff --git a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md deleted file mode 100644 index 0552d641e5..0000000000 --- a/sources/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ /dev/null @@ -1,224 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) -[#]: via: (https://itsfoss.com/32-bit-linux-distributions/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer -====== - -If you’ve been keeping up with the latest [Linux distributions][1], you must have noticed that 32-bit support has been dropped from [most of the popular Linux distributions][2]. Arch Linux, Ubuntu, Fedora, everyone has dropped the support for this older architecture. - -But, what if you have vintage hardware with you that still needs to be revived or you want to make use of it for something? Fret not, there are still a few options left to choose from for your 32-bit system. - -In this article, I’ve tried to compile some of the best Linux distributions that will keep on supporting 32-bit platform for next few years. - -### Top Linux distributions that still offer 32-bit support - -![][3] - -This list is a bit different from [our earlier list of Linux distributions for old laptops][4]. Even 64-bit computers can be considered old if they were released before 2010. This is why some suggestions listed there included distros that only support 64-bit now. - -The information presented here are correct as per my knowledge and findings but if you find otherwise, please let me know in the comment section. - -Before you go on, I suppose you know [how to check if you have a 32 bit or 64 bit computer][5]. - -#### 1\. Debian - -![Image Credits: mrneilypops / Deviantart][6] - -Debian is a fantastic choice for 32-bit systems because they still support it with their latest stable release. At the time of writing this, the latest stable release **Debian 10 “buster”** offers a 32-bit version and is supported until 2024. - -If you’re new to Debian, it is worth mentioning that you get solid documentation for everything on their [official wiki][7]. So, it shouldn’t be an issue to get started. - -You can browse through the [available installers][8] to get it installed. However, before you proceed, I would recommend referring to the list of [things to remember before installing Debian][9] in addition to its [installation manual][10]. - -[Debian][11] - -#### 2\. Slax - -![][12] - -If you just want to quickly boot up a device for some temporary work, Slax is an impressive option. - -It is based on Debian but it aims to be a portable and fast option that is meant to be run through USB devices or DVDs. You can download the 32-bit ISO file from their website for free or purchase a rewritable DVD/encrypted pendrive with Slax pre-installed. - -Of course, this isn’t meant to replace a traditional desktop operating system. But, yes, you do get the 32-bit support with Debian as its base. - -[Slax][13] - -#### 3\. AntiX - -![Image Credits: Opensourcefeed][14] - -Yet another impressive Debian-based distribution. AntiX is popularly known as a systemd-free distribution which focuses on performance while being a lightweight installation. - -It is perfectly suitable for just about any old 32-bit system. To give you an idea, it just needs 256 MB RAM and 2.7 GB storage space at the very least. Not just easy to install, but the user experience is focused for both newbies and experienced users as well. - -You should get the latest version based on Debian’s latest stable branch available. - -[AntiX][15] - -#### 4\. openSUSE - -![][16] - -openSUSE is an independent Linux distribution that supports 32-bit systems as well. Even though the latest regular version (Leap) does not offer 32-bit images, the rolling release edition (Tumbleweed) does provide 32-bit image. - -It will be an entirely different experience if you’re new. However, I suggest you to go through the [reasons why you should be using openSUSE.][17] - -It is mostly focused for developers and system administrators but you can utilize it as an average desktop user as well. It is worth noting that openSUSE is not meant to run on vintage hardware — so you have to make sure that you have at least 2 GB RAM, 40+ GB storage space, and a dual core processor. - -[openSUSE][18] - -#### 5\. Emmabuntüs - -![][19] - -Emmabuntus is an interesting distribution that aims to extend the life of the hardware to reduce waste of raw materials with 32-bit support. As a group they’re also involved in providing computers and digital technologies to schools. - -It offers two different editions, one based on Ubuntu and the other based on Debian. If you want a longer 32-bit support, you may want to go with the Debian edition. It may not be the best option, but with a number of pre-configured software to make the Linux learning experience easy and 32-bit support, it is a decent option if you want to support their cause in the process. - -[Emmanbuntus][20] - -#### 6\. NixOS - -![Nixos KDE Edition \(Image Credits: Distrowatch\)][21] - -NixOS is yet another independent Linux distribution that supports 32-bit systems. It focuses on providing a reliable system where packages are isolated from each other. - -This may not be directly geared towards average users but it is a KDE-powered usable distribution with a unique approach to package management. You can learn more about its [features][22] from its official website. - -[NixOS][23] - -#### 7\. Gentoo Linux - -![][24] - -If you’re an experienced Linux user and looking for a 32-bit Linux distributions, Gentoo Linux should be a great choice. - -You can easily configure, compile, and install a kernel through package manager with Gentoo Linux if you want. Not just limited to its configurability, which it is popularly known for, you will also be able to run it without any issues on older hardware. - -Even if you’re not an experienced user and want to give it a try, simply read through the [installation instructions][25] and you will be in for an adventure. - -[Gentoo Linux][26] - -#### 8\. Devuan - -![][27] - -[Devuan][28] is yet another systemd-free distribution. It is technically a fork of Debian, just without systemd and encouraging [Init freedom][29]. - -It may not be a very popular Linux distribution for an average user but if you want a systemd-free distribution and 32-bit support, Devuan should be a good option. - -[Devuan][30] - -#### 9\. Void Linux - -![][31] - -Void Linux is an interesting distribution independently developed by volunteers. It aims to be a general purpose OS while offering a stable rolling release cycle. It features runit as the init system instead of systemd and gives you the option of several [desktop environments][32]. - -It has an extremely impressive minimum requirement specification with just 96 MB of RAM paired up with Pentium 4 (or equivalent) chip. Try it out! - -[Void Linux][33] - -#### 10\. Q4OS - -![][34] - -Q4OS is another Debian-based distribution that focuses on providing a minimal and fast desktop user experience. It also happens to be one of the [best lightweight Linux distributions][4] in our list. It features the [Trinity desktop][35] for its 32-bit edition and you can find KDE Plasma support on 64-bit version. - -Similar to Void Linux, Q4OS also runs on a bare minimum of at least 128 MB RAM and a 300 MHz CPU with a 3 GB storage space requirement. It should be more than enough for any vintage hardware. So, I’d say, you should definitely try it out! - -To know more about it, you can also check out [our review of Q4OS][36]. - -[Q$OS][37] - -#### 11: MX Linux - -![][38] - -If you’ve got a slightly decent configuration (not completely vintage but old), MX Linux would be my personal recommendation for 32-bit systems. It also happens to be one of the [best Linux distributions][2] for every type of user. - -In general, MX Linux is a fantastic lightweight and customizable distribution based on Debian. You get the option to choose from KDE, XFCE or Fluxbox (which is their own desktop environment for older hardware). You can explore more about it on their official website and give it a try. - -[MX Linux][39] - -### Honorable Mention: Funtoo - -Funtoo is a Gentoo-based community-developed Linux distribution. It focuses on giving you the best performance with Gentoo Linux along with some extra packages to make the experience complete for users. It is also interesting to note that the development is actually led by Gentoo Linux’s creator **Daniel Robbins**. - -Of course, if you’re new to Linux, you may not have the best experience here. But, it does support 32-bit systems and works well across many older Intel/AMD chipsets. Explore more about it on its official website to see if you want to try it out. - -[Funtoo][40] - -### Wrapping Up - -I focused the list on Debian-based and some Independent distributions. However, if you don’t mind long term support and just want to get your hands on a 32-bit supported image, you can try any Ubuntu 18.04 based distributions (or any official flavour) as well. - -At the time of writing this, they just have a few more months of software support left. Hence, I avoided mentioning it as the primary options. But, if you like Ubuntu 18.04 based distros or any of its flavours, you do have options like [LXLE][41], [Linux Lite][42], [Zorin Lite 15][43], and other official flavours. - -Even though most modern desktop operating systems based on Ubuntu have dropped support for 32-bit support. You still have plenty of choices to go with. - -What would you prefer to have on your 32-bit system? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/32-bit-linux-distributions/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/what-is-linux-distribution/ -[2]: https://itsfoss.com/best-linux-distributions/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/32-bit-linux.png?resize=800%2C450&ssl=1 -[4]: https://itsfoss.com/lightweight-linux-beginners/ -[5]: https://itsfoss.com/32-bit-64-bit-ubuntu/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/debian-screenshot.png?resize=800%2C450&ssl=1 -[7]: https://wiki.debian.org/FrontPage -[8]: https://www.debian.org/releases/buster/debian-installer/ -[9]: https://itsfoss.com/before-installing-debian/ -[10]: https://www.debian.org/releases/buster/installmanual -[11]: https://www.debian.org/ -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/slax-screenshot.jpg?resize=800%2C600&ssl=1 -[13]: https://www.slax.org -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/antiX-19-1.jpg?resize=800%2C500&ssl=1 -[15]: https://antixlinux.com -[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/opensuse-15-1.png?resize=800%2C500&ssl=1 -[17]: https://itsfoss.com/why-use-opensuse/ -[18]: https://www.opensuse.org/ -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/Emmabuntus-xfce.png?resize=800%2C500&ssl=1 -[20]: https://emmabuntus.org/ -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/nixos-kde.jpg?resize=800%2C500&ssl=1 -[22]: https://nixos.org/features.html -[23]: https://nixos.org/ -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/gentoo-linux.png?resize=800%2C450&ssl=1 -[25]: https://www.gentoo.org/get-started/ -[26]: https://www.gentoo.org -[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/devuan-beowulf.jpg?resize=800%2C600&ssl=1 -[28]: https://itsfoss.com/devuan-3-release/ -[29]: https://www.devuan.org/os/init-freedom -[30]: https://www.devuan.org -[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/void-linux.jpg?resize=800%2C450&ssl=1 -[32]: https://itsfoss.com/best-linux-desktop-environments/ -[33]: https://voidlinux.org/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os8Debonaire.jpg?resize=800%2C500&ssl=1 -[35]: https://en.wikipedia.org/wiki/Trinity_Desktop_Environment -[36]: https://itsfoss.com/q4os-linux-review/ -[37]: https://q4os.org/index.html -[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 -[39]: https://mxlinux.org/ -[40]: https://www.funtoo.org/Welcome -[41]: https://www.lxle.net/ -[42]: https://www.linuxliteos.com -[43]: https://zorinos.com/download/15/lite/32/ diff --git a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md new file mode 100644 index 0000000000..294f392832 --- /dev/null +++ b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -0,0 +1,224 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) +[#]: via: (https://itsfoss.com/32-bit-linux-distributions/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +可以在古老的 32 位计算机上使用的 11 种 Linux 发行版 +====== + +如果您紧跟最新的[Linux 发行版][1],那么您一定已经注意到,[大多数流行的 Linux 发行版][2]已经终止了 32 位支持。Arch Linux,Ubuntu,Fedora,每一个都已经放弃了对这种较旧架构的支持。 + +但是,如果您拥有仍然需要再生的老式硬件,或者想将其用于某些用途,该怎么办?不用担心,还剩下一些 32 位系统选项可供选择。 + +在本文中,我试图编译一些最好的 Linux 发行版,这些发行版将在未来几年继续支持 32 位平台。 + +### 仍提供 32 位支持的最优 Linux 发行版 + +![][3] + +此列表与[较早的支持旧笔记本电脑的 Linux 发行版列表][4]略有不同。如果 64 位计算机是在 2010 年之前发布的,那么甚至可以认为它们是过时的。这就是为什么其中列出的一些建议包括现在仅支持 64 位版本的发行版的原因。 + +根据我的知识和认知,此处提供的信息是正确的,但是如果您发现有误,请在评论部分让我知道。 + +在继续之前,我认为您知道[如何检查您拥有的是否是 32 位或 64 位计算机][5]。 + +#### 1\. Debian + +![图片来源: mrneilypops / Deviantart][6] + +对于 32 位系统,Debian 是一个绝佳的选择,因为他们仍通过最新的稳定版本支持它。在撰写本文时,最新的稳定发行版 **Debian 10“buster”** 提供了32位版本,并一直支持到2024年。 + +如果您是 Debian 的新手,值得一提的是,您可以在[官方Wiki][7]上获得有关其所有内容的可靠文档。因此,上手应该不是问题。 + +您可以浏览[可用的安装程序][8]进行安装。但是,在开始之前,除了[安装手册][10]外,我建议您参考[安装 Debian 之前要记住的事情][9]列表。 + +[Debian][11] + +#### 2\. Slax + +![][12] + +如果您只是想快速启动设备以进行一些临时工作,Slax是一个令人印象深刻的选择。 + +它基于 Debian,但它旨在成为一种便携式且通过 USB 设备或 DVD 运行的快速选项。您可以从他们的网站免费下载 32 位 ISO 文件,或购买预装有 Slax 的可擦写 DVD /**(或)**加密的闪存盘。 + +当然,这并不是要取代传统的桌面操作系统。但是,是的,您确实获得了以 Debian 为基础的 32 位支持。 + +[Slax][13] + +#### 3\. AntiX + +![图片来源: Opensourcefeed(开源提供)][14] + +另一个令人印象深刻的基于 Debian 的发行版。AntiX 通常被称为免系统发行版,该发行版在轻量级安装的同时侧重于性能。 + +它完全适合几乎所有老式的 32 位系统。建议至少需要 256 MB 内存和 2.7 GB 存储空间。不仅易于安装,而且用户体验也针对新手和有经验的用户。 + +您应该根据 Debian 的最新稳定可用分支获得最新版本。 + +[AntiX][15] + +#### 4\. openSUSE + +![][16] + +openSUSE 是一个独立的 Linux 发行版,也支持 32 位系统。实际上最新的常规版本(Leap)不提供 32 位映像,但滚动发行版本(Tumbleweed)确实提供了 32 位映像。 + +如果您是新手,那将是完全不同的体验。但是,我建议您仔细阅读[为什么要使用 openSUSE 的原因。][17] + +它主要面向开发人员和系统管理员,但也可以将其用作普通桌面用户。值得注意的是,openSUSE 不意味在老式硬件上运行-因此必须确保至少有 2 GB 内存,40+ GB存储空间和双核处理器。 + +[openSUSE][18] + +#### 5\. Emmabuntüs + +![][19] + +Emmabuntus 是一个有趣的发行版,旨在通过 32 位支持来延长硬件的使用寿命,以减少原材料的浪费。作为一个小组,他们还参与向学校提供计算机和数字技术。 + +它提供了两个不同的版本,一个基于 Ubuntu,另一个基于 Debian。如果您需要更长久的 32 位支持,则可能要使用 Debian 版本。它可能不是最好的选择,但是它具有许多预配置的软件来简化 Linux 学习体验并提供 32 位支持,如果您希望在此过程中支持他们的事业,那么这是一个相当不错的选择。 + +[Emmanbuntus][20] + +#### 6\. NixOS + +![Nixos KDE Edition \(图片来源: Distrowatch\)][21] + +NixOS 是另一个独立的支持 32 位系统的 Linux 发行版。它着重于提供一个可靠的系统,其中程序包彼此隔离。 + +这可能不直接面向普通用户,但它是 KDE 支持的可用发行版,具有独一无二的软件包管理方法。您可以从其官方网站上了解有关其[功能][22]的更多信息。 + +[NixOS][23] + +#### 7\. Gentoo Linux + +![][24] + +如果您是经验丰富的 Linux 用户,并且正在寻找 32 位 Linux 发行版,那么 Gentoo Linux 应该是一个不错的选择。 + +如果需要,您可以使用 Gentoo Linux 通过软件包管理器轻松配置,编译和安装内核。不仅限于众所周知的可配置性,您还可以在较旧的硬件上运行而不会出现任何问题。 + +即使您不是经验丰富的用户,也想尝试一下,只需阅读[安装说明][25],就可以大胆尝试了。 + +[Gentoo Linux][26] + +#### 8\. Devuan + +![][27] + +[Devuan][28]是另一种免系统的发行版。从技术上讲,它是 Debian的一个分支,只是没有系统化和鼓励[开始自由][29]。 + +对于普通用户来说,它可能不是一个非常流行的 Linux 发行版,但是如果您想要免系统发行版和 32 位支持,Devuan 应该是一个不错的选择。 + +[Devuan][30] + +#### 9\. Void Linux + +![][31] + +Void Linux 是由志愿者独立开发的有趣发行版。它旨在成为一个通用的 OS(操作系统),同时提供稳定的滚动发布周期。它以 `runit`作为初始系统替代 `systemd`,并具有多个[桌面环境][32]的选项。 + +它具有令人印象深刻的最低需求规格,只需 96 MB 的内存和 Pentium(奔腾) 4(或等效的)芯片配对。试试看吧! + +[Void Linux][33] + +#### 10\. Q4OS + +![][34] + +Q4OS 是另一个基于 Debian 的发行版,致力于提供最小和快速的桌面用户体验。它也恰好是我们列表中的[最佳轻量级 Linux 发行版][4]之一。它的 32 位版本具有[Trinity 桌面][35],您可以在 64 位版本上找到 KDE Plasma 支持。 + +与 Void Linux 类似,Q4OS 也至少可以运行在至少 128 MB 的内存和 300 MHz 的 CPU 上,并需要 3 GB 的存储空间。对于任何老式硬件来说,它应该绰绰有余。因此,我想说,您绝对应该尝试一下! + +要了解更多信息,您还可以查看[我们对 Q4OS 的回顾][36]。 + +[Q$OS][37] + +#### 11: MX Linux + +![][38] + +如果有一个稍微不错的配置(不完全是老式的,而是旧的),对于 32 位系统,我个人推荐 MX Linux。对于每种类型的用户,它也都会成为[最佳 Linux 发行版][2]之一。 + +通常,MX Linux 是基于 Debian 的出色的轻量级和可自定义发行版。您可以选择从 KDE,XFCE 或 Fluxbox(这是它们自己的用于较旧硬件的桌面环境)中进行选择。您可以在他们的官方网站上找到更多关于它的信息,然后尝试一下。 + +[MX Linux][39] + +### 荣誉提名:Funtoo + +Funtoo 是基于 Gentoo 社区开发的 Linux 发行版。它着重于为您提供 Gentoo Linux 的最佳性能以及一些额外的软件包,以使用户获得完整的体验。有趣的是,该开发实际上是由 Gentoo Linux 的创建者丹尼尔·罗宾斯(Daniel Robbins)领导的。 + +当然,如果您不熟悉 Linux,那么这里可能没有最好的体验。但是,它确实支持 32 位系统,并且可以在许多较旧的 Intel/AMD 芯片组上很好地工作。 + +[Funtoo][40] + +### 总结 + +我将列表集中在基于 Debian 的发行版和一些独立发行版上。但是,如果您不介意长期支持条款,而只想获得 32 位受支持的映像,也可以尝试使用任何基于 Ubuntu 18.04 的发行版(或任何官方版本)。 + +在撰写本文时,他们只剩下几个月的软件支持。因此,我避免将其作为主要选项提及。但是,如果您喜欢基于 Ubuntu 18.04 的发行版或其它任何版本,可以选择 [LXLE][41],[Linux Lite][42],[Zorin Lite 15][43]及其他官方版本。 + +即使大多数基于 Ubuntu 的现代桌面操作系统都放弃了对 32 位的支持。您仍然有很多选项可以选择。 + +在 32 位系统上更喜欢哪一个?在下面的评论中让我知道您的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/32-bit-linux-distributions/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-linux-distribution/ +[2]: https://itsfoss.com/best-linux-distributions/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/32-bit-linux.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/lightweight-linux-beginners/ +[5]: https://itsfoss.com/32-bit-64-bit-ubuntu/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/debian-screenshot.png?resize=800%2C450&ssl=1 +[7]: https://wiki.debian.org/FrontPage +[8]: https://www.debian.org/releases/buster/debian-installer/ +[9]: https://itsfoss.com/before-installing-debian/ +[10]: https://www.debian.org/releases/buster/installmanual +[11]: https://www.debian.org/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/slax-screenshot.jpg?resize=800%2C600&ssl=1 +[13]: https://www.slax.org +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/antiX-19-1.jpg?resize=800%2C500&ssl=1 +[15]: https://antixlinux.com +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/opensuse-15-1.png?resize=800%2C500&ssl=1 +[17]: https://itsfoss.com/why-use-opensuse/ +[18]: https://www.opensuse.org/ +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/Emmabuntus-xfce.png?resize=800%2C500&ssl=1 +[20]: https://emmabuntus.org/ +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/nixos-kde.jpg?resize=800%2C500&ssl=1 +[22]: https://nixos.org/features.html +[23]: https://nixos.org/ +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/gentoo-linux.png?resize=800%2C450&ssl=1 +[25]: https://www.gentoo.org/get-started/ +[26]: https://www.gentoo.org +[27]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/devuan-beowulf.jpg?resize=800%2C600&ssl=1 +[28]: https://itsfoss.com/devuan-3-release/ +[29]: https://www.devuan.org/os/init-freedom +[30]: https://www.devuan.org +[31]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/void-linux.jpg?resize=800%2C450&ssl=1 +[32]: https://itsfoss.com/best-linux-desktop-environments/ +[33]: https://voidlinux.org/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/02/q4os8Debonaire.jpg?resize=800%2C500&ssl=1 +[35]: https://en.wikipedia.org/wiki/Trinity_Desktop_Environment +[36]: https://itsfoss.com/q4os-linux-review/ +[37]: https://q4os.org/index.html +[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 +[39]: https://mxlinux.org/ +[40]: https://www.funtoo.org/Welcome +[41]: https://www.lxle.net/ +[42]: https://www.linuxliteos.com +[43]: https://zorinos.com/download/15/lite/32/ From b74b31052d662f4125262b36772adf35acdcfea1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 09:52:47 +0800 Subject: [PATCH 182/307] PRF @stevenzdg988 --- ...t tips for managing your home directory.md | 84 +++++++++---------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/translated/tech/20210405 7 Git tips for managing your home directory.md b/translated/tech/20210405 7 Git tips for managing your home directory.md index f79436921e..2ea2141134 100644 --- a/translated/tech/20210405 7 Git tips for managing your home directory.md +++ b/translated/tech/20210405 7 Git tips for managing your home directory.md @@ -3,54 +3,54 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 7个管理家目录的 Git 技巧 ====== -这是我怎样设置 Git 来管理我的家目录的方法。 -![一排房子][1] -我有几台电脑。我有一台笔记本电脑在工作,一台工作站在家里,一台 Raspberry Pi(或四台),一台 [Pocket CHIP][2],一台 [运行各种不同的 Linux 的 Chromebook][3],等等。我过去常常按照相同的步骤或多或少地在每台计算机上设置我的用户环境,而且我经常告诉自己,我喜欢每台计算机都略微独特。例如,我在工作中比在家里更经常使用 [Bash 别名][4],并且我在家里使用的帮助脚本可能对工作没有用。 +> 这是我怎样设置 Git 来管理我的家目录的方法。 -这些年来,我对各种设备的期望开始相融,而我忘记了我在家用计算机上建立的功能没有移植到我的工作计算机上,诸如此类。我需要一种标准化我的自定义工具包的方法。使我感到意外的答案是 Git。 +![](https://img.linux.net.cn/data/attachment/album/202104/20/095224mtq14szo7opfofq7.jpg) -Git 是版本跟踪器软件。它著名于使用在最大和最小的开源项目,甚至最大的专利软件公司。但是它是为源代码设计的,而不是一个充满音乐和视频文件,游戏,照片等的家目录。我听说有人使用 Git 管理其家目录,但我认为这是编码人员进行的一项附带实验,而不是像我这样的现实生活中的用户。 +我有好几台电脑。一台笔记本电脑用于工作,一台工作站放在家里,一台树莓派(或四台),一台 [Pocket CHIP][2],一台 [运行各种不同的 Linux 的 Chromebook][3],等等。我曾经在每台计算机上或多或少地按照相同的步骤设置我的用户环境,也经常告诉自己让每台计算机都略有不同。例如,我在工作中比在家里更经常使用 [Bash 别名][4],并且我在家里使用的辅助脚本可能对工作没有用。 -用 Git 管理我的家目录是一个不断发展的过程。随着时间的推移我一直在学习和适应。如果您决定使用 Git 管理家目录,则可能需要记住以下几点。 +这些年来,我对各种设备的期望开始相融,我会忘记我在家用计算机上建立的功能没有移植到我的工作计算机上,诸如此类。我需要一种标准化我的自定义工具包的方法。使我感到意外的答案是 Git。 -### 1\. 文本和二进制位置 +Git 是版本跟踪软件。它以既可以用在非常大的开源项目也可以用在极小的开源项目而闻名,甚至最大的专有软件公司也在用它。但是它是为源代码设计的,而不是用在一个装满音乐和视频文件、游戏、照片等的家目录。我听说过有人使用 Git 管理其家目录,但我认为这是程序员们进行的一项附带实验,而不是像我这样的现实生活中的用户。 + +用 Git 管理我的家目录是一个不断发展的过程。随着时间的推移我一直在学习和适应。如果你决定使用 Git 管理家目录,则可能需要记住以下几点。 + +### 1、文本和二进制位置 ![家目录][5] -(Seth Kenlon, [CC BY-SA 4.0][6]) +当由 Git 管理时,除了配置文件之外,你的家目录对于所有内容而言都是“无人之地”。这意味着当你打开主目录时,除了可预见的目录的列表之外,你什么都看不到。不应有任何杂乱无章的照片或 LibreOffice 文档,也不应有 “我就在这里放一分钟” 的临时文件。 -当由 Git 管理时,除了配置文件之外,您的家目录对于所有内容而言都是"无人之地"。这意味着当您打开主目录时,除了可预见的目录的列表之外,您什么都看不到。不应有任何无主的照片或 LibreOffice 文档,也不应有 “我将其放在此处仅一分钟(临时)” 的文件。 - -原因很简单:使用 Git 管理家目录时,家目录中所有 _未_ 提交的内容都会变得杂乱无章。每次执行 `git status` 时,您都必须滚动到过去任何 Git 未跟踪的文件,因此将这些文件保存在子目录(添加到 `.gitignore` 文件中)至关重要。 +原因很简单:使用 Git 管理家目录时,家目录中所有 _未_ 提交的内容都会变成噪音。每次执行 `git status` 时,你都必须翻过去之前 Git 未跟踪的任何文件,因此将这些文件保存在子目录(添加到 `.gitignore` 文件中)至关重要。 许多 Linux 发行版提供了一组默认目录: - * 文档 - * 下载 - * 音乐 - * 相片 - * 模板 - * 视频 + * `Documents` + * `Downloads` + * `Music` + * `Photos` + * `Templates` + * `Videos` -如果需要,您可以创建更多。例如,我区分创作的音乐(音乐)和购买的聆听音乐(专辑)。同样,我的 Cinema (电影)目录包含其他人的电影,而 Videos (视频目录)包含我需要编辑的视频文件。换句话说,我的默认目录结构比大多数 Linux 发行版提供的默认集更详细,但是我认为这样做有好处。如果没有适合您的目录结构,由于缺少更好的存放位置,您将更有可能将其存放在家目录中,因此请提前考虑并计划适合您的工作目录。您以后总是可以添加更多,但是最好先开始擅长的。 +如果需要,你可以创建更多。例如,我把创作的音乐(`Music`)和购买来聆听的音乐(`Albums`)区分开来。同样,我的电影(`Cinema`)目录包含了其他人的电影,而视频(`Videos`)目录包含我需要编辑的视频文件。换句话说,我的默认目录结构比大多数 Linux 发行版提供的默认设置更详细,但是我认为这样做有好处。如果没有适合你的目录结构,你更会将其存放在家目录中,因为没有更好的存放位置,因此请提前考虑并规划好适合你的工作目录。你以后总是可以添加更多,但是最好先开始擅长的。 -### 2\. 设置最优的 `.gitignore` +### 2、、设置最优的 `.gitignore` -清理家目录后,您可以像往常一样将其作为 Git 存储库实例化: +清理家目录后,你可以像往常一样将其作为 Git 存储库实例化: ``` $ cd $ git init . ``` -您的 Git 信息库还没有任何内容,因此您的家目录中的所有内容均未被跟踪。您的第一项工作是筛选未跟踪文件的列表,并确定要保持未跟踪状态的文件。要查看未跟踪的文件: +你的 Git 仓库中还没有任何内容,你的家目录中的所有内容均未被跟踪。你的第一项工作是筛选未跟踪文件的列表,并确定要保持未跟踪状态的文件。要查看未跟踪的文件: ``` $ git status @@ -65,51 +65,49 @@ $ git status [...] ``` -根据您使用家目录的时间长短,此列表可能很长。简单的目录是您在第一步中确定的目录。通过将它们添加到名为 `.gitignore` 的隐藏文件中,您告诉 Git 停止将它们列为未跟踪文件,并且从不对其进行跟踪: +根据你使用家目录的时间长短,此列表可能很长。简单的是你在上一步中确定的目录。通过将它们添加到名为 `.gitignore` 的隐藏文件中,你告诉 Git 停止将它们列为未跟踪文件,并且永远不对其进行跟踪: ``` -`$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore` +$ \ls -lg | grep ^d | awk '{print $8}' >> ~/.gitignore ``` -完成后,浏览 `git status` 所示的其余未跟踪文件,并确定是否有其他文件需要授权排除。这个过程帮助我发现了几个陈旧的配置文件和目录,这些文件和目录最终被我全部丢弃了,而且还发现了一些特定于一台计算机的文件和目录。我在这里非常严格,因为许多配置文件在自动生成时会做得更好。例如,我从未提交过 KDE 配置文件,因为许多文件包含诸如最新文档之类的信息以及其他机器上不存在的其他元素。 +完成后,浏览 `git status` 所示的其余未跟踪文件,并确定是否有其他文件需要排除。这个过程帮助我发现了几个陈旧的配置文件和目录,这些文件和目录最终被我全部丢弃了,而且还发现了一些特定于一台计算机的文件和目录。我在这里非常严格,因为许多配置文件在自动生成时会表现得更好。例如,我从不提交我的 KDE 配置文件,因为许多文件包含了诸如最新文档之类的信息以及其他机器上不存在的其他元素。 -我跟踪我的个性化配置文件,脚本和实用程序,配置文件和 Bash 配置以及速查表和我经常引用的其他文本片段。如果该软件主要负责维护文件,则将其忽略。当对文件有疑问时,我将其忽略。您以后总是可以取消忽略它(通过从 .gitignore 文件中删除它)。 +我会跟踪我的个性化配置文件、脚本和实用程序、配置文件和 Bash 配置,以及速查表和我经常引用的其他文本片段。如果有软件主要负责维护的文件,则将其忽略。当对一个文件不确定时,我将其忽略。你以后总是可以取消忽略它(通过从 `.gitignore` 文件中删除它)。 -### 3\. 了解您的数据 +### 3、了解你的数据 -我正在使用 KDE,因此我使用开源扫描程序 [Filelight][7] 来获取我的数据概述。Filelight 为您提供了一个图表,可让您查看每个目录的大小。您可以浏览每个目录以查看占用了所有空间的内容,然后回溯调查其他地方。这是您系统的迷人视图,它使您可以以全新的方式查看文件。 +我使用的是 KDE,因此我使用开源扫描程序 [Filelight][7] 来了解我的数据概况。Filelight 为你提供了一个图表,可让你查看每个目录的大小。你可以浏览每个目录以查看占用了空间的内容,然后回溯调查其他地方。这是一个令人着迷的系统视图,它使你可以以全新的方式看待你的文件。 ![Filelight][8] -(Seth Kenlon, [CC BY-SA 4.0][6]) - 使用 Filelight 或类似的实用程序查找不需要提交的意外数据缓存。例如,KDE 文件索引器(Baloo)生成了大量特定于其主机的数据,我绝对不希望将其传输到另一台计算机。 -### 4\. 不要忽略您的 .gitignore 文件 +### 4、不要忽略你的 `.gitignore` 文件 -在某些项目中,我告诉 Git 忽略我的`.gitignore`文件,因为有时我要忽略的内容特定于我的工作目录,并且我不认为同一项目中的其他开发人员需要我告诉他们的 `.gitignore` 文件的内容应该看起来像什么。因为我的家目录仅供我使用,所以我 _不_ 会忽略我的家目录的 `.gitignore` 文件。我将其与其他重要文件一起提交,因此它已在我的所有系统中被继承。当然,从家目录的角度来看,我所有的系统都是相同的:它们具有相同的默认文件夹集和许多相同的隐藏配置文件。 +在某些项目中,我告诉 Git 忽略我的 `.gitignore` 文件,因为有时我要忽略的内容特定于我的工作目录,并且我不认为同一项目中的其他开发人员需要我告诉他们 `.gitignore` 文件应该是什么样子。因为我的家目录仅供我使用,所以我 _不_ 会忽略我的家目录的 `.gitignore` 文件。我将其与其他重要文件一起提交,因此它已在我的所有系统中被继承。当然,从家目录的角度来看,我所有的系统都是相同的:它们具有一组相同的默认文件夹和许多相同的隐藏配置文件。 -### 5\. 不要担心二进制文件 +### 5、不要担心二进制文件 -我对系统进行了数周的严格测试,确信将二进制文件提交到 Git 是绝对不明智的。我尝试了 GPG 加密的密码文件,尝试了 LibreOffice 文档,JPEG,PNG 等等。我甚至有一个脚本,可以在将 LibreOffice 文件添加到 Git 之前取消存档,然后提取其中的 XML,以便仅提交 XML,然后重新构建 LibreOffice 文件,以便可以在 LibreOffice 中继续工作。我的理论是,提交 XML 会比使用 ZIP 文件(这实际上是 LibreOffice 文档的全部)提供一个更小的 Git 存储库。 +我对我的系统进行了数周的严格测试,确信将二进制文件提交到 Git 绝对不是明智之举。我试过 GPG 加密的密码文件、试过 LibreOffice 文档、JPEG、PNG 等等。我甚至有一个脚本,可以在将 LibreOffice 文件添加到 Git 之前先解压缩,提取其中的 XML,以便仅提交 XML,然后重新构建 LibreOffice 文件,以便可以在 LibreOffice 中继续工作。我的理论是,提交 XML 会比使用 ZIP 文件(LibreOffice 文档实际上就是一个 ZIP 文件)会让 Git 存储库更小一些。 -令我惊讶的是,我发现不时提交一些二进制文件并没有实质性地增加我的 Git 存储库的大小。我使用 Git 已经很长时间了,以至于如果我要提交千兆字节的二进制数据,我的存储库将会遭受损失,但是偶尔的二进制文件并不是不惜一切代价避免的紧急情况。 +令我惊讶的是,我发现偶尔提交一些二进制文件并没有大幅增加我的 Git 存储库的大小。我使用 Git 已经很长时间了,我知道如果我要提交几千兆的二进制数据,我的存储库将会受到影响,但是偶尔提交几个二进制文件也不是不惜一切代价要避免的紧急情况。 -有了这种信心,我将字体 OTF 和 TTF 文件添加到我的标准主存储库,GDM 的`.face`文件以及其他附带的次要二进制 Blob 文件。不要想太多,不要浪费时间去避免它。只需提交即可。 +有了这种信心,我将字体 OTF 和 TTF 文件添加到我的标准主存储库,以及 GDM 的 `.face` 文件以及其他偶尔小型二进制 Blob 文件。不要想太多,不要浪费时间去避免它。只需提交即可。 -### 6\. 使用私有存储库 +### 6、使用私有存储库 -即使主机提供私人帐户,也不要将您的主目录提交到公共 Git 存储库。如果您像我一样,拥有 SSH 密钥,GPG 密钥链和 GPG 加密的文件,这些属于自己的文件不应该出现在任何人的服务器上。 +即使托管方提供了私人帐户,也不要将你的主目录提交到公共 Git 存储库。如果你像我一样,拥有 SSH 密钥、GPG 密钥链和 GPG 加密的文件,这些文件不应该出现在任何人的服务器上,而应该出现在我自己的服务器上。 -我在 Raspberry Pi 上[运行本地 Git 服务器][9](这比您想象的要容易),因此我可以在家里时随时更新任何一台计算机。我是一名远程工作者,所以通常情况下就足够了,但是我也可以通过 [VPN][10] 访问计算机。 +我在树莓派上 [运行本地 Git 服务器][9](这比你想象的要容易),因此我可以在家里时随时更新任何一台计算机。我是一名远程工作者,所以通常情况下就足够了,但是我也可以在旅行时通过 [虚拟私人网络][10] 访问我的计算机。 -### 7\. 要记得推送 +### 7、要记得推送 -关于 Git ,仅当您通知服务器时,它才会将更改推送到您的服务器。如果您是 Git 的长期用户,则此过程可能对您很自然。对于可能习惯于 Nextcloud 或 Syncthing 自动同步的新用户,这可能需要一些时间来适应。 +Git 的特点是,只有当你告诉它要推送改动时,它才会把改动推送到你的服务器上。如果你是 Git 的老用户,则此过程可能对你很自然。对于可能习惯于 Nextcloud 或 Syncthing 自动同步的新用户,这可能需要一些时间来适应。 ### Git 家目录 -使用 Git 管理我的通用文件并没有使跨设备的生活更加便利。知道我对所有配置和实用程序脚本都有完整的历史记录,这会鼓励我尝试新的想法,因为如果结果变得 _很糟糕_,则很容易回滚我的更改。 Git 已将我从在 `.bashrc` 文件欠考虑的掩码设置中解救出来,对于我的软件包管理脚本糟糕的深夜附加物,并且更改 [rxvt][11] 配色方案以及过去的其他一些错误这时看起来像一个很酷的想法。在家(目录)中尝试 Git,因为一起提交的家(目录)会合并在一起。 +使用 Git 管理我的常用文件,不仅使我在不同设备上的生活更加便利。我知道我拥有所有配置和实用程序脚本的完整历史记录,这会鼓励我尝试新的想法,因为如果结果变得 _很糟糕_,则很容易回滚我的更改。Git 曾将我从在 `.bashrc` 文件中一个欠考虑的 `umask` 设置中解救出来、从深夜对包管理脚本的拙劣添加中解救出来、从当时看似很酷的 [rxvt][11] 配色方案的修改中解救出来,也许还有其他一些错误。在家目录中尝试 Git 吧,因为这些提交会让家目录融合在一起。 -------------------------------------------------------------------------------- @@ -118,7 +116,7 @@ via: https://opensource.com/article/21/4/git-home 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe92594d4afce25a10e7b5bab65d6334c23d035d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 09:54:05 +0800 Subject: [PATCH 183/307] PUB @stevenzdg988 https://linux.cn/article-13313-1.html --- .../20210405 7 Git tips for managing your home directory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210405 7 Git tips for managing your home directory.md (99%) diff --git a/translated/tech/20210405 7 Git tips for managing your home directory.md b/published/20210405 7 Git tips for managing your home directory.md similarity index 99% rename from translated/tech/20210405 7 Git tips for managing your home directory.md rename to published/20210405 7 Git tips for managing your home directory.md index 2ea2141134..67d8a3ceea 100644 --- a/translated/tech/20210405 7 Git tips for managing your home directory.md +++ b/published/20210405 7 Git tips for managing your home directory.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13313-1.html) 7个管理家目录的 Git 技巧 ====== From 70901f10de3ef855c6a7dc6c89e40d87415037f2 Mon Sep 17 00:00:00 2001 From: cooljelly Date: Tue, 20 Apr 2021 10:24:13 +0800 Subject: [PATCH 184/307] translating by cooljelly --- ...10104 Network address translation part 1 - packet tracing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210104 Network address translation part 1 - packet tracing.md b/sources/tech/20210104 Network address translation part 1 - packet tracing.md index 850b4f9e1c..1a2b7b92cb 100644 --- a/sources/tech/20210104 Network address translation part 1 - packet tracing.md +++ b/sources/tech/20210104 Network address translation part 1 - packet tracing.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (cooljelly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f98a28abeb4c2c2e20df4862d71fef2c6f57d503 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Tue, 20 Apr 2021 10:34:35 +0800 Subject: [PATCH 185/307] Update 20210308 Cast your Android device with a Raspberry Pi.md --- ...your Android device with a Raspberry Pi.md | 76 ++++++++++--------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md index 218bdb488e..c9527e687e 100644 --- a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md @@ -2,34 +2,36 @@ [#]: via: (https://opensource.com/article/21/3/android-raspberry-pi) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (RiaXu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) -Cast your Android device with a Raspberry Pi +使用树莓派投射你的安卓设备 ====== -Use Scrcpy to turn your phone screen into an app running alongside your -applications on a Raspberry Pi or any other Linux-based device. +使用Scrcpy可以把你的手机屏幕变成一个应用,与在树莓派或任何其他基于Linux的设备上的应用一起运行。 ![A person looking at a phone][1] -It's hard to stay away from the gadgets we use on a daily basis. In the hustle and bustle of modern life, I want to make sure I don't miss out on the important notifications from friends and family that pop up on my phone screen. I'm also busy and do not want to get lost in distractions, and picking up a phone and replying to messages tends to be distracting. +要远离我们日常使用的电子产品是很难的。在熙熙攘攘的现代生活中,我想确保我不会错过手机屏幕上弹出的来自朋友和家人的重要信息。我很忙而且不希望迷失在令人分心的事情中,但是拿起手机并且恢复信息往往会使我分心。 -To further complicate matters, there are a lot of devices out there. Luckily, most of them, from powerful workstations to laptops and even the humble Raspberry Pi, can run Linux. Because they run Linux, almost every solution I find for one device is a perfect fit for the others. -### One size fits all +更糟糕的是,还有很多其他的设备。幸运地是,大多数的设备(从功能强大的笔记本电脑到甚至不起眼的树莓派)都可以运行Linux。因为它们运行Linux,所以我找到的解决方案几乎都适用于其他设备。 -I wanted a way to unify the different sources of data in my life on whatever screen I am staring at. -I decided to solve this problem by copying my phone's screen onto my computer. In essence, I made my phone into an app running alongside all of my other applications. This helps me keep my attention on my desktop, prevents me from mentally wandering away, and makes it easier for me to reply to urgent notifications. +### 万全之策 -Sound appealing? Here's how you can do it too. +我想要一种无论我使用什么屏幕,都能统一我生活中不同来源的数据的方法。 -### Set up Scrcpy +我决定通过把手机屏幕复制到电脑上来解决这个问题。本质上,我把手机变成了一个应用,可以和其他所有程序运行在一起。这个有助于我将注意力集中在桌面上,防止我走神,并使我更容易回复紧急通知。 -[Scrcpy][2], commonly known as Screen Copy, is an open source screen-mirroring tool that displays and controls Android devices from Linux, Windows, or macOS. Communication between the Android device and the computer is primarily done over a USB connection and Android Debug Bridge (ADB). It uses TCP/IP and does not require any root access. +听起来有吸引力吗?你也可以这样做。 -Scrcpy's setup and configuration are very easy. If you're running Fedora, you can install it from a Copr repository: +### 设置Scrcpy + +[Scrcpy][2], 通常被称为屏幕复制(Screen Copy),是一个开源屏幕镜像工具,它可以在Linux、Windows或者MacOS上显示和控制安卓设备。安卓设备和计算机之间的通信主要是通过USB连接和安卓调试桥(Android Debug Bridge, ADB)。它使用TCP/IP,且不需要root权限访问。 + + +Scrcpy的设置和配置非常简单。如果你正在运行Fedora,你可以从Copr仓库安装它: ``` @@ -37,32 +39,32 @@ $ sudo dnf copr enable zeno/scrcpy $ sudo dnf install scrcpy -y ``` -On Debian or Ubuntu: +在Debian或者Ubuntu上: ``` `$ sudo apt install scrcpy` ``` -You can also compile scrcpy yourself. It doesn't take long to build, even on a Raspberry Pi, using the instructions on [scrcpy's GitHub page][3]. +你也可以自己编译Scrcpy。即使是在树莓派上,使用[Scrcpy的Github主页][3]上的说明来构建也不需要很长时间。 -### Set up the phone +### 设置手机 -Once scrcpy is installed, you must enable USB debugging and authorize each device (your Raspberry Pi, laptop, or workstation) as a trusted controller. +Scrcpy安装好后,你必须启用USB调试并授权每个设备(你的树莓派、笔记本电脑或者工作站)为受信任的控制器。 -Open the **Settings** app on your Android and scroll down to **Developer options.** If Developer options is not activated, follow Android's [instructions to unlock it][4]. +打开安卓上的**设置**应用程序。如果**开发者选项**没有被激活,按照安卓的[说明来解锁它][4]。 -Next, enable **USB debugging**. +接下来,启用**USB调试**。 ![Enable USB Debugging option][5] (Sudeshna Sur, [CC BY-SA 4.0][6]) -Then connect the phone to your Raspberry Pi or laptop (or whatever device you're using) over USB and set the mode to [PTP][7], if that's an option. If your phone doesn't use PTP, set the mode your phone uses for transferring files (rather than, for instance, serving as a tethering or MIDI device). +然后通过USB将手机连接到你的树莓派或者笔记本电脑(或者你正在使用的任何设备),如果可以选择的话,将模式设置为[PTP][7]。如果你的手机不能使用PTP,将你的手机设置为用于传输文件的模式(而不是,如,作为一个捆绑或者MIDI设备)。 -Your phone will probably prompt you to authorize your computer, identified by its RSA fingerprint. You only have to do this the first time you connect; after that, your phone will recognize and trust your computer. +你的手机可能会提示你授权你的电脑,这个是会通过它的RSA指纹进行识别的。你只需要在你第一次连接的时候操作即可,在之后你的手机会识别并信任你的计算机。 -Confirm the setting with the `lsusb` command: +使用`lsusb`命令确认设置: ``` @@ -77,53 +79,53 @@ Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` -Then execute `$ scrcpy` to launch it with the default settings. +然后执行`$scrcpy`在默认设置下运行。 ![Scrcpy running on a Raspberry Pi][8] (Opensource.com, [CC BY-SA 4.0][6]) -Performance and responsiveness vary depending on what device you're using to control your mobile. On a Pi, some of the animations can be slow, and even the response sometimes lags. Scrcpy provides an easy fix for this: Reducing the bitrate and resolution of the image scrcpy displays makes it easier for your computer to keep up. Do this with: +性能和响应能力取决于你使用什么设备来控制你的手机。在一个派上,一些动画可能会变慢,甚至有时候会响应滞后。Scrcpy提供了一个简单的解决办法:降低scrcpy显示的图像的位速率和分辨率使得你的计算机能够容易显示动画。使用以下命令来实现: ``` `$ scrcpy --bit-rate 1M --max-size 800` ``` -Try different values to find the one you prefer. To make it easier to type, once you've settled on a command, consider [making your own Bash alias][9]. +尝试不同的值来找到一个适合你的值。为了使键入更方便,在选定一个命令之后,可以考虑[创建自己的Bash别名][9]。 -### Cut the cord +### 冲破束缚 -Once scrcpy is running, you can even connect your mobile and your computer over WiFi. The scrcpy installation process also installs `adb`, a command to communicate with Android devices. Scrcpy also uses this command to communicate with your device and `adb` can connect over TCP/IP. +一旦Scrcpy开始运行,你甚至可以通过WIFI连接你的手机和计算机。Scrcpy安装过程也会安装`adb`,它是一个完成安卓设备之间通信的命令。Scrcpy也可以使用这个命令与设备通信,`adb`可以通过TCP/IP连接。 ![Scrcpy running on a computer][10] (Sudeshna Sur, [CC BY-SA 4.0][6]) -To try it, make sure your phone is connected over WiFi on the same wireless network your computer is using. Do NOT disconnect your phone from USB yet! +试试吧,请确保你的手机通过WIFI连在与你的计算机所使用的相同的无线网络上。依然不要断开你的手机与USB的连接! -Next, get your phone's IP address by navigating to **Settings** and selecting **About phone**. Look at the **Status** option to get your address. It usually starts with 192.168 or 10. +接下来,通过手机中的**设置**,选择**关于手机**来获取你手机的IP地址。查看**状态**选项来获得你的地址。它通常是192.168或者10开头。 -Alternately, you can get your mobile's IP address using `adb`: +或者,你也可以使用`adb`来获得你手机的IP地址: ``` $ adb shell ip route | awk '{print $9}' -To connect to your device over WiFi, you must enable TCP/IP connections. This, you must do through the adb command: +为了通过WIFI连接你的设备,你必须打开TCP/IP连接。也就是说你必须通过adb命令: $ adb tcpip 5555 -Now you can disconnect your mobile from USB. -Whenever you want to connect over WiFi, first connect to the mobile with the command adb connect. For instance, assuming my mobile's IP address is 10.1.1.22, the command is: +现在你可以断开手机和USB的连接了。 +任何你想通过WIFI连接的时候,首先需要通过adb命令连接你的手机。例如,假设我的手机IP地址是10.1.1.22,命令如下: $ adb connect 10.1.1.22:5555 ``` -Once it's connected, you can run scrcpy as usual. +连接好之后,你就可以像往常一样运行Scrcpy了。 -### Remote control +### 远程控制 -Scrcpy is easy to use. You can try it in a terminal or as [a GUI application][11]. +Scrcpy很容易使用。你可以在终端或者[一个图形界面应用][11]中尝试它。 -Do you use another screen-mirroring application? If so, let us know about it in the comments. +你是否在使用另一个屏幕镜像?如果有的话,请在评论中告诉我们吧。 -------------------------------------------------------------------------------- From 9806ea3b8a4d6ece71941ab5046e823290eb3ce7 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Tue, 20 Apr 2021 10:35:21 +0800 Subject: [PATCH 186/307] Rename sources/tech/20210308 Cast your Android device with a Raspberry Pi.md to translated/tech/20210308 Cast your Android device with a Raspberry Pi.md --- .../tech/20210308 Cast your Android device with a Raspberry Pi.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210308 Cast your Android device with a Raspberry Pi.md (100%) diff --git a/sources/tech/20210308 Cast your Android device with a Raspberry Pi.md b/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md similarity index 100% rename from sources/tech/20210308 Cast your Android device with a Raspberry Pi.md rename to translated/tech/20210308 Cast your Android device with a Raspberry Pi.md From 0e26858497c8053a783543e019324fbb4727037f Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Tue, 20 Apr 2021 12:05:04 +0800 Subject: [PATCH 187/307] translating by DCOLIVERSUN --- ...Something bugging you in Fedora Linux- Let-s get it fixed.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md index 312a0c4b1b..bf3bc428bd 100644 --- a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (DCOLIVERSUN) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0fd3859204642b6d7c4e733a2137df9f09063a45 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 20 Apr 2021 13:23:47 +0800 Subject: [PATCH 188/307] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...orum Software That You Can Deploy on Your Linux Servers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md index 7f9aa7f892..431f3041e2 100644 --- a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ b/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -179,7 +179,7 @@ via: https://itsfoss.com/open-source-forum-software/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1a47a36ea6c0fcc287d98ca97a8294a2318ed35b Mon Sep 17 00:00:00 2001 From: tt67wq Date: Tue, 20 Apr 2021 14:46:20 +0800 Subject: [PATCH 189/307] translate done: 20200617 How to handle dynamic and static libraries in Linux.md --- ...e dynamic and static libraries in Linux.md | 298 ----------------- ...e dynamic and static libraries in Linux.md | 299 ++++++++++++++++++ 2 files changed, 299 insertions(+), 298 deletions(-) delete mode 100644 sources/tech/20200617 How to handle dynamic and static libraries in Linux.md create mode 100644 translated/tech/20200617 How to handle dynamic and static libraries in Linux.md diff --git a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md b/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md deleted file mode 100644 index 24cce91127..0000000000 --- a/sources/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ /dev/null @@ -1,298 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (tt67wq) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to handle dynamic and static libraries in Linux) -[#]: via: (https://opensource.com/article/20/6/linux-libraries) -[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) - -How to handle dynamic and static libraries in Linux -====== -Knowing how Linux uses libraries, including the difference between -static and dynamic linking, can help you fix dependency problems. -![Hand putting a Linux file folder into a drawer][1] - -Linux, in a way, is a series of static and dynamic libraries that depend on each other. For new users of Linux-based systems, the whole handling of libraries can be a mystery. But with experience, the massive amount of shared code built into the operating system can be an advantage when writing new applications. - -To help you get in touch with this topic, I prepared a small [application example][2] that shows the most common methods that work on common Linux distributions (these have not been tested on other systems). To follow along with this hands-on tutorial using the example application, open a command prompt and type: - - -``` -$ git clone -$ cd library_sample/ -$ make -cc -c main.c -Wall -Werror -cc -c libmy_static_a.c -o libmy_static_a.o -Wall -Werror -cc -c libmy_static_b.c -o libmy_static_b.o -Wall -Werror -ar -rsv libmy_static.a libmy_static_a.o libmy_static_b.o -ar: creating libmy_static.a -a - libmy_static_a.o -a - libmy_static_b.o -cc -c -fPIC libmy_shared.c -o libmy_shared.o -cc -shared -o libmy_shared.so libmy_shared.o -$ make clean -rm *.o -``` - -After executing these commands, these files should be added to the directory (run `ls` to see them): - - -``` -my_app -libmy_static.a -libmy_shared.so -``` - -### About static linking - -When your application links against a static library, the library's code becomes part of the resulting executable. This is performed only once at linking time, and these static libraries usually end with a `.a` extension. - -A static library is an archive ([ar][3]) of object files. The object files are usually in the ELF format. ELF is short for [Executable and Linkable Format][4], which is compatible with many operating systems. - -The output of the `file` command tells you that the static library `libmy_static.a` is the `ar` archive type: - - -``` -$ file libmy_static.a -libmy_static.a: current ar archive -``` - -With `ar -t`, you can look into this archive; it shows two object files: - - -``` -$ ar -t libmy_static.a -libmy_static_a.o -libmy_static_b.o -``` - -You can extract the archive's files with `ar -x `. The extracted files are object files in ELF format: - - -``` -$ ar -x libmy_static.a -$ file libmy_static_a.o -libmy_static_a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped -``` - -### About dynamic linking - -Dynamic linking means the use of shared libraries. Shared libraries usually end with `.so` (short for "shared object"). - -Shared libraries are the most common way to manage dependencies on Linux systems. These shared resources are loaded into memory before the application starts, and when several processes require the same library, it will be loaded only once on the system. This feature saves on memory usage by the application. - -Another thing to note is that when a bug is fixed in a shared library, every application that references this library will profit from it. This also means that if the bug remains undetected, each referencing application will suffer from it (if the application uses the affected parts). - -It can be very hard for beginners when an application requires a specific version of the library, but the linker only knows the location of an incompatible version. In this case, you must help the linker find the path to the correct version. - -Although this is not an everyday issue, understanding dynamic linking will surely help you in fixing such problems. - -Fortunately, the mechanics for this are quite straightforward. - -To detect which libraries are required for an application to start, you can use `ldd`, which will print out the shared libraries used by a given file: - - -``` -$ ldd my_app -        linux-vdso.so.1 (0x00007ffd1299c000) -        libmy_shared.so => not found -        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000) -        /lib64/ld-linux-x86-64.so.2 (0x00007f56b8881000) -``` - -Note that the library `libmy_shared.so` is part of the repository but is not found. This is because the dynamic linker, which is responsible for loading all dependencies into memory before executing the application, cannot find this library in the standard locations it searches. - -Errors associated with linkers finding incompatible versions of common libraries (like `bzip2`, for example) can be quite confusing for a new user. One way around this is to add the repository folder to the environment variable `LD_LIBRARY_PATH` to tell the linker where to look for the correct version. In this case, the right version is in this folder, so you can export it: - - -``` -$ LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH -$ export LD_LIBRARY_PATH -``` - -Now the dynamic linker knows where to find the library, and the application can be executed. You can rerun `ldd` to invoke the dynamic linker, which inspects the application's dependencies and loads them into memory. The memory address is shown after the object path: - - -``` -$ ldd my_app -        linux-vdso.so.1 (0x00007ffd385f7000) -        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000) -        /lib64/ld-linux-x86-64.so.2 (0x00007f3fad408000) -``` - -To find out which linker is invoked, you can use `file`: - - -``` -$ file my_app -my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=26c677b771122b4c99f0fd9ee001e6c743550fa6, for GNU/Linux 3.2.0, not stripped -``` - -The linker `/lib64/ld-linux-x86–64.so.2` is a symbolic link to `ld-2.30.so`, which is the default linker for my Linux distribution: - - -``` -$ file /lib64/ld-linux-x86-64.so.2 -/lib64/ld-linux-x86-64.so.2: symbolic link to ld-2.31.so -``` - -Looking back to the output of `ldd`, you can also see (next to `libmy_shared.so`) that each dependency ends with a number (e.g., `/lib64/libc.so.6`). The usual naming scheme of shared objects is: - - -``` -`**lib** XYZ.so **.** . ****` -``` - -On my system, `libc.so.6` is also a symbolic link to the shared object `libc-2.30.so` in the same folder: - - -``` -$ file /lib64/libc.so.6 -/lib64/libc.so.6: symbolic link to libc-2.31.so -``` - -If you are facing the issue that an application will not start because the loaded library has the wrong version, it is very likely that you can fix this issue by inspecting and rearranging the symbolic links or specifying the correct search path (see "The dynamic loader: ld.so" below). - -For more information, look on the [`ldd` man page][5]. - -#### Dynamic loading - -Dynamic loading means that a library (e.g., a `.so` file) is loaded during a program's runtime. This is done using a certain programming scheme. - -Dynamic loading is applied when an application uses plugins that can be modified during runtime. - -See the [`dlopen` man page][6] for more information. - -#### The dynamic loader: ld.so - -On Linux, you mostly are dealing with shared objects, so there must be a mechanism that detects an application's dependencies and loads them into memory. - -`ld.so` looks for shared objects in these places in the following order: - - 1. The relative or absolute path in the application (hardcoded with the `-rpath` compiler option on GCC) - 2. In the environment variable `LD_LIBRARY_PATH` - 3. In the file `/etc/ld.so.cache` - - - -Keep in mind that adding a library to the systems library archive `/usr/lib64` requires administrator privileges. You could copy `libmy_shared.so` manually to the library archive and make the application work without setting `LD_LIBRARY_PATH`: - - -``` -unset LD_LIBRARY_PATH -sudo cp libmy_shared.so /usr/lib64/ -``` - -When you run `ldd`, you can see the path to the library archive shows up now: - - -``` -$ ldd my_app -        linux-vdso.so.1 (0x00007ffe82fab000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000) -        /lib64/ld-linux-x86-64.so.2 (0x00007f0a96401000) -``` - -### Customize the shared library at compile time - -If you want your application to use your shared libraries, you can specify an absolute or relative path during compile time. - -Modify the makefile (line 10) and recompile the program by invoking `make -B` . Then, the output of `ldd` shows `libmy_shared.so` is listed with its absolute path. - -Change this: - - -``` -`CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd)` -``` - -To this (be sure to edit the username): - - -``` -`CFLAGS =/home/stephan/library_sample/libmy_shared.so` -``` - -Then recompile: - - -``` -`$ make` -``` - -Confirm it is using the absolute path you set, which you can see on line 2 of the output: - - -``` -$ ldd my_app -    linux-vdso.so.1 (0x00007ffe143ed000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000) -        /home/stephan/library_sample/libmy_shared.so (0x00007fe509268000) -        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000) -        /lib64/ld-linux-x86-64.so.2 (0x00007fe50928e000) -``` - -This is a good example, but how would this work if you were making a library for others to use? New library locations can be registered by writing them to `/etc/ld.so.conf` or creating a `.conf` file containing the location under `/etc/ld.so.conf.d/`. Afterward, `ldconfig` must be executed to rewrite the `ld.so.cache` file. This step is sometimes necessary after you install a program that brings some special shared libraries with it. - -See the [`ld.so` man page][7] for more information. - -### How to handle multiple architectures - -Usually, there are different libraries for the 32-bit and 64-bit versions of applications. The following list shows their standard locations for different Linux distributions: - -**Red Hat family** - - * 32 bit: `/usr/lib` - * 64 bit: `/usr/lib64` - - - -**Debian family** - - * 32 bit: `/usr/lib/i386-linux-gnu` - * 64 bit: `/usr/lib/x86_64-linux-gnu` - - - -**Arch Linux family** - - * 32 bit: `/usr/lib32` - * 64 bit: `/usr/lib64` - - - -[**FreeBSD**][8] (technical not a Linux distribution) - - * 32bit: `/usr/lib32` - * 64bit: `/usr/lib` - - - -Knowing where to look for these key libraries can make broken library links a problem of the past. - -While it may be confusing at first, understanding dependency management in Linux libraries is a way to feel in control of the operating system. Run through these steps with other applications to become familiar with common libraries, and continue to learn how to fix any library challenges that could come up along your way. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/6/linux-libraries - -作者:[Stephan Avenwedde][a] -选题:[lujun9972][b] -译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/hansic99 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) -[2]: https://github.com/hANSIc99/library_sample -[3]: https://en.wikipedia.org/wiki/Ar_%28Unix%29 -[4]: https://linuxhint.com/understanding_elf_file_format/ -[5]: https://www.man7.org/linux/man-pages/man1/ldd.1.html -[6]: https://www.man7.org/linux/man-pages/man3/dlopen.3.html -[7]: https://www.man7.org/linux/man-pages/man8/ld.so.8.html -[8]: https://opensource.com/article/20/5/furybsd-linux diff --git a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md new file mode 100644 index 0000000000..bc951369bb --- /dev/null +++ b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md @@ -0,0 +1,299 @@ +[#]: collector: (lujun9972) +[#]: translator: (tt67wq) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to handle dynamic and static libraries in Linux) +[#]: via: (https://opensource.com/article/20/6/linux-libraries) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) + +怎样在 Linux 中处理动态和静态库 +====== +了解 Linux 如何使用库,包括静态库和动态库的差别,有助于你解决依赖问题。![Hand putting a Linux file folder into a drawer][1] + +Linux 从某种意义上来说就是一堆相互依赖的静态和动态库。对于 Linux 系统新手来说,库的整个处理过程简直是个迷。但对有经验的人来说,被构建进操作系统的大量共享代码对于编写新应用来说却是个优点。 + + +为了让你熟悉这个话题,我准备了一个小巧的[应用例子 ][2] 来展示在常用 Linux 发行版(在其他操作系统上未验证)上最常用的可行方法。为了用这个例子来跟上这个需要动手的教程,打开命令行输入: + + +``` +$ git clone +$ cd library_sample/ +$ make +cc -c main.c -Wall -Werror +cc -c libmy_static_a.c -o libmy_static_a.o -Wall -Werror +cc -c libmy_static_b.c -o libmy_static_b.o -Wall -Werror +ar -rsv libmy_static.a libmy_static_a.o libmy_static_b.o +ar: creating libmy_static.a +a - libmy_static_a.o +a - libmy_static_b.o +cc -c -fPIC libmy_shared.c -o libmy_shared.o +cc -shared -o libmy_shared.so libmy_shared.o +$ make clean +rm *.o +``` + +当执行完这些命令,这些文件应当被添加进目录下(执行 `ls` 来查看): + + +``` +my_app +libmy_static.a +libmy_shared.so +``` + +### 关于静态链接 + +当你的应用链接了一个静态库,这个库的代码就变成了可执行结果的一部分。这个动作只在链接过程中执行一次,这些静态库通常以 `.a` 扩展符结尾。 + +静态库是多个对象文件的打包。这些目标文件通常是 ELF 格式的。ELF 是 [Executable and Linkable Format][4] 的简写,可以兼容多个操作系统。 + +`file` 命令的输出告诉你静态库 `libmy_static.a` 是 `ar` 格式的压缩文件类型。 + + +``` +$ file libmy_static.a +libmy_static.a: current ar archive +``` + +使用 `ar -t`,你可以看到压缩包内部;它展示了两个目标文件: + + +``` +$ ar -t libmy_static.a +libmy_static_a.o +libmy_static_b.o +``` + +你可以用 `ax -x ` 命令来提取压缩包的文件。被提出的都是 ELF 格式的对象文件: + + +``` +$ ar -x libmy_static.a +$ file libmy_static_a.o +libmy_static_a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped +``` + +### 关于动态链接 + +动态链接的指的是使用共享库。共享库通常以 `.so` 的扩展符结尾 ("shared object" 的简写)。 + +共享库是 Linux 系统中依赖管理最常用的方法。这些共享库在应用启动前被载入内存,当多个应用都需要同一个库时,这个库在系统中只会被加载一次。这个特点减少了应用的内存占用。 + +另外一个值得注意的点是,当一个共享库的 bug 被修复后,所有引用了这个库的应用都会受益。这也意味着,如果一个 bug 还没被发现,那所有相关的应用都会遭受这个 bug 影响(如果这个应用使用了受影响的部分)。 + +当一个应用需要某个特定版本的库,但是链接器只知道某个不兼容版本的位置,对于初学者来说这个问题非常棘手。在这个场景下,你必须帮助链接器找到正确版本的路径。 + +尽管这不是一个需要每天处理的问题,但是理解动态链接的原理总是有助于你修复类似的问题。 + +幸运的是,动态链接的机制其实非常简洁明了。 + +为了检查一个应用在启动时需要哪些库,你可以使用 `ldd` 命令,它会打印出给定文件所需的动态库: + + +``` +$ ldd my_app +        linux-vdso.so.1 (0x00007ffd1299c000) +        libmy_shared.so => not found +        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000) +        /lib64/ld-linux-x86-64.so.2 (0x00007f56b8881000) +``` + +注意到 `libmy_shared.so` 库是代码仓库的一部分但是没有被找到。这是因为负责在应用启动之前将所有依赖加载进内存的动态链接器没有在它搜索的标准路径下找到这个库。 + +对新手来说,与常用库(例如 `bizp2`) 版本不兼容相关的问题往往十分令人困惑。一种方法是把该仓库的路径加入到环境变量 `LD_LIBRARY_PATH` 中来告诉链接器去哪里找到正确的版本。在本例中,正确的版本就在这个目录下,所以你可以导出它至环境变量: + + +``` +$ LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH +$ export LD_LIBRARY_PATH +``` + +现在动态链接器知道去哪找库了,应用也可以执行了。你可以再次执行 `ldd` 去调用动态链接器,它会检查应用的依赖然后加载进内存。内存地址会在对象路径后展示: + + +``` +$ ldd my_app +        linux-vdso.so.1 (0x00007ffd385f7000) +        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000) +        /lib64/ld-linux-x86-64.so.2 (0x00007f3fad408000) +``` + +想知道哪个链接器被调用了,你可以用 `file` 命令: + + + +``` +$ file my_app +my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=26c677b771122b4c99f0fd9ee001e6c743550fa6, for GNU/Linux 3.2.0, not stripped +``` + +链接器 `/lib64/ld-linux-x86–64.so.2` 是一个指向 `ld-2.30.so` 的软链接,它也是我的 Linux 发行版的默认链接器: + + +``` +$ file /lib64/ld-linux-x86-64.so.2 +/lib64/ld-linux-x86-64.so.2: symbolic link to ld-2.31.so +``` + +回头看看 `ldd` 命令的输出,你还可以看到(在 `libmy_shared.so` 边上)每个依赖都以一个数字结尾(例如 `/lib64/libc.so.6`)。共享对象的常见命名格式为: + + +``` +`**lib** XYZ.so **.** . ****` +``` + +在我的系统中,`libc.so.6` 也是指向同一目录下的共享对象 `libc-2.30.so` 的软链接。 + + +``` +$ file /lib64/libc.so.6 +/lib64/libc.so.6: symbolic link to libc-2.31.so +``` + +如果你正在面对一个应用因为加载库的版本不对导致无法启动的问题,有很大可能你可以通过检查整理这些软链接或者确定正确的搜索路径(查看下方"动态链接器:ld.so") 来解决这个问题。 + +更为详细的信息请查看 [`ldd`man 手册 ][5] + +#### 动态加载 + +动态加载的意思是一个库(例如一个 `.so` 文件)在程序的运行时被加载。这是使用某种特定的编程方法实现的。 + +当一个应用使用运行时可编辑的插件时,动态加载会生效。 + +查看 [`dlopen`man 手册 ][6] 获取更多信息。 + +#### 动态加载器:ld.so + +在 Linux 系统中,你很大可能正在跟共享库打交道,所以必须有个机制来检测一个应用的依赖并将其加载进内存中。 + + +`ld.so` 按以下顺序在这些地方寻找共享对象: + + 1。应用的绝对路径或相对路径下 (GCC 编译器用 `-rpath` 选项来硬编码) + 2。环境变量 `LD_LIBRARY_PATH` + 3。`/etc/ld.so.cache` 文件 + + +需要记住的是,将一个库加到系统归档 `/usr/lib64` 中需要管理员权限。你可以手动拷贝 `libmy_shared.so` 至库归档中来让应用可用而避免设置 `LD_LIBRARY_PATH`。 + + +``` +unset LD_LIBRARY_PATH +sudo cp libmy_shared.so /usr/lib64/ +``` + + +当你运行 `ldd` 时,你现在可以看到归档库的路径被展示出来: + + +``` +$ ldd my_app +        linux-vdso.so.1 (0x00007ffe82fab000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000) +        /lib64/ld-linux-x86-64.so.2 (0x00007f0a96401000) +``` + +### 在编译时定制共享库 + +如果你想你的应用使用你的共享库,你可以在编译时指定一个绝对或相对路径。 + +编辑 makefile( 第 10 行)然后通过 `make -B` 来重新编译程序。然后 `ldd` 输出显示 `libmy_shared.so` 和它的绝对路径一起被列出来了。 + +把这个: + + +``` +`CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd)` +``` + +改成这个(记得修改用户名): + + +``` +`CFLAGS =/home/stephan/library_sample/libmy_shared.so` +``` + +然后重新编译: + + +``` +`$ make` +``` + +确认下它正在使用你设定的绝对路径,你可以在输出的第二行看到: + + +``` +$ ldd my_app +    linux-vdso.so.1 (0x00007ffe143ed000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000) +        /home/stephan/library_sample/libmy_shared.so (0x00007fe509268000) +        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000) +        /lib64/ld-linux-x86-64.so.2 (0x00007fe50928e000) +``` + +这是个不错的例子,但是如果你在编写给其他人用的库,它是怎样工作的呢?新库的路径可以通过写入 `/etc/ld.so.conf` 或是在 `/etc/ld.so.conf.d/` 目录下创建一个包含路径的 `.conf` 文件来注册至系统。之后,你必须执行 `ldconfig` 命令来覆写 `ld.so.cache` 文件。这一步有时候在你装了携带特殊的共享库的程序来说是不可省略的。 + +查看 [`ld.so` 的 man 手册 ][7] 获取更多详细信息。 + +### 怎样处理多种架构 + +通常来说,32 位和 64 位版本的应用有不同的库。下面列表展示了不同 Linux 发行版库的标准路径: + +**红帽家族** + + * 32 位:`/usr/lib` + * 64 位:`/usr/lib64` + + + +**Debian 家族** + + * 32 位:`/usr/lib/i386-linux-gnu` + * 64 位:`/usr/lib/x86_64-linux-gnu` + + + +**Arch Linux 家族** + + * 32 位:`/usr/lib32` + * 64 位:`/usr/lib64` + + + +[**FreeBSD**][8] (技术上来说不算 Linux 发行版) + + * 32 位:`/usr/lib32` + * 64 位:`/usr/lib` + + + +知道去哪找这些关键库可以让库链接失效的问题成为历史。 + +虽然刚开始会有点困惑,但是理解 Linux 库的依赖管理是一种对操作系统掌控感的表现。用其他应用按这些步骤执行下来增加常用库的熟练度,然后继续学习怎样解决任何你可能遇到的库的挑战。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/6/linux-libraries + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[tt67wq](https://github.com/tt67wq) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://github.com/hANSIc99/library_sample +[3]: https://en.wikipedia.org/wiki/Ar_%28Unix%29 +[4]: https://linuxhint.com/understanding_elf_file_format/ +[5]: https://www.man7.org/linux/man-pages/man1/ldd.1.html +[6]: https://www.man7.org/linux/man-pages/man3/dlopen.3.html +[7]: https://www.man7.org/linux/man-pages/man8/ld.so.8.html +[8]: https://opensource.com/article/20/5/furybsd-linux From 74b07b40cb74dee7f44e98af44af3dc41d681690 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 16:24:29 +0800 Subject: [PATCH 190/307] PRF @RiaXu --- ...your Android device with a Raspberry Pi.md | 86 ++++++++----------- 1 file changed, 37 insertions(+), 49 deletions(-) diff --git a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md b/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md index c9527e687e..fc88271808 100644 --- a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md @@ -3,69 +3,63 @@ [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) [#]: translator: (RiaXu) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用树莓派投射你的安卓设备 +将你的安卓手机屏幕投射到 Linux ====== -使用Scrcpy可以把你的手机屏幕变成一个应用,与在树莓派或任何其他基于Linux的设备上的应用一起运行。 -![A person looking at a phone][1] -要远离我们日常使用的电子产品是很难的。在熙熙攘攘的现代生活中,我想确保我不会错过手机屏幕上弹出的来自朋友和家人的重要信息。我很忙而且不希望迷失在令人分心的事情中,但是拿起手机并且恢复信息往往会使我分心。 +> 使用 Scrcpy 可以把你的手机屏幕变成一个“应用”,与在树莓派或任何其他基于 Linux 的设备上的应用一起运行。 +![](https://img.linux.net.cn/data/attachment/album/202104/20/162346alpbh85xz26xcb5h.jpg) -更糟糕的是,还有很多其他的设备。幸运地是,大多数的设备(从功能强大的笔记本电脑到甚至不起眼的树莓派)都可以运行Linux。因为它们运行Linux,所以我找到的解决方案几乎都适用于其他设备。 +要远离我们日常使用的电子产品是很难的。在熙熙攘攘的现代生活中,我想确保我不会错过手机屏幕上弹出的来自朋友和家人的重要信息。我也很忙,不希望迷失在令人分心的事情中,但是拿起手机并且回复信息往往会使我分心。 +更糟糕的是,有很多的设备。幸运地是,大多数的设备(从功能强大的笔记本电脑到甚至不起眼的树莓派)都可以运行 Linux。因为它们运行的是 Linux,所以我为一种设置找到的解决方案几乎都适用于其他设备。 -### 万全之策 +### 普遍适用 我想要一种无论我使用什么屏幕,都能统一我生活中不同来源的数据的方法。 -我决定通过把手机屏幕复制到电脑上来解决这个问题。本质上,我把手机变成了一个应用,可以和其他所有程序运行在一起。这个有助于我将注意力集中在桌面上,防止我走神,并使我更容易回复紧急通知。 +我决定通过把手机屏幕复制到电脑上来解决这个问题。本质上,我把手机变成了一个“应用”,可以和我所有的其他程序运行在一起。这有助于我将注意力集中在桌面上,防止我走神,并使我更容易回复紧急通知。 听起来有吸引力吗?你也可以这样做。 -### 设置Scrcpy +### 设置 Scrcpy -[Scrcpy][2], 通常被称为屏幕复制(Screen Copy),是一个开源屏幕镜像工具,它可以在Linux、Windows或者MacOS上显示和控制安卓设备。安卓设备和计算机之间的通信主要是通过USB连接和安卓调试桥(Android Debug Bridge, ADB)。它使用TCP/IP,且不需要root权限访问。 - - -Scrcpy的设置和配置非常简单。如果你正在运行Fedora,你可以从Copr仓库安装它: +[Scrcpy][2] 俗称屏幕复制(Screen Copy),是一个开源的屏幕镜像工具,它可以在 Linux、Windows 或者 macOS 上显示和控制安卓设备。安卓设备和计算机之间的通信主要是通过 USB 连接和安卓调试桥Android Debug Bridge(ADB)。它使用 TCP/IP,且不需要 root 权限访问。 +Scrcpy 的设置和配置非常简单。如果你正在运行 Fedora,你可以从 COPR 仓库安装它: ``` $ sudo dnf copr enable zeno/scrcpy $ sudo dnf install scrcpy -y ``` -在Debian或者Ubuntu上: - +在 Debian 或者 Ubuntu 上: ``` -`$ sudo apt install scrcpy` +$ sudo apt install scrcpy ``` -你也可以自己编译Scrcpy。即使是在树莓派上,使用[Scrcpy的Github主页][3]上的说明来构建也不需要很长时间。 +你也可以自己编译 Scrcpy。即使是在树莓派上,按照 [Scrcpy 的 GitHub 主页][3] 上的说明来构建也不需要很长时间。 ### 设置手机 -Scrcpy安装好后,你必须启用USB调试并授权每个设备(你的树莓派、笔记本电脑或者工作站)为受信任的控制器。 +Scrcpy 安装好后,你必须启用 USB 调试并授权每个设备(你的树莓派、笔记本电脑或者工作站)为受信任的控制器。 -打开安卓上的**设置**应用程序。如果**开发者选项**没有被激活,按照安卓的[说明来解锁它][4]。 +打开安卓上的“设置”应用程序。如果“开发者选项”没有被激活,按照安卓的 [说明来解锁它][4]。 -接下来,启用**USB调试**。 +接下来,启用“USB 调试”。 ![Enable USB Debugging option][5] -(Sudeshna Sur, [CC BY-SA 4.0][6]) +然后通过 USB 将手机连接到你的树莓派或者笔记本电脑(或者你正在使用的任何设备),如果可以选择的话,将模式设置为 [PTP][7]。如果你的手机不能使用 PTP,将你的手机设置为用于传输文件的模式(而不是,作为一个叠接tethering或者 MIDI 设备)。 -然后通过USB将手机连接到你的树莓派或者笔记本电脑(或者你正在使用的任何设备),如果可以选择的话,将模式设置为[PTP][7]。如果你的手机不能使用PTP,将你的手机设置为用于传输文件的模式(而不是,如,作为一个捆绑或者MIDI设备)。 - -你的手机可能会提示你授权你的电脑,这个是会通过它的RSA指纹进行识别的。你只需要在你第一次连接的时候操作即可,在之后你的手机会识别并信任你的计算机。 - -使用`lsusb`命令确认设置: +你的手机可能会提示你授权你的电脑,这是通过它的 RSA 指纹进行识别的。你只需要在你第一次连接的时候操作即可,在之后你的手机会识别并信任你的计算机。 +使用 `lsusb` 命令确认设置: ``` $ lsusb @@ -79,53 +73,47 @@ Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub ``` -然后执行`$scrcpy`在默认设置下运行。 +然后执行 `scrcpy` 以默认设置运行。 ![Scrcpy running on a Raspberry Pi][8] -(Opensource.com, [CC BY-SA 4.0][6]) - -性能和响应能力取决于你使用什么设备来控制你的手机。在一个派上,一些动画可能会变慢,甚至有时候会响应滞后。Scrcpy提供了一个简单的解决办法:降低scrcpy显示的图像的位速率和分辨率使得你的计算机能够容易显示动画。使用以下命令来实现: - +性能和响应能力取决于你使用什么设备来控制你的手机。在树莓派派上,一些动画可能会变慢,甚至有时候会响应滞后。Scrcpy 提供了一个简单的解决办法:降低 Scrcpy 显示图像的位速率和分辨率使得你的计算机能够容易显示动画。使用以下命令来实现: ``` -`$ scrcpy --bit-rate 1M --max-size 800` +$ scrcpy --bit-rate 1M --max-size 800 ``` -尝试不同的值来找到一个适合你的值。为了使键入更方便,在选定一个命令之后,可以考虑[创建自己的Bash别名][9]。 +尝试不同的值来找到一个适合你的值。为了使键入更方便,在选定一个命令之后,可以考虑 [创建自己的 Bash 别名][9]。 -### 冲破束缚 +### 剪断连线 -一旦Scrcpy开始运行,你甚至可以通过WIFI连接你的手机和计算机。Scrcpy安装过程也会安装`adb`,它是一个完成安卓设备之间通信的命令。Scrcpy也可以使用这个命令与设备通信,`adb`可以通过TCP/IP连接。 +Scrcpy 开始运行后,你甚至可以通过 WiFi 连接你的手机和计算机。Scrcpy 安装过程也会安装 `adb`,它是一个与安卓设备通信的命令。Scrcpy 也可以使用这个命令与你的设备通信,`adb` 可以通过 TCP/IP 连接。 ![Scrcpy running on a computer][10] -(Sudeshna Sur, [CC BY-SA 4.0][6]) +要尝试的话,请确保你的手机通过 WiFi 连在与你的计算机所使用的相同的无线网络上。依然不要断开你的手机与 USB 的连接! -试试吧,请确保你的手机通过WIFI连在与你的计算机所使用的相同的无线网络上。依然不要断开你的手机与USB的连接! - -接下来,通过手机中的**设置**,选择**关于手机**来获取你手机的IP地址。查看**状态**选项来获得你的地址。它通常是192.168或者10开头。 - -或者,你也可以使用`adb`来获得你手机的IP地址: +接下来,通过手机中的“设置”,选择“关于手机”来获取你手机的 IP 地址。查看“状态”选项来获得你的地址。它通常是 192.168 或者 10 开头。 +或者,你也可以使用 `adb` 来获得你手机的IP地址: ``` $ adb shell ip route | awk '{print $9}' -为了通过WIFI连接你的设备,你必须打开TCP/IP连接。也就是说你必须通过adb命令: +To connect to your device over WiFi, you must enable TCP/IP connections. This, you must do through the adb command: $ adb tcpip 5555 -现在你可以断开手机和USB的连接了。 -任何你想通过WIFI连接的时候,首先需要通过adb命令连接你的手机。例如,假设我的手机IP地址是10.1.1.22,命令如下: +Now you can disconnect your mobile from USB. +Whenever you want to connect over WiFi, first connect to the mobile with the command adb connect. For instance, assuming my mobile's IP address is 10.1.1.22, the command is: $ adb connect 10.1.1.22:5555 ``` -连接好之后,你就可以像往常一样运行Scrcpy了。 +连接好之后,你就可以像往常一样运行 Scrcpy 了。 ### 远程控制 -Scrcpy很容易使用。你可以在终端或者[一个图形界面应用][11]中尝试它。 +Scrcpy 很容易使用。你可以在终端或者 [一个图形界面应用][11] 中尝试它。 -你是否在使用另一个屏幕镜像?如果有的话,请在评论中告诉我们吧。 +你是否在使用其它的屏幕镜像工具?如果有的话,请在评论中告诉我们吧。 -------------------------------------------------------------------------------- @@ -133,8 +121,8 @@ via: https://opensource.com/article/21/3/android-raspberry-pi 作者:[Sudeshna Sur][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) +译者:[ShuyRoy](https://github.com/ShuyRoy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e89832627c4411e1c344dff20c7ed1ca2fddaecf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 16:26:31 +0800 Subject: [PATCH 191/307] PUB @ShuyRoy https://linux.cn/article-13314-1.html --- ...20210308 Cast your Android device with a Raspberry Pi.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210308 Cast your Android device with a Raspberry Pi.md (98%) diff --git a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md b/published/20210308 Cast your Android device with a Raspberry Pi.md similarity index 98% rename from translated/tech/20210308 Cast your Android device with a Raspberry Pi.md rename to published/20210308 Cast your Android device with a Raspberry Pi.md index fc88271808..b41dd7f427 100644 --- a/translated/tech/20210308 Cast your Android device with a Raspberry Pi.md +++ b/published/20210308 Cast your Android device with a Raspberry Pi.md @@ -2,10 +2,10 @@ [#]: via: (https://opensource.com/article/21/3/android-raspberry-pi) [#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur) [#]: collector: (lujun9972) -[#]: translator: (RiaXu) +[#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13314-1.html) 将你的安卓手机屏幕投射到 Linux ====== From cfc4e9716127882f6d5d134b0558e0ace625f4a6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 22:13:13 +0800 Subject: [PATCH 192/307] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liweitianux 感谢您,完成了第一篇贡献! --- ...10410 5 signs you-re a groff programmer.md | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/translated/tech/20210410 5 signs you-re a groff programmer.md b/translated/tech/20210410 5 signs you-re a groff programmer.md index 8fd7d28acf..f63ca7fc8c 100644 --- a/translated/tech/20210410 5 signs you-re a groff programmer.md +++ b/translated/tech/20210410 5 signs you-re a groff programmer.md @@ -3,60 +3,64 @@ [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) [#]: translator: (liweitianux) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -你是 groff 程序员的 5 个标志 +groff 程序员的 5 个标志 ====== -学习 groff,一款老派的文本处理软件,类似于学习骑自行车。 -![Typewriter in the grass][1] -我第一次发现 Unix 系统是在 90 年代早期,当时我还在大学读本科。我太喜欢这个系统了,所以我将家里电脑上的 MS-DOS 也换成了 Linux 系统。 +> 学习一款老派的文本处理软件 groff,就像是学习骑自行车。 -在 90 年代早期至中期,Linux 所缺失的一个东西是字处理软件word processor。在其他桌面操作系统上,这是一套标准的办公软件,其中的字处理软件能让你轻松地编辑文本。我经常在 DOS 上使用字处理软件来撰写课程论文。直到 90 年代末,我都没能找到一款 Linux 原生的字处理软件。也直到那时,文字处理是我在第一台电脑上保留双启动的个别原因之一,那样我可以偶尔切换到 DOS 系统写论文。 +![](https://img.linux.net.cn/data/attachment/album/202104/20/221218y34lew4gewqw2xg2.jpg) -后来,我发现 Linux 提供了一款文字处理软件。GNU troff,一般称为 [groff][2],是经典的文本处理系统 troff 的一个现代实现。troff 是 typesetter roff 的简称,是 nroff 系统的改进版本,而 nroff 又是最初的 roff 系统的新实现。roff 表示快速印出run off,比如“快速印出”一份文档。 +我第一次发现 Unix 系统是在 20 世纪 90 年代早期,当时我还在大学读本科。我太喜欢这个系统了,所以我将家里电脑上的 MS-DOS 也换成了 Linux 系统。 + +在 90 年代早期至中期,Linux 所缺失的一个东西是字处理软件word processor。作为其他桌面操作系统的标准办公程序,字处理软件能让你轻松地编辑文本。我经常在 DOS 上使用字处理软件来撰写课程论文。直到 90 年代末,我都没能找到一款 Linux 原生的字处理软件。直到那时,文字处理是我在第一台电脑上保留双启动的少有的原因之一,那样我可以偶尔切换到 DOS 系统写论文。 + +后来,我发现 Linux 提供了一款文字处理软件:GNU troff,它一般称为 [groff][2],是经典的文本处理系统 troff 的一个现代实现。troff 是 “排版工快印typesetter roff” 的简称,是 nroff 系统的改进版本,而 nroff 又是最初的 roff 系统的新实现。roff 表示快速印出run off,比如“快速印出”一份文档。 利用文本处理系统,你在纯文本编辑器里编辑内容,通过macro或其他处理命令来添加格式。然后将文件输入文本处理系统,比如 groff,来生成适合打印的格式化输出。另一个知名的文本处理系统是 LaTeX,但是 groff 已经满足我的需求,而且足够简单。 -经过一点实践,我发现在 Linux 上使用 groff 来撰写课程论文与使用字处理软件一样容易。尽管我现在不再使用 groff 来写文档了,我依然记得它的那些宏和命令。如果你也是这样并且在那么多年之前学会了使用 groff 写作,你可能会认出这 5 个你是 groff 程序员的标志。 +经过一点实践,我发现在 Linux 上使用 groff 来撰写课程论文与使用字处理软件一样容易。尽管我现在不再使用 groff 来写文档了,我依然记得它的那些宏和命令。如果你也是这样并且在那么多年之前学会了使用 groff 写作,你可能会认出这 5 个 groff 程序员的标志。 -### 1\. 你有一个最喜欢的宏集 +### 1、你有一个喜欢的宏集 -输入由宏点缀的纯文本,你便能在 groff 里对文档进行格式化。groff 里的宏是行首为单个句点的短命令。例如:如果你想在输出里插入几行,宏命令 `.sp 2` 会添加两个空行。groff 还具有其他一些基本的宏,支持各种各样的格式化。 +输入由宏点缀的纯文本,你便能在 groff 里对文档进行格式化。groff 里的宏是行首为单个句点(`.`)的短命令。例如:如果你想在输出里插入几行,宏命令 `.sp 2` 会添加两个空行。groff 还具有其他一些基本的宏,支持各种各样的格式化。 -为了能让作者更容易地格式化文档,groff 还提供了不同的 _宏集macro set_,即一组能够让你以自己的方式格式化文档的宏的集合。我学会的第一个宏集是 `-me` 宏集。这个宏集的名称其实是 `e`,而且你在处理文件时使用 `-me` 选项来指定这个 `e` 宏集。 +为了能让作者更容易地格式化文档,groff 还提供了不同的 宏集macro set,即一组能够让你以自己的方式格式化文档的宏的集合。我学会的第一个宏集是 `-me` 宏集。这个宏集的名称其实是 `e`,你在处理文件时使用 `-me` 选项来指定这个 `e` 宏集。 -groff 还包含其他宏集。例如,`-man` 宏集以前是用于格式化 Unix 系统内置 _手册页manual page_ 的标准宏集,`-ms` 宏集经常用于格式化其他一些技术文档。如果你学会了使用 groff 写作,你可能有一个最喜欢的宏集。 +groff 还包含其他宏集。例如,`-man` 宏集以前是用于格式化 Unix 系统内置的 手册页manual page 的标准宏集,`-ms` 宏集经常用于格式化其他一些技术文档。如果你学会了使用 groff 写作,你可能有一个喜欢的宏集。 -### 2\. 你想专注于内容而非格式 +### 2、你想专注于内容而非格式 -使用 groff 写作的一个很好的特点是你能专注于你的 _内容_,而不用太担心它看起来会怎么样。对于技术作者而言这是一个很实用的特点。对专业作家来说,groff 是一个很好的、“不会分心”的写作环境。至少,你不必在意使用 groff `-T` 选项所支持的任何格式来交付内容,包括 PDF、PostScript、HTML、以及纯文本。不过,你无法直接从 groff 生成 LibreOffice ODT 文件或者 Word DOC 文件。 +使用 groff 写作的一个很好的特点是,你能专注于你的 _内容_,而不用太担心它看起来会怎么样。对于技术作者而言这是一个很实用的特点。对专业作家来说,groff 是一个很好的、“不会分心”的写作环境。至少,使用 groff `-T` 选项所支持的任何格式来交付内容时你不用担心,这包括 PDF、PostScript、HTML、以及纯文本。不过,你无法直接从 groff 生成 LibreOffice ODT 文件或者 Word DOC 文件。 -一旦你使用 groff 写作变得有信心之后,宏便开始 _消失_。用于格式化的宏变成了背景,而你纯粹地专注于眼前的文本内容。我已经使用 groff 写了足够多,以至于我甚至不再看见那些宏。也许,这就像写代码,而你的大脑随意换档,于是你就像计算机一样思考,看到的代码就是一组指令。对我而言,使用 groff 写作就像那样:我仅仅看到文本,而我的大脑将宏自动地翻译成格式。 +一旦你使用 groff 写作变得有信心之后,宏便开始 _消失_。用于格式化的宏变成了背景的一部分,而你纯粹地专注于眼前的文本内容。我已经使用 groff 写了足够多内容,以至于我甚至不再看见那些宏。也许,这就像写代码,而你的大脑随意换档,于是你就像计算机一样思考,看到的代码就是一组指令。对我而言,使用 groff 写作就像那样:我仅仅看到文本,而我的大脑将宏自动地翻译成格式。 -### 3\. 你喜欢怀旧复古的感觉 +### 3、你喜欢怀旧复古的感觉 当然,使用一个更典型的字处理软件来写你的文档可能更 _简单_,比如 LibreOffice Writer、甚至 Google Docs 或 Microsoft Word。而且对于某些种类的文档,桌面型字处理软件才是正确的选择。但是,如果你想要这种怀旧复古的感觉,使用 groff 写作很难被打败。 -我会承认我大部分的写作是用 LibreOffice Writer 完成的,它的表现很出色。但是当我渴望以一种怀旧复古的方式去做时,我会打开编辑器用 groff 来写文档。 +我承认,我的大部分写作是用 LibreOffice Writer 完成的,它的表现很出色。但是当我渴望以一种怀旧复古的方式去做时,我会打开编辑器用 groff 来写文档。 -### 4\. 你希望能到处使用它 +### 4、你希望能到处使用它 -groff 及其同类软件在几乎所有的 Unix 系统上都是一个标准软件包。此外,groff 宏不会随系统而变化。比如,`-me` 宏集在不同系统上都应该相同。因此,一旦你在一个系统上学会使用宏,你能在下一个系统上同样地使用它们。 +groff 及其同类软件在几乎所有的 Unix 系统上都是标准软件包。此外,groff 宏不会随系统而变化。比如,`-me` 宏集在不同系统上都应该相同。因此,一旦你在一个系统上学会使用宏,你能在下一个系统上同样地使用它们。 -另外,因为 groff 文档就是纯文本,所以你能使用任何你喜欢的编辑器来编辑文档。我喜欢使用 GNU Emacs 来编辑我的 groff 文档,但是你可能使用 GNOME Gedit、Vim、其他你[最喜欢的文本编辑器][3]。大部分编辑器会支持这样一种模式,其中 groff 宏会以不同的颜色高亮显示,帮助你在处理文件之前便能发现错误。 +另外,因为 groff 文档就是纯文本文档,所以你能使用任何你喜欢的编辑器来编辑文档。我喜欢使用 GNU Emacs 来编辑我的 groff 文档,但是你可能使用 GNOME Gedit、Vim、其他你 [最喜欢的文本编辑器][3]。大部分编辑器会支持这样一种模式,其中 groff 宏会以不同的颜色高亮显示,帮助你在处理文件之前便能发现错误。 -### 5\. 你使用 -me 写了这篇文章 +### 5、你使用 -me 写了这篇文章 当我决定要写这篇文章时,我认为最佳的方式便是直接使用 groff。我想要演示 groff 在编写文档方面是多么的灵活。所以,虽然你正在网上读这篇文章,但是它最初是用 groff 写的。 -我希望这激发了你学习如何使用 groff 撰写文档的兴趣。如果你想学习 `-me` 宏集里更高级的函数,参考 Eric Allman 的《Writing papers with groff using -me》,你应该能在系统的 groff 文档找到,文件名为 **meintro.me**。这是一份很好的参考资料,还解释了使用 `-me` 宏集格式化论文的其他方式。 +我希望这激发了你学习如何使用 groff 撰写文档的兴趣。如果你想学习 `-me` 宏集里更高级的函数,参考 Eric Allman 的《Writing papers with groff using -me》,你应该能在系统的 groff 文档找到这本书,文件名为 `meintro.me`。这是一份很好的参考资料,还解释了使用 `-me` 宏集格式化论文的其他方式。 -我还提供了这篇文章的原始草稿,其中使用了 `-me` 宏集。下载这个文件并保存为 **five-signs-groff.me**,然后输入 groff 处理来查看。`-T` 选项设置输出类型,比如 `-Tps` 用于生成 PostScript 输出,`-Thtml` 用于生成 HTML 文件。比如: +我还提供了这篇文章的原始草稿,其中使用了 `-me` 宏集。下载这个文件并保存为 `five-signs-groff.me`,然后运行 groff 处理来查看它。`-T` 选项设置输出类型,比如 `-Tps` 用于生成 PostScript 输出,`-Thtml` 用于生成 HTML 文件。比如: -groff -me -Thtml five-signs-groff.me > five-signs-groff.html +``` +groff -me -Thtml five-signs-groff.me > five-signs-groff.html +``` -------------------------------------------------------------------------------- @@ -65,7 +69,7 @@ via: https://opensource.com/article/21/4/groff-programmer 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[liweitianux](https://github.com/liweitianux) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 43459616fd88cb0622c391ac624cbfcb350535be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 20 Apr 2021 22:14:29 +0800 Subject: [PATCH 193/307] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @liweitianux 本文首发地址:https://linux.cn/article-13316-1.html 您的 LCTT 专页:https://linux.cn/lctt/liweitianux --- .../20210410 5 signs you-re a groff programmer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210410 5 signs you-re a groff programmer.md (99%) diff --git a/translated/tech/20210410 5 signs you-re a groff programmer.md b/published/20210410 5 signs you-re a groff programmer.md similarity index 99% rename from translated/tech/20210410 5 signs you-re a groff programmer.md rename to published/20210410 5 signs you-re a groff programmer.md index f63ca7fc8c..53e41c98fd 100644 --- a/translated/tech/20210410 5 signs you-re a groff programmer.md +++ b/published/20210410 5 signs you-re a groff programmer.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (liweitianux) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13316-1.html) groff 程序员的 5 个标志 ====== From f65a6aec51ca979911d1b19eaf00a1bac0487b57 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:02:32 +0800 Subject: [PATCH 194/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420=20?= =?UTF-8?q?In=20the=20trenches=20with=20Thomas=20Gleixner,=20real-time=20L?= =?UTF-8?q?inux=20kernel=20patch=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md --- ...ixner, real-time Linux kernel patch set.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md diff --git a/sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md b/sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md new file mode 100644 index 0000000000..d5a39bf6c5 --- /dev/null +++ b/sources/tech/20210420 In the trenches with Thomas Gleixner, real-time Linux kernel patch set.md @@ -0,0 +1,133 @@ +[#]: subject: (In the trenches with Thomas Gleixner, real-time Linux kernel patch set) +[#]: via: (https://www.linux.com/news/in-the-trenches-with-thomas-gleixner-real-time-linux-kernel-patch-set/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +In the trenches with Thomas Gleixner, real-time Linux kernel patch set +====== + +_![][1]_ + +_Jason Perlow, Editorial Director at the Linux Foundation interviews Thomas Gleixner, Linux Foundation Fellow, CTO of Linutronix GmbH, and project leader of the_ [_PREEMPT_RT_][2] _real-time kernel patch set._ + +**JP:** *Greetings, Thomas! It’s great to have you here this morning — although for you, it’s getting late in the afternoon in Germany. So **PREEMPT_RT**, the real-time patch set for the kernel is a fascinating project because it has some very important use-cases that most people who use Linux-based systems may not be aware of. First of all, can you tell me what “Real-Time” truly means? * + +**TG:** Real-Time in the context of operating systems means that the operating system provides mechanisms to guarantee that the associated real-time task processes an event within a specified period of time. Real-Time is often confused with “really fast.” The late Prof. Doug Niehaus explained it this way: “Real-Time is not as fast as possible; it is as fast as specified.” + +The specified time constraint is application-dependent. A control loop for a water treatment plant can have comparatively large time constraints measured in seconds or even minutes, while a robotics control loop has time constraints in the range of microseconds. But for both scenarios missing the deadline at which the computation has to be finished can result in malfunction. For some application scenarios, missing the deadline can have fatal consequences. + +In the strict sense of Real-Time, the guarantee which is provided by the operating system must be verifiable, e.g., by mathematical proof of the worst-case execution time. In some application areas, especially those related to functional safety (aerospace, medical, automation, automotive, just to name a few), this is a mandatory requirement. But for other scenarios or scenarios where there is a separate mechanism for providing the safety requirements, the proof of correctness can be more relaxed. But even in the more relaxed case, the malfunction of a real-time system can cause substantial damage, which obviously wants to be avoided. + +**JP:** _What is the history behind the project? How did it get started?_ + +**TG:** Real-Time Linux has a history that goes way beyond the actual **PREEMPT_RT** project. + +Linux became a research vehicle very early on. Real-Time researchers set out to transform Linux into a Real-Time Operating system and followed different approaches with more or less success. Still, none of them seriously attempted a fully integrated and perhaps upstream-able variant. In 2004 various parties started an uncoordinated effort to get some key technologies into the Linux kernel on which they wanted to build proper Real-Time support. None of them was complete, and there was a lack of an overall concept.  + +Ingo Molnar, working for RedHat, started to pick up pieces, reshape them and collect them in a patch series to build the grounds for the real-time preemption patch set **PREEMPT_RT**. At that time, I worked with [the late Dr. Doug Niehaus][3] to port a solution we had working based on the 2.4 Linux kernel forward to the 2.6 kernel. Our work was both conflicting and complimentary, so I teamed up with Ingo quickly to get this into a usable shape. Others like Steven Rostedt brought in ideas and experience from other Linux Real-Time research efforts. With a quickly forming loose team of interested developers, we were able to develop a halfway usable Real-Time solution that was fully integrated into the Linux kernel in a short period of time. That was far from a maintainable and production-ready solution. Still, we had laid the groundwork and proven that the concept of making the Linux Kernel real-time capable was feasible. The idea and intent of fully integrating this into the mainline Linux kernel over time were there from the very beginning. + +**JP:** _Why is it still a separate project from the Mainline kernel today?_ + +**TG:** To integrate the real-time patches into the Linux kernel, a lot of preparatory work, restructuring, and consolidation of the mainline codebase had to be done first. While many pieces that emerged from the real-time work found their way into the mainline kernel rather quickly due to their isolation, the more intrusive changes that change the Linux kernel’s fundamental behavior needed (and still need) a lot of polishing and careful integration work.  + +Naturally, this has to be coordinated with all the other ongoing efforts to adopt the Linux kernel to the different use cases ranging from tiny embedded systems to supercomputers.  + +This also requires carefully designing the integration so it does not get in the way of other interests and imposes roadblocks for further developing the Linux kernel, which is something the community and especially Linus Torvalds, cares about deeply.  + +As long as these remaining patches are out of the mainline kernel, this is not a problem because it does not put any burden or restriction on the mainline kernel. The responsibility is on the real-time project, but on the other side, in this context, there is no restriction to take shortcuts that would never be acceptable in the upstream kernel. + +The real-time patches are fundamentally different from something like a device driver that sits at some corner of the source tree. A device driver does not cause any larger damage when it goes unmaintained and can be easily removed when it reaches the final state bit-rot. Conversely, the **PREEMPT_RT** core technology is in the heart of the Linux kernel. Long-term maintainability is key as any problem in that area will affect the Linux user universe as a whole. In contrast, a bit-rotted driver only affects the few people who have a device depending on it. + +**JP:** *Traditionally, when I think about RTOS, I think of legacy solutions based on closed systems. Why is it essential we have an open-source alternative to them? * + +**TG:** The RTOS landscape is broad and, in many cases, very specialized. As I mentioned on the question of “what is real-time,” certain application scenarios require a fully validated RTOS, usually according to an application space-specific standard and often regulatory law. Aside from that, many RTOSes are limited to a specific class of CPU devices that fit into the targeted application space. Many of them come with specialized application programming interfaces which require special tooling and expertise. + +The Real-Time Linux project never aimed at these narrow and specialized application spaces. It always was meant to be the solution for 99% of the use cases and to be able to fully leverage the flexibility and scalability of the Linux kernel and the broader FOSS ecosystem so that integrated solutions with mixed-criticality workloads can be handled consistently.  + +Developing real-time applications on a real-time enabled Linux kernel is not much different from developing non-real-time applications on Linux, except for the careful selection of system interfaces that can be utilized and programming patterns that should be avoided, but that is true for real-time application programming in general independent of the RTOS.  + +The important difference is that the tools and concepts are all the same, and integration into and utilizing the larger FOSS ecosystem comes for free. + +The downside of **PREEMPT_RT** is that it can’t be fully validated, which excludes it from specific application spaces, but there are efforts underway, e.g., the LF ELISA project, to fill that gap. The reason behind this is, that large multiprocessor systems have become a commodity, and the need for more complex real-time systems in various application spaces, e.g., assisted / autonomous driving or robotics, requires a more flexible and scalable RTOS approach than what most of the specialized and validated RTOSes can provide.  + +That’s a long way down the road. Still, there are solutions out there today which utilize external mechanisms to achieve the safety requirements in some of the application spaces while leveraging the full potential of a real-time enabled Linux kernel along with the broad offerings of the wider FOSS ecosystem. + +**JP:** _What are examples of products and systems that use the real-time patch set that people depend on regularly?_ + +**TG:** It’s all over the place now. Industrial automation, control systems, robotics, medical devices, professional audio, automotive, rockets, and telecommunication, just to name a few prominent areas. + +**JP:** *Who are the major participants currently developing systems and toolsets with the real-time Linux kernel patch set?  * + +**TG:** Listing them all would be equivalent to reciting the “who’s who” in the industry. On the distribution side, there are offerings from, e.g., RedHat, SUSE, Mentor, and Wind River, which deliver RT to a broad range of customers in different application areas. There are firms like Concurrent, National Instruments, Boston Dynamics, SpaceX, and Tesla, just to name a few on the products side. + +RedHat and National Instruments are also members of the LF collaborative Real-Time project. + +**JP:** _What are the challenges in developing a real-time subsystem or specialized kernel for Linux? Is it any different than how other projects are run for the kernel?_ + +**TG:** Not really different; the same rules apply. Patches have to be posted, are reviewed, and discussed. The feedback is then incorporated. The loop starts over until everyone agrees on the solution, and the patches get merged into the relevant subsystem tree and finally end up in the mainline kernel. + +But as I explained before, it needs a lot of care and effort and, often enough, a large amount of extra work to restructure existing code first to get a particular piece of the patches integrated. The result is providing the desired functionality but is at the same time not in the way of other interests or, ideally, provides a benefit for everyone. + +The technology’s complexity that reaches into a broad range of the core kernel code is obviously challenging, especially combined with the mainline kernel’s rapid change rate. Even larger changes happening at the related core infrastructure level are not impacting ongoing development and integration work too much in areas like drivers or file systems. But any change on the core infrastructure can break a carefully thought-out integration of the real-time parts into that infrastructure and send us back to the drawing board for a while. + +**JP:**  *Which companies have been supporting the effort to get the **PREEMPT_RT** Linux kernel patches upstream? * + +**TG:** For the past five years, it has been supported by the members of the LF real-time Linux project, currently ARM, BMW, CIP, ELISA, Intel, National Instruments, OSADL, RedHat, and Texas Instruments. CIP, ELISA, and OSADL are projects or organizations on their own which have member companies all over the industry. Former supporters include Google, IBM, and NXP. + +I personally, my team and the broader Linux real-time community are extremely grateful for the support provided by these members.  + +However, as with other key open source projects heavily used in critical infrastructure, funding always was and still is a difficult challenge. Even if the amount of money required to keep such low-level plumbing but essential functionality sustained is comparatively small, these projects struggle with finding enough sponsors and often lack long-term commitment. + +The approach to funding these kinds of projects reminds me of the [Mikado Game][4], which is popular in Europe, where the first player who picks up the stick and disturbs the pile often is the one who loses. + +That’s puzzling to me, especially as many companies build key products depending on these technologies and seem to take the availability and sustainability for granted up to the point where such a project fails, or people stop working on it due to lack of funding. Such companies should seriously consider supporting the funding of the Real-Time project. + +It’s a lot like the [Jenga][5] game, where everyone pulls out as many pieces as they can up until the point where it collapses. We cannot keep taking; we have to give back to these communities putting in the hard work for technologies that companies heavily rely on. + +I gave up long ago trying to make sense of that, especially when looking at the insane amounts of money thrown at the over-hyped technology of the day. Even if critical for a large part of the industry, low-level infrastructure lacks the buzzword charm that attracts attention and makes headlines — but it still needs support. + +**JP:**  *One of the historical concerns was that Real-Time didn’t have a community associated with it; what has changed in the last five years?  * + +**TG:** There is a lively user community, and quite a bit of the activity comes from the LF project members. On the development side itself, we are slowly gaining more people who understand the intricacies of **PREEMPT_RT** and also people who look at it from other angles, e.g., analysis and instrumentation. Some fields could be improved, like documentation, but there is always something that can be improved. + +**JP:**  _What will the Real-Time Stable team be doing once the patches are accepted upstream?_ + +**TG:** The stable team is currently overseeing the RT variants of the supported mainline stable versions. Once everything is integrated, this will dry out to some extent once the older versions reach EOL. But their expertise will still be required to keep real-time in shape in mainline and in the supported mainline stable kernels. + +**JP:** _So once the upstreaming activity is complete, what happens afterward?_ + +**TG:** Once upstreaming is done, efforts have to be made to enable RT support for specific Linux features currently disabled on real-time enabled kernels. Also, for quite some time, there will be fallout when other things change in the kernel, and there has to be support for kernel developers who run into the constraints of RT, which they did not have to think about before.  + +The latter is a crucial point for this effort. Because there needs to be a clear longer-term commitment that the people who are deeply familiar with the matter and the concepts are not going to vanish once the mainlining is done. We can’t leave everybody else with the task of wrapping their brains around it in desperation; there cannot be institutional knowledge loss with a system as critical as this.  + +The lack of such a commitment would be a showstopper on the final step because we are now at the point where the notable changes are focused on the real-time only aspects rather than welcoming cleanups, improvements, and features of general value. This, in turn, circles back to the earlier question of funding and industry support — for this final step requires several years of commitment by companies using the real-time kernel. + +There’s not going to be a shortage of things to work on. It’s not going to be as much as the current upstreaming effort, but as the kernel never stops changing, this will be interesting for a long time. + +**JP:** _Thank you, Thomas, for your time this morning. It’s been an illuminating discussion._ + +_To get involved with the real-time kernel patch for Linux, please visit the_ [_PREEMPT_RT wiki_][2] _at The Linux Foundation or email [real-time-membership@linuxfoundation.org][6]_ + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/in-the-trenches-with-thomas-gleixner-real-time-linux-kernel-patch-set/ + +作者:[Linux.com Editorial Staff][a] +选题:[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/author/linuxdotcom/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2021/04/IntheTrenches_ThomasGleixner.png +[2]: https://wiki.linuxfoundation.org/realtime/start +[3]: https://lwn.net/Articles/514182/?fbclid=IwAR1mhNcOVlNdQ_QmwOhC1vG3vHzxsXRwa_g4GTo62u1sHbjOZBPPviT5bxc +[4]: https://en.wikipedia.org/wiki/Mikado_(game) +[5]: https://en.wikipedia.org/wiki/Jenga +[6]: mailto:real-time-membership@linuxfoundation.org From 61a864220d15f73cd58295afb327c5efbff4be91 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:03 +0800 Subject: [PATCH 195/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421=20?= =?UTF-8?q?How=20to=20Delete=20Partitions=20in=20Linux=20[Beginner?= =?UTF-8?q?=E2=80=99s=20Guide]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md --- ...e Partitions in Linux -Beginner-s Guide.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md diff --git a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md new file mode 100644 index 0000000000..1662169a52 --- /dev/null +++ b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -0,0 +1,134 @@ +[#]: subject: (How to Delete Partitions in Linux [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/delete-partition-linux/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to Delete Partitions in Linux [Beginner’s Guide] +====== + +Managing partitions is serious business, especially when you have to remove them. I find myself doing this frequently, especially after using thumb drives as live disks and Linux installers because they create several partitions that I won’t need afterwards. + +In this tutorial, I will show you how to remove partitions in Linux using both command line and GUI tools. + + * [Delete partition in Linux with GUI tool like GParted][1] + * [Delete partition using Linux commands][2] + + + +Warning! + +You delete the partition, you lose your data. Whenever you are playing with partitions, make sure backup your data. A slight typo or slip of finger could prove costly. Don’t say we didn’t warn you! + +### Remove disk partition using GParted [GUI Method] + +As a desktop Linux user, you probably will be more comfortable and perhaps safer with a GUI-based tool. + +There are [several tools that let you manage partitions on Linux][3]. Depending on your distribution you will have one or even more such tool already installed on your system. + +For this tutorial, I am going to use [GParted][4]. It is a popular open source tool and it’s very easy and intuitive to use. + +The first step is [installing GParted][5] if it isn’t already in your system. You should be able to find it in the software center of your distribution. + +![][6] + +Alternatively, you can use your distribution’s package manager for installing it. In Debian and Ubuntu-based Linux distributions, you can [use the apt install command][7]: + +``` +sudo apt install gparted +``` + +Once installed, let’s open **GParted**. Since you are dealing with disk partitions, you’ll be required to have root access. It will ask for authentication and once it opens you should see a window like this one: + +![][8] + +On the right-upper corner you can select the disk and in the lower screen the partition you want to remove. + +Next, select the option **Delete** from the Partition menu: + +![][9] + +The process is incomplete until you rewrite the partition table. This is a safety measure and it gives you the option to review the changes before confirming it. + +To do this just click on the **Apply All Operations** button located in the toolbar and then **Apply** when asked for confirmation. + +![][10] + +After hitting **Apply**, you will see a progress bar and a results message saying that all the operations were successful. You can close the message and the main window and consider your partition completely deleted from our disk. + +Now that you are aware of the GUI method, let’s move on to the command line. + +### Delete partitions using fdisk command + +Almost every Linux distribution comes with [fdisk][11] by default and we are going to use this tool today. The first thing you need to know is what device is assigned to the disk with the partitions you want to remove. To do that, type the following in the terminal: + +``` +sudo fdisk --list +``` + +This will print all the drives and partitions in our system as well as the assigned devices. You [need to have root access][12] in order for it work. + +In this example, I will work with a USB drive that contains two partitions as shown below: + +![][13] + +The device assigned in the system is /sdb and it has two partitions, sdb1 and sdb2. Now that you identified which device contains the partitions, you can start working on it by using `fdisk` and the path to the device: + +``` +sudo fdisk /dev/sdb +``` + +This will start `fdisk` in command mode. You can always press `m` to see a list of options. + +Next, type `p` and press `Enter` to view the partition information and confirm that you are using the right device. If the wrong device is in use you can use the `q` command to exit `fdisk` and start the procedure again. + +Now enter `d` to delete a partition and it will immediately ask for the partition number, that corresponds to the number listed in the Device column, which in this case are numbers 1 and 2 (as can be seen in the screen capture below) but can and will vary according to the current partition table. + +![][14] + +Let’s remove the second partition by typing `2` and pressing `Enter`. You should see a message saying **“Partition 2 has been deleted**“, but actually, it hasn’t been removed yet. `fdisk` needs one more step to rewrite the partition table and apply the changes. Safety net, you see. + +You need to type `w` and press `Enter` to make the changes permanent. No confirmation is asked. + +After this, you should receive some feedback like the one here: + +![][15] + +Now, use `sudo fdisk --list /dev/sdb` to view the current partition table of the device and you can see that the second partition is completely gone. You are done removing your partition using the terminal and `fdisk` command. Success! + +#### Wrapping up + +And so I end this tutorial on how to remove partitions in Linux using both the terminal and GUI tools. Remember, stay always on the safe side, backup your files before manipulating your partitions and double check that you are using the right device. Deleting a partition will delete everything in it with little to no chance of [recovering][16] it. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/delete-partition-linux/ + +作者:[Chris Patrick Carias Stas][a] +选题:[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/chris/ +[b]: https://github.com/lujun9972 +[1]: tmp.Q615QYIwTl#gparted +[2]: tmp.Q615QYIwTl#fdisk +[3]: https://itsfoss.com/partition-managers-linux/ +[4]: https://gparted.org/index.php +[5]: https://itsfoss.com/gparted/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gparted-ubuntu-software-center.png?resize=800%2C348&ssl=1 +[7]: https://itsfoss.com/apt-command-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-004.png?resize=800%2C542&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-005.png?resize=800%2C540&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-006.png?resize=800%2C543&ssl=1 +[11]: https://man7.org/linux/man-pages/man8/fdisk.8.html +[12]: https://itsfoss.com/root-user-ubuntu/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-001.png?resize=800%2C255&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-002.png?resize=800%2C362&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-003.png?resize=800%2C153&ssl=1 +[16]: https://itsfoss.com/recover-deleted-files-linux/ From 3986d8718f533da9082b42271e3830345971b2b0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:21 +0800 Subject: [PATCH 196/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420=20?= =?UTF-8?q?5=20ways=20to=20protect=20your=20documents=20with=20open=20sour?= =?UTF-8?q?ce=20software?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 5 ways to protect your documents with open source software.md --- ...our documents with open source software.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 sources/tech/20210420 5 ways to protect your documents with open source software.md diff --git a/sources/tech/20210420 5 ways to protect your documents with open source software.md b/sources/tech/20210420 5 ways to protect your documents with open source software.md new file mode 100644 index 0000000000..88de0c620e --- /dev/null +++ b/sources/tech/20210420 5 ways to protect your documents with open source software.md @@ -0,0 +1,147 @@ +[#]: subject: (5 ways to protect your documents with open source software) +[#]: via: (https://opensource.com/article/21/4/secure-documents-open-source) +[#]: author: (Ksenia Fedoruk https://opensource.com/users/ksenia-fedoruk) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 ways to protect your documents with open source software +====== +Control your own data so that unauthorized users can't access it. +![Filing papers and documents][1] + +Users have every right to be concerned about the safety and security of their data. When you create data on a computer, it's reasonable to want exclusive control over it. + +There are many ways to protect your documents. At the filesystem level, you can [encrypt your hard drive][2] or [just a file][3]. A good office suite affords you many more options, though, and I've gathered five of the methods I use to secure my documents with open source software. + +### 5 ways to secure your docs + +#### 1\. Keeping documents in secure cloud storage services + +Self-hosting an open source content management system (CMS) platform gives you complete control over your data. All your data stays on your server, and you control who has access to it. + +**Options:** [Nextcloud][4], [ownCloud][5], [Pydio][6], and [Seafile][7] + +All of these offer functionality for storing, syncing, and sharing documents and folders, managing content, file versioning, and so on. They can easily replace Dropbox, Google Drive, and other proprietary cloud storage that place your data on servers you don't own, maintain, or govern. + +The open source self-hosted options listed above are compliant with GDPR and other international regulations that protect user data. They offer backup and data recovery options, auditing and monitoring tools, permissions management, and data encryption. + +![Pydio audit control][8] + +Audit control in Pydio Cells. (Source: [Pydio.com][9]) + +#### 2\. Enabling encryption at rest, in transit, and end-to-end + +We often speak of data encryption in general terms, but there are several aspects to consider when encrypting files: + + * With **encryption at rest** (or disk encryption), you can protect data stored within your infrastructure or on your hard drive. + * **Encryption in transit** protects data as traffic when it's using protocols like HTTPS. It protects your data from being intercepted and transformed as it moves from one location to another. This is important when you upload documents to your cloud. + * **End-to-end encryption** (E2EE) protects data by encrypting it on one end and decrypting it on the other. No third party can read your documents, even if they interfere in the process and get access to the files unless they have the decryption key. + + + +**Options:** CryptPad, ownCloud, ONLYOFFICE Workspace, Nextcloud, and Seafile + +ownCloud, ONLYOFFICE Workspace, Nextcloud, and Seafile support all three layers of encryption. They differ in how they implement end-to-end encryption: + + * In ownCloud, there's an E2EE plugin that allows you to encrypt folder sharing. + * In Nextcloud, there's a folder-level option available in the desktop client. + * Seafile provides client-side E2EE by creating encrypted libraries. + * [ONLYOFFICE Workspace][10] not only allows you to encrypt your documents while storing and sharing them, but it also permits you to securely co-edit them in real time in Private Rooms. The encryption data is automatically generated and transferred and is encrypted itself—you don't have to keep or remember any passwords. + * [CryptPad][11], as its name suggests, is completely private. All content is encrypted and decrypted by your browser. This means documents, chats, and files are unreadable outside the session where you are logged in. Even the service administrators can't get your information. + + + +![Encrypted CryptPad storage][12] + +Encrypted CryptPad storage. (Source: [Cryptpad.fr][13]) + +#### 3\. Using digital signatures + +Digital signatures allow you to verify that you originated a document's content and no alterations have been made to it. + +**Options:** LibreOffice Writer, ONLYOFFICE Desktop Editors, OpenESignForms, and SignServer + +[LibreOffice][14] and [ONLYOFFICE][15] suites provide an integrated tool to digitally sign documents. You can add a signature line that is visible in the document text and allows you to request signatures from other users. + +Once you apply a digital signature, no one can edit the document. If someone changes the document, the signature becomes invalid, so you'll know the content was modified. + +In ONLYOFFICE, you can sign OOXML files (e.g., DOCX, XLSX, PPTX) in LibreOffice as ODFs and PDFs. If you try to sign an OOXML document in LibreOffice, the signature will be marked with "only parts of the document are signed." + +![Digital signature in ONLYOFFICE][16] + +Digital signature in ONLYOFFICE. (Source: [ONLYOFFICE Help Center][17]) + +[SignServer][18] and [Open eSignForms][19] are free electronic signature services that you can use if you don't need to sign a document right in the editor. Both tools allow you to work with documents, and SignServer also enables you to sign code, including Java, and apply time stamping. + +#### 4\. Watermarking + +Watermarks avoid unauthorized redistribution of your content and protect any confidential information your files might contain. + +**Options:** Collabora Online in Nextcloud or ONLYOFFICE Docs in Nextcloud + +[ONLYOFFICE Docs][20] and [Collabora][21], when integrated with Nextcloud, allow you to embed a watermark in your documents, spreadsheets, and presentations. To activate watermarking, you have to log into your Nextcloud instance as an admin and go to **Secure view settings** on the solution's Settings page. + +You can replace the default watermark with your own text using the placeholders. The watermark will be displayed individually for each user when opening a file. You can also define groups to differentiate users who will see the watermark and select the types of shares that must show the watermark. + +![Watermark][22] + +Watermarking (Ksenia Fedoruk, [CC BY-SA 4.0][23]) + +You can also insert watermarks in your docs in the LibreOffice and ONLYOFFICE desktop apps. However, in this case, it's just a text or an image placed under the main text layer, so anyone can remove it easily. + +#### 5\. Protecting documents with passwords + +Password protection allows you to store and exchange local files securely. If someone accesses your desktop or gets the protected file via email or another method, they won't be able to open it without knowing the password. + +**Options:** Apache OpenOffice, LibreOffice, and ONLYOFFICE Desktop Editors + +All three solutions offer you the ability to set a password for your sensitive documents. + +If a protected doc is important to you, it is strongly recommended you save the password using a password manager or memorize it because LibreOffice, ONLYOFFICE, and [OpenOffice][24] don't offer a password-recovery option. So, if you forget or lose the password, there is no ability to restore or reset it and open the file. + +### Your data belongs to you + +Protect your documents using one or more of these methods to stay safer online. It's the 21st century, and computing is too advanced to risk giving your data to a service outside your control. Use open source and take ownership of your digital life. + +What are your favorite tools for working securely with docs? Please share them in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/secure-documents-open-source + +作者:[Ksenia Fedoruk][a] +选题:[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/ksenia-fedoruk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documents_papers_file_storage_work.png?itok=YlXpAqAJ (Filing papers and documents) +[2]: https://opensource.com/article/21/3/encryption-luks +[3]: https://opensource.com/article/21/3/luks-truecrypt +[4]: https://nextcloud.com/ +[5]: https://owncloud.com/ +[6]: https://pydio.com/ +[7]: https://www.seafile.com/en/home/ +[8]: https://opensource.com/sites/default/files/uploads/pydiocells.png (Pydio audit control) +[9]: http://pydio.com +[10]: https://www.onlyoffice.com/workspace.aspx +[11]: https://cryptpad.fr/ +[12]: https://opensource.com/sites/default/files/uploads/cryptdrive.png (Encrypted CryptPad storage) +[13]: http://cryptpad.fr +[14]: https://www.libreoffice.org/ +[15]: https://www.onlyoffice.com/desktop.aspx +[16]: https://opensource.com/sites/default/files/uploads/onlyoffice_digitalsig.png (Digital signature in ONLYOFFICE) +[17]: http://helpcenter.onlyoffice.com +[18]: https://www.signserver.org/ +[19]: https://github.com/OpenESignForms +[20]: https://www.onlyoffice.com/office-for-nextcloud.aspx +[21]: https://www.collaboraoffice.com/ +[22]: https://opensource.com/sites/default/files/uploads/onlyoffice_watermark.png (Watermark) +[23]: https://creativecommons.org/licenses/by-sa/4.0/ +[24]: https://www.openoffice.org/ From ca5aff38fc7ec48ec560a31a01c79df3c61b98de Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:33 +0800 Subject: [PATCH 197/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420=20?= =?UTF-8?q?A=20beginner's=20guide=20to=20network=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 A beginner-s guide to network management.md --- ... beginner-s guide to network management.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20210420 A beginner-s guide to network management.md diff --git a/sources/tech/20210420 A beginner-s guide to network management.md b/sources/tech/20210420 A beginner-s guide to network management.md new file mode 100644 index 0000000000..9dc5f8b77f --- /dev/null +++ b/sources/tech/20210420 A beginner-s guide to network management.md @@ -0,0 +1,218 @@ +[#]: subject: (A beginner's guide to network management) +[#]: via: (https://opensource.com/article/21/4/network-management) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +A beginner's guide to network management +====== +Learn how networks work and some tricks to optimize network performance +with open source. +![Tips and gears turning][1] + +Most people connect to at least two networks every day. After you turn on a computer or mobile device, it connects to a local WiFi network, which in turn provides access to the interconnected network of networks that is "the internet" (a combination of the words _inter_connected _net_works). + +But how do networks actually work? How does your device know how to find the internet, a shared printer, or a file share? How do these things know how to respond to your device? What tricks do system administrators use to optimize the performance of a network? + +Open source is firmly embedded into networking technology, so resources on networking are freely available to anyone who wants to learn more. This article covers the basics of network management using open source. + +### What is a network? + +A network of computers is a collection of two or more computers that can communicate with one another. For networking to work, one machine on a network must be able to find another, and communication must be able to get from one machine to another. To resolve this requirement, two different systems were developed and defined: TCP and IP. + +#### TCP for transport + +For computers to communicate, there must be a means of transport for messages between them. When humans talk, the sounds of our voices are made possible by sound waves moving through air. Computers communicate with digital signals carried over Ethernet cables, radio waves, or microwaves. The specifications for this are formally defined as the [TCP protocol][2]. + +#### IP for addressing + +For computers to address one another, they must have some means for identification. When humans address one another, we use names and pronouns. When computers address each other, they use IP addresses, such as `192.168.0.1`, which can be mapped to names, such as Laptop and Desktop or Tux or Penguin. The specifications for this are formally defined as the [IP protocol][3]. + +### Set up a minimal configuration + +The simplest network is a two-computer network using a specially wired Ethernet cable called a **crossover cable**. A crossover cable connects and transmits signals coming from one computer to the appropriate receptors on another computer. There are also crossover adapters that convert a standard Ethernet into a crossover cable. + +![Crossover cable][4] + +(Seth Kenlon, [CC BY-SA 4.0][5]) + +With no router between the computers, all network management must be done manually on each machine, making this a good introductory exercise for networking basics. + +With a crossover cable, you can connect two computers together. Because the two computers are connected directly with no network controller to offer guidance, neither computer does anything to create or join a network. Normally, this task would be prompted by a switch and a DHCP server or a router, but in this simple network setup, you are the ultimate authority. + +To create a network, you first must assign an IP address to each computer. The block reserved for self-assigned IP addresses starts with `169.254`, and it's a useful convention for reminding yourself that this is a closed-loop system. + +#### Find a network interface + +First, you must know what network interfaces you're working with. The Ethernet port is usually designated with the term `eth` plus a number starting with `0`, but some devices are reported with different terms. You can discover the interfaces on a computer with the `ip` command: + + +``` +$ ip address show +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 ... +    link/loopback 00:00:00:00:00:00 brd ... +    inet 127.0.0.1/8 scope host lo +       valid_lft forever preferred_lft forever +    inet6 ::1/128 scope host +       valid_lft forever preferred_lft forever +2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> ... +    link/ether dc:a6:32:be:a3:e1 brd ... +3: wlan0: <BROADCAST,MULTICAST> ... +    link/ether dc:a6:32:be:a3:e2 brd ... +``` + +In this case, `eth0` turns out to be the correct interface name. However, in some cases, you'll see `en0` or `enp0s1` or something similar, so it's important to always verify a device name before using it. + +#### Assign an IP address + +Normally, an IP address is obtained from a router, which broadcasts offers for addresses over the network. When a computer gets connected to a network, it requests an address. The router registers which device on the network, identified by its Media Access Control (MAC) address (this has nothing to do with Apple Mac computers) has been assigned which address. That's how computers know how to find one another across a network. + +In this simple network, however, there is no router handing out IP addresses or registering devices, so you must create an IP address. To assign an IP address to a computer, use the `ip` command: + + +``` +`$ sudo ip address add 169.254.0.1 dev eth0` +``` + +And again on the other computer, this time incrementing the IP address by 1: + + +``` +`$ sudo ip address add 169.254.0.2 dev eth0` +``` + +Now each computer has a means of transport (the crossover cable) and a way to be found on the network (a unique IP address). But this network still lacks one important element: The computers still don't know they're a member of a network. + +#### Set up a route + +Another task that's usually managed by a router is setting up the paths network traffic must take to get from one place to another. This is called a _routing table_, and you can think of it as a very basic city map for your network. + +Currently, no routing table exists on your network. You can view your non-existent routing table with the `route` command: + + +``` +$ route +Kernel IP routing table +Destination | Gateway | Genmask | Flags|Metric|Ref | Use | Iface +$ +``` + +Alternatively, you can view it with the `ip` command: + + +``` +$ ip route +$ +``` + +You can add a route with the `ip` command: + + +``` +$ sudo ip route \ +add 169.254.0.0/24 \ +dev eth0 \ +proto static +``` + +This command adds a route to the address range (starting from `169.254.0.0` and ending at `169.254.0.255`) to the `eth0` interface. It sets the routing protocol to `static` to indicate that you, the administrator, created the route as an intentional override for any dynamic routing. + +Verify your routing table with the `route` command: + + +``` +$ route +Kernel IP routing table +Destination | Gateway | Genmask       | ... | Iface +link-local  | 0.0.0.0 | 255.255.255.0 | ... | eth0 +``` + +Or use the `ip` command for a different view: + + +``` +$ ip route +169.254.0.0/24 dev eth0 proto static scope link +``` + +#### Ping your neighbor + +Now that your network has established a method of transport, a means of addressing, and a network route, you can reach hosts outside your computer. The simplest message to send another computer is a `ping`, which is conveniently also the name of the command that generates the message: + + +``` +$ ping -c1 169.254.0.2 +64 bytes from 169.254.0.2: icmp_seq=1 ttl=64 time=0.233 ms + +\--- 169.254.0.2 ping statistics --- +1 packets transmitted, 1 received, 0% packet loss, time 0ms +rtt min/avg/max/mdev = 0.244/0.244/0.244/0.000 ms +``` + +You can also view the neighbors you've interacted with: + + +``` +$ ip neighbour +169.254.0.2 dev eth0 lladdr e8:6a:64:ac:ef:7c STALE +``` + +### Grow your network with a switch + +There aren't many needs for two-node networks. Special hardware, called a network **switch**, was developed to solve this problem. A network switch allows you to attach several Ethernet cables to it, and it distributes messages indiscriminately from the computer sending it to all computers listening on the switch. All computers ignore the message except for the one with an IP address that matches the intended recipient. This makes for a relatively noisy network, but it's an easy way to physically connect a group of computers. + +A physical switch for physical cables isn't practical or desired on most modern home networks, so a WiFi access point is used instead. A WiFi access point serves the same function as a switch: it allows many computers to connect to it and pass messages between them. + +Access to the Internet is not just an expectation; it's usually the reason home networks exist at all. A switch or WiFi access point without access to the Internet isn't very useful, but to connect your network to another network, you need a router. + +### Add a router + +In practice, local networks connect many devices, and the number is growing as more devices become network-aware. Connect a network to the Internet (a network itself), and that number goes up by orders of magnitude. + +It's impractical to manually configure a network, so common tasks are assigned to specific nodes on the network, and each computer runs a **daemon** (a job that runs silently in the background) to populate network settings received from authoritative servers on the network. On a home network, these jobs are often consolidated into one small embedded device, often provided by your Internet service provider (ISP), called a **router** (people sometimes incorrectly call it a modem). In a large network, each task is usually assigned to a separate dedicated server to ensure focus and resiliency. These include: + + * DHCP server to assign and track IP addresses to devices joining the network + * [DNS server][6] to convert registered domain names like [redhat.com][7] to IP addresses like `209.132.183.105`) + * [Firewall][8] to protect your network from unwanted incoming traffic or forbidden outgoing traffic + * Router to efficiently direct traffic on the network, serve as a gateway to other networks (such as the Internet), and perform network address translation (NAT) + + + +You probably have a router on your network now, and it probably manages all these tasks and possibly more. You can run[ your own open source router][9], thanks to projects like VyOS. For such a project, you should use a dedicated computer with at least two network interface controllers (NICs): one to connect to your ISP and another to connect to a switch or, more likely, a WiFi access point. + +### Scale your knowledge + +Regardless of how many devices are on your network or how many other networks your network connects to, the principles remain the same as with your two-node network. You need a mode of transport, a scheme for addressing, and knowledge of how to reach the network. + +### Networking cheat sheet + +Understanding how a network operates is vital for managing a network. You can't troubleshoot issues unless you understand the results of your tests, and you can't run tests unless you know what commands interact with your network infrastructure. For an overview of important networking commands and what kind of information you can extract with them, [download our updated networking cheat sheet][10]. + +Learn more about software defined networking, network functions virtualization, OpenDaylight,... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/network-management + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://tools.ietf.org/html/rfc793 +[3]: https://tools.ietf.org/html/rfc791 +[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg (Crossover cable) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/17/4/build-your-own-name-server +[7]: http://redhat.com +[8]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[9]: https://opensource.com/article/20/1/open-source-networking +[10]: https://opensource.com/downloads/cheat-sheet-networking From f3ff5dcfced0423e49046dcb7139b8493b625562 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 21 Apr 2021 05:03:45 +0800 Subject: [PATCH 198/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210420=20?= =?UTF-8?q?Application=20observability=20with=20Apache=20Kafka=20and=20Sig?= =?UTF-8?q?Noz?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md --- ...ervability with Apache Kafka and SigNoz.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md diff --git a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md new file mode 100644 index 0000000000..be94aca606 --- /dev/null +++ b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md @@ -0,0 +1,157 @@ +[#]: subject: (Application observability with Apache Kafka and SigNoz) +[#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) +[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Application observability with Apache Kafka and SigNoz +====== +SigNoz helps developers start meeting their observability goals quickly +and with minimum effort. +![Ship captain sailing the Kubernetes seas][1] + +SigNoz is an open source application observability platform. Built in React and Go, SigNoz is written from the ground up to allow developers to get started with their observability goals as soon as possible and with minimum effort. + +This article looks at the software in detail, including the architecture, Kubernetes-based deployment, and some common SigNoz uses. + +### SigNoz architecture + +SigNoz ties several components together to create a scalable, loosely coupled system that is easy to get started with. Some of the most important components are: + + * OpenTelemetry Collector + * Apache Kafka + * Apache Druid + + + +[OpenTelemetry Collector][2] is the trace or metrics data collection engine. This enables SigNoz to ingest data in industry-standard formats, including Jaeger, Zipkin, and OpenConsensus. Then the collected data is forwarded to Apache Kafka. + +SigNoz uses Kafka and stream processors for real-time ingestion of high volumes of observability data. This data is then passed on to Apache Druid, which excels at storing such data for short- and long-term SQL analysis. + +Once the data is flattened and stored in Druid, SigNoz's query service can query and pass the data to the SigNoz React frontend. The front end then creates nice graphs for users to visualize the observability data. + +![SigNoz architecture][3] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### Install SigNoz + +SigNoz's components include Apache Kafka and Druid. These components are loosely coupled and work in tandem to ensure a seamless experience for the end user. Given all the components, it is best to run SigNoz as a combination of microservices on Kubernetes or Docker Compose (for local testing). + +This example uses a Kubernetes Helm chart-based deployment to install SigNoz on Kubernetes. As a prerequisite, you'll need a Kubernetes cluster. If you don't have a Kubernetes cluster available, you can use tools like [MiniKube][5] or [Kind][6] to create a test cluster on your local machine. Note that the machine should have at least 4GB available for this to work. + +Once you have the cluster available and kubectl configured to communicate with the cluster, run: + + +``` +$ git clone && cd signoz + +$ helm dependency update deploy/kubernetes/platform + +$ kubectl create ns platform + +$ helm -n platform install signoz deploy/kubernetes/platform + +$ kubectl -n platform apply -Rf deploy/kubernetes/jobs + +$ kubectl -n platform apply -f deploy/kubernetes/otel-collector +``` + +This installs SigNoz and related containers on the cluster. To access the user interface (UI), run the `kubectl port-forward` command; for example: + + +``` +`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` +``` + +You should now be able to access your SigNoz dashboard using a local browser on the address `http://localhost:3000`. + +Now that your observability platform is up, you need an application that generates observability data to visualize and trace. For this example, you can use [HotROD][7], a sample application developed by the Jaegar team. + +To install it, run: + + +``` +$ kubectl create ns sample-application + +$ kubectl -n sample-application apply -Rf sample-apps/hotrod/ +``` + +### Explore the features + +You should now have a sample application with proper instrumentation up and running in the demo setup. Look at the SigNoz dashboard for metrics and trace data. As you land on the dashboard's home, you will see a list of all the configured applications that are sending instrumentation data to SigNoz. + +![SigNoz dashboard][8] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### Metrics + +When you click on a specific application, you will land on the application's homepage. The Metrics page displays the last 15 minutes worth (this number is configurable) of information, like application latency, average throughput, error rate, and the top endpoints the application is accessing. This gives you a birds-eye view of the application's status. Any spikes in errors, latency, or load are immediately visible. + +![Metrics in SigNoz][9] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### Tracing + +The Traces page lists every request in chronological order with high-level details. As soon as you identify a single request of interest (e.g., something taking longer than expected to complete), you can click the trace and look at individual spans for every action that happened inside that request. The drill-down mode offers thorough inspection for each request. + +![Tracing in SigNoz][10] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +![Tracing in SigNoz][11] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### Usage Explorer + +Most of the metrics and tracing data are very useful, but only for a certain period. As time passes, the data ceases to be useful in most cases. This means it is important to plan a proper retention duration for data; otherwise, you will pay more for the storage. The Usage Explorer provides an overview of ingested data per hour, day, and week. + +![SigNoz Usage Explorer][12] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### Add instrumentation + +So far, you've been looking at metrics and traces from the sample HotROD application. Ideally, you'll want to instrument your application so that it sends observability data to SigNoz. Do this by following the [Instrumentation Overview][13] on SigNoz's website. + +SigNoz supports a vendor-agnostic instrumentation library, OpenTelemetry, as the primary way to configure instrumentation. OpenTelemetry offers instrumentation libraries for various languages with support for both automatic and manual instrumentation. + +### Learn more + +SigNoz helps developers get started quickly with metrics and tracing applications. To learn more, you can consult the [documentation][14], join the [community][15], and access the source code on [GitHub][16]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/observability-apache-kafka-signoz + +作者:[Nitish Tiwari][a] +选题:[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/tiwarinitish86 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://github.com/open-telemetry/opentelemetry-collector +[3]: https://opensource.com/sites/default/files/uploads/signoz_architecture.png (SigNoz architecture) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://minikube.sigs.k8s.io/docs/start/ +[6]: https://kind.sigs.k8s.io/docs/user/quick-start/ +[7]: https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod +[8]: https://opensource.com/sites/default/files/uploads/signoz_dashboard.png (SigNoz dashboard) +[9]: https://opensource.com/sites/default/files/uploads/signoz_applicationmetrics.png (Metrics in SigNoz) +[10]: https://opensource.com/sites/default/files/uploads/signoz_tracing.png (Tracing in SigNoz) +[11]: https://opensource.com/sites/default/files/uploads/signoz_tracing2.png (Tracing in SigNoz) +[12]: https://opensource.com/sites/default/files/uploads/signoz_usageexplorer.png (SigNoz Usage Explorer) +[13]: https://signoz.io/docs/instrumentation/overview/ +[14]: https://signoz.io/docs/ +[15]: https://github.com/SigNoz/signoz#community +[16]: https://github.com/SigNoz/signoz From e0a9987b3cc5123ef00aaa1c70c318f01f590e70 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Apr 2021 08:45:09 +0800 Subject: [PATCH 199/307] translated --- ...in Ubuntu and Other Linux Distributions.md | 101 ------------------ ...in Ubuntu and Other Linux Distributions.md | 101 ++++++++++++++++++ 2 files changed, 101 insertions(+), 101 deletions(-) delete mode 100644 sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md deleted file mode 100644 index 1fd15cf3ac..0000000000 --- a/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) -[#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -How to Add Fingerprint Login in Ubuntu and Other Linux Distributions -====== - -Many high-end laptops come with fingerprint readers these days. Windows and macOS have been supporting fingerprint login for some time. In desktop Linux, the support for fingerprint login was more of geeky tweaks but [GNOME][1] and [KDE][2] have started supporting it through system settings. - -This means that on newer Linux distribution versions, you can easily use fingerprint reading. I am going to enable fingerprint login in Ubuntu here but you may use the steps on other distributions running GNOME 3.38. - -Prerequisite - -This is obvious, of course. Your computer must have a fingerprint reader. - -This method works for any Linux distribution running GNOME version 3.38 or higher. If you are not certain, you may [check which desktop environment version you are using][3]. - -KDE 5.21 also has a fingerprint manager. The screenshots will look different, of course. - -### Adding fingerprint login in Ubuntu and other Linux distributions - -Go to **Settings** and the click on **Users** from left sidebar. You should see all the user account on your system here. You’ll see several option including **Fingerprint Login**. - -Click on the Fingerprint Login option here. - -![Enable fingerprint login in Ubuntu][4] - -It will immediately ask you to scan a new fingerprint. When you click the + sign to add a fingerprint, it presents a few predefined options so that you can easily identify which finger or thumb it is. - -You may of course scan left thumb by clicking right index finger though I don’t see a good reason why you would want to do that. - -![Adding fingerprint][5] - -While adding the fingerprint, rotate your finger or thumb as directed. - -![Rotate your finger][6] - -Once the system registers the entire finger, it will give you a green signal that the fingerprint has been added. - -![Fingerprint successfully added][7] - -If you want to test it right away, lock the screen by pressing Super+L keyboard shortcut in Ubuntu and then using the fingerprint for login. - -![Login With Fingerprint in Ubuntu][8] - -#### Experience with fingerprint login on Ubuntu - -Fingerprint login is what its name suggests: login using your fingerprint. That’s it. You cannot use your finger when it asks for authentication for programs that need sudo access. It’s not a replacement of your password. - -One more thing. The fingerprint login allows you to log in but you cannot use your finger when your system asks for sudo password. The [keyring in Ubuntu][9] also remains locked. - -Another annoying thing is because of GNOME’s GDM login screen. When you login, you have to click on your account first to get to the password screen. This is where you can use your finger. It would have been nicer to not bothered about clicking the user account ID first. - -I also notice that fingerprint reading is not as smooth and quick as it is in Windows. It works, though. - -If you are somewhat disappointed with the fingerprint login on Linux, you may disable it. Let me show you the steps in the next section. - -### Disable fingerprint login - -Disabling fingerprint login is pretty much the same as enabling it in the first place. - -Go to **Settings→User** and then click on Fingerprint Login option. It will show a screen with options to add more fingerprints or delete the existing ones. You need to delete the existing fingerprints. - -![Disable Fingerprint Login][10] - -Fingerprint login does have some benefits, specially for lazy people like me. I don’t have to type my password every time I lock the screen and I am happy with the limited usage. - -Enabling sudo with fingerprint should not be entirely impossible with [PAM][11]. I remember that when I [set up face unlock in Ubuntu][12], it could be used with sudo as well. Let’s see if future versions add this feature. - -Do you have a laptop with fingerprint reader? Do you use it often or is it just one of things you don’t care about? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fingerprint-login-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.gnome.org/ -[2]: https://kde.org/ -[3]: https://itsfoss.com/find-desktop-environment/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/enable-fingerprint-ubuntu.png?resize=800%2C607&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-login-ubuntu.png?resize=800%2C496&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-ubuntu-linux.png?resize=800%2C603&ssl=1 -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/fingerprint-added-ubuntu.png?resize=797%2C510&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/login-with-fingerprint-ubuntu.jpg?resize=800%2C320&ssl=1 -[9]: https://itsfoss.com/ubuntu-keyring/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/disable-fingerprint-login.png?resize=798%2C524&ssl=1 -[11]: https://tldp.org/HOWTO/User-Authentication-HOWTO/x115.html -[12]: https://itsfoss.com/face-unlock-ubuntu/ diff --git a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..6a9000c8ba --- /dev/null +++ b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) +[#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +如何在 Ubuntu 和其他 Linux 发行版中添加指纹登录 +====== + +现在很多高端笔记本都配备了指纹识别器。Windows 和 macOS 支持指纹登录已经有一段时间了。在桌面 Linux 中,对指纹登录的支持更多的是极客的调整,但 [GNOME][1] 和 [KDE][2] 已经开始通过系统设置来支持它。 + +这意味着在新的 Linux 发行版上,你可以轻松使用指纹识别。在这里我将在 Ubuntu 中启用指纹登录,但你也可以在其他运行 GNOME 3.38 的发行版上使用这些步骤。 + +前提条件 + +当然,这是显而易见的。你的电脑必须有一个指纹识别器。 + +这个方法适用于任何运行 GNOME 3.38 或更高版本的 Linux 发行版。如果你不确定,你可以[检查你使用的桌面环境版本][3]。 + +KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同。 + +### 在 Ubuntu 和其他 Linux 发行版中添加指纹登录功能 + +进入 **Settings** ,然后点击左边栏的 **Users**。你应该可以看到系统中所有的用户账号。你会看到几个选项,包括 **Fingerprint Login**。 + +点击这里的指纹登录选项。 + +![Enable fingerprint login in Ubuntu][4] + +它将立即要求你扫描一个新的指纹。当你点击 “+” 号来添加指纹时,它会提供一些预定义的选项,这样你就可以很容易地识别出它是哪根手指或拇指。 + +当然,你可以点击右手食指但扫描左手拇指,不过我看不出你有什么好的理由要这么做。 + +![Adding fingerprint][5] + +在添加指纹时,请按照指示旋转你的手指或拇指。 + +![Rotate your finger][6] + +系统登记了整个手指后,就会给你一个绿色的信号,表示已经添加了指纹。 + +![Fingerprint successfully added][7] + +如果你想马上测试一下,在 Ubuntu 中按 Super+L 快捷键锁定屏幕,然后使用指纹进行登录。 + +![Login With Fingerprint in Ubuntu][8] + +#### 在 Ubuntu 上使用指纹登录的经验 + +指纹登录顾名思义就是用指纹登录。就是这样。当它要求对需要 sudo 访问的程序进行认证时,你不能使用手指。它不能代替你的密码。 + +还有一件事。指纹登录可以让你登录,但当系统要求输入 sudo 密码时,你不能用手指。Ubuntu 中的 [keyring][9] 也仍然是锁定的。 + +另一件烦人的事情是因为 GNOME 的 GDM 登录界面。当你登录时,你必须先点击你的账户才能进入密码界面。你在这可以使用手指。如果不用麻烦先点击用户帐户 ID 就更好了。 + +我还注意到,指纹识别没有 Windows 中那么流畅和快速。不过,它可以使用。 + +如果你对 Linux 上的指纹登录有些失望,你可以禁用它。让我在下一节告诉你步骤。 + +### 禁用指纹登录 + +禁用指纹登录和最初启用指纹登录差不多。 + +进入 **Settings→User**,然后点击指纹登录选项。它会显示一个有添加更多指纹或删除现有指纹的页面。你需要删除现有的指纹。 + +![Disable Fingerprint Login][10] + +指纹登录确实有一些好处,特别是对于我这种懒人来说。我不用每次锁屏时输入密码,我也对这段有限的使用感到满意。 + +用 [PAM][11] 启用指纹解锁 sudo 应该不是完全不可能。我记得我[在 Ubuntu 中设置脸部解锁][12]时,也可以用于 sudo。看看以后的版本是否会增加这个功能吧。 + +你有带指纹识别器的笔记本吗?你是否经常使用它,或者它只是你不关心的东西之一? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fingerprint-login-ubuntu/ + +作者:[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.gnome.org/ +[2]: https://kde.org/ +[3]: https://itsfoss.com/find-desktop-environment/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/enable-fingerprint-ubuntu.png?resize=800%2C607&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-login-ubuntu.png?resize=800%2C496&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/adding-fingerprint-ubuntu-linux.png?resize=800%2C603&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/fingerprint-added-ubuntu.png?resize=797%2C510&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/login-with-fingerprint-ubuntu.jpg?resize=800%2C320&ssl=1 +[9]: https://itsfoss.com/ubuntu-keyring/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/disable-fingerprint-login.png?resize=798%2C524&ssl=1 +[11]: https://tldp.org/HOWTO/User-Authentication-HOWTO/x115.html +[12]: https://itsfoss.com/face-unlock-ubuntu/ From 9e0533b270ceed35506813d0d7c62b2a27a7df1d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 21 Apr 2021 08:52:51 +0800 Subject: [PATCH 200/307] translating --- ... Ambient Noise App With Variety of Sounds to Stay Focused.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md index 27bfbe6d37..cce8abbd45 100644 --- a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dd90c119d23fcabe1098838c0b710dbcec6cdeb9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Apr 2021 18:49:15 +0800 Subject: [PATCH 201/307] PRF @tt67wq --- ...e dynamic and static libraries in Linux.md | 130 +++++++----------- 1 file changed, 51 insertions(+), 79 deletions(-) diff --git a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md index bc951369bb..19454dbd89 100644 --- a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ b/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md @@ -1,24 +1,25 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to handle dynamic and static libraries in Linux) [#]: via: (https://opensource.com/article/20/6/linux-libraries) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) -怎样在 Linux 中处理动态和静态库 +怎样在 Linux 中使用动态和静态库 ====== -了解 Linux 如何使用库,包括静态库和动态库的差别,有助于你解决依赖问题。![Hand putting a Linux file folder into a drawer][1] + +> 了解 Linux 如何使用库,包括静态库和动态库的差别,有助于你解决依赖问题。 + +![](https://img.linux.net.cn/data/attachment/album/202104/21/184822euzoqsiwxxpiqqrr.jpg) Linux 从某种意义上来说就是一堆相互依赖的静态和动态库。对于 Linux 系统新手来说,库的整个处理过程简直是个迷。但对有经验的人来说,被构建进操作系统的大量共享代码对于编写新应用来说却是个优点。 - -为了让你熟悉这个话题,我准备了一个小巧的[应用例子 ][2] 来展示在常用 Linux 发行版(在其他操作系统上未验证)上最常用的可行方法。为了用这个例子来跟上这个需要动手的教程,打开命令行输入: - +为了让你熟悉这个话题,我准备了一个小巧的 [应用例子][2] 来展示在普通的 Linux 发行版(在其他操作系统上未验证)上是经常是如何处理库的。为了用这个例子来跟上这个需要动手的教程,请打开命令行输入: ``` -$ git clone +$ git clone https://github.com/hANSIc99/library_sample $ cd library_sample/ $ make cc -c main.c -Wall -Werror @@ -34,8 +35,7 @@ $ make clean rm *.o ``` -当执行完这些命令,这些文件应当被添加进目录下(执行 `ls` 来查看): - +当执行完这些命令,这些文件应当被添加进目录下(执行 `ls` 来查看): ``` my_app @@ -45,20 +45,18 @@ libmy_shared.so ### 关于静态链接 -当你的应用链接了一个静态库,这个库的代码就变成了可执行结果的一部分。这个动作只在链接过程中执行一次,这些静态库通常以 `.a` 扩展符结尾。 +当你的应用链接了一个静态库,这个库的代码就变成了可执行文件的一部分。这个动作只在链接过程中执行一次,这些静态库通常以 `.a` 扩展符结尾。 -静态库是多个对象文件的打包。这些目标文件通常是 ELF 格式的。ELF 是 [Executable and Linkable Format][4] 的简写,可以兼容多个操作系统。 - -`file` 命令的输出告诉你静态库 `libmy_static.a` 是 `ar` 格式的压缩文件类型。 +静态库是多个目标object文件的归档archive([ar][3])。这些目标文件通常是 ELF 格式的。ELF 是 [可执行可链接格式][4]Executable and Linkable Format 的简写,它与多个操作系统兼容。 +`file` 命令的输出可以告诉你静态库 `libmy_static.a` 是 `ar` 格式的归档文件类型。 ``` $ file libmy_static.a libmy_static.a: current ar archive ``` -使用 `ar -t`,你可以看到压缩包内部;它展示了两个目标文件: - +使用 `ar -t`,你可以看到归档文件的内部。它展示了两个目标文件: ``` $ ar -t libmy_static.a @@ -66,8 +64,7 @@ libmy_static_a.o libmy_static_b.o ``` -你可以用 `ax -x ` 命令来提取压缩包的文件。被提出的都是 ELF 格式的对象文件: - +你可以用 `ax -x ` 命令来提取归档文件的文件。被提出的都是 ELF 格式的目标文件: ``` $ ar -x libmy_static.a @@ -77,33 +74,31 @@ libmy_static_a.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stri ### 关于动态链接 -动态链接的指的是使用共享库。共享库通常以 `.so` 的扩展符结尾 ("shared object" 的简写)。 +动态链接指的是使用共享库。共享库通常以 `.so` 的扩展名结尾(“共享对象shared object” 的简写)。 -共享库是 Linux 系统中依赖管理最常用的方法。这些共享库在应用启动前被载入内存,当多个应用都需要同一个库时,这个库在系统中只会被加载一次。这个特点减少了应用的内存占用。 +共享库是 Linux 系统中依赖管理的最常用方法。这些共享库在应用启动前被载入内存,当多个应用都需要同一个库时,这个库在系统中只会被加载一次。这个特性减少了应用的内存占用。 -另外一个值得注意的点是,当一个共享库的 bug 被修复后,所有引用了这个库的应用都会受益。这也意味着,如果一个 bug 还没被发现,那所有相关的应用都会遭受这个 bug 影响(如果这个应用使用了受影响的部分)。 +另外一个值得注意的地方是,当一个共享库的 bug 被修复后,所有引用了这个库的应用都会受益。但这也意味着,如果一个 bug 还没被发现,那所有相关的应用都会遭受这个 bug 影响(如果这个应用使用了受影响的部分)。 -当一个应用需要某个特定版本的库,但是链接器只知道某个不兼容版本的位置,对于初学者来说这个问题非常棘手。在这个场景下,你必须帮助链接器找到正确版本的路径。 +当一个应用需要某个特定版本的库,但是链接器linker只知道某个不兼容版本的位置,对于初学者来说这个问题非常棘手。在这个场景下,你必须帮助链接器找到正确版本的路径。 -尽管这不是一个需要每天处理的问题,但是理解动态链接的原理总是有助于你修复类似的问题。 +尽管这不是一个每天都会遇到的问题,但是理解动态链接的原理总是有助于你修复类似的问题。 幸运的是,动态链接的机制其实非常简洁明了。 为了检查一个应用在启动时需要哪些库,你可以使用 `ldd` 命令,它会打印出给定文件所需的动态库: - ``` $ ldd my_app         linux-vdso.so.1 (0x00007ffd1299c000) -        libmy_shared.so => not found -        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000) +        libmy_shared.so => not found +        libc.so.6 => /lib64/libc.so.6 (0x00007f56b869b000)         /lib64/ld-linux-x86-64.so.2 (0x00007f56b8881000) ``` -注意到 `libmy_shared.so` 库是代码仓库的一部分但是没有被找到。这是因为负责在应用启动之前将所有依赖加载进内存的动态链接器没有在它搜索的标准路径下找到这个库。 - -对新手来说,与常用库(例如 `bizp2`) 版本不兼容相关的问题往往十分令人困惑。一种方法是把该仓库的路径加入到环境变量 `LD_LIBRARY_PATH` 中来告诉链接器去哪里找到正确的版本。在本例中,正确的版本就在这个目录下,所以你可以导出它至环境变量: +可以注意到 `libmy_shared.so` 库是代码仓库的一部分,但是没有被找到。这是因为负责在应用启动之前将所有依赖加载进内存的动态链接器没有在它搜索的标准路径下找到这个库。 +对新手来说,与常用库(例如 `bizp2`)版本不兼容相关的问题往往十分令人困惑。一种方法是把该仓库的路径加入到环境变量 `LD_LIBRARY_PATH` 中来告诉链接器去哪里找到正确的版本。在本例中,正确的版本就在这个目录下,所以你可以导出它至环境变量: ``` $ LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH @@ -112,19 +107,16 @@ $ export LD_LIBRARY_PATH 现在动态链接器知道去哪找库了,应用也可以执行了。你可以再次执行 `ldd` 去调用动态链接器,它会检查应用的依赖然后加载进内存。内存地址会在对象路径后展示: - ``` $ ldd my_app         linux-vdso.so.1 (0x00007ffd385f7000) -        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000) +        libmy_shared.so => /home/stephan/library_sample/libmy_shared.so (0x00007f3fad401000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f3fad21d000)         /lib64/ld-linux-x86-64.so.2 (0x00007f3fad408000) ``` 想知道哪个链接器被调用了,你可以用 `file` 命令: - - ``` $ file my_app my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=26c677b771122b4c99f0fd9ee001e6c743550fa6, for GNU/Linux 3.2.0, not stripped @@ -132,68 +124,60 @@ my_app: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, 链接器 `/lib64/ld-linux-x86–64.so.2` 是一个指向 `ld-2.30.so` 的软链接,它也是我的 Linux 发行版的默认链接器: - ``` $ file /lib64/ld-linux-x86-64.so.2 /lib64/ld-linux-x86-64.so.2: symbolic link to ld-2.31.so ``` -回头看看 `ldd` 命令的输出,你还可以看到(在 `libmy_shared.so` 边上)每个依赖都以一个数字结尾(例如 `/lib64/libc.so.6`)。共享对象的常见命名格式为: - +回头看看 `ldd` 命令的输出,你还可以看到(在 `libmy_shared.so` 边上)每个依赖都以一个数字结尾(例如 `/lib64/libc.so.6`)。共享对象的常见命名格式为: ``` -`**lib** XYZ.so **.** . ****` +libXYZ.so.. ``` -在我的系统中,`libc.so.6` 也是指向同一目录下的共享对象 `libc-2.30.so` 的软链接。 - +在我的系统中,`libc.so.6` 也是指向同一目录下的共享对象 `libc-2.31.so` 的软链接。 ``` $ file /lib64/libc.so.6 /lib64/libc.so.6: symbolic link to libc-2.31.so ``` -如果你正在面对一个应用因为加载库的版本不对导致无法启动的问题,有很大可能你可以通过检查整理这些软链接或者确定正确的搜索路径(查看下方"动态链接器:ld.so") 来解决这个问题。 +如果你正在面对一个应用因为加载库的版本不对导致无法启动的问题,有很大可能你可以通过检查整理这些软链接或者确定正确的搜索路径(查看下方“动态加载器:ld.so”一节)来解决这个问题。 -更为详细的信息请查看 [`ldd`man 手册 ][5] +更为详细的信息请查看 [ldd 手册页][5]。 #### 动态加载 -动态加载的意思是一个库(例如一个 `.so` 文件)在程序的运行时被加载。这是使用某种特定的编程方法实现的。 +动态加载的意思是一个库(例如一个 `.so` 文件)在程序的运行时被加载。这是使用某种特定的编程方法实现的。 -当一个应用使用运行时可编辑的插件时,动态加载会生效。 +当一个应用使用可以在运行时改变的插件时,就会使用动态加载。 -查看 [`dlopen`man 手册 ][6] 获取更多信息。 +查看 [dlopen 手册页][6] 获取更多信息。 #### 动态加载器:ld.so -在 Linux 系统中,你很大可能正在跟共享库打交道,所以必须有个机制来检测一个应用的依赖并将其加载进内存中。 - +在 Linux 系统中,你几乎总是正在跟共享库打交道,所以必须有个机制来检测一个应用的依赖并将其加载进内存中。 `ld.so` 按以下顺序在这些地方寻找共享对象: - 1。应用的绝对路径或相对路径下 (GCC 编译器用 `-rpath` 选项来硬编码) - 2。环境变量 `LD_LIBRARY_PATH` - 3。`/etc/ld.so.cache` 文件 - - -需要记住的是,将一个库加到系统归档 `/usr/lib64` 中需要管理员权限。你可以手动拷贝 `libmy_shared.so` 至库归档中来让应用可用而避免设置 `LD_LIBRARY_PATH`。 + 1. 应用的绝对路径或相对路径下(用 GCC 编译器的 `-rpath` 选项硬编码的) + 2. 环境变量 `LD_LIBRARY_PATH` + 3. `/etc/ld.so.cache` 文件 +需要记住的是,将一个库加到系统库归档 `/usr/lib64` 中需要管理员权限。你可以手动拷贝 `libmy_shared.so` 至库归档中来让应用可以运行,而避免设置 `LD_LIBRARY_PATH`。 ``` unset LD_LIBRARY_PATH sudo cp libmy_shared.so /usr/lib64/ ``` - 当你运行 `ldd` 时,你现在可以看到归档库的路径被展示出来: - ``` $ ldd my_app         linux-vdso.so.1 (0x00007ffe82fab000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) -        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007f0a963e0000) +        libc.so.6 => /lib64/libc.so.6 (0x00007f0a96216000)         /lib64/ld-linux-x86-64.so.2 (0x00007f0a96401000) ``` @@ -201,44 +185,40 @@ $ ldd my_app 如果你想你的应用使用你的共享库,你可以在编译时指定一个绝对或相对路径。 -编辑 makefile( 第 10 行)然后通过 `make -B` 来重新编译程序。然后 `ldd` 输出显示 `libmy_shared.so` 和它的绝对路径一起被列出来了。 +编辑 `makefile`(第 10 行)然后通过 `make -B` 来重新编译程序。然后 `ldd` 输出显示 `libmy_shared.so` 和它的绝对路径一起被列出来了。 把这个: - ``` -`CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd)` +CFLAGS =-Wall -Werror -Wl,-rpath,$(shell pwd) ``` -改成这个(记得修改用户名): - +改成这个(记得修改用户名): ``` -`CFLAGS =/home/stephan/library_sample/libmy_shared.so` +CFLAGS =/home/stephan/library_sample/libmy_shared.so ``` 然后重新编译: - ``` -`$ make` +$ make ``` 确认下它正在使用你设定的绝对路径,你可以在输出的第二行看到: - ``` $ ldd my_app     linux-vdso.so.1 (0x00007ffe143ed000) -        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000) +        libmy_shared.so => /lib64/libmy_shared.so (0x00007fe50926d000)         /home/stephan/library_sample/libmy_shared.so (0x00007fe509268000) -        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000) +        libc.so.6 => /lib64/libc.so.6 (0x00007fe50909e000)         /lib64/ld-linux-x86-64.so.2 (0x00007fe50928e000) ``` 这是个不错的例子,但是如果你在编写给其他人用的库,它是怎样工作的呢?新库的路径可以通过写入 `/etc/ld.so.conf` 或是在 `/etc/ld.so.conf.d/` 目录下创建一个包含路径的 `.conf` 文件来注册至系统。之后,你必须执行 `ldconfig` 命令来覆写 `ld.so.cache` 文件。这一步有时候在你装了携带特殊的共享库的程序来说是不可省略的。 -查看 [`ld.so` 的 man 手册 ][7] 获取更多详细信息。 +查看 [ld.so 的手册页][7] 获取更多详细信息。 ### 怎样处理多种架构 @@ -249,32 +229,24 @@ $ ldd my_app * 32 位:`/usr/lib` * 64 位:`/usr/lib64` - - **Debian 家族** * 32 位:`/usr/lib/i386-linux-gnu` * 64 位:`/usr/lib/x86_64-linux-gnu` - - **Arch Linux 家族** * 32 位:`/usr/lib32` * 64 位:`/usr/lib64` - - -[**FreeBSD**][8] (技术上来说不算 Linux 发行版) +[FreeBSD][8](技术上来说不算 Linux 发行版) * 32 位:`/usr/lib32` * 64 位:`/usr/lib` - - 知道去哪找这些关键库可以让库链接失效的问题成为历史。 -虽然刚开始会有点困惑,但是理解 Linux 库的依赖管理是一种对操作系统掌控感的表现。用其他应用按这些步骤执行下来增加常用库的熟练度,然后继续学习怎样解决任何你可能遇到的库的挑战。 +虽然刚开始会有点困惑,但是理解 Linux 库的依赖管理是一种对操作系统掌控感的表现。在其他应用程序中运行这些步骤,以熟悉常见的库,然后继续学习怎样解决任何你可能遇到的库的挑战。 -------------------------------------------------------------------------------- @@ -283,7 +255,7 @@ via: https://opensource.com/article/20/6/linux-libraries 作者:[Stephan Avenwedde][a] 选题:[lujun9972][b] 译者:[tt67wq](https://github.com/tt67wq) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 14d5e9677e716059430ddfa7979d720685f71480 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 21 Apr 2021 18:51:20 +0800 Subject: [PATCH 202/307] PUB @tt67wq https://linux.cn/article-13318-1.html --- ...617 How to handle dynamic and static libraries in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200617 How to handle dynamic and static libraries in Linux.md (99%) diff --git a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md b/published/20200617 How to handle dynamic and static libraries in Linux.md similarity index 99% rename from translated/tech/20200617 How to handle dynamic and static libraries in Linux.md rename to published/20200617 How to handle dynamic and static libraries in Linux.md index 19454dbd89..d74b9a4b50 100644 --- a/translated/tech/20200617 How to handle dynamic and static libraries in Linux.md +++ b/published/20200617 How to handle dynamic and static libraries in Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (tt67wq) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13318-1.html) [#]: subject: (How to handle dynamic and static libraries in Linux) [#]: via: (https://opensource.com/article/20/6/linux-libraries) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) From cc9e6b9c4b5116ecab41d848c5a36a071ae7ad4b Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Wed, 21 Apr 2021 20:20:48 +0800 Subject: [PATCH 203/307] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=BF=BB=E8=AF=91=20?= =?UTF-8?q?(#21672)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Create 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 完成翻译 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Rename sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md to translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md --- ... Source Supply Chain- A Matter of Trust.md | 69 ------------------- ... Source Supply Chain- A Matter of Trust.md | 66 ++++++++++++++++++ 2 files changed, 66 insertions(+), 69 deletions(-) delete mode 100644 sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md create mode 100644 translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md diff --git a/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md deleted file mode 100644 index 3484c3ca55..0000000000 --- a/sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Open Source Supply Chain: A Matter of Trust) -[#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) -[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) - -Open Source Supply Chain: A Matter of Trust -====== - -[![][1]][2] - -_**Co-authored by Curtis Franklin, Jr**_ - -Open source software is often considered safer and more secure than proprietary software because users can, if they want, compile the software from the source code. They know the source of the code running in their environment.  Every component that they are running in their environment can be audited and the developer held accountable.   - -However, users and vendors are moving away from complexity that comes with total control and embracing convenience and ease of use. - -“I am often taken aback when I see a talk around security and privacy and then the presenter runs the ‘docker run’ command to install and run some random binary downloaded from the internet,” said [Dirk Hohndel, Vice-President and Chief Open Source Officer at VMware.][3] “Those two things seem to be a little bit at odds with each other.” - -The software supply chain — the process that takes an application from coding through packaging and distribution to its ultimate user — is complicated. If done wrong, it could be potentially risky, especially for open source software.  A malevolent player can get access to the backend and start inserting any random binary code onto a user’s system without that user’s knowledge or control. - -It’s not a problem specific to the cloud-native world. It can be seen in modern app development environments, including JavaScript, npm, PyPI, RubyGems, and so on.  Even Homebrew on Mac used to be provided through source code that a user would compile themselves.  - -“Today, you just download the binary and install it, hoping that it’s built from the same source code that you have access to,” said Hohndel. “As an industry, we need to pay more attention to our supply chain.  It’s something that is extremely important to me and that I’m trying to get more people interested in it.”  - -It’s not simply a binary versus source code equation, though. There are huge advantages to just running a binary instead of having to build everything from sources.   It allows developers to be more flexible and more responsive in their turnaround. They can cycle very quickly through new development and product releases by reusing some binaries. - -“It would be nice if there was a way to sign these binaries and have an ‘on-the-fly’ verification mechanism so users know they can trust these,” said Hohndel. - -Linux distributions have solved this problem as the distributions act as gatekeepers who check the integrity of packages that go into supported repositories.  - -“Packages offered through distributions like Debian are signed with a key. It takes a lot of work to ensure that this is really the software that should be in the distribution. They have solved the supply chain problem,” said Hohndel. - -But even on Linux distribution, people want to simplify things and trade correctness and security for speed. There are now projects like AppImage, Snap and Flatpack that have adopted the binary route, bringing the trust issue to Linux distributions. It’s the same problem of docker containers all over again. - -“The ideal solution would be to find a way for us as a community to devise a system of trust which ensures that if a binary was signed with a key that is in the network of trust, it can be trusted and provides us with the ability to reliably go back to the sources and do an audit,” suggested Hohndel. - -However, all this additional steps incur costs that most projects are either unwilling or unable to afford. Some projects are trying to find ways around the problem. NPM, for example, has begun to encourage those submitting packages to properly authenticate and secure their accounts to improve trustworthiness on the platform.  - -**Open Source Community Is Good At Solving Problems** - -Hohndel is involved with many efforts to solve the open source supply chain problem and is spreading awareness about it. Last year, [VMware acquired Bitnami,][4] which is a great place for curating open source applications that are signed by VMware.  - -“We are talking with upstream open source communities in various ecosystems to raise awareness about it. We are also discussing technical solutions that will make it easier for these communities to solve the underlying problems,” said Hohndel. - -The open source community has historically been diligent at ensuring software quality, including the mechanisms for security and privacy. Still, Hohndel says, “The biggest concern that I have is that, in the excitement about the next new thing, we often ignore the underlying engineering discipline that we really need.” - -Ultimately, Hohndel feels that answer will come from the open source community itself. “Open source is an engineering methodology and it’s a social experiment. Open source is all about people trusting each other, working with each other, collaborating across borders, between companies, amongst competitors in ways that we didn’t do before,” he explains. - --------------------------------------------------------------------------------- - -via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ - -作者:[Swapnil Bhartiya][a] -选题:[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/author/swapnil/ -[b]: https://github.com/lujun9972 -[1]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920-1068x801.jpg (hand-1137978_1920) -[2]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920.jpg -[3]: https://www.swapnilbhartiya.com/open-source-leaders-dirk-hohndel-brings-open-source-to-vmware/ -[4]: https://techcrunch.com/2019/05/15/vmware-acquires-bitnami-to-deliver-packaged-applications-anywhere/ diff --git a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md new file mode 100644 index 0000000000..a0fe07a2f9 --- /dev/null +++ b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -0,0 +1,66 @@ +[#]: collector: (lujun9972) +[#]: translator: (Kevin3599) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source Supply Chain: A Matter of Trust) +[#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) +[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) + +开源供应链:一个有关信任的问题 +====== + +[![][1]][2] + +_**Co-authored by Curtis Franklin, Jr**_ + + 开源软件相比于商业性软件,通常是被认为更加安全的,因为用户可以编译软件的源代码开发者们知道在他们的开发环境中运行的代码。在他们的环境中运行的代码每个部分都可以被审查,也可以追溯每段代码的开发者。 + + 然而,用户和开发商们正在逐渐远离这样对软件的完全控制带来的复杂性,而在转而追求软件的便捷和易用。 + + VMware副总裁兼首席开源官Dirk Hohndel表示:“当我看到一个有关网络安全和隐私的演讲,然后演讲者运行‘docker run’命令来安装和运行从互联网上随机下载的二进制文件时,我感到大吃一惊。”“这两件事似乎有点不协调。”他说到。 + + 软件供应链——应用程序从编码、打包、分发到最终用户的过程是相当复杂的。如果其中有一环出现错误,可能会导致软件存在潜在的风险,特别是对于开源软件。黑客可以访问后端并在用户不知情或不受控的情况下向其插入任何可能的恶意代码。 + + 这样的问题不单单存在于云计算领域。这样的问题在现代的app开发中很常见,包括JavaScript、npm、PyPI、RubyGems等等。甚至连Mac上的homebrew曾经依赖于用户自行编译的代码。 + + Hohndel说:“今天,你只需要下载二进制文件并安装它,并期望其源代码并没有被恶意修改过。”“作为一个行业,我们需要更加关注我们的开源代码供应。这对我来说非常重要,我正努力让更多的人意识到其重要性。” + + 然而,这不仅仅是一个二进制与源代码的等式。只运行一个二进制文件,而不必从源代码构建所有东西有着巨大的优势。当软件开发需求发生转变时候,这种运行方式允许开发人员在过程中更加灵活和响应更快。通过重用一些二进制文件,他们可以在新的开发和部署中快速地循环。 + + Hohndel 说:"如果有办法想这些软件添加签名,并建立一个'即时'验证机制,让用户知道他们可以信任此软件。会是很好的方案。 + + Linux的发行版解决了这个问题,因为发行版充当了看门人的角色,负责检查进入受支持存储库的软件包的完整性。 + + “像通过Debian等发行版提供的软件包都用密钥签名。要确保它确实是发行版中应包含的软件,需要进行大量工作。开发者们通过这种方式解决了开源供应链问题。”Hohndel说。 + + 但是,即使在Linux发行版上,人们也希望简化事情,并以正确性和安全性换取速度。现在,诸如AppImage,Snap和Flatpack之类的项目已经采用了二进制搜索路由,从而将开源供应链信任问题带入了Linux发行版。而Docker容器又一次遇到了同样的问题。 + + “理想的解决方案是为开源社区找到一种设计信任系统的方法,该系统可以确保如果二进制文件是用受信任网络中的密钥签名的,那么它就可以被信任,并允许我们可靠地返回源头并进行审核,” Hohndel建议。 + + 但是,所有这些附加步骤都会导致大多数项目产生开发者不愿或无法承担的费用。一些项目正在尝试寻找解决该问题的方法。例如,NPM已开始鼓励提交软件包的用户正确认证和保护其账户安全,以提高平台的可靠性。 + + Hohndel致力于解决开源供应链问题,并正试图让更多开发者意识到其重要性。去年,VMware收购了Bitnami,这为管理由VMware所签名的开源软件提供了一个良机。 + + “我们正在与各种上游开源社区进行交流,以提高对此的认识。我们还在讨论技术解决方案,这些方案将使这些社区更容易解决潜在的开源供应链问题。” Hohndel说。 + + 开源社区历来致力于确保软件质量,这其中也包括安全性和隐私性。不过,Hohndel说:“我最担心的是,在对下一个新事物感到兴奋时,我们经常忽略需要的技术。” + + 最终,Hohndel认为答案将来自开源社区本身。 “开源是一种工程方法论,是一种社会实验。开源就是人们之间相互信任,相互合作,跨国界,公司之间以及竞争对手之间以我们以前从未有过的方式合作。”他解释说。 +-------------------------------------------------------------------------------- + +via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ + +作者:[Swapnil Bhartiya][a] +选题:[lujun9972][b] +译者:[Kevin3599]() +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.linux.com/author/swapnil/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920-1068x801.jpg (hand-1137978_1920) +[2]: https://www.linux.com/wp-content/uploads/2020/01/hand-1137978_1920.jpg +[3]: https://www.swapnilbhartiya.com/open-source-leaders-dirk-hohndel-brings-open-source-to-vmware/ +[4]: https://techcrunch.com/2019/05/15/vmware-acquires-bitnami-to-deliver-packaged-applications-anywhere/ From e6b2a8840b890b44dac2cd9103daf8552efdf554 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 05:02:33 +0800 Subject: [PATCH 204/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421=20?= =?UTF-8?q?Build=20smaller=20containers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 Build smaller containers.md --- .../tech/20210421 Build smaller containers.md | 352 ++++++++++++++++++ 1 file changed, 352 insertions(+) create mode 100644 sources/tech/20210421 Build smaller containers.md diff --git a/sources/tech/20210421 Build smaller containers.md b/sources/tech/20210421 Build smaller containers.md new file mode 100644 index 0000000000..a4e71cd974 --- /dev/null +++ b/sources/tech/20210421 Build smaller containers.md @@ -0,0 +1,352 @@ +[#]: subject: (Build smaller containers) +[#]: via: (https://fedoramagazine.org/build-smaller-containers/) +[#]: author: (Daniel Schier https://fedoramagazine.org/author/danielwtd/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Build smaller containers +====== + +![build smaller containers][1] + +Otter image excerpted from photo by [Dele Oluwayomi][2] on [Unsplash][3] + +Working with containers is a daily task for many users and developers. Container developers often need to (re)build container images frequently. If you develop containers, have you ever thought about reducing the image size? Smaller images have several benefits. They require less bandwidth to download and they save costs when run in cloud environments. Also, using smaller container images on Fedora [CoreOS][4], [IoT][5] and [Silverblue][6] improves overall system performance because those operating systems rely heavily on container workflows. This article will provide a few tips for reducing the size of container images. + +### The tools + +The host operating system in the following examples is Fedora Linux 33. The examples use [Podman][7] 3.1.0 and [Buildah][8] 1.2.0. Podman and Buildah are pre-installed in most Fedora Linux variants. If you don’t have Podman or Buildah installed, run the following command to install them. + +``` +$ sudo dnf install -y podman buildah +``` + +### The task + +Begin with a basic example. Build a web container meeting the following requirements. + + * The container must be based on Fedora Linux + * Use the Apache httpd web server + * Include a custom website + * The container should be relatively small + + + +The following steps will also work on more complex images. + +### The setup + +First, create a project directory. This directory will include your website and container file. + +``` +$ mkdir smallerContainer +$ cd smallerContainer +$ mkdir files +$ touch files/index.html +``` + +Make a simple landing page. For this demonstration, you may copy the below HTML into the _index.html_ file. + +``` + + + + + Container Page + + + +
+

Container Page

+
+
+

Fedora

+ +

Podman

+ +

Buildah

+ +

Skopeo

+ +

CRI-O

+ +
+ + + +``` + +Optionally, test the above _index.html_ file in your browser. + +``` +$ firefox files/index.html +``` + +Finally, create a container file. The file can be named either _Dockerfile_ or _Containerfile_. + +``` +$ touch Containerfile +``` + +You should now have a project directory with a file system layout similar to what is shown in the below diagram. + +``` +smallerContainer/ +|- files/ +| |- index.html +| +|- Containerfile +``` + +### The build + +Now make the image. Each of the below stages will add a layer of improvements to help reduce the size of the image. You will end up with a series of images, but only one _Containerfile_. + +#### Stage 0: a baseline container image + +Your new image will be very simple and it will only include the mandatory steps. Place the following text in _Containerfile_. + +``` +# Use Fedora 33 as base image +FROM registry.fedoraproject.org/fedora:33 + +# Install httpd +RUN dnf install -y httpd + +# Copy the website +COPY files/* /var/www/html/ + +# Expose Port 80/tcp +EXPOSE 80 + +# Start httpd +CMD ["httpd", "-DFOREGROUND"] +``` + +In the above file there are some comments to indicate what is being done. More verbosely, the steps are: + + 1. Create a build container with the base FROM registry.fedoraproject.org/fedora:33 + 2. RUN the command: _dnf install -y httpd_ + 3. COPY files relative to the _Containerfile_ to the container + 4. Set EXPOSE 80 to indicate which port is auto-publishable + 5. Set a CMD to indicate what should be run if one creates a container from this image + + + +Run the below command to create a new image from the project directory. + +``` +$ podman image build -f Containerfile -t localhost/web-base +``` + +Use the following command to examine your image’s attributes. Note in particular the size of your image (467 MB). + +``` +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-base latest ac8c5ed73bb5 5 minutes ago 467 MB +registry.fedoraproject.org/fedora 33 9f2a56037643 3 months ago 182 MB +``` + +The example image shown above is currently occupying 467 MB of storage. The remaining stages should reduce the size of the image significantly. But first, verify that the image works as intended. + +Enter the following command to start the container. + +``` +$ podman container run -d --name web-base -P localhost/web-base +``` + +Enter the following command to list your containers. + +``` +$ podman container ls +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +d24063487f9f localhost/web-base httpd -DFOREGROUN... 2 seconds ago Up 3 seconds ago 0.0.0.0:46191->80/tcp web-base +``` + +The container shown above is running and it is listening on port _46191_. Going to _localhost:46191_ from a web browser running on the host operating system should render your web page. + +``` +$ firefox localhost:46191 +``` + +#### Stage 1: clear caches and remove other leftovers from the container + +The first step one should always perform to optimize the size of their container image is “clean up”. This will ensure that leftovers from installations and packaging are removed. What exactly this process entails will vary depending on your container. For the above example you can just edit _Containerfile_ to include the following lines. + +``` +[...] +# Install httpd +RUN dnf install -y httpd && \ + dnf clean all -y +[...] +``` + +Build the modified _Containerfile_ to reduce the size of the image significantly (237 MB in this example). + +``` +$ podman image build -f Containerfile -t localhost/web-clean +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-clean latest f0f62aece028 6 seconds ago 237 MB +``` + +#### Stage 2: remove documentation and unneeded package dependencies + +Many packages will pull in recommendations, weak dependencies and documentation when they are installed. These are often not needed in a container and can be excluded. The _dnf_ command has options to indicate that it should not include weak dependencies or documentation. + +Edit _Containerfile_ again and add the options to exclude documentation and weak dependencies on the _dnf install_ line: + +``` +[...] +# Install httpd +RUN dnf install -y httpd --nodocs --setopt install_weak_deps=False && \ + dnf clean all -y +[...] +``` + +Build _Containerfile_ with the above modifications to achieve an even smaller image (231 MB). + +``` +$ podman image build -f Containerfile -t localhost/web-docs +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-docs latest 8a76820cec2f 8 seconds ago 231 MB +``` + +#### Stage 3: use a smaller container base image + +The prior stages, in combination, have reduced the size of the example image by half. But there is still one more thing that can be done to reduce the size of the image. The base image _registry.fedoraproject.org/fedora:33_ is meant for general purpose use. It provides a collection of packages that many people expect to be pre-installed in their Fedora Linux containers. The collection of packages provided in the general purpose Fedora Linux base image is often more extensive than needed, however. The Fedora Project also provides a _fedora-minimal_ base image for those who wish to start with only the essential packages and then add only what they need to achieve a smaller total image size. + +Use _podman image search_ to search for the _fedora-minimal_ image as shown below. + +``` +$ podman image search fedora-minimal +INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED +fedoraproject.org registry.fedoraproject.org/fedora-minimal 0 +``` + +The _fedora-minimal_ base image excludes [DNF][9] in favor of the smaller [microDNF][10] which does not require Python. When _registry.fedoraproject.org/fedora:33_ is replaced with _registry.fedoraproject.org/fedora-minimal:33_, _dnf_ needs to be replaced with _microdnf_. + +``` +# Use Fedora minimal 33 as base image +FROM registry.fedoraproject.org/fedora-minimal:33 + +# Install httpd +RUN microdnf install -y httpd --nodocs --setopt install_weak_deps=0 && \ + microdnf clean all -y +[...] +``` + +Rebuild the image to see how much storage space has been recovered by using _fedora-minimal_ (169 MB). + +``` +$ podman image build -f Containerfile -t localhost/web-docs +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-minimal latest e1603bbb1097 7 minutes ago 169 MB +``` + +The initial image size was **467 MB**. Combining the methods detailed in each of the above stages has resulted in a final image size of **169 MB**. The final _total_ image size is smaller than the original _base_ image size of 182 MB! + +### Building containers from scratch + +The previous section used a container file and Podman to build a new image. There is one last thing to demonstrate — building a container from scratch using Buildah. Podman uses the same libraries to build containers as Buildah. But Buildah is considered a pure build tool. Podman is designed to work as a replacement for Docker. + +When building from scratch using Buildah, the container is empty — there is _nothing_ in it. Everything needed must be installed or copied from outside the container. Fortunately, this is quite easy with Buildah. Below, a small Bash script is provided which will build the image from scratch. Instead of running the script, you can run each of the commands from the script individually in a terminal to better understand what is being done. + +``` +#!/usr/bin/env bash +set -o errexit + +# Create a container +CONTAINER=$(buildah from scratch) + +# Mount the container filesystem +MOUNTPOINT=$(buildah mount $CONTAINER) + +# Install a basic filesystem and minimal set of packages, and nginx +dnf install -y --installroot $MOUNTPOINT --releasever 33 glibc-minimal-langpack httpd --nodocs --setopt install_weak_deps=False + +dnf clean all -y --installroot $MOUNTPOINT --releasever 33 + +# Cleanup +buildah unmount $CONTAINER + +# Copy the website +buildah copy $CONTAINER 'files/*' '/var/www/html/' + +# Expose Port 80/tcp +buildah config --port 80 $CONTAINER + +# Start httpd +buildah config --cmd "httpd -DFOREGROUND" $CONTAINER + +# Save the container to an image +buildah commit --squash $CONTAINER web-scratch +``` + +Alternatively, the image can be built by passing the above script to Buildah. Notice that root privileges are not required. + +``` +$ buildah unshare bash web-scratch.sh +$ podman image ls +REPOSITORY TAG IMAGE ID CREATED SIZE +localhost/web-scratch latest acca45fc9118 9 seconds ago 155 MB +``` + +The final image is only **155 MB**! Also, the [attack surface][11] has been reduced. Not even DNF (or microDNF) is installed in the final image. + +### Conclusion + +Building smaller container images has many advantages. Reducing the needed bandwidth, the disk footprint and attack surface will lead to better images overall. It is easy to reduce the footprint with just a few small changes. Many of the changes can be done without altering the functionality of the resulting image. + +It is also possible to build very small images from scratch which will only hold the needed binaries and configuration files. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/build-smaller-containers/ + +作者:[Daniel Schier][a] +选题:[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/danielwtd/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/podman-smaller-1-816x345.jpg +[2]: https://unsplash.com/@errbodysaycheese?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/otter?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/getting-started-with-fedora-coreos/ +[5]: https://getfedora.org/en/iot/ +[6]: https://fedoramagazine.org/what-is-silverblue/ +[7]: https://podman.io/ +[8]: https://buildah.io/ +[9]: https://github.com/rpm-software-management/dnf +[10]: https://github.com/rpm-software-management/microdnf +[11]: https://en.wikipedia.org/wiki/Attack_surface From 0b73099ceb0b554ea31129eee32ed28ba1e5d7af Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 05:03:21 +0800 Subject: [PATCH 205/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421=20?= =?UTF-8?q?Optimize=20your=20Python=20code=20with=20C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 Optimize your Python code with C.md --- ...210421 Optimize your Python code with C.md | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 sources/tech/20210421 Optimize your Python code with C.md diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md new file mode 100644 index 0000000000..b21ec770ac --- /dev/null +++ b/sources/tech/20210421 Optimize your Python code with C.md @@ -0,0 +1,208 @@ +[#]: subject: (Optimize your Python code with C) +[#]: via: (https://opensource.com/article/21/4/cython) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Optimize your Python code with C +====== +Cython creates C modules that speed up Python code execution, important +for complex applications where an interpreted language isn't efficient. +![Hands on a keyboard with a Python book ][1] + +Cython is a compiler for the Python programming language meant to optimize performance and form an extended Cython programming language. As an extension of Python, [Cython][2] is also a superset of the Python language, and it supports calling C functions and declaring C types on variables and class attributes. This makes it easy to wrap external C libraries, embed C into existing applications, or write C extensions for Python in syntax as easy as Python itself. + +Cython is commonly used to create C modules that speed up Python code execution. This is important in complex applications where an interpreted language isn't efficient. + +### Install Cython + +You can install Cython on Linux, BSD, Windows, or macOS using Python: + + +``` +`$ python -m pip install Cython` +``` + +Once installed, it's ready to use. + +### Transform Python into C + +A good way to start with Cython is with a simple "hello world" application. It's not the best demonstration of Cython's advantages, but it shows what happens when you're using Cython. + +First, create this simple Python script in a file called `hello.pyx` (the `.pyx` extension isn't magical and it could technically be anything, but it's Cython's default extension): + + +``` +`print("hello world")` +``` + +Next, create a Python setup script. A `setup.py` file is like Python's version of a makefile, and Cython can use it to process your Python code: + + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("hello.pyx") +) +``` + +Finally, use Cython to transform your Python script into C code: + + +``` +`$ python setup.py build_ext --inplace` +``` + +You can see the results in your project directory. Cython's `cythonize` module transforms `hello.pyx` into a `hello.c` file and a `.so` library. The C code is 2,648 lines, so it's quite a lot more text than the single line of `hello.pyx` source. The `.so` library is also over 2,000 times larger than its source (54,000 compared to 20 bytes). Then again, Python is required to run a single Python script, so there's a lot of code propping up that single-line `hello.pyx` file. + +To use the C code version of your Python "hello world" script, open a Python prompt and import the new `hello` module you created: + + +``` +>>> import hello +hello world +``` + +### Integrate C code into Python + +A good generic test of computational power is calculating prime numbers. A prime number is a positive number greater than 1 that produces a positive integer only when divided by 1 or itself. It's simple in theory, but as numbers get larger, the calculation requirements also increase. In pure Python, it can be done in under 10 lines of code: + + +``` +import sys + +number = int(sys.argv[1]) +if not number <= 1: +    for i in range(2, number): +        if (number % i) == 0: +            print("Not prime") +            break +else: +    print("Integer must be greater than 1") +``` + +This script is silent upon success and returns a message if the number is not prime: + + +``` +$ ./prime.py 3 +$ ./prime.py 4 +Not prime. +``` + +Converting this to Cython requires a little work, partly to make the code appropriate for use as a library and partly for performance. + +#### Scripts and libraries + +Many users learn Python as a scripting language: you tell Python the steps you want it to perform, and it does the work. As you learn more about Python (and open source programming in general), you learn that much of the most powerful code out there is in the libraries that other applications can harness. The _less_ specific your code is, the more likely it can be repurposed by a programmer (you included) for other applications. It can be a little more work to decouple computation from workflow, but in the end, it's usually worth the effort. + +In the case of this simple prime number calculator, converting it to Cython begins with a setup script: + + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("prime.py") +) +``` + +Transform your script into C: + + +``` +`$ python setup.py build_ext --inplace` +``` + +Everything appears to be working well so far, but when you attempt to import and use your new module, you get an error: + + +``` +>>> import prime +Traceback (most recent call last): +  File "<stdin>", line 1, in <module> +  File "prime.py", line 2, in init prime +    number = sys.argv[1] +IndexError: list index out of range +``` + +The problem is that a Python script expects to be run from a terminal, where arguments (in this case, an integer to test as a prime number) are common. You need to modify your script so that it can be used as a library instead. + +#### Write a library + +Libraries don't use system arguments and instead accept arguments from other code. Instead of using `sys.argv` to bring in user input, make your code a function that accepts an argument called `number` (or `num` or whatever variable name you prefer): + + +``` +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") +``` + +This admittedly makes your script somewhat difficult to test because when you run the code in Python, the `calculate` function is never executed. However, Python programmers have devised a common, if not intuitive, workaround for this problem. When the Python interpreter executes a Python script, there's a special variable called `__name__` that gets set to `__main__`, but when it's imported as a module, `__name__` is set to the module's name. By leveraging this, you can write a library that is both a Python module and a valid Python script: + + +``` +import sys + +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") + +if __name__ == "__main__": +    number = sys.argv[1]     +    calculate( int(number) ) +``` + +Now you can run the code as a command: + + +``` +$ python ./prime.py 4 +Not a prime +``` + +And you can convert it to Cython for use as a module: + + +``` +>>> import prime +>>> prime.calculate(4) +Not prime +``` + +### C Python + +Converting code from pure Python to C with Cython can be useful. This article demonstrates how to do that part, yet there are Cython features to help you optimize your code before conversion, options to analyze your code to find when Cython interacts with C, and much more. If you're using Python, but you're looking to enhance your code with C code or further your understanding of how libraries provide better extensibility than scripts, or if you're just curious about how Python and C can work together, then start experimenting with Cython. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cython + +作者:[Alan Smithee][a] +选题:[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/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://cython.org/ From b15146269e1833b99852539795aef127a66ad178 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 05:03:33 +0800 Subject: [PATCH 206/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210421=20?= =?UTF-8?q?How=20to=20take=20your=20open=20source=20project=20to=20the=20n?= =?UTF-8?q?ext=20level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210421 How to take your open source project to the next level.md --- ...r open source project to the next level.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210421 How to take your open source project to the next level.md diff --git a/sources/tech/20210421 How to take your open source project to the next level.md b/sources/tech/20210421 How to take your open source project to the next level.md new file mode 100644 index 0000000000..2a56c4c9f7 --- /dev/null +++ b/sources/tech/20210421 How to take your open source project to the next level.md @@ -0,0 +1,116 @@ +[#]: subject: (How to take your open source project to the next level) +[#]: via: (https://opensource.com/article/21/4/open-source-saas) +[#]: author: (Stef Walter https://opensource.com/users/stefw) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How to take your open source project to the next level +====== +Merely releasing your SaaS's source code is not enough to make it open +source. +![Green graph of measurements][1] + +Open sourcing the code to your software as a service (SaaS) is not sufficient to make it actually be open source. Does that sound contradictory to you? Let me explain. + +Most services that espouse "open source" do so by simply throwing the code over the wall. It's better than nothing but really misses the point that powers open source: enabling users to make a change to the software they're using. + +Some other popular services powered by Open Source software, do include the tools used to operate/deploy their service. Pause for applause. + +But that’s also insufficient to actually enable users to become contributors effectively. + +Much of a service's value comes from things other than the code. It comes from the infrastructure it runs on, the operational processes, the monitoring, the backups, the metrics, the high availability, the scalability. It comes from data, from the network effect—with other users, with other interconnected services, with integrated tools, from legal agreements, and so on. + +Any non-toy service is not reproducible. + +Launching a clone of the service to contribute effectively is a high barrier. Certain kinds of contributions clearly are possible. But contributors are essentially asked to "fork" the non-code aspects of the service to iterate on their changes against their real-world use cases. + +What's more, without true open source principles, we are missing a way to have a community develop with a center of gravity around the service itself. This leads to companies forking the service in a way that typical open source projects with a true community are resilient to. + +I believe that if we enable contributions to services _rather than just the software_, we reap the advantages of true open source. That means enabling users to make a change to a running service and experience that change themselves. + +You still with me? + +Yes, that means opening a pull request against a running service and experiencing that change before it's merged. + +This is not as insane as it sounds. + +It appears that every technique we need to enable such a capability is already in use in modern deployment and operations methodology. We just have to connect the dots. + +### Why should I care? + +I've been part of open source for over 20 years now. Although I'm just one contributor, together, we've changed something fundamental about the world. Our lives are too short, and software is too complex to have one company or one individual invent everything from scratch. So, we work together across humanity to accomplish what no individual team could. This is our legacy, and it has become commonplace. + +And yet, there's a very simple principle that drives open source: + +> Open source thrives when it converts some +> small percentage of users into contributors. + +If you interrupt that principle, you starve open source. SaaS does just that: When someone else runs your software for you, the intuitive mechanisms for you to change that software are not available. + +![How users become contributors][2] + +(Source: Stef Walter, [CC-BY-SA][3]) + +"But," you may say, "if the source code for that running service was _open_, then I could still change it." + +Sure, you could change the code in some components. Still, for any reasonably complex service, you wouldn't be able to run your changes or experience your changes against real-world workflows, much less iterate on them, until they're good enough to share with others. + +In reality, the threat here is far more fundamental: Users of services cannot readily change something in the service, not only because the processes are operated by someone else but because they have explicitly chosen not to be involved in operating the software. + +If the primary way to use Postgres was "as a service," then that (fabulous) project would be starved for contributors. This is because the number of contributors in such a project is a function of some small percentage of users deciding to try to make change. + +As this mechanism for using SaaS takes over the world, the pool of users who can contribute to open source shrinks dramatically. + +For a long time, I saw this as a fundamental threat that would starve open source. I was unable to reconcile SaaS with a healthy open source ecosystem. + +But recently, I've become convinced that if we enable an effective contribution model on a service, one that doesn't require that the users become operators of the service, then we can reconcile this threat, and open source will thrive on services instead of being starved by them. + +### You want me to do what?!? + +To enable contributions by users of a service, users that have explicitly chosen not to operate the software themselves, we have to set up a process by which they can make a change to a running service and experience that change before others do. + +For example, a user of such a hypothetical service should be able to: + + 1. Discover which component of a service to contribute to + 2. Make a nonsensical change (like adding a printf-style log statement) or change the spelling of a word + 3. Experience that change when they use the service or when it acts on their data + + + +After discussing this with others, I firmly believe we have all the techniques we need, whether they're canary deployments, load balancing, continuous delivery, infrastructure as code, and so on. It's been hard to find a single problem that an existing practice doesn't solve. + +It turns out that many experienced engineering teams have come to that same conclusion. Rapid deployment of changes to services is a powerful capability that's highly sought after. For example, [GitHub deploys changes before they're merged][4]. Whereas [Facebook rapidly deploys changes][5] to a few canary machines and scales each change up to production. Everyone has their own version of continuous delivery. It's hard to take an engineering team seriously if they haven't figured out how their team members can get a change rapidly deployed. + +Open source has all the ingredients to have a decisive advantage here. To effectively collaborate on _open source services_, with contributors working across all of humanity.  + +Let's try to craft a playbook to achieve this basic capability that drives open source software and apply it to open source services: That is, the ability to change code and interact with that change… on a service. + +_Note: [Thanks to the reviewers of this article!][6]_ + +* * * + +_This originally appeared on [stef.thewalter.net][7] and is republished with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/open-source-saas + +作者:[Stef Walter][a] +选题:[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/stefw +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements) +[2]: https://opensource.com/sites/default/files/uploads/funneling-open-source-service.png (How users become contributors) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://github.blog/2015-06-02-deploying-branches-to-github-com/ +[5]: https://engineering.fb.com/2017/08/31/web/rapid-release-at-massive-scale/ +[6]: https://github.com/stefwalter/blog/pull/1 +[7]: http://stef.thewalter.net/open-source-services.html From 3a37fcedb35c91c3ec10d3f7581b7c4293363e7c Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Apr 2021 08:33:30 +0800 Subject: [PATCH 207/307] translated --- ...c terminal theme with open source tools.md | 100 ------------------ ...c terminal theme with open source tools.md | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md create mode 100644 translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md diff --git a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md deleted file mode 100644 index 60ac7ea7e6..0000000000 --- a/sources/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: (4 steps to customizing your Mac terminal theme with open source tools) -[#]: via: (https://opensource.com/article/21/4/zsh-mac) -[#]: author: (Bryant Son https://opensource.com/users/brson) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4 steps to customizing your Mac terminal theme with open source tools -====== -Make your terminal window pretty on your Mac with open source tools. -![4 different color terminal windows with code][1] - -Do you ever get bored with seeing the same old terminal window on your macOS computer? If so, add some bells and whistles to your view with the open source Oh My Zsh framework and Powerlevel10k theme. - -This basic step-by-step walkthrough (including a video tutorial at the end) will get you started customizing your macOS terminal. If you're a Linux user, check out Seth Kenlon's guide to [Adding themes and plugins to Zsh][2] for in-depth guidance. - -### Step 1: Install Oh My Zsh - -[Oh My Zsh][3] is an open source, community-driven framework for managing your Z shell (Zsh) configuration. - -![Oh My Zsh][4] - -(Bryant Son, [CC BY-SA 4.0][5]) - -Oh My Zsh is released under the MIT License. Install it with: - - -``` -`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` -``` - -### Step 2: Install Powerlevel10k fonts - -![Powerlevel10k][6] - -(Bryant Son, [CC BY-SA 4.0][5]) - -Powerlevel10k is an MIT-Licensed Zsh theme. Before installing Powerlevel10k, you will want to install custom fonts for your terminal. - -Go to the [Powerlevel10 GitHub][7] page, and search for "fonts" in the README. The steps for installing the custom fonts will vary depending on your operating system; the video at the bottom of this page explains how to do it on macOS. It should be just a simple click–download–install series of operations. - -![Powerlevel10k fonts][8] - -(Bryant Son, [CC BY-SA 4.0][5]) - -### Step 3: Install the Powerlevel10k theme - -Next, install Powerlevel10k by running: - - -``` -`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` -``` - -After you finish, open a `~/.zshrc` configuration file with a text editor, such as [Vim][9], set the line `ZSH_THEME="powerlevel10k/powerlevel10k`, then save the file. - -### Step 4: Finalize your Powerlevel10k setup - -Open a new terminal, and you should see the Powerlevel10k configuration wizard. If not, run `p10k configure` to bring up the configuration wizard. If you installed the custom fonts in Step 2, the icons and symbols should display correctly. Change the default font to **MeslowLG NF** (see the video below for instructions). - -![Powerlevel10k configuration][10] - -(Bryant Son, [CC BY-SA 4.0][5]) - -Once you complete the configuration, you should see a beautiful terminal. - -![Oh My Zsh/Powerlevel10k theme][11] - -(Bryant Son, [CC BY-SA 4.0][5]) - -If you want to see an interactive tutorial, please check out this video: - -That's it! You should be ready to enjoy your beautiful new terminal. Be sure to check out other Opensource.com articles for more tips and articles on using the shell, Linux administration, and more. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/zsh-mac - -作者:[Bryant Son][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/brson -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) -[2]: https://opensource.com/article/19/9/adding-plugins-zsh -[3]: https://ohmyz.sh/ -[4]: https://opensource.com/sites/default/files/uploads/1_ohmyzsh.jpg (Oh My Zsh) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/sites/default/files/uploads/2_powerlevel10k.jpg (Powerlevel10k) -[7]: https://github.com/romkatv/powerlevel10k -[8]: https://opensource.com/sites/default/files/uploads/3_downloadfonts.jpg (Powerlevel10k fonts) -[9]: https://opensource.com/resources/what-vim -[10]: https://opensource.com/sites/default/files/uploads/4_p10kconfiguration.jpg (Powerlevel10k configuration) -[11]: https://opensource.com/sites/default/files/uploads/5_finalresult.jpg (Oh My Zsh/Powerlevel10k theme) diff --git a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md new file mode 100644 index 0000000000..c94d760cee --- /dev/null +++ b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -0,0 +1,100 @@ +[#]: subject: (4 steps to customizing your Mac terminal theme with open source tools) +[#]: via: (https://opensource.com/article/21/4/zsh-mac) +[#]: author: (Bryant Son https://opensource.com/users/brson) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用开源工具定制 Mac 终端主题的 4 个步骤 +====== +用开源工具让你的终端窗口在 Mac 上漂亮起来。 +![4 different color terminal windows with code][1] + +你是否曾经厌倦了在你的 macOS 电脑上看到同样老式的终端窗口?如果是这样,使用开源的 Oh My Zsh 框架和 Powerlevel10k 主题为你的视图添加一些点缀。 + +这个基本的逐步教程(包括最后的视频教程)将让你开始定制你的 macOS 终端。如果你是一个 Linux 用户,请查看 Seth Kenlon 的指南[为 Zsh 添加主题和插件][2]以获得深入指导。 + +### 步骤 1:安装 Oh My Zsh + +[Oh My Zsh][3] 是一个开源的、社区驱动的框架,用于管理你的 Z shell (Zsh) 配置。 + +![Oh My Zsh][4] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Oh My Zsh 是在 MIT 许可下发布的。使用以下命令安装: + + +``` +`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` +``` + +### 步骤 2:安装 Powerlevel10k 字体 + +![Powerlevel10k][6] + +(Bryant Son, [CC BY-SA 4.0][5]) + +Powerlevel10k 是一个 MIT 许可的 Zsh 主题。在安装 Powerlevel10k 之前,你需要为你的终端安装自定义字体。 + +到 [Powerlevel10 GitHub][7] 页面,在 README中 搜索 “fonts”。安装自定义字体的步骤会根据你的操作系统而有所不同。本页底部的视频解释了如何在 macOS 上安装。这只需要简单地点击-下载-安装的系列操作。 + +![Powerlevel10k fonts][8] + +(Bryant Son, [CC BY-SA 4.0][5]) + +### 步骤 3:安装 Powerlevel10k 主题 + +接下来,运行以下命令安装 Powerlevel10k: + + +``` +`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` +``` + +完成后,用文本编辑器,比如 [Vim][9],打开 `~/.zshrc` 配置文件,设置行 `ZSH_THEME="powerlevel10k/powerlevel10k`,然后保存文件。 + +### 步骤 4:完成 Powerlevel10 的设置 + +打开一个新的终端,你应该看到 Powerlevel10k 配置向导。如果没有,运行 `p10k configure` 来调出配置向导。如果你在步骤 2 中安装了自定义字体,那么图标和符号应该正确显示。将默认字体更改为 **MeslowLG NF**(请看下面的视频说明)。 + +![Powerlevel10k configuration][10] + +(Bryant Son, [CC BY-SA 4.0][5]) + +当你完成配置后,你应该会看到一个漂亮的终端。 + +![Oh My Zsh/Powerlevel10k theme][11] + +(Bryant Son, [CC BY-SA 4.0][5]) + +如果你想看交互式教程,请看这个视频。 + +就是这些了!你应该可以享受你美丽的新终端了。请务必查看 Opensource.com 的其他文章,了解更多关于使用 shell、Linux 管理等方面的技巧和文章。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/zsh-mac + +作者:[Bryant Son][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/brson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos.png?itok=aOBLy7Ky (4 different color terminal windows with code) +[2]: https://opensource.com/article/19/9/adding-plugins-zsh +[3]: https://ohmyz.sh/ +[4]: https://opensource.com/sites/default/files/uploads/1_ohmyzsh.jpg (Oh My Zsh) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/2_powerlevel10k.jpg (Powerlevel10k) +[7]: https://github.com/romkatv/powerlevel10k +[8]: https://opensource.com/sites/default/files/uploads/3_downloadfonts.jpg (Powerlevel10k fonts) +[9]: https://opensource.com/resources/what-vim +[10]: https://opensource.com/sites/default/files/uploads/4_p10kconfiguration.jpg (Powerlevel10k configuration) +[11]: https://opensource.com/sites/default/files/uploads/5_finalresult.jpg (Oh My Zsh/Powerlevel10k theme) From 24f5917279c2d01dadfff1843296dc04e24f5bd0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 22 Apr 2021 08:34:31 +0800 Subject: [PATCH 208/307] Rename sources/tech/20210421 How to take your open source project to the next level.md to sources/talk/20210421 How to take your open source project to the next level.md --- ...0421 How to take your open source project to the next level.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210421 How to take your open source project to the next level.md (100%) diff --git a/sources/tech/20210421 How to take your open source project to the next level.md b/sources/talk/20210421 How to take your open source project to the next level.md similarity index 100% rename from sources/tech/20210421 How to take your open source project to the next level.md rename to sources/talk/20210421 How to take your open source project to the next level.md From c8838d0d0addaaa2aa94f6272ecfed3441aa813a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 22 Apr 2021 08:39:38 +0800 Subject: [PATCH 209/307] translating --- ...10421 How to Delete Partitions in Linux -Beginner-s Guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md index 1662169a52..f38599901c 100644 --- a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md +++ b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/delete-partition-linux/) [#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From cfe27b72e2bf559ca36b39411cf1441e22900831 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Thu, 22 Apr 2021 08:45:02 +0800 Subject: [PATCH 210/307] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...at You Can Deploy on Your Linux Servers.md | 226 ------------------ ...at You Can Deploy on Your Linux Servers.md | 226 ++++++++++++++++++ 2 files changed, 226 insertions(+), 226 deletions(-) delete mode 100644 sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md create mode 100644 translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md diff --git a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md deleted file mode 100644 index 431f3041e2..0000000000 --- a/sources/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ /dev/null @@ -1,226 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) -[#]: via: (https://itsfoss.com/open-source-forum-software/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -9 Open Source Forum Software That You Can Deploy on Your Linux Servers -====== - -_**Looking to have a community forum or customer support portal? Here are some of the best open source forum software you can deploy on your servers.**_ - -Just like our [It’s FOSS Community][1] forum, it is important to always build a platform where like-minded people can discuss, interact, and seek support. - -A forum gives users (or customers) a space to reach out for something that they cannot easily find on the Internet for the most part. - -If you are an enterprise, you may hire a team of developers and build your own forum the way you want but that adds a lot of cost to your budget. - -Fortunately, there are several impressive open source forum software that you can deploy on your server and you’re good to go! You will save a lot of money in the process and still get what you need. - -Here, I have compiled a list of best open source forum software that you can install on your Linux server. - -### Best open source forum software to build a community portal - -![][2] - -In case you haven’t built a website yet, you might want to take a look at [some open-source website creation tools][3] before you deploy a forum. - -_**Note:** The list is in no particular order of ranking._ - -#### 1\. Discourse (modern and popular) - -![][4] - -Discourse is the most popular modern forum software that people deploy to set up their discussion platforms. In fact, our [It’s FOSS community][1] forum utilizes the Discourse platform. - -It offers most of the essential features that I’m aware of which includes email notifications, moderation tools, style customization options, third-part integrations like Slack/WordPress, and more. - -It is completely free to self-host and you can find the project on [GitHub][5] as well. If you do not need the hassle of deploying it on a self-managed server, you can always choose to opt for [managed services offered by Discourse][6] itself (which will be certainly expensive). - -[Discourse][7] - -#### 2\. Talkyard (inspired by Discourse and StackOverflow) - -![][8] - -Talkyard is completely free to use and an open-source project. It looks close to Discourse but there are distinctions if you inspect it. - -You get most of the key features from StackOverflow here along with all essential features that you would expect on a forum platform. It may not be a popular forum solution but if you want something similar to Discourse along with some interesting features, this is worth trying out. - -You can explore more about it in their [GitHub page][9]. - -[Talkyard][10] - -#### 3\. NodeBB (Modern and full of features) - -![][11] - -NodeBB is an open-source forum software based on [Node.js][12]. It aims to be simple, elegant, and fast as well. Primarily, it is geared towards organizations and enterprises with managed hosting plans available. But, you can choose to host it yourself as well. - -You get a real-time native analytics feature along with chat and notification support as well. It also offers an API, if you want to integrate it with any of your existing product. It also supports moderation tools and tools to fight spam. - -You get some 3rd party integration support out of the box like WordPress, Mailchimp, etc. - -Explore more about it in their [GitHub page][13] or the official website. - -[NodeBB][14] - -#### 4\. Vanilla Forums (enterprise focused) - -![][15] - -Vanilla Forums is primarily an enterprise focused forum software with essential features to brand your platform, offer a Q/A for customers, and also gives the ability to vote on posts. - -The user experience is geared with a modern look and is being used by the likes of EA, Adobe, and some other big shot companies. - -Of course, if you want to try the cloud-based Vanilla Forums (managed by a team of professionals) along with the access to some premium features, feel free to request a Demo. In either case, you can opt for the community edition, which is free to use with most of the latest features with the responsibility of hosting it yourself and managing it. - -You can explore more about it on their official website and [GitHub page][16]. - -[Vanilla Forums][17] - -**Recommended Read:** - -![][18] - -#### [Best Open Source eCommerce Platforms to Build Online Shopping Websites][19] - -Want to create an online shopping website? Here are some open source ecommerce platforms you can deploy on your own Linux server. - -#### 5\. bbPress (from WordPress) - -![][20] - -bbPress is a solid forum software built by the creators of WordPress. It aims to provide a simple and snappy forum experience. - -The user interface would seem old-school but it is easy to use and offers the basic functionalities that you would normally look for in a forum software. The moderation tools are simple and easy to set up. You can extend the functionality using plugins available and choose from several themes available to tweak the look and feel of your forum. - -If you just want a simple forum platform with no fancy features, bbPress should be perfect. You can also check out their [GitHub page][21] for more information. - -[bbPress][22] - -#### 6\. phpBB (classic forum software) - -![][23] - -If you want a traditional forum design and just want the basic functionalities, phpBB software is a good choice. Of course, you may not get the best user experience or the features, but it is functional and quite effective as a traditional-design forum plaform. - -Especially, for users comfortable with the traditional approach, it will be a simple and effective solution. - -Not just limited to the simplicity, but also it is way easier to set up with an average hosting provider. You get a 1-click installation feature on every shared hosting platform, so you do not need a lot of technical knowledge to set it up as well. - -You can explore more about it in their official website or the [GitHub page][24]. - -[phpBB][25] - -#### 7\. Simple Machines Forum (another classic) - -![][26] - -Similar to php BB, Simple Machines forum is yet another basic (or simple) implementation of a forum platform. You may not be able to customize the look and feel by a long extent (not easily at least) but the default look is clean and offers a good user experience. - -Personally, I like it better than php BB, but you can head to their [official website][27] to explore more about it. Also, you can easily install Simple Machines Forum on any shared hosting service using the 1-click installation method. - -[Simple Machines Forum][27] - -#### 8\. FluxBB (old school) - -![][28] - -FluxBB is yet another simple and lightweight open source forum. When compared to some others, it may not be super actively maintained but if you just want to deploy a basic forum with a few users, you can easily give this a try. - -You can explore more about it in their official website and the [GitHub page][29]. - -[FluxBB][30] - -#### 9\. MyBB (less popular but worth a look) - -![][31] - -MyBB is a unique open-source forum software that offers a wide range of styles and includes essential features you’ll need. - -Starting from plugin support and moderation tools, you get everything necessary needed to manage a big community. It also supports private messaging to individual users similar to Discourse and similar forum software. - -It may not be a popular option but it checks out for most of the use-cases and it completely free. You might want to support and explore the project on [GitHub][32] as well. - -[MyBB][33] - -#### Bonus: Flarum (in beta) - -![][34] - -If you want something simpler and unique, have a look at Flarum. It is a lightweight forum software which aims to be mobile-first while offering a fast experience. - -It supports some third-party integrations and you can extend the functionality using extensions as well. Personally, it looks beautiful to me. I haven’t got a chance to try it you can take a look at its [documentation][35] and it is safe to assume that it features all the necessary features for a forum. - -It is worth noting that Flarum is fairly new so it is still in beta. You might want to deploy it on your test server first before taking a leap of faith on your production environment. Do check out their [GitHub page][36] for more details. - -[Flarum][37] - -Can’t self-host? Let us help you - -Deploying open source applications and managing Linux servers takes some expertise and time. If you lack either but still want to have your own instance of open source software, we can help you out. -With our new project, [High on Cloud][38], you can leave the deployment and server management part to us while you work on growing your community forum. - -### Wrapping Up - -Most of the open source forum software offer pretty much the same features for basic use-case. If you are looking for something specific, you might want to explore their documentations. - -Personally, I recommend Discourse. It is popular, modern looking and has a significant user base. - -What do you think is the best open source forum software? Did I miss any of your favorites? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/open-source-forum-software/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.community/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/open-source-forum-software.png?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/open-source-cms/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/itsfoss-community-discourse.jpg?resize=800%2C561&ssl=1 -[5]: https://github.com/discourse/discourse -[6]: https://discourse.org/buy -[7]: https://www.discourse.org/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/talkyard-forum.jpg?resize=800%2C598&ssl=1 -[9]: https://github.com/debiki/talkyard -[10]: https://www.talkyard.io/ -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/nodebb.jpg?resize=800%2C369&ssl=1 -[12]: https://nodejs.org/en/ -[13]: https://github.com/NodeBB/NodeBB -[14]: https://nodebb.org/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/vanilla-forums.png?resize=800%2C433&ssl=1 -[16]: https://github.com/Vanilla -[17]: https://vanillaforums.com/en/ -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/open-source-eCommerce.png?fit=800%2C450&ssl=1 -[19]: https://itsfoss.com/open-source-ecommerce/ -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/bbpress.jpg?resize=800%2C552&ssl=1 -[21]: https://github.com/bbpress -[22]: https://bbpress.org/ -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/phpBB.png?resize=798%2C600&ssl=1 -[24]: https://github.com/phpbb/phpbb -[25]: https://www.phpbb.com/ -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/simplemachines.jpg?resize=800%2C343&ssl=1 -[27]: https://www.simplemachines.org/ -[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/FluxBB.jpg?resize=800%2C542&ssl=1 -[29]: https://github.com/fluxbb/fluxbb/ -[30]: https://fluxbb.org/ -[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/mybb-example.png?resize=800%2C461&ssl=1 -[32]: https://github.com/mybb/mybb -[33]: https://mybb.com/ -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/flarum-screenshot.png?resize=800%2C503&ssl=1 -[35]: https://docs.flarum.org/ -[36]: https://github.com/flarum -[37]: https://flarum.org/ -[38]: https://highoncloud.com/ diff --git a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md new file mode 100644 index 0000000000..8d397b2c9b --- /dev/null +++ b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -0,0 +1,226 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) +[#]: via: (https://itsfoss.com/open-source-forum-software/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +9 个可以在 Linux 服务器上部署的开源论坛软件 +====== + +_**是否想要建立社区论坛或客户支持门户站点?以下是一些可以在服务器上部署的最佳开源论坛软件。**_ + +就像我们的 [FOSS 社区][1]论坛一样,重要的是随时建立一个让志趣相投的人可以讨论,互动和寻求支持的平台。 + +论坛为用户(或客户)提供了一个满足他们大部分在 Internet(互联网)上不容易找到的东西(软件)的空间。 + +如果您是一家企业,则可以聘请开发人员团队并按照自己的方式建立自己的论坛,但这会增加大量预算。 + +幸运的是,您可以在服务器上部署多种出色的开源论坛软件,而且一切顺利!在此过程中,您将节省很多钱,但仍能获得所需的东西(软件)。 + +在这里,我列出了可以在 Linux 服务器上安装的最佳开源论坛软件列表。 + +### 建立社区门户的最佳开源论坛软件 + +![][2] + +如果您尚未建立过网站,则在部署论坛之前,可能需要看一下[某些开源网站创建工具][3]。 + +_**注意:** 列表没有特定的排名顺序。_ + +#### 1\. Discourse (现代和流行) + +![][4] + +Discourse 是人们用来部署配置讨论平台的最流行的现代论坛软件。实际上,我们的[FOSS 社区][1]论坛使用了 Discourse 平台。 + +它提供了我所知道的大多数基本功能,包括电子邮件通知,审核工具,样式自定义选项,像 Slack/WordPress 的第三方集成,甚至更多。 + +它是完全免费的自我托管,您也可以在 [GitHub][5]上找到该项目。如果您要减少将其部署在自托管服务器上的麻烦,可以决定选择 [Discourse 提供的自托管服务][6](肯定会很昂贵)。 + +[Discourse][7] + +#### 2\. Talkyard (来自 Discourse 和 StackOverflow 的灵感) + +![][8] + +Talkyard 是完全免费使用的开源项目。它看起来很像“ Discourse ”,但是如果您对其进行检查,则会有区别。 + +您可以在这从 StackOverflow 获得大多数关键功能,以及在论坛平台上期望得到的所有基本功能。它可能不是一个流行的论坛解决方案,但是如果您想要类似于 Discourse 的功能以及一些有趣的功能,那么值得尝试一下。 + +您可以在他们的 [GitHub 页面][9] 中进一步了解它。 + +[Talkyard][10] + +#### 3\. NodeBB (现代且功能齐全) + +![][11] + +NodeBB 是基于[Node.js][12]的开源论坛软件。它的目标是简单,简洁和快速。首先,它面向可用的托管计划的组织和企业。但是,您也可以选择自己托管它。 + +您还可以获得具有聊天和通知支持的实时本地分析功能。它还提供一个 API 将其与现有产品中的任何一个集成。它还支持审核工具和打击垃圾邮件的工具。 + +您可以获得一些立即可用的第三方集成支持,例如 WordPress,Mailchimp 等。 + +请在它们的[GitHub页面][13]或官方网站上进一步了解它。 + +[NodeBB][14] + +#### 4\. Vanilla 论坛(企业版) + +![][15] + +Vanilla Forums 主要是一款企业版的论坛软件,具有标记平台的基本功能,为客户提供问答,还可以对帖子进行投票。 + +用户体验具有现代的外观,并且已被像 EA,Adobe 和其他一些大公司使用。 + +当然,如果您想尝试基于云的 Vanilla 论坛(由专业团队管理)以及对某些高级功能的访问权,请随时请求演示。无论哪种情况,您都可以选择社区版,该社区版可以免费使用大多数负责自托管和管理的最新功能。 + +您可以在他们的官方网站和[GitHub 页面][16]上进一步了解它。 + +[Vanilla 论坛][17] + +**推荐阅读:** + +![][18] + +#### [建立在线购物网站的最佳开源电子商务平台][19] + +想要创建一个在线购物网站吗?以下是一些可以在自己的 Linux 服务器上部署的开源电子商务平台。 + +#### 5\. bbPress (来自 WordPress) + +![][20] + +bbPress 是由 WordPress 的创建者构建的可靠论坛软件。旨在提供一个简单而活泼的论坛体验。 + +用户界面看起来很老旧,但易于使用,并提供了您通常在论坛软件中需要的基本功能。审核工具既简单又易于设置。您可以使用可用的插件扩展功能,并从几个可用的主题中进行选择以调整论坛的外观。 + +如果您只想要一个没有花哨功能的简单论坛平台,bbPress 应该是完美的。您也可以查看他们的[GitHub 页面][21]了解更多信息。 + +[bbPress][22] + +#### 6\. phpBB (经典论坛软件) + +![][23] + +如果您想要传统的论坛设计而只想要基本功能,则 phpBB 软件是一个不错的选择。当然,您可能无法获得最佳的用户体验或功能,但是作为传统设计论坛平台,它是实用的并且非常有效。 + +尤其是,对于习惯使用传统方法的用户而言,这将是一种简单而有效的解决方案。 + +不仅限于简单,而且与普通托管服务提供商一起设置起来更容易。您可以在每个共享主机平台上获得一键式安装功能,因此也不需要太多的技术知识来进行设置。 + +您可以在他们的官方网站或[GitHub 页面][24]上找到更多有关它的信息。 + +[phpBB][25] + +#### 7\. Simple Machines 论坛(另一个经典) + +![][26] + +与 phpBB 类似,Simple Machines (简单机器)论坛是论坛平台的另一种基本(或简单)实现。您可能无法长期(至少不容易)自定义外观,但是默认外观是干净的,并提供了良好的用户体验。 + +就个人而言,相比 php BB 我更喜欢它,但是您可以前往他们的[官方网站][27]进行进一步的探索。同样,您可以使用一键安装方法在任何共享的托管服务上轻松安装 Simple Machines 论坛。 + +[Simple Machines 论坛][27] + +#### 8\. FluxBB (old school) + +![][28] + +FluxBB 是另一个简单,轻量级的开源论坛。与其他的相比,它可能维护的不是非常活跃,但是如果您只想部署一个由几个用户组成的基本论坛,则可以轻松尝试一下。 + +您可以在他们的官方网站和 [GitHub 页面][29]上找到更多有关它的信息。 + +[FluxBB][30] + +#### 9\. MyBB (不太受欢迎,但值得一看) + +![][31] + +MyBB 是一款独特的开源论坛软件,它提供多种样式,并包含您需要的基本功能。 + +从插件支持和审核工具开始,您将获得管理大型社区所需的一切。它还支持类似于 Discourse 和类似论坛软件面向个人用户的私人消息传递。 + +它可能不是一个流行的选项,但是它可以检查大多数用例,并且完全免费。您可能获得支持并在 [GitHub][32]上探索该项目。 + +[MyBB][33] + +#### 额外收获: Flarum (测试版) + +![][34] + +如果您想要更简单和独特的(论坛),请看一下 Flarum。它是一款轻量级的论坛软件,旨在以移动为先,同时提供快速的体验。 + +它支持某些第三方集成,也可以使用扩展来扩展功能。就我个人而言,它看起来很漂亮。我没有机会尝试它,您可以看一下它的[文档][35],可以肯定地认为它具有论坛所需的所有必要功能的特征。 + +值得注意的是 Flarum 是相当新的,因此仍处于测试阶段。您可能需要先将其部署在测试服务器上测试后再应用到生产环境。请查看其 [GitHub 页面][36]了解更多详细信息。 + +[Flarum][37] + +无法自我托管?让我们来帮助您 + +部署开源应用程序和管理 Linux 服务器需要专业知识和花费一些时间。如果两者都不缺,但仍然希望拥有自己的开源软件实例,我们可以为您提供帮助。 +通过我们的新项目 [High on Cloud][38],您可以在发展社区论坛的过程中将部署和服务器管理部分留给我们。 + +### 总结 + +大多数开源论坛软件都为基本用例提供几乎相同的功能。如果您正在寻找特定的内容,则可能需要浏览其文档。 + +就个人而言,我推荐 Discourse。它很流行,外观现代,拥有大量的用户基础。 + +您认为最好的开源论坛软件是什么?我是否错过了你的偏爱?在下面的评论中让我知道。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/open-source-forum-software/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.community/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/open-source-forum-software.png?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/open-source-cms/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/itsfoss-community-discourse.jpg?resize=800%2C561&ssl=1 +[5]: https://github.com/discourse/discourse +[6]: https://discourse.org/buy +[7]: https://www.discourse.org/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/talkyard-forum.jpg?resize=800%2C598&ssl=1 +[9]: https://github.com/debiki/talkyard +[10]: https://www.talkyard.io/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/nodebb.jpg?resize=800%2C369&ssl=1 +[12]: https://nodejs.org/en/ +[13]: https://github.com/NodeBB/NodeBB +[14]: https://nodebb.org/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/vanilla-forums.png?resize=800%2C433&ssl=1 +[16]: https://github.com/Vanilla +[17]: https://vanillaforums.com/en/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/open-source-eCommerce.png?fit=800%2C450&ssl=1 +[19]: https://itsfoss.com/open-source-ecommerce/ +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/bbpress.jpg?resize=800%2C552&ssl=1 +[21]: https://github.com/bbpress +[22]: https://bbpress.org/ +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/phpBB.png?resize=798%2C600&ssl=1 +[24]: https://github.com/phpbb/phpbb +[25]: https://www.phpbb.com/ +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/simplemachines.jpg?resize=800%2C343&ssl=1 +[27]: https://www.simplemachines.org/ +[28]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/FluxBB.jpg?resize=800%2C542&ssl=1 +[29]: https://github.com/fluxbb/fluxbb/ +[30]: https://fluxbb.org/ +[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/mybb-example.png?resize=800%2C461&ssl=1 +[32]: https://github.com/mybb/mybb +[33]: https://mybb.com/ +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/flarum-screenshot.png?resize=800%2C503&ssl=1 +[35]: https://docs.flarum.org/ +[36]: https://github.com/flarum +[37]: https://flarum.org/ +[38]: https://highoncloud.com/ From 5a3952b211a6b6923355dea4250644b362b58910 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 22 Apr 2021 10:46:32 +0800 Subject: [PATCH 211/307] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/tech/20210421 Optimize your Python code with C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md index b21ec770ac..772c385fe1 100644 --- a/sources/tech/20210421 Optimize your Python code with C.md +++ b/sources/tech/20210421 Optimize your Python code with C.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/cython) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (RiaXu) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -197,7 +197,7 @@ via: https://opensource.com/article/21/4/cython 作者:[Alan Smithee][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d7fbc36e2f15d9e777e06400b46f41d1d8a70e2c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:52:18 +0800 Subject: [PATCH 212/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210420=20?= =?UTF-8?q?The=20Guided=20Installer=20in=20Arch=20is=20a=20Step=20in=20the?= =?UTF-8?q?=20Right=20Direction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...n Arch is a Step in the Right Direction.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md new file mode 100644 index 0000000000..d28fdd0fe3 --- /dev/null +++ b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -0,0 +1,99 @@ +[#]: subject: (The Guided Installer in Arch is a Step in the Right Direction) +[#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +The Guided Installer in Arch is a Step in the Right Direction +====== + +For 20 years, Arch Linux has provided users access to a completely custom and unique system. Over those years, it has built a reputation for customization, at the expense of user-friendliness. + +As a [rolling release distro][1], Arch doesn’t provide any set releases, instead they just update the image each month. However, if you have downloaded Arch in the last few weeks, you may have noticed a new addition: **archinstall**. It makes [installing Arch Linux way easier][2]. + +![][3] + +Today, I will be discussing what this change represents for the future of the Arch project, and what this could mean for future releases. + +### A New Direction for Arch? + +![][4] + +While many were surprised at this move, having an official installer included by default is actually a very sensible move. It signifies a change in direction for Arch, with a greater focus on accessibility, while still retaining the legendary customization it is known for. + +As the installer’s GitHub page says: + +> The guided installer will provide user-friendly options along the way, but the keyword here is options, they are optional and will never be forced upon anyone + +This means that the new installer doesn’t affect advanced users, yet also opens up the distro to a wider audience. Among the many benefits this change brings, one stands above the crowd: more users. + +More users mean more support for the project, whether that is through donations or development work. And with each of these contributions, the user experience continues to improve for both new and experienced users alike. + +### This was bound to happen + +Looking into the past, we can see many additions to the installation medium that have helped new users. Examples of these include [pacstrap][5] (a tool to install base system) and [reflector][6] (a tool to find the best pacman mirrors). + +Plus, users have been asking for a way to script their installation for years, which the new installer provides. Capable of being scripted in Python, it enables far easier deployment for administrators, making it a very attractive option. + +### More Customizability (Somehow?) + +While it may seem counter-intuitive, the inclusion of an installer actually may improve the customization options of Arch. Currently, the biggest bottleneck with Arch’s incredible customization options is the user’s skill level, an issue eliminated thanks to archinstall. + +With the new installer, you don’t need to have the skills to create your perfect environment, instead taking advantage of the installer to do it for you. This opens up a huge range of customization options that would otherwise be out of reach for the average user. + +### Closing Thoughts + +With this new addition, it seems that Arch Linux has started moving towards a more User-Friendly philosophy. The new installer provides a wide range of benefits to Newbies and advanced users alike. These include wider customization options and a larger community. + +All in all, the new installer will provide a positive impact on the community as a whole. + +_What do you think about the new Arch guided installer? Have you tried it out yet?_ + +![][7] + +I'm not interested + +#### _Related_ + + * [Installing Arch Linux is Now Easier With This Change in the Newest ISO Refresh][2] + * ![][8] ![][9] + + + * [EndeavourOS's First Release of 2021 Brings Linux Kernel 5.10 LTS, Xfce 4.16, and More][10] + * ![][8] ![][11] + + + * [Linux Kernel 5.9 Reached End of Life. Here's What You Should Do Now!][12] + * ![][8] ![Linux kernel 5.9 reached end of life][13] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/arch-new-guided-installer/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/rolling-release/ +[2]: https://news.itsfoss.com/arch-linux-easy-install/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://man.archlinux.org/man/pacstrap.8 +[6]: https://wiki.archlinux.org/index.php/Reflector +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[10]: https://news.itsfoss.com/endeavouros-2021-release/ +[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 1bb09eda56bc77e98748d7cc25a90c8106f82b76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:52:31 +0800 Subject: [PATCH 213/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210419=20?= =?UTF-8?q?Ubuntu=2021.04=20is=20Releasing=20This=20Week!=20Take=20a=20Loo?= =?UTF-8?q?k=20at=20the=20New=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md --- ...s Week- Take a Look at the New Features.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md diff --git a/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md b/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md new file mode 100644 index 0000000000..30a313a024 --- /dev/null +++ b/sources/news/20210419 Ubuntu 21.04 is Releasing This Week- Take a Look at the New Features.md @@ -0,0 +1,176 @@ +[#]: subject: (Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features) +[#]: via: (https://news.itsfoss.com/ubuntu-21-04-features/) +[#]: author: (Abhishek https://news.itsfoss.com/author/root/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features +====== + +Ubuntu 21.04 is releasing this week on April 22. Some of you might already have [upgraded to Ubuntu 21.04 beta][1] to enjoy the latest and greatest (?) version of Ubuntu. + +For the rest, who are curious about what’s new in Ubuntu 21.04, I have curated a list here. + +### What’s new in Ubuntu 21.04 ‘Hiruste Hippo’? + +First of all, this is an interim release. Don’t expect groundbreaking changes here specially when you compare it to Ubuntu 20.10. There are subtle visual changes here and there, a bit of performance improvements, newer versions of popular software and libraries in the official repository along with the addition of a couple of new features. + +![][2] + +#### 1\. Wayland becomes the default display server + +After the failed experiment with Ubuntu 17.10, Canonical is once again going with Wayland as the default display server in Ubuntu 21.04. + +Wayland has been available as an alternate option for past several releases. It is just becoming the default in this release. + +What does it mean to you? Wayland has a tad bit better performance specially when it comes to [multiple monitors and HiDPI screen handling][3]. + +However, you’ll find that several applications do not work very well or do not work at all in Wayland. This is painful for screen capture and recording applications. + +The good thing is that [switching back to Xorg from Wayland][4] is a matter of a few clicks. You just have to figure out if you cannot function well without Xorg server. + +#### 2\. Darker dark theme + +Yaru dark theme in Ubuntu 21.04 has a bit darker shade than the one in Ubuntu 20.10. This actually gives a nice look to the operating system, in my opinion. + +You can move the slider to see the visual difference between the dark shade of the two versions. + +#### 3\. Dark shell theme by default + +Ubuntu 20.10 the standard Yaru theme by default and you had to opt for the dark mode. That remains as it is in 21.04 as well except the shell theme has been switched to Yaru Dark by default. + +This means that even though your system will have the light theme by default, the notifications, message tray and the system tray will use dark theme. + +![][2] + +#### 4\. Power mode option for laptops + +This is a minor change in the power settings. If you are using a laptop, you can now choose a power mode from the settings. + +![][5] + +You have the following options available: + + * Performance: Takes a lot of batter power but gives high performance (keeps bluetooth active, screen brightness high and more) + * Balanced power: Standard performance with decent batter usage + * Power saver: The focus is on saving battery power + + + +#### 5\. A hybrid mix of GNOME 3.38 and some GNOME 40 applications + +The much anticipated [GNOME 40 with the unorthodox horizontal layout is not available in Ubuntu 21.04][6]. Ubuntu team was not ready for the GTK 4 and the layout change. They are working to bring it to Ubuntu 21.10 in October this year. + +While some core components like Nautilus file manager remain at 3.38, some other GNOME apps like Epiphany browser, Disk Utility etc have the latest versions. + +#### 6\. Private home directories + +So far, the home directories had the permission of 755. Fresh installation of Ubuntu 21.04 will have this changed to 750 and thus making the [home directories private][7]. + +![][8] + +#### 7\. Recovery key option for encrypted installs + +While installing Ubuntu, if you opt for disk encryption, you can now also set a recovery key option directly in the installer. + +![Image Credit: OMG Ubuntu][9] + +#### 8\. Minor visual changes + +By no means these are groundbreaking changes. It’s just something I noticed in Ubuntu 21.04 so far. + +You’ll notice that the items on the right click context menu has been divided by more contrast colored lines. I believe this is for accessibility reasons. + +![][10] + +I also noticed that the mounted drives are displayed in the top-right corner of the desktop. If I recall correctly, it used to be under the Home and Trash icons in the previous versions. + +![][11] + +The default Yaru icons have been refreshed for a number of software. You can clearly notice it for the LibreOffice icons. + +![][12] + +#### 9\. Under the hood changes + +Some other changes you should be aware: + + * Support for [Smart Card][13] authentication via PAM + * Drag and Drop interaction support with software in the desktop view + * Pipewire support enabled to handle audio in sandboxed applications and screen recording + * nftables replaces iptables + + + +There are newer versions of software: + + * Linux kernel 5.11 + * Python 3.9 + * gEdit 3.38.1 + * LibreOffice 7.1.2 + * Firefox 87 + + + +By now you might have realized that there are not many changes in this new release of Ubuntu. There is support for newer hardware and improvements for HiDPI and fingerprint reader but that’s not for everyone. It includes the latest Linux kernel 5.11 if that’s any consolation. + +If you are using Ubuntu 20.10, you should upgrade to Ubuntu 21.04 anyway because 20.10 reaches end of life in July. + +What’s your overall feeling about Ubuntu 21.04? Were you expecting more new features? What are you missing the most here? + +![][14] + +I'm not interested + +#### _Related_ + + * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][15] + * ![][16] ![No GNOME 40 in Ubuntu 21.04][17] + + + * [With 21.04, Ubuntu is Switching to Wayland by Default Again][18] + * ![][16] ![Ubuntu 21.04 to use Wayland by default][19] + + + * [Ubuntu 21.04 Beta is Now Available to Download][20] + * ![][16] ![][21] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-21-04-features/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/upgrade-ubuntu-beta/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://news.itsfoss.com/ubuntu-21-04-multi-monitor-support/ +[4]: https://itsfoss.com/switch-xorg-wayland/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://news.itsfoss.com/gnome-40-release/ +[7]: https://news.itsfoss.com/private-home-directory-ubuntu-21-04/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI2MScgd2lkdGg9Jzc3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ3OScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ2OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzE2Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[13]: https://en.wikipedia.org/wiki/Smart_card +[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[15]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/ +[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[17]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/gnome-40-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/ubuntu-21-04-wayland/ +[19]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/wayland-by-default-in-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[20]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ +[21]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From b5ba8640f763fe579be2c6311edce89aa3919e8e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:52:45 +0800 Subject: [PATCH 214/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210418=20?= =?UTF-8?q?F(r)iction:=20Or=20How=20I=20Learnt=20to=20Stop=20Worrying=20an?= =?UTF-8?q?d=20Start=20Loving=20Vim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md --- ...t to Stop Worrying and Start Loving Vim.md | 179 ++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md diff --git a/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md b/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md new file mode 100644 index 0000000000..7743b5f167 --- /dev/null +++ b/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md @@ -0,0 +1,179 @@ +[#]: subject: (F(r)iction: Or How I Learnt to Stop Worrying and Start Loving Vim) +[#]: via: (https://news.itsfoss.com/how-i-started-loving-vim/) +[#]: author: (Theena https://news.itsfoss.com/author/theena/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +F(r)iction: Or How I Learnt to Stop Worrying and Start Loving Vim +====== + +It is Dec 2009, and I am ready to quit my job. + +I wanted to focus on writing my first book; neither my commitments at work nor the state of technology was helping. + +Writing is hard work. + +Few tasks in the modern world can be as singular – or as daunting – a pursuit as sitting down in front of a blank piece of paper, and asking your brain to vomit out words that communicate an idea to readers. I am not suggesting that writing can’t be collaborative of course, but merely illustrating how daunting it can be for writers to set off on a new piece by themselves. This is true for fiction +and non-fiction writing, but since I am a novelist I’d like to focus primarily on fiction in this article. + +![][1] + +Remember what 2009 was like? + +Smart phones were 3 years old – I still hadn’t gone away from feature phones. Laptops were big and bulky. Meanwhile, cloud-based web applications for productivity was in their infancy, and just not good. Technologically speaking, writers like me were using their Gmail accounts (and a very young cloud-based storage called Dropbox) as an always-available option to work on their drafts, even while away from my personal computer. While this was a nice change from what writers had to go through when working with typewriters (or god forbid, pen and paper), it wasn’t much. + +For one thing, version control of manuscripts was a nightmare. Further, the more tools I added to my tool kit to simplify the workflow, the more I had to switch context – both from a UI and a UX sense. + +I would start writing drafts on Windows Notepad, save it on a MS Word Document on my PC at home, email myself a copy, keep another copy on Dropbox (since Dropbox wasn’t accessible at work), work on the copy of that file at work, email it back to myself at the end of the day, download it on the home computer, saving it under a new name and the respective date so that I would recognize the changes in the file were made at work (as opposed to home)…well you get the picture. If you think this workflow involving Windows Notepad, MS Word, Gmail, and Dropbox is insane, well now you know why I quit my job. + +More soberingly, I still know writers, damn good writers too, who use variations of the workflow that I followed in 2009. + +Over the next three years, I worked on the manuscript, completing the first draft in 2012. During the three years much had changed with the state of technology. Smart phones were actually pretty great, and some of the complications I had in 2009 had disappeared. I could still work on the same file that I had been working from at home, on my phone (not necessarily fresh writing, but editing had become considerably easier thanks to Dropbox on the phone.) My main writing tool remained Microsoft’s Windows Notepad and Word, which is how I completed the first draft. + +The novel [**First Utterance**][2] was released in 2016 to critical and commercial acclaim. + +The end. + +Or so I thought. + +As soon as I completed the manuscript and sent it to my editor, I had begun working on the second novel. I was no longer quitting my job to work on writing, but I had taken a more pragmatic approach: I’d take two weeks off at the end of ever year so that I could go to a little cabin in the mountains to write. + +It took me half a day to realize that the things that annoyed me about my [writing tools][3] and workflow had not disappeared, but morphed into a more complex beast. As a writer, I wasn’t being productive or as efficient as I wanted. + +### Linux in the time of Corona + +![][4] + +It is 2020 and the world is on the verge of mass hysteria. + +What had started out as an isolated novel virus in China was morphing into the first global pandemic since 1911. On March 20th, Sri Lanka followed most of the rest of the world and shutdown. + +April in Sri Lanka is the height of the dry season. Temperatures in concrete jungles like Colombo can reach the mid 30s, with humidity in the high 90s. It can drive most people to distraction at the best of times, but stuck at home with no always-on air conditioning while a global pandemic is underway? That is a good recipe for madness. + +My madness was Linux or, as we in the open source community call it, ‘distro-hopping’. + +The more I played around with *nix distros, the more enamoured I came to be with the idea of control. When nothing seems to be within our control – not even the simple act of shaking hands with another person – then it is only natural we lean towards things where we feel more in control. + +Where better to get more control in my life than with my computing? Naturally, this extended to my writing tools and workflow too. + +### The path to Vim + +There’s a joke about [Vim][5] that describes perfectly my first experience with it. People are obsessive about Vim because they don’t know how to close it. + +I was attempting to edit a configuration file, and the [fresh install of Ubuntu Server][6] had only Vim pre-installed. First there was panic – so much so I restarted the machine thinking the OS wasn’t picking up my keyboard. Then when it happened again, the inevitable Google search: ‘[How do I close vim?][7]‘ + +_Oh. That’s interesting_, I thought. + +_But why?_ + +To understand why I was even remotely interested in a text editor that was too complex to close, you have to understand how much I adore Windows Notepad. + +As a writer, I loved writing on its no-nonsense, no buttons, white-abyss like canvas. It had no spell check. It had no formatting. But I didn’t care. + +For the writer in me, Notepad was the best writing scratch pad ever devised. Unfortunately, it isn’t powerful – so even if I start writing my drafts in Notepad, I would move it to MS Word once I had passed a 1000 words – Notepad wasn’t built for prose, and those limitations would be glaringly obvious when I passed that word limit. + +So the first thing I installed I moved all my computing away from Windows, was a good text editor. + +[Kate][8] was the first replacement where I felt more comfortable than I did on Windows Notepad – it was more powerful (it had spell-checker!), and hey, I could mess around with some hobbyist-type coding in the same environment. + +It was love. + +But then Vim happened. + +The more I learnt about Vim, the more I watched developers live coding on Vim, the more I found myself opening Vim for my text editing needs. I use the phrase ‘text editing’ in the traditional Unix sense: editing blocks of text in configuration files, or sometimes writing basic Bash scripts. + +I still hadn’t used Vim remotely for my prose writing needs. + +For that I had LibreOffice. + +Sort of. + +While it is an adequate [replacement for MS Office][9], I found myself underwhelmed. The UI is perhaps even more distracting than MS Word, and with each distro having different packages of LibreOffice, I found myself using a hellishly fragmented tool kit and workflow, to say nothing about how different the UI can look in various distros and desktop environments. + +Things had become even more complicated because I had also started my Masters. In this scenario, I was taking notes down on Kate, transferring them to LibreOffice, and then saving it on to my Dropbox. + +Context switching was staring at me in the face every day. + +Productivity dropped as I had to open and close a number of unrelated applications. I needed one writing tool to meet all my needs – as a novelist, as a student, and as a hobbyist coder. + +And that’s when I realized that the solution to my context switching nightmare was also staring at me in the face at the same time. + +By this point, I had used Vim often enough – even used it with Termux on my Android phone – to be pretty comfortable with the idea of moving everything to Vim. Since it supported markdown syntax, note-taking would also become even easier. + +This was just about two months ago. + +How am I doing? + +It is April 2021. + +I started this draft on my phone, [using Vim][10] via Termux (with the aid of a Bluetooth keyboard), while in a taxi. I pushed the file to a GitHub private repo for my writing, from which I pulled the file to my PC, wrote a few more lines, before heading out again. I pulled the new version of the file from GitHub to my phone, made changes, pushed it, repeat, until I emailed the final draft to the editor. + +The context switching is now no more. + +The distractions that come from writing in word processors is no more. + +Editing is infinitely easier, and faster. + +My wrists are no longer in pain because I hid my mouse from sight. + +It is April 2021. + +I am a novelist. + +And I write on Vim. + +How? I’ll discuss the specific of this workflow in the second part of this column series on how non-tech people are using free and open source technology. Stay tuned. + +![][11] + +I'm not interested + +#### _Related_ + + * [Going Against Google Analytics With Plausible's Co-Founder [Interview]][12] + * ![][13] ![Interview with Plausible founder Marco Saric][14] + + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][15] + * ![][13] ![][16] + + + * [Multi Monitor and HiDPI Setup is Looking Better on Ubuntu 21.04 [My Experience So Far]][17] + * ![][13] ![Multimonitor setup with Ubuntu 21.04][18] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/how-i-started-loving-vim/ + +作者:[Theena][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/theena/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM5MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://www.goodreads.com/book/show/29616237-first-utterance +[3]: https://itsfoss.com/open-source-tools-writers/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM5NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://www.vim.org/ +[6]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[7]: https://itsfoss.com/how-to-exit-vim/ +[8]: https://kate-editor.org/ +[9]: https://itsfoss.com/best-free-open-source-alternatives-microsoft-office/ +[10]: https://linuxhandbook.com/basic-vim-commands/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://news.itsfoss.com/marko-saric-plausible/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/Interview-plausible.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/lutris-creator-interview/ +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[17]: https://news.itsfoss.com/ubuntu-21-04-multi-monitor-support/ +[18]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/multi-monitor-ubuntu-21-itsfoss.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 From 491f33db9264e42fe140ea117a14f7a63d89f220 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:08 +0800 Subject: [PATCH 215/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210416=20?= =?UTF-8?q?Kate=20Editor=20Set=20to=20Become=20KDE=E2=80=99s=20Answer=20to?= =?UTF-8?q?=20Microsoft=E2=80=99s=20Visual=20Studio=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md --- ...nswer to Microsoft-s Visual Studio Code.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md diff --git a/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md b/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md new file mode 100644 index 0000000000..b881262e10 --- /dev/null +++ b/sources/news/20210416 Kate Editor Set to Become KDE-s Answer to Microsoft-s Visual Studio Code.md @@ -0,0 +1,128 @@ +[#]: subject: (Kate Editor Set to Become KDE’s Answer to Microsoft’s Visual Studio Code) +[#]: via: (https://news.itsfoss.com/kate/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Kate Editor Set to Become KDE’s Answer to Microsoft’s Visual Studio Code +====== + +KDE has revealed some details on the upcoming 21.04 release of their Kate text editor, or KDE Advanced Text Editor. With this release comes a huge range of new features, such as a new HUD style command palette and improved search in files. + +To the Visual Studio Code users out there, this may seem familiar. Microsoft VS Code has had a similar style command palette for a long time, which Kate users (until now) had to leave out of their workflow. + +Some of the features I will be looking at in this article include: + + * **Integrated Git support** + * HUD style command palette + * Quick open with fuzzy matching + * Improved Search In Files + * Improved Language Server Protocol (LSP) support + + + +### Integrated Git Support – Finally! + +![][1] + +One of the biggest features of this update is the integrated git support. Although it has been possible to load git repositories in Kate for a while now, the new integrated git support allows you to checkout and create branches, stash stuff, stage your files for commit or diff, and do the commit and push afterward, **all without touching the terminal!** + +This is a huge improvement over the old way of using Kate’s built-in terminal to manage your repositories. + +Additionally, it opens up the ability to use git on the Windows version of Kate, which still doesn’t have the ability to access a command line (most likely due to the locked-down nature of it). + +This is a a huge feature, and I suspect that it will be welcomed by developers everywhere. + +### HUD Style Command Palette + +![][2] + +One of the key components of the VS Code workflow is the Command Palette. After waiting for years, this huge feature has finally been added to Kate. + +The Command Palette is possibly one of the most commonly used features in VS Code, and it has been one of the few things that have kept me using the aforementioned text editor. Now with the integration into Kate, I can happily switch, without worrying about a huge disruption to my workflow. + +### Quick Open (With Fuzzy Matching) + +![][3] + +A longtime feature of Kate, Quick Open hasn’t been improved all that much over the past few years. Now with the new 21.04 release, it is receiving a major overhaul, with things such as Fuzzy Matching and a new UI that aims to be more consistent with the Command Palette. + +The new UI is the result of a move to a more consistent design throughout Kate. Although minor, this change definitely is more eye-pleasing and helps improve the layout for those with larger screens. + +The fuzzy matching is also a welcome improvement. The Quick Open dialog used to use a wildcard filter for its top result, with direct matches to the search term being listed beneath it. The 21.04 release uses a new fuzzy matching algorithm, providing the best results at the top, with less likely results located at the bottom. + +The result of this is far more reliable results, which when combined with the new UI, provides a huge improvement to the user experience. + +### Improved Search in Files + +![][3] + +With the new release comes yet another welcome improvement: Better search in files. + +The search plugin got a major overhaul with much better result representation in the proper editor font and colors. It has also been improved in terms of speed, with a very noticeable performance jump. + +One way they achieved this is through parallelizing the search engine, allowing it to attempt to utilize all the available cores on the CPU. No longer does Kate need to hide behind Atom/VS Code! + +### Improved LSP Support + +![][4] + +For those unfamiliar with the term, LSP stands for Language Server Protocol. This is what’s responsible for the detection of code errors and warnings, go to definition/declaration capabilities, and symbol outlines. + +If you happen to be coding in one of the supported languages, it should be enabled out of the box, enabling Kate to be used similarly to a lightweight IDE. + +### Wrapping Up + +With this [upcoming new release][5], you can expect heaps of cool new features, each providing a better experience to the end-user. After a long wait, it seems that Kate is finally catching up with other [modern code editors like VS Code][6] in terms of features, with the added benefit of better integration into KDE Plasma desktop. + +The new release should arrive in within the next two weeks. Keep an eye out for it. + +![][7] + +I'm not interested + +#### _Related_ + + * [KDE Plasma 5.22 To Include New Adaptive Panel Opacity and Other Exciting Improvements][8] + * ![][9] ![][10] + + + * [KDE Plasma 5.21 Brings in a New Application Launcher, Wayland Support, and Other Exciting Additions][11] + * ![][9] ![][12] + + + * [Linux Release Roundup #21.12: 7-Zip, Vivaldi Browser 3.7, Audacity 3.0 and More New Releases][13] + * ![][9] ![Linux Release Roundups][14] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kate/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUwNycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUxMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzNScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Nycgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://kate-editor.org/post/2021/2021-03-29-kate-21.04-feature-preview/ +[6]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: https://news.itsfoss.com/kde-plasma-5-22-dev/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/kde-plasma-22-dev-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/kde-plasma-5-21-release/ +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/kde-plasma-5-21-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/linux-release-roundup-2021-12/ +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 From ece4654be3135cf24fca0971edba82c65c171955 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:21 +0800 Subject: [PATCH 216/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210416=20?= =?UTF-8?q?Metro=20Exodus=20is=20Finally=20Here=20on=20Steam=20for=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md --- ...odus is Finally Here on Steam for Linux.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md diff --git a/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md new file mode 100644 index 0000000000..37aa353478 --- /dev/null +++ b/sources/news/20210416 Metro Exodus is Finally Here on Steam for Linux.md @@ -0,0 +1,84 @@ +[#]: subject: (Metro Exodus is Finally Here on Steam for Linux) +[#]: via: (https://news.itsfoss.com/metro-exodus-steam/) +[#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Metro Exodus is Finally Here on Steam for Linux +====== + +Metro Exodus, a long-time fan favorite, is finally here in Linux. After a long wait of over two years, Linux users can finally get their hands on the third installment of the Metro trilogy. Although a few unofficial ports of the game was available, this is an official release by 4A Games. + +It is a first-person shooter game with gorgeous ray tracing graphics and the story is set in Russian wilderness across vast lands. The brilliant story-line spans an entire year through spring, summer and autumn to the nuclear winter. The game is a combination of fast-paced combat and stealth with exploration and survival and is easily one of the most immersive games in Linux. + +### Can my PC Run it? + +Being a graphically intensive game means you need to have a decent hardware to get good frame rates. This game heavily depends on Ray Tracing to make the images look as good as they do. + +Just to run the game, you will need **Intel Core i5 4400** with **8 GB** of RAM and an **NVIDIA GTX670** or AMD Radeon R9 380, at least. The recommended specification is Intel Core i7 4770K with a GTX1070 or RX 5500XT. + +Here is the official list of specifications as mentioned by developers: + +![][1] + +It’s a paid game, and you need to shell out $39.99 USD to get your hands on the newest and greatest version of Metro Exodus. + +Check for your graphics drivers and Linux kernel version if you can’t play it due to constant crashes. Some have reported a few issues with it to start with, but not a widespread problem. + +### Where do I get the Game? + +The Linux version is available on [Steam][2] for Linux. If you already bought the game, it will appear in your Steam for Linux library automatically. + +[Metro Exodus (Steam)][2] + +If you don’t have it installed, you can follow our guide to [install Steam on Ubuntu][3] and [Fedora][4]. + +_Do you already have Metro Exodus in your Steam library? Planning to get it? Let me know in the comments below._ + +![][5] + +I'm not interested + +#### _Related_ + + * [Popular Game Titles Metro Exodus and Total War: Rome Remastered Releasing for Linux in April][6] + * ![][7] ![][8] + + + * [Don't Miss These Epic Deals & Free Games for Linux This Holiday Season][9] + * ![][7] ![][10] + + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][11] + * ![][7] ![][12] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/metro-exodus-steam/ + +作者:[Asesh Basu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/asesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://store.steampowered.com/app/412020/Metro_Exodus/ +[3]: https://itsfoss.com/install-steam-ubuntu-linux/ +[4]: https://itsfoss.com/install-steam-fedora/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[9]: https://news.itsfoss.com/game-deals-holiday-2020/ +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-Game-Deals.png?fit=800%2C450&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/lutris-creator-interview/ +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 4ab959cc15c08f8aa36edc5e617838ab44d8d9ea Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:32 +0800 Subject: [PATCH 217/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210416=20?= =?UTF-8?q?Much-Anticipated=20Zorin=20OS=2016=20is=20Available=20for=20Bet?= =?UTF-8?q?a=20Testing=20With=20A=20Stunning=20New=20Look?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md --- ...r Beta Testing With A Stunning New Look.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md diff --git a/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md b/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md new file mode 100644 index 0000000000..9687debad2 --- /dev/null +++ b/sources/news/20210416 Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look.md @@ -0,0 +1,155 @@ +[#]: subject: (Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look) +[#]: via: (https://news.itsfoss.com/zorin-os-16-beta/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Much-Anticipated Zorin OS 16 is Available for Beta Testing With A Stunning New Look +====== + +Zorin OS 16 was one of my picks for [distributions to look out for in 2021][1]. They always do something interesting with every major upgrade, and it looks like Zorin OS 16 is going to be an exciting release to talk about. + +The Zorin team [announced][2] the availability of Zorin OS 16 (based on **Ubuntu 20.04 LTS**) beta along with all the new features that come with it. + +Here, I will mention the highlights of the new release along with a video tour (with the download link at the bottom). + +### Zorin OS 16 Beta: What’s New? + +Zorin OS always tries to make the UX cleaner and attractive while improving the performance, let us see what Zorin OS 16 is all about. Here’s a short video tour to see it in action: + +Now, let me highlight the key changes: + +#### User Interface Refresh + +![][3] + +The most exciting part of this release is the UI overhaul that gives it an impressive look. + +Zorin OS 15 was already a [gorgeous Linux distribution][4]. And with Zorin OS 16, they have refreshed the user interface to look nicer and cleaner. + +It looks like we might have a good-looking alternative to Deepin Linux after all. + +The animations and the theme have been polished to look cleaner. Especially, with the new default background, it blends in pretty nice. In fact, it is a dynamic wallpaper that changes based on the time of the day. + +Also, the lock screen now displays your wallpaper blurred. + +#### Flathub Included + +The adoption of [Flatpak][5] is increasing every day. Now, Zorin OS 16 enables the Flathub repository by default. + +So, you can easily find Flatpak apps right from the Software store. + +Of course, you also have Snap store enabled by default. Hence, the software store presents you a range of catalogs. + +#### Improved Welcome Tour + +![][6] + +This is quite common for every distribution to include. However, this time Zorin OS has updated the tour to guide the user through the basics along with customization options. + +This is definitely going to be very helpful for a newbie. + +#### New Touchpad Gestures + +Even though I stick to my desktop, for users with Laptops the new touchpad gestures should help you navigate quickly between workspaces and activity overview. + +#### Addition of a Sound Recorder App + +The new sound recorder app is a minimal and beautiful app to let you record audio/speech. + +Having an audio recorder out of the box is a plus, not many distributions offer it. + +#### Customization Improvements + +![][7] + +Zorin OS 15 was moderately customizable. With Zorin OS 16, you get enhanced customization options for the taskbar and the overall layout of the system. + +You can set the panel’s transparency, display it on multiple monitors, auto-hide, and more. For the appearance, you can now select an icon theme, change the app theme, fonts, and more. + +The options look much cleaner and easier to find. + +#### Windows 10X-like Desktop Layout Planned + +![][8] + +They plan to introduce a Windows 10X-like desktop layout for users with comfortable with touchpad, touchscreens, and mice. This isn’t included with the beta, but it is expected arrive before the final release. + +Zorin OS was already a good choice as a [Windows-like distribution][9]. + +#### Other Improvements + +There are several under-the-hood tweaks that would contribute to a better user experience. Some of them include: + + * A new jelly animation effect when moving windows and minimizing it + * Fractional scaling support for high-res displays + * Improved Fingerprint reader support + * Unread icons + * Refresh settings app + * Disabled built-in tracking and telemetry in Firefox + * Linux Kernel 5.8 + + + +### Try Zorin OS 16 (Beta) + +You get the Zorin OS 16 beta ISO from the download button below. It is worth noting that it may not be wise to use it on a production system while it is meant for beta testing. + +As mentioned in their announcement post, other editions of Zorin OS 16 – such as Lite, Education, and Ultimate – will be available over the coming months. + +[Zorin OS 16 Core Beta][10] + +If you are curious, you may take a look at the full changelog to know more about the release. + +![][11] + +I'm not interested + +#### _Related_ + + * [Linux Release Roundup #21.16: CopyQ 4.0, Zorin OS 16 Beta, Slackware 15 Beta, and More New Releases][12] + * ![][13] ![Linux Release Roundups][14] + + + * [7 Linux Distros to Look Forward to in 2021][1] + * ![][13] ![Best Linux Distributions in 2021][15] + + + * [Fedora 34 Beta Arrives With Awesome GNOME 40 (Unlike Ubuntu 21.04)][16] + * ![][13] ![][17] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/zorin-os-16-beta/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-distros-for-2021/ +[2]: https://blog.zorin.com/2021/04/15/introducing-zorin-os-16-test-the-beta-today/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://itsfoss.com/beautiful-linux-distributions/ +[5]: https://itsfoss.com/what-is-flatpak/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzY0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzU3Micgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: https://itsfoss.com/windows-like-linux-distributions/ +[10]: https://zorinos.com/download/16/core/beta +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://news.itsfoss.com/linux-release-roundup-2021-16/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/best-distros-2021.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[16]: https://news.itsfoss.com/fedora-34-beta-release/ +[17]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/fedora-34-beta-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From f27fa786be799e1fb6b9c5bf57fadfa7a6e5ac30 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:45 +0800 Subject: [PATCH 218/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210415=20?= =?UTF-8?q?ProtonMail=20Users=20can=20Now=20Access=20Proton=20Calendar=20(?= =?UTF-8?q?beta)=20for=20Free?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md --- ... Access Proton Calendar (beta) for Free.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md diff --git a/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md b/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md new file mode 100644 index 0000000000..e5f0496b16 --- /dev/null +++ b/sources/news/20210415 ProtonMail Users can Now Access Proton Calendar (beta) for Free.md @@ -0,0 +1,96 @@ +[#]: subject: (ProtonMail Users can Now Access Proton Calendar (beta) for Free) +[#]: via: (https://news.itsfoss.com/protoncalendar-beta-free/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +ProtonMail Users can Now Access Proton Calendar (beta) for Free +====== + +[ProtonMail][1] is one of the [best secure email services][2] out there. While alternatives like [Tutanota][3] already offer a calendar feature, ProtonMail did not offer it for all the users. + +The calendar feature (in beta) was limited to paid users. Recently, in an [announcement][4], ProtonMail has made it accessible for all users for free. + +It is worth noting that it is still in beta but accessible to more users. + +### Try Proton Calendar beta + +Proton Calendar is a feature integrated with ProtonMail itself. However, you get a separate mobile app if you want to use it on Android. No signs of an iOS app yet. + +If you are already using the **[beta.protonmail.com][5]** portal when accessing through your web browser, you can navigate your way to Proton Calendar as shown below: + +![][6] + +In either case, you can simply head to [Proton Calendar page][7] (calendar.protonmail.com) and log in to access it. + +They should also add the selector menu to the main ProtonMail version, but unfortunately, it is only available on the beta portal for now. + +As per the announcement, the features available with Proton Calendar right now are: + + * Create, edit, and delete events across devices + * Set reminders + * Send and respond to event invitations (web only for now) + * Set up recurring events annually, monthly, weekly, daily, or on an interval of your choice + * Also available in dark mode + + + +You can also import events from your existing calendar if you are thinking to make a switch. Event invitations should work from both Google and Microsoft Calendars. + +Unlike other calendars, Proton Calendar utilizes end-to-end encryption to protect your events. So, only you know what events you have and the information regarding it. + +If you are curious to know the details behind how they protect your calendar data, you can refer to their [official blog post][8] about it. + +_Have you tried Proton Calendar yet? Is it as useful as Tutanota’s already existing calendar if you’ve tried it?_ + +![][9] + +I'm not interested + +#### _Related_ + + * [Gmail's Privacy Alternative ProtonMail Makes 'Undo Send' Feature Available for All Users][10] + * ![][11] ![ProtonMail undo send option][12] + + + * [Firefox Proton With Major Redesign Change is Coming Soon. Take a Look Before the Final Release][13] + * ![][11] ![][14] + + + * [ProtonVPN Adds 'NetShield' Feature to Block Malware, Scripts & Ads Online][15] + * ![][11] ![NetShield by ProtonVPN][16] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/protoncalendar-beta-free/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/recommends/protonmail/ +[2]: https://itsfoss.com/secure-private-email-services/ +[3]: https://tutanota.com/ +[4]: https://protonmail.com/blog/calendar-free-web-android/ +[5]: https://beta.protonmail.co +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1OScgd2lkdGg9JzI4NycgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://calendar.protonmail.com +[8]: https://protonmail.com/blog/protoncalendar-security-model/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://news.itsfoss.com/protonmail-undo-send/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/protonmail-undo-send.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/firefox-proton-redesign/ +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/firefox-proton-look-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/protonvpn-netshield/ +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Netshield-by-ProtonVPN.png?fit=1200%2C675&ssl=1&resize=350%2C200 From b88d1833fa14457b645650ba117cd914ac6e2b08 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 22 Apr 2021 11:53:56 +0800 Subject: [PATCH 219/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210415=20?= =?UTF-8?q?Microsoft=20Gets=20into=20the=20OpenJDK=20Business:=20What=20Do?= =?UTF-8?q?es=20it=20Mean=20for=20You=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md --- ...JDK Business- What Does it Mean for You.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md diff --git a/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md b/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md new file mode 100644 index 0000000000..48d663b1fc --- /dev/null +++ b/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md @@ -0,0 +1,98 @@ +[#]: subject: (Microsoft Gets into the OpenJDK Business: What Does it Mean for You?) +[#]: via: (https://news.itsfoss.com/microsoft-openjdk/) +[#]: author: (John Paul Wohlscheid https://news.itsfoss.com/author/john/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Microsoft Gets into the OpenJDK Business: What Does it Mean for You? +====== + +Microsoft is getting into the Java business. The question is “What does this mean for the Open-Source community?” Has Microsoft learned anything from their past interactions with Java? Let’s see. + +### Introducing Microsoft Builds of OpenJDK + +Microsoft recently announced that they would be releasing builds of OpenJDK. According to [the announcement][1], these builds will be Long-Term Support (LTS). + +The builds will include Java 11 (based on OpenJDK 11.0.10+9) for “macOS, Linux, and Windows”. They will be available for both servers and desktop systems. They are also introducing Early Access builds of Java 16 for Windows on ARM (based on OpenJDK 16+36). “The Microsoft Build of OpenJDK is a simple drop-in replacement for any other OpenJDK distribution available in the Java ecosystem.” + +All of the binaries available are considered “Preview”. The announcement mentions that Java 11 was released in 2018. So what call it a “Preview”? Because Microsoft wants feedback from customers on “things like the packaging and installation experience” before they make them production ready. + +Since they are consider Long-Term Support, Java 11 will be supported until 2024. OpenJDK 17 will be made available when Java 17 “is finalized”. Microsoft will not be offering support for Java 8. + +For those interested in the recipes Microsoft is using to bake its Java cake, they are using the “same build scripts used by the Eclipse Adoptium project and tested against the Eclipse Adoptium Quality Assurance suite (including OpenJDK project tests)”. + +The binaries are licensed as “General Public License 2.0 with Classpath Exception (GPLv2+CE)”. + +### Not Microsoft’s First Java Rodeo + +![][2] + +What’s interesting is that this is not the first time that Microsoft got involved with Java. Back in 1996, Microsoft introduced the imaginatively named [J++][3]. Initially, J++ got a lot of [good press][4]. + +However, the honeymoon didn’t last. [In 2007][5], Sun Microsystems sued Microsoft. They said that Microsoft “breached its licensing agreement by adding extensions that weren’t Java-compatible”. The suit was settled in 2001. “Microsoft was required to pay Sun $20 million, as well as to permanently stop using “Java-compatible” trademarks.” J++ supported ended in 2004. + +This was just one of [many times][6] that Microsoft enacted their [Embrace, Extent, Extinguish mantra][7]. This time it was Microsoft plans that were extinguished. + +Sometimes, its hard to equate all of the underhanded tactics that Microsoft committed under Bill Gates and his philanthropy. + +### So What Does This All Mean? + +The burning question is why is Microsoft even bothering to create these binaries in the first place? There are at least half of a dozen organizations that offer OpenJDK binaries, including IBM, Amazon, and Eclipse. + +[Mike and Chris from Coder Radio][8] has repeatedly mentioned that Microsoft is transforming itself into a company that creates tools for programmers. They don’t care what platform programmers use, just that they use Microsoft tools. (In the OpenJDK announcement, Microsoft listed the available platforms as “macOS, Linux, and Windows”.) This newest announcement is the latest step in the transformation. + +What does it mean for open source? If Microsoft leaves the OpenJDK binaries unchanged, probably not much. At most, they will make the binaries work better on Windows and with Visual Studio Code. However, the big concern would be if they start changing the code. + +My advice: Keep your eggs out of Microsoft’s basket, so you don’t get locked into their tooling. At least, until they have proven that they are not evil. After all, there are plenty of alternative already. + +![][9] + +I'm not interested + +#### _Related_ + + * [Microsoft Makes 'Extensible Storage Engine' Open-Source, Used by Windows 10 & Microsoft Exchange][10] + * ![][11] ![][12] + + + * [Is Google Locking Down Chrome to Resist the Rise of Chromium Based Browsers?][13] + * ![][11] ![Google Chrome][14] + + + * [Good News! elementary OS is Coming to Raspberry Pi 4][15] + * ![][11] ![elementary OS Raspberry Pi Build][16] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/microsoft-openjdk/ + +作者:[John Paul Wohlscheid][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://devblogs.microsoft.com/java/announcing-preview-of-microsoft-build-of-openjdk/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3NScgd2lkdGg9JzI5NScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://en.wikipedia.org/wiki/Visual_J%2B%2B +[4]: https://www.drdobbs.com/microsofts-visual-j-10/184415556 +[5]: https://www.informit.com/articles/article.aspx?p=101152 +[6]: https://birdhouse.org/beos/byte/30-bootloader/ +[7]: https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish +[8]: https://coder.show/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://news.itsfoss.com/microsoft-ese-open-source/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/ese-microsoft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/is-google-locking-down-chrome/ +[14]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/google-chrome.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/elementary-os-raspberry-pi-release/ +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/elementaryos-raspberry-pi-build.jpg?fit=800%2C450&ssl=1&resize=350%2C200 From 7d250e5b2734a9bbf90643ed302283e34cebfaee Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 22 Apr 2021 14:18:45 +0800 Subject: [PATCH 220/307] Rename sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md to sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md --- ...tion- Or How I Learnt to Stop Worrying and Start Loving Vim.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md (100%) diff --git a/sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md b/sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md similarity index 100% rename from sources/news/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md rename to sources/talk/20210418 F(r)iction- Or How I Learnt to Stop Worrying and Start Loving Vim.md From 6d97327a8fd50608c8446121a10db74cf954760a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 22 Apr 2021 14:24:37 +0800 Subject: [PATCH 221/307] Rename sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md to sources/talk/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md --- ...t Gets into the OpenJDK Business- What Does it Mean for You.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md (100%) diff --git a/sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md b/sources/talk/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md similarity index 100% rename from sources/news/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md rename to sources/talk/20210415 Microsoft Gets into the OpenJDK Business- What Does it Mean for You.md From f0e48af4e544c4ef73dc67b613e56434fcb8a59a Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 22 Apr 2021 14:46:01 +0800 Subject: [PATCH 222/307] Update 20210421 Optimize your Python code with C.md --- sources/tech/20210421 Optimize your Python code with C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md index 772c385fe1..e000b1fbf0 100644 --- a/sources/tech/20210421 Optimize your Python code with C.md +++ b/sources/tech/20210421 Optimize your Python code with C.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/cython) [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) -[#]: translator: (RiaXu) +[#]: translator: (ShuyRoy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -197,7 +197,7 @@ via: https://opensource.com/article/21/4/cython 作者:[Alan Smithee][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/ShuyRoy) +译者:[ShuyRoy](https://github.com/ShuyRoy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2d8c846b02610f615abcdf6920cb00d3c74b9b45 Mon Sep 17 00:00:00 2001 From: "Qian.Sun" Date: Thu, 22 Apr 2021 15:51:20 +0800 Subject: [PATCH 223/307] translated by DCOLIVERSUN --- ...you in Fedora Linux- Let-s get it fixed.md | 70 ------------------- ...you in Fedora Linux- Let-s get it fixed.md | 70 +++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md create mode 100644 translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md diff --git a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md deleted file mode 100644 index bf3bc428bd..0000000000 --- a/sources/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ /dev/null @@ -1,70 +0,0 @@ -[#]: subject: (Something bugging you in Fedora Linux? Let’s get it fixed!) -[#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) -[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) -[#]: collector: (lujun9972) -[#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Something bugging you in Fedora Linux? Let’s get it fixed! -====== - -![][1] - -Software has bugs. Any complicated system is guaranteed to have at least some bits that don’t work as planned. Fedora Linux is a _very_ complicated system. It contains thousands of packages created by countless independent upstream projects around the world. There are also hundreds of updates every week. So, it’s inevitable that problems creep in. This article addresses the bug fixing process and how some bugs may be prioritized. - -### The release development process - -As a Linux distribution project, we want to deliver a polished, “everything just works” experience to our users. Our release process starts with “Rawhide”. This is our development area where we integrate new versions of all that updated free and open source software. We’re constantly improving our ongoing testing and continuous integration processes to make even Rawhide safe to use for the adventurous. By its nature, however, Rawhide will always be a little bit rough. - -Twice a year we take that rough operating system and branch it for a beta release, and then a final release. As we do that, we make a concerted effort to find problems. We run Test Days to check on specific areas and features. “Candidate builds” are made which are checked against our [release validation test plan][2]. We then enter a “freeze” state where only approved changes go into the candidates. This isolates the candidate from the constant development (which still goes into Rawhide!) so new problems are not introduced. - -Many bugs, big and small, are squashed as part of the release process. When all goes according to plan, we have a shiny new on-schedule Fedora Linux release for all of our users. (We’ve done this reliably and repeatedly for the last few years — thanks, everyone who works so hard to make it so!) If something is really wrong, we can mark it as a “release blocker”. That means we won’t ship until it’s fixed. This is often appropriate for big issues, and definitely turns up the heat and attention that bug gets. - -Sometimes, we have issues that are persistent. Perhaps something that’s been going on for a release or two, or where we don’t have an agreed solution. Some issues are really annoying and frustrating to many users, but individually don’t rise to the level we’d normally block a release for. We _can_ mark these things as blockers. But that is a really big sledgehammer. A blocker may cause the bug to get finally smashed, but it can also cause disruption all around. If the schedule slips, all the _other_ bug fixes and improvements, as well as features people have been working on, don’t get to users. - -### The Prioritized Bugs process - -So, we have another way to address annoying bugs! The [Prioritized Bugs process][3] is a different way to highlight issues that result in unpleasantness for a large number of users. There’s no hammer here, but something more like a spotlight. Unlike the release blocker process, the Prioritized Bugs process does not have a strictly-defined set of criteria. Each bug is evaluated based on the breadth and severity of impact. - -A team of interested contributors helps curate a short list of issues that need attention. We then work to connect those issues to people who can fix them. This helps take pressure off of the release process, by not tying the issues to any specific deadlines. Ideally, we find and fix things before we even get to the beta stage. We try to keep the list short, no more than a handful, so there truly is a focus. This helps the teams and individuals addressing problems because they know we’re respectful of their often-stretched-thin time and energy. - -Through this process, Fedora has resolved dozens of serious and annoying problems. This includes everything from keyboard input glitches to SELinux errors to that thing where gigabytes of old, obsolete package updates would gradually fill up your disk. But we can do a lot more — we actually aren’t getting as many nominations as we can handle. So, if there’s something _you_ know that’s causing long-term frustration or affecting a lot of people and yet which seems to not be reaching a resolution, follow the [Prioritized Bugs process][3] and let _us_ know. - -#### **You can help** - -All Fedora contributors are invited to participate in the Prioritized Bugs process. Evaluation meetings occur every two weeks on IRC. Anyone is welcome to join and help us evaluate the nominated bugs. See the [calendar][4] for meeting time and location. The Fedora Program Manager sends an agenda to the [triage][5] and [devel][6] mailing lists the day before meetings. - -### Bug reports welcome - -Big or small, when you find a bug, we really appreciate it if you report it. In many cases, the best place to do that is with the project that creates the software. For example, lets say there is a problem with the way the Darktable photography software renders images from your digital camera. It’s best to take that to the Darktable developers. For another example, say there’s a problem with the GNOME or KDE desktop environments or with the software that is part of them. Taking these issues to those projects will usually get you the best results. - -However, if it’s a Fedora-specific problem, like something with our build or configuration of the software, or a problem with how it’s integrated, don’t hesitate to [file a bug with us][7]. This is also true when there is a problem which you know has a fix that we just haven’t included yet. - -I know this is kind of complex… it’d be nice to have a one-stop place to handle all of the bugs. But remember that Fedora packagers — the people who do the work of taking upstream software and configuring it to build in our system — are largely volunteers. They are not always the deepest experts in the code for the software they’re working with. When in doubt, you can always file a [Fedora bug][7]. The folks in Fedora responsible for the corresponding package can help with their connections to the upstream software project. - -Remember, when you find a bug that’s gone through diagnosis and doesn’t yet have a good fix, when you see something that affects a lot of people, or when there’s a long-standing problem that just isn’t getting attention, please nominate it as a Prioritized Bug. We’ll take a look and see what can be done! - -_PS: The famous image in the header is, of course, from the logbook of the Mark II computer at Harvard where Rear Admiral Grace Murray Hopper worked. But contrary to popular belief about the story, this isn’t the first use of the term “bug” for a systems problem — it was already common in engineering, which is why it was funny to find a literal bug as the cause of an issue. #nowyouknow #jokeexplainer_ - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/ - -作者:[Matthew Miller][a] -选题:[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/mattdm/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/bugging_you-816x345.jpg -[2]: https://fedoraproject.org/wiki/QA:Release_validation_test_plan -[3]: https://docs.fedoraproject.org/en-US/program_management/prioritized_bugs/ -[4]: https://calendar.fedoraproject.org/base/ -[5]: https://lists.fedoraproject.org/archives/list/triage%40lists.fedoraproject.org/ -[6]: https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/ -[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ diff --git a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md new file mode 100644 index 0000000000..1696d834ff --- /dev/null +++ b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -0,0 +1,70 @@ +[#]: subject: (Something bugging you in Fedora Linux? Let’s get it fixed!) +[#]: via: (https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: (DCOLIVERSUN) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Linux 中有 Bug 吗?一起来修复它! +====== + +![][1] + +软件有 bug。任何复杂系统都无法保证每个部分都能按计划工作。Fedora Linux是一个 _非常_ 复杂的系统,包含几千个包,这些包由全球无数独立上游项目创建。每周还有数百个更新。因此,问题是不可避免的。本文介绍了 bug 修复过程以及如何确定 bug 优先级。 + +### 发布开发过程 + +作为 Linux 发行项目,我们希望为用户提供完善的、一切正常的体验。我们的发布起始于 “Rawhide”。我们在 Rawhide 中集成了所有更新的免费、开源软件,这些软件都是新版本的。我们一直在不断改进正在进行的测试和持续集成Continuous Integration过程,为了让 Rawhide 可以安全地用来做任何冒险行为。可是,从本质来讲,Rawhide 始终有点粗糙。 + +一年内我们两次把这个粗糙的操作系统先后分支到测试版本、最终版本。当我们这么做时,我们齐心协力地寻找问题。我们在测试日Test Days检查特定的区域和功能。“Candidate builds” 是根据我们的[发布验证测试计划][2]进行检测的。然后我们进入冻结状态freeze state,只有批准的更改可以并入候选版本。这就把候选版本从不断发展的版本中隔离开来,不断发展的版本并入 Rawhide 中。所以,不会引入新的问题。 + +在发布过程中许多 bug 被压缩,这些 bug 有大有小。当一切按计划进行时,我们为所有用户提供了按计划发布的崭新的 Fedora Linux版本。(在过去几年里,我们已经可靠地重复这一动作——感谢每个人的努力,我们做到了!)如果确实有问题,我们可以将其标记为发布阻碍release blocker。这就意味着我们要等到修复后才能发布。发布阻碍通常代表重大问题,该表达一定会引发对 bug 的关注。 + +有时,我们遇到的问题是持续存在的。可能是一两个版本正在发布的内容,或者是我们没有达成共识的解决方案。有些问题确实困扰着许多用户,但个别问题并没有达到阻碍发布的程度。我们可以将这些东西标记为阻碍blocker。但这会像锤子一样砸下来。阻碍可能导致最终破坏该 bug ,但也可能导致周围的破坏。如果进度落后,用户不会对其他所有 bug 修复、改进感兴趣的,更不会对一直开发的特性感兴趣。 + +### 按优先顺序排列 bug 流程 + +所以,我们有另一种方法来解决烦人的 bug。[按优先顺序排列 bug 流程][3]与其他方式不同,可以标出导致大量用户不满意的问题。这里没有锤子,更像是聚光灯。与发布阻碍不同,按优先顺序排列 bug 流程没有一套严格定义的标准。每个 bug 都是根据影响范围和严重性来评估的。 + +一组有兴趣的贡献者帮助策划一个简短列表,上面罗列着需要注意的问题。然后,我们的工作是将问题匹配到能够解决它们的人。这有助于减轻发布过程中的压力,因为它没有给问题指定任何特定的截止时间。理论上,我们甚至在进入测试阶段之前就发现并解决问题。我们尽量保持列表简短,不会超过几个,这样才会真正有重点。这种做法有助于团队和个人解决问题,因为他们知道我们尊重他们捉襟见肘的时间与精力。 + +通过这个过程,Fedora 解决了几十个严重而恼人的问题,包括从键盘输入故障到 SELinux 错误,再到千兆字节大小的旧包更新会逐渐填满你的磁盘。但是我们可以做得更多——我们实际上没有收到处理能力上限数量的提案。因此,如果你知道有什么事情导致了长期挫折或影响了很多人,至今没有达成解决方案,遵循[按优先顺序排列 bug 流程][3],提交给我们。 + +### **你可以帮助** + +邀请所有 Fedora 贡献者参与按优化顺序排列 bug 流程。每两周评估会议在 IRC 上举办。欢迎任何人加入并帮助我们评估指定的 bug。请参阅[日历][4]了解会议时间和地点。Fedora 程序管理器在会议开始的前一天将议程发送到[分类][5]和[开发][6]邮件列表。 + +### 欢迎报告 bug + +当你发现 bug 时,无论大小,我们很感激你能报告 bug。在很多情况下,解决 bug 最好的方式是回到创建该软件的项目中。例如,假设渲染数据相机照片的暗室摄影软件出了问题,最好把它带给暗室摄影软件的开发人员。再举个例子,假设 GNOME 或 KDE 桌面环境或组成部分软件出了问题,将这些问题带到这些项目中通常会得到最好的结果。 + +然而, 如果这是一个特定的 Fedora 问题,比如我们的软件构建或配置或者它集成的问题,毫不犹豫地[向我们提交 bug][7]。当你知道我们还没有解决的问题时,也要提交给我们。 + +我知道这很复杂... 最好有一个一站式的地方来处理所有 bug。但是请记住,Fedora 包装者大部分是志愿者,他们负责获取上游软件并将其配置到我们系统中。即便是对我们正在使用的软件,他们也不总是最了解代码的专家。有疑问的时候,你可以随时提交一个 [Fedora bug][7]。Fedora 中负责相应包的人员可以协助把它们连接到上游软件项目中。 + +请记住,当你发现一个已通过但尚未得到良好修复的 bug 时,当你看到影响很多人的问题时,或者当有一个长期存在的问题没有得到关注时,请将其指定为高优先级 bug。我们来看看能做些什么! + +_附言:标题中的著名图片当然是来自哈佛大学马克 2 号计算机的日志,这里曾是格蕾丝·赫柏少将工作的地方。但是与这个故事的普遍看法相背,这并不是 “bug” 一词第一次用于系统问题——它在工程中已经很常见了,发现字面上的 bug 代表问题原因这一现象是很有趣的,这就是原因。 #nowyouknow #jokeexplainer_ + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-it-fixed/ + +作者:[Matthew Miller][a] +选题:[lujun9972][b] +译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/bugging_you-816x345.jpg +[2]: https://fedoraproject.org/wiki/QA:Release_validation_test_plan +[3]: https://docs.fedoraproject.org/en-US/program_management/prioritized_bugs/ +[4]: https://calendar.fedoraproject.org/base/ +[5]: https://lists.fedoraproject.org/archives/list/triage%40lists.fedoraproject.org/ +[6]: https://lists.fedoraproject.org/archives/list/devel%40lists.fedoraproject.org/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/howto-file-a-bug/ From 0cbe4ad12f9a0f9ea497f9e6c956f712d25710ec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 19:10:29 +0800 Subject: [PATCH 224/307] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Kevin3599 感谢您,完成了第一篇翻译。 --- ... Source Supply Chain- A Matter of Trust.md | 55 ++++++++++--------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md index a0fe07a2f9..05b37a32fe 100644 --- a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md +++ b/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Open Source Supply Chain: A Matter of Trust) @@ -12,49 +12,52 @@ [![][1]][2] -_**Co-authored by Curtis Franklin, Jr**_ +共同作者:Curtis Franklin, Jr + +开源软件通常被认为比专有软件更安全、更有保障,因为如果用户愿意,他们可以从源代码编译软件。他们知道在他们环境中运行的代码的来源。在他们的环境中运行的代码每个部分都可以被审查,也可以追溯每段代码的开发者。 - 开源软件相比于商业性软件,通常是被认为更加安全的,因为用户可以编译软件的源代码开发者们知道在他们的开发环境中运行的代码。在他们的环境中运行的代码每个部分都可以被审查,也可以追溯每段代码的开发者。 +然而,用户和提供者们正在逐渐远离完全控制软件所带来的复杂性,而在转而追求软件的便捷和易用。 + +VMware 副总裁兼首席开源官 Dirk Hohndel 说:“当我看到在一个有关网络安全和隐私的讲座中,演讲者运行 `docker run` 命令来安装和运行一些从互联网上下载的随机二进制文件时,我经常会大吃一惊。这两件事似乎有点相左。” - 然而,用户和开发商们正在逐渐远离这样对软件的完全控制带来的复杂性,而在转而追求软件的便捷和易用。 - - VMware副总裁兼首席开源官Dirk Hohndel表示:“当我看到一个有关网络安全和隐私的演讲,然后演讲者运行‘docker run’命令来安装和运行从互联网上随机下载的二进制文件时,我感到大吃一惊。”“这两件事似乎有点不协调。”他说到。 +软件供应链,即将应用程序从编码、打包、分发到最终用户的过程是相当复杂的。如果其中有一环出现错误,可能会导致软件存在潜在的风险,特别是对于开源软件。一个恶意行为者可以访问后端,并在用户不知情或不受控的情况下向其插入任何可能的恶意代码。 - 软件供应链——应用程序从编码、打包、分发到最终用户的过程是相当复杂的。如果其中有一环出现错误,可能会导致软件存在潜在的风险,特别是对于开源软件。黑客可以访问后端并在用户不知情或不受控的情况下向其插入任何可能的恶意代码。 +这样的问题不单单存在于云原生领域,在现代应用开发中很常见,这包括 JavaScript、NPM、PyPI、RubyGems 等等。甚至连 Mac 上的 Homebrew 过去也是通过源代码提供,由用户自己编译。 + +“如今,你只需要下载二进制文件并安装它,并期望其源代码并没有被恶意修改过。”Hohndel 说,“作为一个行业,我们需要更加关注我们的开源代码供应。这对我来说是非常重要的事,我正努力让更多的人意识到其重要性。” - 这样的问题不单单存在于云计算领域。这样的问题在现代的app开发中很常见,包括JavaScript、npm、PyPI、RubyGems等等。甚至连Mac上的homebrew曾经依赖于用户自行编译的代码。 +然而,这不仅仅是一个二进制与源代码的关系。只运行一个二进制文件,而不必从源代码构建所有东西有着巨大的优势。当软件开发需求发生转变时候,这种运行方式允许开发人员在过程中更加灵活和响应更快。通过重用一些二进制文件,他们可以在新的开发和部署中快速地循环。 - Hohndel说:“今天,你只需要下载二进制文件并安装它,并期望其源代码并没有被恶意修改过。”“作为一个行业,我们需要更加关注我们的开源代码供应。这对我来说非常重要,我正努力让更多的人意识到其重要性。” - - 然而,这不仅仅是一个二进制与源代码的等式。只运行一个二进制文件,而不必从源代码构建所有东西有着巨大的优势。当软件开发需求发生转变时候,这种运行方式允许开发人员在过程中更加灵活和响应更快。通过重用一些二进制文件,他们可以在新的开发和部署中快速地循环。 +Hohndel 说:“如果有办法向这些软件添加签名,并建立一个‘即时’验证机制,让用户知道他们可以信任此软件,那就更好了。” - Hohndel 说:"如果有办法想这些软件添加签名,并建立一个'即时'验证机制,让用户知道他们可以信任此软件。会是很好的方案。 +Linux 发行版解决了这个问题,因为发行版充当了看门人的角色,负责检查进入受支持的软件存储库的软件包的完整性。 - Linux的发行版解决了这个问题,因为发行版充当了看门人的角色,负责检查进入受支持存储库的软件包的完整性。 +“像通过 Debian 等发行版提供的软件包都使用了密钥签名。要确保它确实是发行版中应包含的软件,需要进行大量工作。开发者们通过这种方式解决了开源供应链问题。”Hohndel 说。 - “像通过Debian等发行版提供的软件包都用密钥签名。要确保它确实是发行版中应包含的软件,需要进行大量工作。开发者们通过这种方式解决了开源供应链问题。”Hohndel说。 +但是,即使在 Linux 发行版上,人们也希望简化事情,并以正确性和安全性换取速度。现在,诸如 AppImage、Snap 和 Flatpack 之类的项目已经采用了二进制方式,从而将开源供应链信任问题带入了 Linux 发行版。这和 Docker 容器的问题如出一辙。 + +“理想的解决方案是为开源社区找到一种设计信任系统的方法,该系统可以确保如果二进制文件是用受信任网络中的密钥签名的,那么它就可以被信任,并允许我们可靠地返回源头并进行审核,” Hohndel 建议。 - 但是,即使在Linux发行版上,人们也希望简化事情,并以正确性和安全性换取速度。现在,诸如AppImage,Snap和Flatpack之类的项目已经采用了二进制搜索路由,从而将开源供应链信任问题带入了Linux发行版。而Docker容器又一次遇到了同样的问题。 +但是,所有这些额外的步骤都会产生成本,大多数项目开发者要么不愿意,或无力承担。一些项目正在尝试寻找解决该问题的方法。例如,NPM 已开始鼓励提交软件包的用户正确认证和保护其账户安全,以提高平台的可信度。 + +### 开源社区善于解决问题 + +Hohndel 致力于解决开源供应链问题,并正试图让更多开发者意识到其重要性。去年,VMware 收购了 Bitnami,这为管理由 VMware 所签名的开源软件提供了一个良机。 - “理想的解决方案是为开源社区找到一种设计信任系统的方法,该系统可以确保如果二进制文件是用受信任网络中的密钥签名的,那么它就可以被信任,并允许我们可靠地返回源头并进行审核,” Hohndel建议。 +“我们正在与各种上游开源社区进行交流,以提高对此的认识。我们还在讨论技术解决方案,这些方案将使这些社区更容易解决潜在的开源供应链问题。” Hohndel 说。 - 但是,所有这些附加步骤都会导致大多数项目产生开发者不愿或无法承担的费用。一些项目正在尝试寻找解决该问题的方法。例如,NPM已开始鼓励提交软件包的用户正确认证和保护其账户安全,以提高平台的可靠性。 +开源社区历来致力于确保软件质量,这其中也包括安全性和隐私性。不过,Hohndel 说:“我最担心的是,在对下一个新事物感到兴奋时,我们经常忽略了需要的基础工程原则。” - Hohndel致力于解决开源供应链问题,并正试图让更多开发者意识到其重要性。去年,VMware收购了Bitnami,这为管理由VMware所签名的开源软件提供了一个良机。 - - “我们正在与各种上游开源社区进行交流,以提高对此的认识。我们还在讨论技术解决方案,这些方案将使这些社区更容易解决潜在的开源供应链问题。” Hohndel说。 - - 开源社区历来致力于确保软件质量,这其中也包括安全性和隐私性。不过,Hohndel说:“我最担心的是,在对下一个新事物感到兴奋时,我们经常忽略需要的技术。” - - 最终,Hohndel认为答案将来自开源社区本身。 “开源是一种工程方法论,是一种社会实验。开源就是人们之间相互信任,相互合作,跨国界,公司之间以及竞争对手之间以我们以前从未有过的方式合作。”他解释说。 +最终,Hohndel 认为答案将来自开源社区本身。 “开源是一种工程方法论,是一种社会实验。开源就是人们之间相互信任、相互合作、跨国界和公司之间以及竞争对手之间的合作,以我们以前从未有过的方式。”他解释说。 + -------------------------------------------------------------------------------- via: https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/ 作者:[Swapnil Bhartiya][a] 选题:[lujun9972][b] -译者:[Kevin3599]() -校对:[校对者ID](https://github.com/校对者ID) +译者:[Kevin3599](https://github.com/kevin3599) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 76af4b8ef7c8eaa605984b9711c7e814fe287542 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 19:11:39 +0800 Subject: [PATCH 225/307] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @Kevin3599 本文首发地址:https://linux.cn/article-13321-1.html 您的 LCTT 专页:https://linux.cn/lctt/Kevin3599 --- .../20200106 Open Source Supply Chain- A Matter of Trust.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20200106 Open Source Supply Chain- A Matter of Trust.md (98%) diff --git a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md b/published/20200106 Open Source Supply Chain- A Matter of Trust.md similarity index 98% rename from translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md rename to published/20200106 Open Source Supply Chain- A Matter of Trust.md index 05b37a32fe..60aa20fb4c 100644 --- a/translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md +++ b/published/20200106 Open Source Supply Chain- A Matter of Trust.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13321-1.html) [#]: subject: (Open Source Supply Chain: A Matter of Trust) [#]: via: (https://www.linux.com/articles/open-source-supply-chain-a-matter-of-trust/) [#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/) From 2c928f596d89923c20b16f5e396a24d4a59193fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 19:46:26 +0800 Subject: [PATCH 226/307] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B6=85=E9=95=BF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E4=BB=A5=E5=85=BC=E5=AE=B9=20Window?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @stevenzdg988 我修复了这个问题 @lujun9972 看来我们需要将文件名做个截断,比如不超过 200 字符或更短一些。 --- ...mand Tutorial series 7--Uncommented Lines of a Config File.md} | 0 ...team up on the Linux desktop, docs for Nvidia GPUs open up.md} | 0 ...le opens Android speech transcription and gesture tracking.md} | 0 ... => 20200908 Tux the Linux Penguin in its first video game.md} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename published/201601/{20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md => 20151127 Linux or UNIX grep Command Tutorial series 7--Uncommented Lines of a Config File.md} (100%) rename published/201908/{20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up, a powerful new way to scan for firmware vulnerabilities, and more news.md => 20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up.md} (100%) rename published/201909/{20190831 Google opens Android speech transcription and gesture tracking, Twitter-s telemetry tooling, Blender-s growing adoption, and more news.md => 20190831 Google opens Android speech transcription and gesture tracking.md} (100%) rename sources/tech/{20200908 Tux the Linux Penguin in its first video game, better DNS and firewall on Android, Gitops IDE goes open source, and more open source news.md => 20200908 Tux the Linux Penguin in its first video game.md} (100%) diff --git a/published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md b/published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Uncommented Lines of a Config File.md similarity index 100% rename from published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Linux or UNIX View Only Configuration File Directives Uncommented Lines of a Config File.md rename to published/201601/20151127 Linux or UNIX grep Command Tutorial series 7--Uncommented Lines of a Config File.md diff --git a/published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up, a powerful new way to scan for firmware vulnerabilities, and more news.md b/published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up.md similarity index 100% rename from published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up, a powerful new way to scan for firmware vulnerabilities, and more news.md rename to published/201908/20190817 GNOME and KDE team up on the Linux desktop, docs for Nvidia GPUs open up.md diff --git a/published/201909/20190831 Google opens Android speech transcription and gesture tracking, Twitter-s telemetry tooling, Blender-s growing adoption, and more news.md b/published/201909/20190831 Google opens Android speech transcription and gesture tracking.md similarity index 100% rename from published/201909/20190831 Google opens Android speech transcription and gesture tracking, Twitter-s telemetry tooling, Blender-s growing adoption, and more news.md rename to published/201909/20190831 Google opens Android speech transcription and gesture tracking.md diff --git a/sources/tech/20200908 Tux the Linux Penguin in its first video game, better DNS and firewall on Android, Gitops IDE goes open source, and more open source news.md b/sources/tech/20200908 Tux the Linux Penguin in its first video game.md similarity index 100% rename from sources/tech/20200908 Tux the Linux Penguin in its first video game, better DNS and firewall on Android, Gitops IDE goes open source, and more open source news.md rename to sources/tech/20200908 Tux the Linux Penguin in its first video game.md From bd954ad605d191e01abe1a4ff08d32cdf9197b24 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 23:46:03 +0800 Subject: [PATCH 227/307] PRF @geekpi --- ...c terminal theme with open source tools.md | 36 +++++++------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md index c94d760cee..abbd774626 100644 --- a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ b/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -3,18 +3,20 @@ [#]: author: (Bryant Son https://opensource.com/users/brson) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用开源工具定制 Mac 终端主题的 4 个步骤 ====== -用开源工具让你的终端窗口在 Mac 上漂亮起来。 -![4 different color terminal windows with code][1] + +> 用开源工具让你的终端窗口在 Mac 上漂亮起来。 + +![](https://img.linux.net.cn/data/attachment/album/202104/22/234534t3t7ntpvdde3v892.jpg) 你是否曾经厌倦了在你的 macOS 电脑上看到同样老式的终端窗口?如果是这样,使用开源的 Oh My Zsh 框架和 Powerlevel10k 主题为你的视图添加一些点缀。 -这个基本的逐步教程(包括最后的视频教程)将让你开始定制你的 macOS 终端。如果你是一个 Linux 用户,请查看 Seth Kenlon 的指南[为 Zsh 添加主题和插件][2]以获得深入指导。 +这个基本的逐步教程将让你开始定制你的 macOS 终端。如果你是一个 Linux 用户,请查看 Seth Kenlon 的指南 [为 Zsh 添加主题和插件][2] 以获得深入指导。 ### 步骤 1:安装 Oh My Zsh @@ -22,57 +24,43 @@ ![Oh My Zsh][4] -(Bryant Son, [CC BY-SA 4.0][5]) - Oh My Zsh 是在 MIT 许可下发布的。使用以下命令安装: - ``` -`$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` +$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` ### 步骤 2:安装 Powerlevel10k 字体 ![Powerlevel10k][6] -(Bryant Son, [CC BY-SA 4.0][5]) - Powerlevel10k 是一个 MIT 许可的 Zsh 主题。在安装 Powerlevel10k 之前,你需要为你的终端安装自定义字体。 -到 [Powerlevel10 GitHub][7] 页面,在 README中 搜索 “fonts”。安装自定义字体的步骤会根据你的操作系统而有所不同。本页底部的视频解释了如何在 macOS 上安装。这只需要简单地点击-下载-安装的系列操作。 +到 [Powerlevel10 GitHub][7] 页面,在 `README` 中 搜索 “fonts”。安装自定义字体的步骤会根据你的操作系统而有所不同。这只需要简单地点击-下载-安装的系列操作。 ![Powerlevel10k fonts][8] -(Bryant Son, [CC BY-SA 4.0][5]) - ### 步骤 3:安装 Powerlevel10k 主题 接下来,运行以下命令安装 Powerlevel10k: - ``` -`git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k` +git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ``` 完成后,用文本编辑器,比如 [Vim][9],打开 `~/.zshrc` 配置文件,设置行 `ZSH_THEME="powerlevel10k/powerlevel10k`,然后保存文件。 ### 步骤 4:完成 Powerlevel10 的设置 -打开一个新的终端,你应该看到 Powerlevel10k 配置向导。如果没有,运行 `p10k configure` 来调出配置向导。如果你在步骤 2 中安装了自定义字体,那么图标和符号应该正确显示。将默认字体更改为 **MeslowLG NF**(请看下面的视频说明)。 +打开一个新的终端,你应该看到 Powerlevel10k 配置向导。如果没有,运行 `p10k configure` 来调出配置向导。如果你在步骤 2 中安装了自定义字体,那么图标和符号应该正确显示。将默认字体更改为 `MeslowLG NF`。 ![Powerlevel10k configuration][10] -(Bryant Son, [CC BY-SA 4.0][5]) - 当你完成配置后,你应该会看到一个漂亮的终端。 ![Oh My Zsh/Powerlevel10k theme][11] -(Bryant Son, [CC BY-SA 4.0][5]) - -如果你想看交互式教程,请看这个视频。 - -就是这些了!你应该可以享受你美丽的新终端了。请务必查看 Opensource.com 的其他文章,了解更多关于使用 shell、Linux 管理等方面的技巧和文章。 +就是这些了!你应该可以享受你美丽的新终端了。 -------------------------------------------------------------------------------- @@ -81,7 +69,7 @@ via: https://opensource.com/article/21/4/zsh-mac 作者:[Bryant Son][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5e67deeac0c1ea102b663ff659b0b66f91eff6d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 22 Apr 2021 23:46:42 +0800 Subject: [PATCH 228/307] PUB @geekpi https://linux.cn/article-13323-1.html --- ...tomizing your Mac terminal theme with open source tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210419 4 steps to customizing your Mac terminal theme with open source tools.md (98%) diff --git a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md b/published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md similarity index 98% rename from translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md rename to published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md index abbd774626..19237b5d7c 100644 --- a/translated/tech/20210419 4 steps to customizing your Mac terminal theme with open source tools.md +++ b/published/20210419 4 steps to customizing your Mac terminal theme with open source tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13323-1.html) 用开源工具定制 Mac 终端主题的 4 个步骤 ====== From a076c391886414e7d4d89ee76857056ffaeddae5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:02:42 +0800 Subject: [PATCH 229/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210422=20?= =?UTF-8?q?Restore=20an=20old=20MacBook=20with=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210422 Restore an old MacBook with Linux.md --- ...10422 Restore an old MacBook with Linux.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210422 Restore an old MacBook with Linux.md diff --git a/sources/tech/20210422 Restore an old MacBook with Linux.md b/sources/tech/20210422 Restore an old MacBook with Linux.md new file mode 100644 index 0000000000..e83554ad66 --- /dev/null +++ b/sources/tech/20210422 Restore an old MacBook with Linux.md @@ -0,0 +1,104 @@ +[#]: subject: (Restore an old MacBook with Linux) +[#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Restore an old MacBook with Linux +====== +Don't throw your old, slow MacBook into the recycling bin; extend its +life with Linux Mint. +![Writing Hand][1] + +Last year, I wrote about how you can give [new life to an old MacBook][2] with Linux, specifically Elementary OS in that instance. Recently, I returned to that circa 2015 MacBook Air and discovered I had lost my login password. I downloaded the latest Elementary OS 5.1.7 Hera release and could not get the live boot to recognize my Broadcom 4360 wireless chipset. + +Lately, I have been using [Linux Mint][3] to refurbish older laptops, and I thought I would give it a try on this MacBook Air. I downloaded the Linux Mint 20.1 ISO and created a USB boot drive using the [Popsicle][4] software on my Linux desktop computer. + +![Popsicle ISO burner][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Next, I connected the Thunderbolt Ethernet adapter to the MacBook and inserted the USB boot drive. I powered on the system and pressed the Option key on the MacBook to instruct it to start it from a USB drive. + +Linux Mint started up nicely in live-boot mode, but the operating system didn't recognize a wireless connection. + +### Where's my wireless? + +This is because Broadcom, the company that makes WiFi cards for Apple devices, doesn't release open source drivers. This is in contrast to Intel, Atheros, and many other chip manufacturers—but it's the chipset used by Apple, so it's a common problem on MacBooks. + +I had a hard-wired Ethernet connection to the internet through my Thunderbolt adapter, so I _was_ online. From prior research, I knew that to get the wireless adapter working on this MacBook, I would need to issue three separate commands in the Bash terminal. However, during the installation process, I learned that Linux Mint has a nice built-in Driver Manager that provides an easy graphical user interface to assist with installing the software. + +![Linux Mint Driver Manager][7] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Once that operation completed, I rebooted and brought up my newly refurbished MacBook Air with Linux Mint 20.1 installed. The Broadcom wireless adapter was working properly, allowing me to connect to my wireless network easily. + +### Installing wireless the manual way + +You can accomplish the same task from a terminal. First, purge any vestige of the Broadcom kernel source: + + +``` +`$ sudo apt-get purge bcmwl-kernel-source` +``` + +Then add a firmware installer: + + +``` +`$ sudo apt install firmware-b43-installer` +``` + +Finally, install the new firmware for the system: + + +``` +`$ sudo apt install linux-firmware` +``` + +### Using Linux as your Mac + +I installed [Phoronix Test Suite][8] to get a good snapshot of the MacBook Air. + +![MacBook Phoronix Test Suite output][9] + +(Don Watkins, [CC BY-SA 4.0][6]) + +The system works very well. A recent update to kernel 5.4.0-64-generic revealed that the wireless connection survived, and I have an 866Mbps connection to my home network. The Broadcom FaceTime camera does not work, but everything else works fine. + +I really like the [Linux Mint Cinnamon 20.1][10] desktop on this MacBook. + +![Linux Mint Cinnamon][11] + +(Don Watkins, [CC BY-SA 4.0][6]) + +I recommend giving Linux Mint a try if you have an older MacBook that has been rendered slow and inoperable due to macOS updates. I am very impressed with the distribution, and especially how it works on my MacBook Air. It has definitely extended the life expectancy of this powerful little laptop. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/restore-macbook-linux + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/write-hand_0.jpg?itok=Uw5RJD03 (Writing Hand) +[2]: https://opensource.com/article/20/2/macbook-linux-elementary +[3]: https://linuxmint.com/ +[4]: https://github.com/pop-os/popsicle +[5]: https://opensource.com/sites/default/files/uploads/popsicle.png (Popsicle ISO burner) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/mint_drivermanager.png (Linux Mint Driver Manager) +[8]: https://www.phoronix-test-suite.com/ +[9]: https://opensource.com/sites/default/files/uploads/macbook_specs.png (MacBook Phoronix Test Suite output) +[10]: https://www.linuxmint.com/edition.php?id=284 +[11]: https://opensource.com/sites/default/files/uploads/mintcinnamon.png (Linux Mint Cinnamon) From 6c51b21aad3f7dc060e76a38f9acaa1f23c7334f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:10 +0800 Subject: [PATCH 230/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210422=20?= =?UTF-8?q?Energy=20infrastructure=20platform=20uses=20open=20source=20to?= =?UTF-8?q?=20fight=20climate=20change?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md --- ...ses open source to fight climate change.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md diff --git a/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md b/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md new file mode 100644 index 0000000000..222722b89d --- /dev/null +++ b/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md @@ -0,0 +1,74 @@ +[#]: subject: (Energy infrastructure platform uses open source to fight climate change) +[#]: via: (https://opensource.com/article/21/4/seapath-open-energy-infrastructure) +[#]: author: (Dr. Shuli Goodman https://opensource.com/users/shuligoodman) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Energy infrastructure platform uses open source to fight climate change +====== +SEAPATH is a Linux Foundation project that aims to modernize the power +grid through an open energy infrastructure. +![Light bulb][1] + +LF Energy is a Linux Foundation project working to accelerate the energy transition of the world's grids and transportation systems through open source. In December, our project took a major step toward achieving its mission when we and our member organizations Alliander, RTE, and Savoir-faire Linux launched [SEAPATH][2], which stands for Software Enabled Automation Platform and Artifacts. + +SEAPATH is a reference design and a real-time, open source platform for grid operators to run virtualized automation and protection applications. It is the second project for LF Energy's [Digital Substation Automation Systems][3] initiative and a vital step toward adopting renewable energy on the power grid. It will accelerate the grid's decarbonization, helping lead the planet to [carbon neutrality by 2050][4]. Power system transformation [leads all efforts for decarbonization][5]; it's the _key_ enabler for fighting climate change. + +### Breaking down silos + +Coordinating power generation, distribution, and transmission systems is a critical component of a green grid. + +Currently, the grid's infrastructure operates on a centralized, point-to-point framework, requiring a source like a gas- or coal-fired power plant to distribute electricity. Essentially, the grid was built on a foundation of silos with different systems for energy generation, transmission, and distribution. However, due to the high variability of renewable energy—power can be produced only when the sun shines or the wind blows—it's difficult to integrate clean energy sources into siloed systems. The [increasing use of electric vehicles][6] is also causing power supply and demand fluctuations. + +These challenges make it difficult for grid operators to control and optimize renewable sources of energy. Furthermore, the grid's infrastructure isn't sustainable for a clean energy future. In fact, the grid of the future will not be a grid at all. Rather, power system networks will process tsunamis of data that enable the orchestration, choreography, and coordination of energy supply and demand. The future energy framework will operate like the internet, digitally connecting thousands of power systems and processing data from their substations to generate, transmit, and distribute electricity. + +### Interoperability through open source + +In working toward clean energy integration, grid operators use digital substations, which require a growing number of computational devices to support field sensors, applications, and automation technologies. + +Typically, these components are provided by multiple proprietary solutions, making interoperability difficult due to redundant hardware requirements. This challenge largely correlates with vendor lock-in throughout the energy industry. US regulators allow utility companies to sign [50-plus year contracts][7] that secure their place in specified regions. As a result, utilities use proprietary solutions for their portion of the grid, making interoperability between substations difficult. In March 2021, we launched [FledgePOWER][8], a new project that seeks to address this problem. + +Solutions do not always share the same specifications, but they often handle similar data. Implementing new solutions is costly, creates technical debt, and is time-consuming. To manage these heterogeneous environments, operators tend to run deprecated legacy systems for decades. With the speed of change increasing, network operations have become increasingly complex, less flexible, and more expensive to operate. Being able to abstract this complexity offers system and network operators new tools for interoperability in a rapidly transforming environment. + +SEAPATH's goal is similar to the Linux Foundation's [OpenDaylight project][9], an open source initiative that catapulted software virtualization for telecommunication networks and set the industry standard for software-defined network infrastructure. SEAPATH aims to apply the same technology OpenDaylight uses to consolidate multi-provider systems on the grid into one platform. This aims to enable operators to digitally implement electricity distribution and transmission through data from their substations. This consolidation also supports time- and cost-efficiency, scalability, flexibility, innovation, and novel technology implementations and merging utility practices. + +Through cross-industry collaboration with SEAPATH, the energy sector can build customer- and vendor-agnostic virtualization technologies required by a modern, climate-conscious grid. The more flexible and scalable the grid can be for greener energy, the faster we can reach decarbonization. + +### How to get involved with SEAPATH + +If you are interested in learning more about SEAPATH or joining the project, here's how you can get involved: + + * **Learn about SEAPATH:** Check out LF Energy's [SEAPATH project page][2] to learn more about the initiative. We have a technical steering committee (TSC), a mailing list, open meetings, a wiki feed, and a roadmap that can help answer any questions you may have about the project. + * **Use SEAPATH:** To access SEAPATH, you must be a member of LF Energy. Organizations can join by [becoming a member][10]. LF Energy is funded through membership dues and contributions of engineering resources. Once registered, you can access SEAPATH on its [GitHub page][11]. If you can't join as an LF Energy member, we still encourage you to contribute by participating in technical projects and discussion lists. + + + +Time is running out for the energy industry to come together and improve the grid for our future. By joining as partners, the entire energy industry—and the entire world—can benefit from a grid powered by green energy for a brighter future. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/seapath-open-energy-infrastructure + +作者:[Dr. Shuli Goodman][a] +选题:[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/shuligoodman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bulb-light-energy-power-idea.png?itok=zTEEmTZB (Light bulb) +[2]: https://www.lfenergy.org/projects/seapath/ +[3]: https://wiki.lfenergy.org/display/HOME/Digital+Substation+Automation+Systems+%28DSAS%29+Initiative +[4]: https://grist.org/climate/yes-the-u-s-can-go-carbon-neutral-by-2050-says-new-princeton-study/ +[5]: https://e360.yale.edu/features/deep-decarbonization-a-realistic-way-forward-on-climate-change +[6]: https://www.iea.org/reports/global-ev-outlook-2020 +[7]: https://apnews.com/article/7393a2dd5c69f590a8e7db3d19f1e240 +[8]: https://www.lfenergy.org/projects/fledgepower/ +[9]: https://opensource.com/business/14/10/opendaylight-helium-gets-out-gate +[10]: https://www.lfenergy.org/join/ +[11]: https://github.com/seapath From bccf95da2f739752da0a0e69fd9856805079c1f4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:31 +0800 Subject: [PATCH 231/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210422=20?= =?UTF-8?q?Hurrah!=20Ubuntu=2021.04=20is=20Now=20Available=20to=20Download?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md --- ...untu 21.04 is Now Available to Download.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md new file mode 100644 index 0000000000..825ad149af --- /dev/null +++ b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md @@ -0,0 +1,125 @@ +[#]: subject: (Hurrah! Ubuntu 21.04 is Now Available to Download) +[#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Hurrah! Ubuntu 21.04 is Now Available to Download +====== + +It is time to make way for Ubuntu’s latest stable release 21.04 Hiruste Hippo. + +While we already know a great deal about the [features introduced with Ubuntu 21.04][1], it has been [officially announced][2]. + +Yes, there’s no GNOME 40, which is a bummer. But, here, let me briefly mention the key highlights of the release and how to get the latest ISO. + +### Ubuntu 21.04: Key Highlights + +Considering this as an interim release, there are no ground-breaking changes but still a few things to get excited about. + +#### Wayland Is The Default Display Server + +This could be one of the most significant changes that you may want to keep an eye on. + +Many applications fail to work with Wayland, but we’re slowly getting Wayland support on new application releases considering its performance and security benefits. + +So, this is probably a bold step to move away from Xorg. + +#### UI Enhancements + +![][3] + +Ranging from subtle improvements to the Dark Theme to the adoption of dark theme by default, you will be greeted with some UI enhancements for a good user experience. + +Also, [Google’s Flutter apps are coming to Ubuntu 21.04][4]. You will find them through the snap store, and it should potentially enable Linux desktop to have high quality cross-platform with improved user experience overall. + +In addition to that, you might observe a few things here and there that could look a bit different. + +#### GNOME 40 Applications & GNOME 3.38 + +Even though it does not come baked in with [GNOME 40][5], you will find the default applications updated to GNOME 40. + +So, the GNOME 40 apps have been made compatible with GNOME 3.38 for this release. The next release should make the transition to GNOME 40 without any hiccups. + +#### Private Home Directories + +![][6] + +The home directory was readable/writable by root and other users. However, with [Ubuntu 21.04, they are making it private][7]. + +#### Other Improvements + +There are plenty of other improvements that include under-the-hood changes for new hardware support, enhanced laptop support, and more. + +Of course, the packages have been updated to the latest as well along with the inclusion of [Linux Kernel 5.11][8]. + +### Things to Know Before You Upgrade + +If you are using Ubuntu 20.10, you can easily upgrade to Ubuntu 21.04 through the **Updates** section. + +In either case, if you are on Ubuntu 20.04 LTS, I would not recommend upgrading to Ubuntu 21.04 yet unless you want the latest and greatest at the expense of stability and potential issues. + +### Download Ubuntu 21.04 Now + +You can get the latest release from the official website, both torrent and a direct ISO file download should be available as options. + +At the time of publishing this, the official website still did not include a link to the latest images but it should be updated soon enough. + +[Ubuntu 21.04 Download][9] + +If you need a choice of desktop environment, you will have to wait for the official flavors of Ubuntu to release an upgrade, that will take a while. + +_What do you think about Ubuntu 21.04 release? Feel free to let me know your thoughts in the comments!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][1] + * ![][10] ![Ubuntu 21.04 New Features][11] + + + * [Ubuntu 21.04 Beta is Now Available to Download][12] + * ![][10] ![][13] + + + * [Ubuntu 21.04 To Offer GNOME 40 Apps with GNOME 3.38 Desktop][14] + * ![][10] ![][15] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-21-04-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/ubuntu-21-04-features/ +[2]: https://ubuntu.com/blog/ubuntu-21-04-is-here +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://itsfoss.com/google-flutter-apps-linux/ +[5]: https://news.itsfoss.com/gnome-40-release/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI2MScgd2lkdGg9Jzc3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://news.itsfoss.com/private-home-directory-ubuntu-21-04/ +[8]: https://news.itsfoss.com/linux-kernel-5-11-release/ +[9]: https://ubuntu.com/download +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu_21_04_features.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[12]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ +[13]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[14]: https://news.itsfoss.com/ubuntu-21-04-gnome-40-apps/ +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/ubuntu-21-04-gnome-40-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 From a639bc19c6b313c316eaba873122657f173d053f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:43 +0800 Subject: [PATCH 232/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210422=20?= =?UTF-8?q?Confusion=20Erupts=20Around=20Misleading=20News=20Surrounding?= =?UTF-8?q?=20Youtube-dl=20Takedown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md --- ...ng News Surrounding Youtube-dl Takedown.md | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md diff --git a/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md b/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md new file mode 100644 index 0000000000..0ec6db98bb --- /dev/null +++ b/sources/news/20210422 Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown.md @@ -0,0 +1,132 @@ +[#]: subject: (Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown) +[#]: via: (https://news.itsfoss.com/youtube-dl-repo-fork/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Confusion Erupts Around Misleading News Surrounding Youtube-dl Takedown +====== + +In November 2020, [GitHub took down the Youtube-dl repository][1] after a complaint from the [RIAA][2]. This action caused a huge backlash within the open-source community, with many developers boycotting GitHub altogether. + +The RIAA claimed that [Youtube-dl][3] was using copyright-protection avoidance technologies, which resulted in immense criticism from multiple open-source organizations. In a surprise move, GitHub reinstated the repository several weeks later. + +![][4] + +To complement this reinstatement, they created a 1 million dollar takedown defense fund, designed to prevent situations like this in the future. + +### False News Surrounding Youtube-dl’s Forks + +![][5] + +Among the confusion caused by this takedown, some recent reports have surfaced claiming that forks of the Youtube-dl repository are still disabled. **This is not true**. If we look at the [list of forks,][6] we can see a huge list of repositories, with each one working as normal. + +Multiple sources reference [this repository][7], which has been taken down and has still not been reinstated by GitHub. However, it is not actually forked from the [official Youtube-dl repository][8]. Instead, this repository is based on an unofficial version of Youtube-dl and is not actually a Youtube-dl fork. + +This isn’t to say that GitHub is without blame, as they have still ignored this developer’s counternotice. However, this warrants nowhere near the amount of criticism GitHub has received because of this. + +### GitHub Working on Preventing a Situation Like This In The Future + +GitHub reinstated the Youtube-dl repository back then (and its forks), many were pleased to hear that they had also started work on preventing a situation like this in the future. Some of these initiatives include: + + * A 1,000,000 USD fund aimed to help developers fight DMCA notices + * Giving the option to developers to dispute the notice + * Requiring additional proof for part 1201 takedown notices + + + +#### New Fund to Fight DMCA Notices + +As a result of the community backlash GitHub received, they have invested one million USD into a fund designed to help developers fight unfair DMCA notices. According to the official [GitHub post:][9] + +> Developers who want to push back against unwarranted takedowns may face the risk of taking on personal liability and legal defense costs. To help them, GitHub will establish and donate $1M to a developer defense fund to help protect open source developers on GitHub from unwarranted DMCA Section 1201 takedown claims. + +GitHub + +Although providing legal support for open-source developers is not a new idea, GitHub providing this support directly is worth appreciating. + +If you are interested in other ways to get support with legal disputes over open-source software, you may want to look at the [SFLC][10] and [EFF][11]. If possible, it would also be great if you could support them whether that’s through donations of time or money. + +#### New Way For Developers To Dispute DMCA Notices + +Another way GitHub is working to improve its relationship with developers is through a new way to dispute takedown notices. This will improve the transparency between developers and the notice issuers, reducing the likelihood of another situation like this. + +> Every single credible 1201 takedown claim will be reviewed by technical experts, including (when appropriate) independent specialists retained by GitHub, to ensure that the project actually circumvents a technical protection measure as described in the claim. +> +> The claim will also be carefully scrutinized by legal experts to ensure that unwarranted claims or claims that extend beyond the boundaries of the DMCA are rejected. +> +> In the case where the claim is ambiguous, we will err on the side of the developer, and leave up the repository unless there is clear evidence of illegal circumvention. + +Yet again, it seems that GitHub is putting in a lot of effort to improve its policies on DMCA takedown notices. These improvements will definitely help with the number of false claims that are currently being accepted. + +#### More Proof Required for Future Part 1201 Notices + +For those without a background in law, Part 1201 DMCA Takedown Notices are a special kind of takedown notice used in cases where the offending party is using code designed to circumvent technical measures to protect copyrighted content. According to GitHub: + +> Section 1201 dates back to the late 1990s and did not anticipate the various implications it has for software use today. As a result, Section 1201 makes it illegal to use or distribute technology (including source code) that bypasses technical measures that control access or copying of copyrighted works, even if that technology can be used in a way that would not be copyright infringement. + +GitHub has now changed its policies so that anyone issuing a part 1201 notice must include additional evidence. This is beneficial to all involved parties as it means that most of the illegitimate claims will be void anyway. + +### Wrapping Up + +With the huge mess, this situation has created, I believe GitHub handled this as well as they reasonably could have. Additionally, it brought to light many legal issues surrounding part 1201 notices, which are being remedied right now. + +Overall, the outcome of this has actually been positive, with a huge step in the right direction in developer rights. Amidst the rumors and fake news that has been circling lately, I think it is important to recognize the changes that have been made, and what they mean for the future of open-source software. + +_What are your thoughts on the removal of Youtube-dl and then reinstating it? Let me know in the comments below!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [PHP Repository Moves to GitHub After its Git Server Was Hacked][12] + * ![][13] ![][14] + + + * [10 Biggest Linux Stories of the Year 2020 [That Made the Biggest Impact]][15] + * ![][13] ![Biggest Linux Stories][16] + + + * [After Rocky Linux, We Have Another RHEL Fork in Works to Replace CentOS][17] + * ![][13] ![CloudLinux][18] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/youtube-dl-repo-fork/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/youtube-dl-github-takedown/ +[2]: https://www.riaa.com/ +[3]: https://youtube-dl.org/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3NScgd2lkdGg9Jzc0MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://github.com/ytdl-org/youtube-dl/network/members +[7]: https://github.com/spookyahell/youtube-dl +[8]: https://github.com/ytdl-org/youtube-dl +[9]: https://github.blog/2020-11-16-standing-up-for-developers-youtube-dl-is-back/ +[10]: https://softwarefreedom.org/donate/ +[11]: https://www.eff.org/ +[12]: https://news.itsfoss.com/php-repository-github/ +[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/php-github-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/biggest-linux-stories-2020/ +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/biggest-linux-stories-2020.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[17]: https://news.itsfoss.com/rhel-fork-by-cloudlinux/ +[18]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Untitled-design-2.png?fit=800%2C450&ssl=1&resize=350%2C200 From 2e468d24d7cee38778c6ff24d7f1dd38372beb21 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 23 Apr 2021 05:03:57 +0800 Subject: [PATCH 233/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210422=20?= =?UTF-8?q?Running=20Linux=20Apps=20In=20Windows=20Is=20Now=20A=20Reality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md --- ... Linux Apps In Windows Is Now A Reality.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md diff --git a/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md new file mode 100644 index 0000000000..f37147f235 --- /dev/null +++ b/sources/news/20210422 Running Linux Apps In Windows Is Now A Reality.md @@ -0,0 +1,143 @@ +[#]: subject: (Running Linux Apps In Windows Is Now A Reality) +[#]: via: (https://news.itsfoss.com/linux-gui-apps-wsl/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Running Linux Apps In Windows Is Now A Reality +====== + +When Microsoft released [Windows Subsystem for Linux][1] (WSL) in 2016, the hype was unreal. People were dreaming of running their Windows and Linux apps side-by-side, without having to reboot. But alas, WSL could only run terminal applications. + +Last year, Microsoft set out again to try to revolutionize the Windows app ecosystem. This time, they replaced the old emulated kernel with a real Linux kernel. This change allowed you to run [Linux apps in Windows][2]. + +### Initial Preview of GUI Apps for WSL + +![][3] + +Technically, you did get the initial support for Linux GUI apps on WSL, but only when using a 3rd-party X server. These were often buggy, slow, hard to set up, and posed a privacy concern. + +The result of this was a small group of Linux enthusiasts (that happened to run Windows) that had the skills and knowledge to set up an X server. These people were then horribly disappointed at the fact there was no hardware acceleration at all. + +So, it was wise to stick to command line utilities on WSL. + +**But this all changes now.** Now that Microsoft is [officially supporting][4] GUI Linux apps, we will be receiving hardware acceleration, alongside a huge range of other improvements in WSL. + +### Linux GUI Apps For The Masses: WSLg + +![Image Credit: Microsoft Devblogs][5] + +With the new official support from Microsoft in WSL, there is a huge range of available improvements. These include: + + * GPU hardware acceleration + * Audio and microphone support out of the box + * Automatic starting of the X and PulseAudio servers + + + +And, they’ve given this feature a nickname “**WSLg**“. + +These features will make running Linux apps on WSL almost as easy as running native apps, with a minimal performance impact. + +So, you can try running your [favorite IDE][6], Linux-specific testing use-cases, and a variety of other applications like [CAD software][7]. + +#### GPU Hardware Acceleration In Linux Apps + +![Image Credit: Microsoft Devblogs][8] + +One of the biggest issues with running GUI Linux apps on Windows previously was that they couldn’t use hardware acceleration. This left us with a slow mess when trying to move windows around and doing anything that needed some GPU horsepower. + +According to the announcement post from Microsoft: + +> As part of this feature, we have also enabled support for GPU accelerated 3D graphics! Thanks to work that was completed in Mesa 21.0, any applications that are doing complex 3D rendering can leverage OpenGL to accelerate these using the GPU on your Windows 10 machine. + +This is a useful addition, and should help anyone wanting to run GPU intensive applications through WSL. + +#### Audio And Microphone Support Out Of The Box! + +One of the key elements to a good experience with Linux apps running alongside Windows apps is the audio. With the new WSL update, audio is supported out of the box. This is achieved with a PulseAudio server being started at the same time as the X server. + +Microsoft explains: + +> Linux GUI applications on WSL will also include out-of-the-box audio and microphone support. This exciting aspect will let your apps play audio cues and utilize the microphone, perfect for building, testing, or using movie players, telecommunication apps, and more. + +If we want Linux apps to become more widespread, this is a key feature. This will also allow developers of Windows apps to better support porting their apps to Linux. + +#### Automatic Starting Of All The Required Servers + +![Image Credit: Microsoft Devblogs][9] + +Previously, you had to start the [PulseAudio][10] and [X servers][11] manually before being able to actually run anything. Now, Microsoft has implemented a service that checks to see if a Linux app is running, and then starts the required servers automatically. + +This allows much easier launching and using of Linux apps on Windows. + +Microsoft claims this will improve the user experience significantly: + +> With this feature, we are automatically starting a companion system distro, containing a Wayland, X server, pulse audio server, and everything else needed to make Linux GUI apps communicate with Windows. After you’re finished using GUI applications and terminate your WSL distribution the system distro will automatically end its session as well. + +These components combine to make it super easy to run Linux GUI apps alongside regular Windows apps. + +### Wrapping Up + +With all these new features, it looks like Microsoft is giving it their best to get Linux apps working on Windows. And with more users running Linux apps on Windows, we may see more of them jump ship and move solely to Linux. Especially since the apps they’re used to would run anyway. + +If this takes off (and Microsoft doesn’t kill it in a few years), it will bring an end to a 5-year quest to bring Linux apps to Windows. If you are curious to learn more about it, you can look at the [release announcement][12]. + +_What are your thoughts on GUI Linux apps running on Windows? Share them in the comments below!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Linux Mint 20.1 is Available to Download Now, Here are 9 New Features in This Release][13] + * ![][14] ![Linux Mint 20.1][15] + + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][16] + * ![][14] ![][17] + + + * [Nitrux 1.3.8 Release Packs in KDE Plasma 5.21, Linux 5.11, and More Changes][18] + * ![][14] ![][19] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-gui-apps-wsl/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://docs.microsoft.com/en-us/windows/wsl/ +[2]: https://itsfoss.com/run-linux-apps-windows-wsl/ +[3]: https://i0.wp.com/i.ytimg.com/vi/f8_nvJzuaSU/hqdefault.jpg?w=780&ssl=1 +[4]: https://devblogs.microsoft.com/commandline/the-initial-preview-of-gui-app-support-is-now-available-for-the-windows-subsystem-for-linux-2/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[7]: https://itsfoss.com/cad-software-linux/ +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0NScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ0MCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://www.freedesktop.org/wiki/Software/PulseAudio/ +[11]: https://x.org/wiki/ +[12]: https://blogs.windows.com/windows-insider/2021/04/21/announcing-windows-10-insider-preview-build-21364/ +[13]: https://news.itsfoss.com/linux-mint-20-1-release/ +[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/linux-mint-20-1.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[16]: https://news.itsfoss.com/lutris-creator-interview/ +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/nitrux-1-3-8-release/ +[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/nitrux-1-3-8.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 7d1967fe1e18119922caa743867c66c6bdd9534a Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 23 Apr 2021 08:44:34 +0800 Subject: [PATCH 234/307] translating --- ... With Variety of Sounds to Stay Focused.md | 88 ------------------- ... With Variety of Sounds to Stay Focused.md | 78 ++++++++++++++++ 2 files changed, 78 insertions(+), 88 deletions(-) delete mode 100644 sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md create mode 100644 translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md diff --git a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md deleted file mode 100644 index cce8abbd45..0000000000 --- a/sources/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: (Blanket: Ambient Noise App With Variety of Sounds to Stay Focused) -[#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Blanket: Ambient Noise App With Variety of Sounds to Stay Focused -====== - -_**Brief: An open-source ambient noise player offering a variety of sounds to help you focus or fall asleep.**_ - -With the increase in the number of activities around you, it is often tough to keep calm and stay focused. - -Sometimes music helps, but it also distracts in some cases. But, ambient noise? That is always soothing to hear. Who doesn’t want to hear birds chirping, rain falling and crowd chattering in a restaurant? Okay, may be not the last one but listening to natural sound could help in relaxing and focusing. This indirectly boots your productivity. - -Recently, I came across a dedicated player which includes different sounds that could help anyone focus. - -### Play Different Ambient Sounds Using Blanket - -Blanket is an impressive ambient noise player that features different sounds that can help you fall asleep or just regain focus by helping you forget about the surrounding distractions. - -It includes nature sounds like rain, waves, birds chirping, storm, wind, water stream, and summer night. - -![][1] - -Also, if you are a commuter or someone comfortable in a mildly busy environment, you can find sounds for trains, boat, city, coffee shop, or a fireplace. - -If you are fond of white noise or pink noise, which combines all sound frequencies that humans can hear, that is available here too. - -It also lets you autostart every time you boot, if that is what you prefer. - -![][2] - -### Install Blanket on Linux - -The best way to install Blanket is from [Flathub][3]. Considering that you have [Flatpak][4] enabled, all you have to type in the terminal to install it is: - -``` -flatpak install flathub com.rafaelmardojai.Blanket -``` - -In case you’re new to Flatpak, you might want to go through our [Flatpak guide][5]. - -If you do not prefer using Flatpaks, you can install it using a PPA maintained by a contributor in the project. For Arch Linux users, you can find it in [AUR][6] to easily install it. - -In addition, you can also find packages for Fedora and openSUSE. To explore all the available packages, you can head to its [GitHub page][7]. - -**Recommended Read:** - -![][8] - -#### [Relax With Natural Sounds By Using Ambient Noise Music Player In Ubuntu][9] - -Listen to natural white noise music with Ambient Noise Music Player application In Ubuntu. - -### Closing Thoughts - -The user experience for a simple ambient noise player is pretty good. I have a pair of HyperX Alpha S headphones and I must mention that the quality of the sounds is good to hear. - -In other words, it is soothing to hear, and I will recommend you to try it out if you wanted to experience Ambient sounds to focus, get rid of your anxiety or just fall asleep. - -Have you tried it yet? Feel free to share your thoughts below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/blanket-ambient-noise-app/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-screenshot.png?resize=614%2C726&ssl=1 -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-autostart-1.png?resize=514%2C214&ssl=1 -[3]: https://flathub.org/apps/details/com.rafaelmardojai.Blanket -[4]: https://itsfoss.com/what-is-flatpak/ -[5]: https://itsfoss.com/flatpak-guide/ -[6]: https://itsfoss.com/aur-arch-linux/ -[7]: https://github.com/rafaelmardojai/blanket -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2015/04/Ambient_Noise_Ubuntu.jpeg?fit=700%2C350&ssl=1 -[9]: https://itsfoss.com/ambient-noise-music-player-ubuntu/ diff --git a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md new file mode 100644 index 0000000000..146a292ad9 --- /dev/null +++ b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -0,0 +1,78 @@ +[#]: subject: (Blanket: Ambient Noise App With Variety of Sounds to Stay Focused) +[#]: via: (https://itsfoss.com/blanket-ambient-noise-app/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Blanket:拥有各种环境噪音的应用,帮助保持注意力集中 +====== + +_**简介:一个开源的环境噪音播放器,提供各种声音,帮助你集中注意力或入睡。**_ + +随着你周围活动的增加,要保持冷静和专注往往是很困难的。 + +有时,音乐会有所帮助,但在某些情况下也会分散注意力。但是,环境噪音如何?这总是让人听起来很舒心。谁不想在餐厅里听到鸟叫声、雨滴声和人群的交谈声?好吧,可能不是最后一个,但听自然的声音可以帮助放松和集中注意力。这间接地提高了你的工作效率。 + +最近,我发现了一个专门的播放器,其中包含了不同的声音,可以帮助任何人集中注意力。 + +### 使用 Blanket 播放不同的环境声音 + +Blanket 是一个令人印象深刻的环境噪音播放器,它具有不同的声音,可以帮助你入睡或只是通过帮助你忘记周围的干扰来重获注意力。 + +它包括自然界的声音,像雨声、海浪声、鸟鸣声、风暴声、风声、水流声、夏夜声。 + +![][1] + +此外,如果你是一个通勤者或在轻微繁忙的环境中感到舒适的人,你可以找到火车、船、城市、咖啡馆或壁炉的声音。 + +如果你喜欢白噪声或粉红噪声,它结合了人类能听到的所有声音频率,这里也可以找到。 + +它还可以让你在每次开机时自动启动,如果你喜欢这样的话。 + +![][2] + +### 在 Linux 上安装 Blanket + +安装 Blanket 的最好方法是来自 [Flathub][3]。考虑到你已经启用了 [Flatpak][4],你只需在终端键入以下命令就可以安装它: + +``` +flatpak install flathub com.rafaelmardojai.Blanket +``` + +如果你是 Flatpak 的新手,你可能想通过我们的 [Flatpak 指南][5]了解。 + +如果你不喜欢使用 Flatpaks,你可以使用该项目中的贡献者维护的 PPA 来安装它。对于 Arch Linux 用户,你可以在 [AUR][6] 中找到它,以方便安装。 + +此外,你还可以找到 Fedora 和 openSUSE 的软件包。要探索所有可用的软件包,你可以前往其 [GitHub 页面][7]。 + +### 结束语 + +对于一个简单的环境噪音播放器来说,用户体验是相当好的。我有一副 HyperX Alpha S 耳机,我必须要说声音的质量很好。 + +换句话说,它听起来很舒缓,如果你想体验环境声音来集中注意力,摆脱焦虑或只是睡着,我建议你试试。 + +你试过它了吗?欢迎在下面分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/blanket-ambient-noise-app/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-screenshot.png?resize=614%2C726&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/blanket-autostart-1.png?resize=514%2C214&ssl=1 +[3]: https://flathub.org/apps/details/com.rafaelmardojai.Blanket +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://itsfoss.com/flatpak-guide/ +[6]: https://itsfoss.com/aur-arch-linux/ +[7]: https://github.com/rafaelmardojai/blanket From 42423d29e602de3a1dd786fc046b01b29cbe1857 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 23 Apr 2021 08:59:15 +0800 Subject: [PATCH 235/307] translating --- ...20 Application observability with Apache Kafka and SigNoz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md index be94aca606..36b52ad61c 100644 --- a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md +++ b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) [#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f934e6a656d9d25775fd399979da72ea87031f00 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Fri, 23 Apr 2021 18:11:48 +0800 Subject: [PATCH 236/307] =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=94=B3=E8=AF=B7=20?= =?UTF-8?q?(#21707)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Create 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 申请译文 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md 完成翻译 * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Rename sources/talk/20200106 Open Source Supply Chain- A Matter of Trust.md to translated/talk/20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20200106 Open Source Supply Chain- A Matter of Trust.md * Update 20210420 The Guided Installer in Arch is a Step in the Right Direction.md * Update 20210420 The Guided Installer in Arch is a Step in the Right Direction.md * Update 20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...Guided Installer in Arch is a Step in the Right Direction.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md index d28fdd0fe3..60263301ae 100644 --- a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 37075aa0314f853e305e01bf9584a9a899fd629d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 23 Apr 2021 18:13:04 +0800 Subject: [PATCH 237/307] Rename sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md to sources/talk/20210422 Energy infrastructure platform uses open source to fight climate change.md --- ...structure platform uses open source to fight climate change.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210422 Energy infrastructure platform uses open source to fight climate change.md (100%) diff --git a/sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md b/sources/talk/20210422 Energy infrastructure platform uses open source to fight climate change.md similarity index 100% rename from sources/tech/20210422 Energy infrastructure platform uses open source to fight climate change.md rename to sources/talk/20210422 Energy infrastructure platform uses open source to fight climate change.md From 263ac09e11b34482a2a41295c0b1ec6c9e9013ec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 23 Apr 2021 18:45:18 +0800 Subject: [PATCH 238/307] PRF @geekpi --- ...and Edit EPUB Files on Linux With Sigil.md | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md index 1f0780b0ec..204b54915f 100644 --- a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ b/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -3,16 +3,18 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Sigil 在 Linux 上创建和编辑 EPUB 文件 ====== -Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你可以使用 Sigil 创建一个新的 EPUB 格式的电子书,或编辑现有的 EPUB 电子书(以 .epub 扩展结尾的文件)。 +![](https://img.linux.net.cn/data/attachment/album/202104/23/184455qn6u6oozmf6gmnec.jpg) -如果你感到好奇,EPUB 是一个标准的电子书格式,并被几个数字出版集团认可。它被许多设备和电子阅读器支持,除了 亚马逊的 Kindle。 +Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你可以使用 Sigil 创建一个新的 EPUB 格式的电子书,或编辑现有的 EPUB 电子书(以 `.epub` 扩展结尾的文件)。 + +如果你感到好奇,EPUB 是一个标准的电子书格式,并被几个数字出版集团认可。它被许多设备和电子阅读器支持,除了亚马逊的 Kindle。 ### Sigil 让你创建或编辑 EPUB 文件 @@ -20,15 +22,14 @@ Sigil 是一个开源的 Linux、Windows 和 MacOS 上的 EPUB 编辑器。你 ![][2] -很多人在[创建或编辑电子书时非常相信 Calibre][3]。它确实是一个完整的工具,它有很多的功能并支持不仅仅是 EPUB 格式。然而,Calibre 有时可能是沉重的资源。 - +很多人在 [创建或编辑电子书时非常相信 Calibre][3]。它确实是一个完整的工具,它有很多的功能,支持的格式不只是 EPUB 格式。然而,Calibre 有时可能需要过多的资源。 Sigil 只专注于 EPUB 书籍,它有以下功能: * 支持 EPUB 2 和 EPUB 3(有一定的限制) * 提供代码视图预览 * 编辑 EPUB 语法 - * 带有多级标题的内容表生成器 + * 带有多级标题的目录生成器 * 编辑元数据 * 拼写检查 * 支持正则查找和替换 @@ -37,9 +38,7 @@ Sigil 只专注于 EPUB 书籍,它有以下功能: * 多语言支持的接口 * 支持 Linux、Windows 和 MacOS - - -Sigil 不是你可以直接输入新书章节的 [WYSIWYG][4] 类型的编辑器。由于 EPUB 依赖于 XML,因此它专注于代码。 将其视为用于 EPUB 文件的[类似于 VS Code 的代码编辑器][5]。出于这个原因,你应该使用一些其他[开源写作工具][6],以 epub 格式导出你的文件(如果可能的话),然后在 Sigil 中编辑它。 +Sigil 不是你可以直接输入新书章节的 [所见即所得][4] 类型的编辑器。由于 EPUB 依赖于 XML,因此它专注于代码。可以将其视为用于 EPUB 文件的 [类似于 VS Code 的代码编辑器][5]。出于这个原因,你应该使用一些其他 [开源写作工具][6],以 epub 格式导出你的文件(如果可能的话),然后在 Sigil 中编辑它。 ![][7] @@ -51,7 +50,7 @@ Sigil 是一款跨平台应用,支持 Windows 和 macOS 以及 Linux。它是 ![Sigil in Ubuntu Software Center][9] -你可能需要事先启用 universe 仓库。你也可以在 Ubuntu发行版中使用 apt 命令: +你可能需要事先启用 universe 仓库。你也可以在 Ubuntu发行版中使用 `apt` 命令: ``` sudo apt install sigil @@ -65,15 +64,15 @@ Sigil 有很多对 Python 库和模块的依赖,因此它下载和安装了大 你的发行版提供的版本不一定是最新的。如果你想要 Sigil 的最新版本,你可以查看它的 GitHub 仓库。 -[Sigil on GitHub][11] +- [Sigil 的 GitHub 仓库][11] ### 并不适合所有人,当然也不适合用于阅读 ePUB 电子书 -我不建议使用 Sigil 阅读电子书。Linux 上有[其他专门的应用来阅读 .epub 文件][12]。 +我不建议使用 Sigil 阅读电子书。Linux 上有 [其他专门的应用来阅读 .epub 文件][12]。 如果你是一个必须处理 EPUB 书籍的作家,或者如果你在数字化旧书,并在各种格式间转换,Sigil 可能是值得一试。 -我还没有广泛使用 Sigil,所以我不提供对它的评论。我让你去探索它,并在这里与我们分享你的经验。 +我还没有大量使用 过 Sigil,所以我不提供对它的评论。我让你去探索它,并在这里与我们分享你的经验。 -------------------------------------------------------------------------------- @@ -82,7 +81,7 @@ via: https://itsfoss.com/sigile-epub-editor/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2d04669d8276e23d463e97c397468ede2cf52673 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 23 Apr 2021 18:45:53 +0800 Subject: [PATCH 239/307] PUB @geekpi https://linux.cn/article-13325-1.html --- ...20210413 Create and Edit EPUB Files on Linux With Sigil.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210413 Create and Edit EPUB Files on Linux With Sigil.md (98%) diff --git a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md b/published/20210413 Create and Edit EPUB Files on Linux With Sigil.md similarity index 98% rename from translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md rename to published/20210413 Create and Edit EPUB Files on Linux With Sigil.md index 204b54915f..9a1a3e0397 100644 --- a/translated/tech/20210413 Create and Edit EPUB Files on Linux With Sigil.md +++ b/published/20210413 Create and Edit EPUB Files on Linux With Sigil.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13325-1.html) 用 Sigil 在 Linux 上创建和编辑 EPUB 文件 ====== From 2527a717dcc2dc8152cb05aaee3cb699552b6bd8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:02:51 +0800 Subject: [PATCH 240/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210424=20?= =?UTF-8?q?Getting=20Started=20With=20Markdown=20[Beginner=E2=80=99s=20Gui?= =?UTF-8?q?de]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md --- ...Started With Markdown -Beginner-s Guide.md | 303 ++++++++++++++++++ 1 file changed, 303 insertions(+) create mode 100644 sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md diff --git a/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md b/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md new file mode 100644 index 0000000000..74b14bf09c --- /dev/null +++ b/sources/tech/20210424 Getting Started With Markdown -Beginner-s Guide.md @@ -0,0 +1,303 @@ +[#]: subject: (Getting Started With Markdown [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/markdown-guide/) +[#]: author: (Bill Dyer https://itsfoss.com/author/bill/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Getting Started With Markdown [Beginner’s Guide] +====== + +In my work, I often have to write code, write the documentation that goes with that code, create Web pages, and work on text restoration projects, and have written several formal papers while I was in school. I can include class notes here, too; I needed to write them for nearly every class. + +I use Markdown for nearly all of my writing and it is a major time-saver for me. + +In this article, I am going to share my experience with Markdown. You’ll be learning the following: + + * What is Markdown? + * How does it work? + * Markdown basic syntax and how to use them + + + +### What is Markdown? + +If you are new to Markdown, it is a text-to-HTML conversion tool for web writers. Markdown files follow a specific syntax that is easy to read and just as easy to write. They are plain text files so they can be created using any text editor on any computer. These files can then be turned into Web pages – and Web pages are built using a markup called HTML. + +Markdown then, is just a way to create Web pages without the need (or even know how) to write HTML code. Actually, Markdown is an great way to format plain text even if you don’t have to convert to HTML. Someone once described Markdown to me this way: + +> “It isn’t _what you see is what you get_, but _what you see is what you mean_”. + +Markdown, however, is more than an easy formatting scheme, it is also a software tool that converts the plain text formatting to HTML. + +This is why the syntax is important. If you want a title on your Web page, Markdown will create one based on the character(s) you use in front of your title. A sampling of some of Markdown’s syntax is shown this screenshot: + +![Markdown to HTML conversion][1] + +### So how do I make this plain text to HTML conversion? + +John Gruber’s Markdown is a Perl script that is run on the command line. Basically, it reads the Markdown text that you create and builds a Web page from it. + +I will avoid the command line here since there are [many outstanding Markdown editors][2] that can do this conversion for you. Not only that, many of these editors will let you write your text and show you what the Web page will look like (called _rendering_) at the same time. + +Markdown editors are generally set up to show two frames. The left frame is where you write your text and the right frame shows you what the formatted text will look like in HTML: + +![Most Markdown editors have two panes to write and preview the text][3] + +When you are finished with your text and are happy with it, simply save the Markdown file. This way, you’ll always have it in case you need to edit or rewrite later. Once the file is saved, you can have the editor export the markdown file to HTML. + +The editor will create the Web page, using your Markdown as a reference. Your Markdown file will not be changed during an export – you will still have it – along with a separate, newly created HTML (Web page) file that you can put on a Web server. + +**Note**: Many Markdown editors can also export your Markdown files to other formats, such as `.doc`, `.docx`, and `.pdf`. You can learn about those advanced setups, and extra software you might need, later on. + +### Basic Markdown Syntax + +To get the new Markdown user up to speed quickly, I will limit this to cover the syntax I use most often. These, I believe will be the most helpful – you can be productive now while you learn more about what Markdown can do for you later on. + +#### Write Headings + +I normally use `#` characters to denote headings. There are six levels: + +``` +# Level 1 Heading +## Level 2 Heading +### Level 3 Heading +#### Level 4 Heading +##### Level 5 Heading +###### Level 6 Heading +``` + +There is another heading style that uses lines underneath the text. I rarely use this type of heading since I am limited to only two. A double line, which is made with the `=` character, makes a `H1` heading. A single line, made with the `-` character, makes a `H2` heading: + +``` +Level 1 Heading +=============== + +Level 2 Heading +--------------- +``` + +![][4] + +#### Paragraphs + +Paragraphs are separated by a blank line (make sure that there is a blank line between paragraphs). Do not indent the first line at all. Indenting with a `` or `` has a different purpose in Markdown. + +A paragraph is a block of text and should not be indented with spaces or tabs. It can have one line or many lines. To end a paragraph and start a new one, the `` key is hit twice; paragraphs are separated by a blank line. + +![][5] + +#### Line Breaks + +Remember that with paragraphs, a blank line has to separate them and this is done by pressing twice on the `` key. Markdown is strict about it. + +Markdown does not support “hard-wrapped” or “fixed-line-length” paragraphs. That is, hitting the `` key once will not force text to a new line. It may appear so in the editing window, but the HTML won’t show it. + +Yet, there will be times when you may need to break up paragraphs with some way to break up a line. Markdown does have a way to do this but it may seem a little strange at first: **a line break is made by ending a line with two or more spaces and then hitting the `` key once.** + +![][6] + +Here is a working example of a short verse. Each line has two spaces at the end. The last line, since it’s the end of the verse, doesn’t have the extra spaces. Since it’s the end of the verse (paragraph), I hit the `` key twice: + +Baa, baa black sheep, +Have you any wool?. +Yes, sir. Yes, sir. +Three bags full. + +Adding two spaces at the end of a line, to create a line break, can take some getting used to. + +![][7] + +#### Horizontal Rules + +Horizontal rules are great for splitting up text into sections. + +Use three or more dashes `-`, underscores `_`, or asterisks `*` for horizontal rules, like so: + +``` +`---` + +`***` + +`___` +``` + +You can even put spaces between the characters: + +``` +`- - -` +``` + +I do not use horizontal rules very often in articles or papers, but they come in handy for me in journal entries, system logs, and class notes. + +![][8] + +#### Emphasis on text with bold and italics + +When you want a word or phrase to stand out and be noticed, you can either make it bold or italicized. Italics and bold text can be made on one of two ways. The first is by surrounding the text with asterisks `*`, while the second is to use underscores `_`. + +To italicize a word or phrase, surround the text with one underscore or asterisk. To make a word or phrase bold, surround it with two underscores or asterisks: + +``` +This is *italics* made with asterisks. + +This is _italics_ made with underscores. + +This is **bold** made with asterisks. + +This is __bold__ made with underscores. +``` + +Remember to use the same character. An asterisk on one side of a word or phrase, and an underscore on the side, will not work. The same character has to be on both sides of the word or phrase. + +![][9] + +#### Block quotes + +Block quotes are used for direct quotes. If you were writing a blog entry and you wanted to repeat something that Benjamin Franklin said, you could use a block quote. + +A right angle bracket is used to specify a block quote: + +``` +> This is a block quote. + +>> Use two right angle brackets if you want a block quote that is further indented. +``` + +![][10] + +#### Adding links in Markdown + +Links are just plain cool. There are three ways to create links on basic Markdown, but I will only cover two here: Regular links and automatic links. + +The third type of link, called reference links, are supported in basic Markdown and more advanced flavors. I want to get to started quickly. You can look up reference links when you are ready for that. + +Regular links let you link to various websites. The name of the site, or a phrase you want to use, is placed in square brackets `[]`. The actual link is inside parentheses `()`. + +``` +Visit [It's FOSS](https://itsfoss.com) today! +``` + +Automatic links are made with angle brackets `<>` surrounding the link. The link is an actual address (either a Web or email address). The link is spelled out and, when it is converted to HTML, the spelled out link becomes a working link. + +``` + + +<[email protected]> +``` + +This is useful for when you want to spell out the address in your text: + +![][11] + +#### Adding images in Markdown + +Links to images are almost identical to links to Web sites. The small difference between site links and images, is that image links begin with a bang (exclamation point) `!` + +The name of the image, or a descriptive phrase of the image, is placed in square brackets `[]`. The actual link is inside parentheses `()`. + +You can embed images like so: + +``` +![alternate text](./images/image.jpg) +``` + +Here’s an example image link. It is a sample link, with no image, but it is a decent sample of how an actual link might look like: + +``` +![a picture of bill](./images/my_photo_of_me.jpg) +``` + +![][12] + +#### Lists + +Lists are made for many reasons. They can be used as ‘things to do’ items, topic elements in an outline, parts lists in an assembly project, and so on. There are two main types of lists: unordered and ordered. + +Unordered lists are not numbered; these are the ‘bullet items’ we see in many documents. Ordered lists are numbered. + +To create an ordered (numbered) list, just begin each line with a number, like so: + +``` +1. Item one. +2. Item two. +3. Item three. +``` + +Unordered lists are not numbered, but use either an asterisk `*`, a plus sign `+`, or a minus sign `-` at the beginning of each item on the list. I prefer to use either an asterisk or minus sign, but you get to choose: + +``` +* Item one. ++ Item two. +- Item three. +``` + +Sub-items can be added to both ordered and unordered lists by indenting, like so: + +``` +1. Item 1 + 1. Sub-item 1 + 2. Sub-item 2 +2. Item 2 +3. Item 3 +``` + +![][13] + +### Markdown syntax cheat sheet + +For your reference, here is a short listing of Markdown syntax that has been covered in this small introduction. + +If you decide to adopt it as a writing tool, you’ll find that Markdown has the means to simplify writing even more. + +![][14] + +[Download Markdown Cheat Sheet in PDF format][15] + +### Conclusion + +Markdown can do more than what I have described here. A huge percentage of my writing can be accomplished with the Markdown syntax I have covered here – and these are the items I use most often even in more complex projects. + +If all of this seems too simple, it really is that easy. Markdown was built to simply the writing task, but you don’t have to take my word for it. Try it out! There is no need to install a Markdown editor; you can do this online. There are several [good online Markdown editors][16]. Here are three that I prefer: + +John Gruber’s [Dingus][17], [Editor.md][18], and [Dillinger][19]. Editor.md and Dillinger will let you see your Markdown rendered as HTML in real time. Dingus doesn’t preview in real time, but there is a Markdown syntax cheat sheet on the page for reference. + +![][20] + +Try out some of the examples in this article on either of these online editors. Try out some of your own ideas, too. This will let you get used to Markdown before possibly committing to learn more about it. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/markdown-guide/ + +作者:[Bill Dyer][a] +选题:[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/bill/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/retext_window_showing_syntax_and_preview-2.png?resize=800%2C429&ssl=1 +[2]: https://itsfoss.com/best-markdown-editors-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/ghostwriter_two_frames-1.png?resize=800%2C458&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/1_md_headings_vscodium.png?resize=800%2C485&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/2_md_paragraphs_example_vscodium.png?resize=800%2C593&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/3_md_line_break_fail_vscodium.png?resize=800%2C593&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/4_md_line_break_success_vscodium.png?resize=800%2C450&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/5_md_horizontal_rules_vscodium.png?resize=800%2C326&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/6_md_emphasis_vscodium.png?resize=800%2C393&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/7_md_blockquotes_vscodium.png?resize=800%2C393&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/8_md_links_vscodium.png?resize=800%2C678&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/9_md_images_vscodium.png?resize=800%2C725&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/10_md_lists_vscodium.png?resize=800%2C725&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/markdown-syntax-cheatsheet.png?resize=727%2C743&ssl=1 +[15]: https://drive.google.com/file/d/1y-Qz9PX_2HksEG5D_WwN-asNB-tpjZHV/view?usp=sharing +[16]: https://itsfoss.com/online-markdown-editors/ +[17]: https://daringfireball.net/projects/markdown/dingus +[18]: http://editor.md.ipandao.com/en.html +[19]: https://dillinger.io/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/editor-md_page_in_browser-1.png?resize=800%2C505&ssl=1 From 845b504ffd09501fa2ab618c010cd9a54f086d42 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:03:08 +0800 Subject: [PATCH 241/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210423=20?= =?UTF-8?q?How=20I=20use=20OBS=20Studio=20to=20record=20videos=20for=20my?= =?UTF-8?q?=20YouTube=20channel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md --- ...to record videos for my YouTube channel.md | 141 ++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md diff --git a/sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md b/sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md new file mode 100644 index 0000000000..79c429e0f3 --- /dev/null +++ b/sources/tech/20210423 How I use OBS Studio to record videos for my YouTube channel.md @@ -0,0 +1,141 @@ +[#]: subject: (How I use OBS Studio to record videos for my YouTube channel) +[#]: via: (https://opensource.com/article/21/4/obs-youtube) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How I use OBS Studio to record videos for my YouTube channel +====== +Install, configure, and use Open Broadcaster Software to record how-to, +promotional, and other types of videos. +![Person using a laptop][1] + +I manage a [YouTube channel for the FreeDOS Project][2], where I record "how-to" videos with FreeDOS running inside the [QEMU][3] PC emulator software. When I started the channel in August 2019, I didn't know anything about recording videos. But with [Open Broadcaster Software][4], also called OBS Studio, I've found recording these videos to be pretty straightforward. Here's how you can do it, too. + +### Install OBS Studio + +I run Fedora Linux, which doesn't include the OBS Studio software by default. Fortunately, the OBS Studio website has an [installation guide][5] that walks you through the steps to install OBS Studio via the RPM Fusion alternative repository. + +If you don't already have RPM Fusion set up on your system, you can add the repository on Fedora using this one-line command: + + +``` +`$ sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm` +``` + +Once the RPM Fusion repo is set up, you can install OBS Studio with this command: + + +``` +`$ sudo dnf install obs-studio` +``` + +If you have an NVIDIA graphics card, there's an extra step in the installation guide to install hardware-accelerated video support. But my graphics card is from Intel, so I don't need to run the extra steps. + +However, OBS Studio does not support [Wayland][6], at least not in the Fedora build. That means when I want to record videos with OBS Studio, I need to log into my GNOME desktop [using an Xorg session][7]. On the login screen, enter your password, click on the gear-shaped icon in the lower-right corner, and select **GNOME on Xorg**. + +### Configure OBS Studio + +The first time you launch OBS Studio, the software runs an auto-configuration wizard to determine the best settings for recording videos. This makes setup a breeze. If you're recording videos on the desktop, like I am, then click the **Optimize just for recording** radio button and click **Next**. + +![OBS Studio configuration][8] + +(Jim Hall, [CC BY-SA 4.0][9]) + +OBS Studio will run through a series of automated tests before it confirms the best video settings for your system. On my system, that's 1920x1080 at 30 frames per second (fps), which is good enough for recording my videos. + +![OBS Studio configuration][10] + +(Jim Hall, [CC BY-SA 4.0][9]) + +#### My setup + +The default OBS Studio interface shows the video front and center and positions the controls at the bottom of the screen. While this is not a bad default arrangement, you can see in my early videos that I occasionally look away from the camera as I change from a full-screen webcam video to my QEMU screen. That's because the default OBS Studio configuration places the **Scene controls** in the lower-left corner. + +![OBS Studio configuration][11] + +(Jim Hall, [CC BY-SA 4.0][9]) + +Breaking virtual eye contact like this is distracting, so I wanted another way to change scenes without looking for the scene controls. I discovered that I could click and drag the OBS Studio controls to different areas on the screen. By positioning the scene controls at the top of the screen, near my computer's webcam, I don't need to look away from the camera to change scenes. + +![OBS Studio configuration][12] + +(Jim Hall, [CC BY-SA 4.0][9]) + +So, my first step whenever I set up OBS Studio is to drag the controls to the top of the screen. I like to place the **Scene selector panel** in the middle, so I don't have to look very far away from my camera to change scenes. I keep the recording controls to one side because I'm never on camera when I start or stop the video, so it doesn't matter if I look away to start or stop my video recording. + +![OBS Studio configuration][13] + +(Jim Hall, [CC BY-SA 4.0][9]) + +### Setting up scenes + +You can set up OBS Studio to support your preferred video style. When I started recording videos, I watched other how-to videos to see how they were organized. Most start with a brief introduction by the host, then switch to a hands-on demonstration, and end with a "thank you" screen to advertise the channel. I wanted to create my videos similarly, and you can do that with scenes. + +Each scene is a different arrangement of **sources**, or elements in the video. Each source is like a layer, so if you have multiple image or video sources, they will appear to stack on top of one another. + +How you define your scenes depends on the kind of video you want to make. I do a lot of hands-on demonstration videos, so I have one scene with a full-screen webcam video, another scene that's just a QEMU window, and yet another scene that's "picture-in-picture" with me over my QEMU screen. I can also set up separate scenes that show a "thank you" image and links to subscribe to my channel or to join the project on social media. + +With these scenes, I can record my videos as Live—meaning I don't need to edit them afterward. I can use the Scene controls in OBS Studio to switch from the **QEMU** scene to the **Full-screen webcam** screen and back to the **QEMU** screen before wrapping up with separate scenes that thank my supporters and share information about my channel. That may sound like a lot of work, but once you have the scenes set up, changing scenes is just clicking an item in the Scenes menu. That's why I like to center the Scene selector at the top of the screen, so I can easily select the scene I need. + +Here's what I use to record my videos and how I set up the sources in each: + + * **Full-screen webcam:** I set up a webcam source from my Vitade webcam as a **video capture device** (V4L) and use the **Transform** menu (right-click) to fit the webcam to the screen. This also uses my Yeti microphone for sound as an **audio input capture** (PulseAudio). + + * **QEMU:** This is where I spend most of my time in my videos. OBS Studio can use any window as a source, and I define my QEMU window as a **window capture** (Xcomposite) source. In case I need to reboot the virtual machine while I'm recording a video, I also set a Color Bars image as a background image on a layer that's "behind" the window. This also uses my Yeti microphone for sound as an **audio input capture** (PulseAudio). + + * **QEMU + webcam:** My viewers tell me they like to see me on camera while I'm showing things in my QEMU window, so I defined another scene that combines the **QEMU** and **Full-screen webcam** scenes. My webcam is a small rectangle in one corner of the screen. + + * **Patreon card:** At the end of my videos, I thank the people who support me on Patreon. I created a striped pattern in GIMP and set that as my background image. I then defined a **text** source where I entered a "thank you" message and a list of my patrons. As before, I set my Yeti microphone for sound as an **audio input capture** (PulseAudio). + + * **End card:** As I wrap up the video, I want to encourage viewers to visit our website or join us on social media. Similar to the Patreon card scene, I use a background pattern that already includes my text and icons. But to add a little visual flair, I created a blinking cursor after our URL, as though someone had typed it in. This cursor is not actually an animation but an **image slideshow** source that uses two images: a blank rectangle and a rectangle with a cursor. The image slideshow flips between these two images, creating the appearance of a blinking cursor. + + + + +![OBS Studio configuration][14] + +(Jim Hall, [CC BY-SA 4.0][9]) + +### And action! + +Once I create my scene collection, I'm ready to record my videos. I usually start by talking over my QEMU window, so I click on the **QEMU** scene and then click the **Start Recording** button. After I've said a few words to set the stage for my video, I click on the **Full-screen webcam** scene to fully introduce the topic. + +After sharing some information about whatever I'm talking about in the video, I click on the **QEMU** scene or the **QEMU + webcam** scene. Which scene I choose depends on whether I need to be seen during the video or if the "picture-in-picture" video will obscure important text on the screen. I spend most of the how-to video in this scene, usually while playing a game, demonstrating a program, or writing a sample program. + +When I'm ready to wrap up, I click on the **Patreon card** scene to thank everyone who supports me on Patreon. Some patrons support me at a higher level, and they get a specific mention and their name listed on the screen. Then, I click on the **End card** scene to encourage viewers to visit our website, join us on Facebook, follow us on Twitter, and consider supporting me on Patreon. Finally, I click the **Stop Recording** button, and OBS Studio stops the video. + +Using OBS Studio is a great way to record videos. I've used this same method to record other videos, including pre-recorded conference talks, welcome videos for a remote symposium, and virtual lecture videos when I teach an online class. + +The next time you need to record a video, try OBS Studio. I think you'll find it easy to learn and use. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/obs-youtube + +作者:[Jim Hall][a] +选题:[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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://www.youtube.com/freedosproject +[3]: https://www.qemu.org/ +[4]: https://obsproject.com/ +[5]: https://obsproject.com/wiki/install-instructions#linux +[6]: https://wayland.freedesktop.org/ +[7]: https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/ +[8]: https://opensource.com/sites/default/files/uploads/obs-setup-02.png (OBS Studio configuration) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/obs-setup-09.png (OBS Studio configuration) +[11]: https://opensource.com/sites/default/files/uploads/obs-setup-10.png (OBS Studio configuration) +[12]: https://opensource.com/sites/default/files/uploads/obs-setup-11.png (OBS Studio configuration) +[13]: https://opensource.com/sites/default/files/uploads/obs-setup-12.png (OBS Studio configuration) +[14]: https://opensource.com/sites/default/files/uploads/obs-setup-18.png (OBS Studio configuration) From d9635ddc015ff4b037ab3a673302df390ade58e4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:03:20 +0800 Subject: [PATCH 242/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210423=20?= =?UTF-8?q?Sustainable=20economic=20development=20begins=20with=20open=20t?= =?UTF-8?q?hinking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210423 Sustainable economic development begins with open thinking.md --- ...c development begins with open thinking.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20210423 Sustainable economic development begins with open thinking.md diff --git a/sources/tech/20210423 Sustainable economic development begins with open thinking.md b/sources/tech/20210423 Sustainable economic development begins with open thinking.md new file mode 100644 index 0000000000..73e1154810 --- /dev/null +++ b/sources/tech/20210423 Sustainable economic development begins with open thinking.md @@ -0,0 +1,124 @@ +[#]: subject: (Sustainable economic development begins with open thinking) +[#]: via: (https://opensource.com/open-organization/21/3/sustainable-development-environment) +[#]: author: (Ron McFarland https://opensource.com/users/ron-mcfarland) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Sustainable economic development begins with open thinking +====== +Do our global development practices respect planetary boundaries? +Greater transparency could provide insight. +![2 cents penny money currency][1] + +To be successful, open organizations must have specific purposes, address achievable goals, perform clear tasks, effectively evaluate the results of their work, and introduce countermeasures or revisions to their operations. [Open organization principles][2] serve vital functions throughout this process. + +This is true no matter the scale of the problem an open organization confronts. In this three part review of [_The Age of Sustainable Development_][3] by Jeffrey Sachs, I'll examine an issue with global scope—sustainable economic development—to demonstrate how thinking openly can help us address global issues. + +Specifically, in this article I'll discuss the important role of _transparency_ in assessing environmental damage and destruction some economic development programs can cause, and I'll explain how the principle of transparency also helps us think about specific actions we can take to combat destructive forces. In the next article, I will discuss human suffering on a global scale—here again stressing transparency. And in the third and last article, I will bring both these concerns together and discuss global governance. That is where we'll recognize the importance of open organization principles for making progress on these issues. + +One more note: All these articles address extremely complex subjects. So at the end of each, I'll share a video presentation offering additional explanation. I'll start that discussion by introducing what I call the Open Organization Principles Loop, so you can visualize how these principles can be applied to sustainable global economic development issues. + +Simply put, letting [open principles][2] guide our work creating sustainable, global economic development will help: + + * Make global, environmental and human suffering problems **transparent** + * Form and unite organizations/**communities** at the local (not only global) level to tackle those problems + * Start **collaboration** within and between communities to find detailed, local solutions + * Recruit and **include** members globally to gain broad perspectives on how to achieve goals + * **Adapt** strategies to each region globally and in each local community + + + +All this starts with exposing specific problems and making them vividly transparent. Once exposed, these problems must be broadly presented and made _immediately personal_ to every individual. + +This is the discussion I hope to start in this article on global environmental issues. + +The earth has what we might call "planetary boundaries." Respecting these boundaries means being prosperous, socially inclusive, and environmentally responsible. + +### Stressing planetary boundaries + +In a previous article entitled "[Climate challenges call for open solutions][4]," I discussed only the issue of carbon-free power generation, particularly through fourth-generation nuclear power plants that are now being developed. But reading Sach's book, _The Age of Sustainable Development_, made me realize that energy generation through nuclear power plants is an approach _too narrow_ to address the massive climate challenges the world faces (the phrase "climate challenge" might _itself_ be too narrow). "Sustainable economic development" might be a better phrase to describe what should be our most pressing concern, of which climate change is only _one_ component issue. When we use the term "sustainable," we're referring to methods that effectively avoid driving something or some species to extinction—including humankind. It is the conservation of living and mineral resources in ways that continue to make life on earth economically viable. + +Sachs' book suggests a wide range of strategies on detailed concerns that could move the global society toward sustainable economic development. I will quickly review them and explain where open organization principles can play a role. + +The earth has what we might call "[planetary boundaries][5]": it can only support life to the extent that life forms respect these boundaries. They are the foundations of ecosystems like forests and fisheries, for example. Respecting these boundaries means being prosperous, socially inclusive, and environmentally responsible. + +We must monitor and manage our relationships with these planetary boundaries globally. Here are at least nine boundaries: + + 1. **Climate change**: This is directly related to [greenhouse gases][6] (GHGs). + 2. **Ocean acidification**: Rising acidity threatens various marine life. + 3. **Stratospheric ozone depletion**: Evidence suggests a direct link to skin cancers and other disorders. + 4. **Biogeochemical flow boundaries (Nitrogen Cycle/Phosphorus Cycle)**: Chemical fertilizers are required for high crop yield, but their runoff negatively impacts the surrounding environment. + 5. **Global freshwater use and water scarcity**: Groundwater is declining worldwide while demand is growing with population growth. + 6. **Land degradation**: Deforestation is a major problem, as forests withdraw CO2 in the atmosphere and are the habitat of many species. + 7. **Biodiversity loss**: We depend on biodiversity for our food supply, for our safety from many natural hazards like flooding, industry/construction material supply, freshwater and combating pests and pathogens. + 8. **Atmospheric aerosol loading**: Simply put, smog causes problems like life-threatening lung disease. + 9. **Chemical pollution**: Petrochemical production, steel production, and mining processes put deadly pollutants into their surrounding environments. + + + +Sachs indicates that humans have stressed these boundaries in major areas around the globe, and earth's natural system can't cope with that pressure. Sachs believes that during this century human beings will stress all nine boundaries in critically dangerous ways, unless dedicated organizations and communities are formed to establish projects that execute on reversing them. + +### Why can't we just save the world? + +It's difficult to convince people of environmental importance and to assemble organizations, communities, neighborhoods and resources to execute action plans. Sachs cites six primary reasons for this: + + 1. **Global problems.** No single actor can take charge to get things started and organizing on a global scale is extremely difficult. + 2. **Short-term special interests groups.** Many parties have competing goals, and no one is [speaking for the planet][7]. + 3. **Impact timeframe.** The greatest impact will be on those not born yet. + 4. **Current economic structure.** The solutions might be incompatible with the current economic structure. But, its damage to the environment must be exposed and a new sustainable economic structure technically developed to replace it. + 5. **Pace of change.** The impact is not visible on a daily, weekly, or even monthly basis. + 6. **Complexity.** Environmental issues are caused by many human activities, not just one. + + + +Reviewing these six characteristics, we see that getting solutions adopted globally requires a powerful sales job. But applying open organization principles can be significantly helpful, particularly making the problems as transparent as possible on a global scale. + +Both globally and locally, communities can't continue with their current modes of economic development—not if they want to respect planetary boundaries. Business as usual, Sachs stresses, will destroy us all. + +As I mentioned earlier, Sachs notes that generally addressing sustainable development directly is too vague and unhelpful. The challenge must be broken down into detailed projects and tasks for each region and community on the planet. Here are some specific examples of initiatives that are important but could vary by region: + + 1. Building/home energy use reduction + 2. Environmentally friendly transportation + 3. Secure food production to reach demand + 4. Clean/efficient electrical power generation, storage and distribution + 5. Environmentally friendly urban designing + 6. Ocean biodiversity protection + 7. Plant biodiversity protection + 8. Wildlife biodiversity protection + 9. Air pollution & the CO2 reduction + 10. Freshwater supply to satisfy future demand + + + +### The cost of doing nothing + +Both globally and locally, communities can't continue with their current modes of economic development—not if they want to respect planetary boundaries. Business as usual, Sachs stresses, will destroy us all. + +At the start of this discussion, I mentioned the importance of transparency and the need to expose the environmental damage that many human economic activities cause. Information and communication technology specialists will become increasingly central to these transparency efforts, as they can effectively and cost efficiently use automated data gathering, analytics, telecommunications, and other technologies to help increase transparency. (Wondering how you might do this? Why not [ask our community][8]?) + +In the next article, I will attempt to make vividly transparent the impact of unsustainable development practices on human inequality and suffering at a global level. Armed with a full understanding of both these challenges, in my last article in this series, I'll present global governance to tackle them. In that governance all open organization principles will play vital roles. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/3/sustainable-development-environment + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Medical%20Costs%20Transparency_1.jpg?itok=CkZ_J88m (2 cents penny money currency) +[2]: https://theopenorganization.org/definition/ +[3]: https://www.goodreads.com/book/show/23215948-the-age-of-sustainable-development +[4]: https://opensource.com/open-organization/19/10/global-energy-climate-challenges +[5]: http://www.igbp.net/news/features/features/aplanetontheedge.5.1b8ae20512db692f2a680003122.html +[6]: https://en.wikipedia.org/wiki/Greenhouse_gas#/media/File:Global_GHG_Emissions_by_Sector_2016.png +[7]: https://opensource.com/open-organization/19/10/open-platform-greenpeace +[8]: http://theopenorganization.community From 659cab69bd55bc9ee2595f2dde4dddb6da82367d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 24 Apr 2021 05:03:40 +0800 Subject: [PATCH 243/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210423=20?= =?UTF-8?q?What=E2=80=99s=20New=20in=20Ubuntu=20MATE=2021.04?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210423 What-s New in Ubuntu MATE 21.04.md --- ...0210423 What-s New in Ubuntu MATE 21.04.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/news/20210423 What-s New in Ubuntu MATE 21.04.md diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md new file mode 100644 index 0000000000..ff6ebd416a --- /dev/null +++ b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -0,0 +1,135 @@ +[#]: subject: (What’s New in Ubuntu MATE 21.04) +[#]: via: (https://news.itsfoss.com/ubuntu-mate-21-04-release/) +[#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What’s New in Ubuntu MATE 21.04 +====== + +Since 18.10, Yaru has been the default user interface. This year, the Yaru team along with the Canonical Design and Ubuntu Desktop Teams joined forces to create a new visual look for Ubuntu MATE 21.04. + +### What’s New in Ubuntu MATE 21.04? + +Here are all the key changes that comes with this release. + +### MATE Desktop + +This time there are no new features but just bug fixes and translation updates. The MATE packaging in Debian has been updated to receive all the new bug fixes and updates. + +### Ayatana Indicators + +![][1] + +It is a system that controls the action, layout, behaviour of the panel indicator area that is also known as your system tray. You can now change settings of Ayatana Indicators from Control Center. + +A new printer indication has been added and RedShift has been removed to maintain stability. + +### Yaru MATE Theme + +Yaru MATE is now a derivative of the Yaru theme. Yaru MATE will now be provided with a light and dark theme, the light theme being the default one. This should ensure better application compatibility. + +Users will now have access to GTK 2.x, 3.x, 4.x light and dark themes collectively. You can also use Suru icons along with some new icons. + +LibreOffice will have a new Yaru MATE icon theming applied by default. Font contrast has been improved as well. As a result of this, you will find it easier to read tiny texts and/or reading from a distance. + +Websites will now maintain the Dark Mode, if selected, at an Operating System level. To get dark theme in websites along with the rest of your system, just enable the Yaru MATE Dark theme. + +Windows manager themes for Macro, Metacity, Compiz now have SVG icons. What this means is that if you have a large screen, the icons won’t look pixelated, that’s a subtle but useful addition! + +### Yaru MATE Snaps + +Although you can’t install Yaru MATE themes right now, you will soon be able to! The gtk-theme-yaru-mate and icon-theme-yaru-mate snaps are pre-installed and ready to be used when you need to connect the themes to compatible snaps. + +As per the announcement, snapd will automatically connect your theme to compatible snaps soon: + +> `snapd` will soon be able to automatically install snaps of themes that match your currently active theme. The snaps we’ve created are ready to integrate with that capability when it is available. + +### Mutiny Layout Changes + +![Mutiny Layout with dark Yaru theme applied.][2] + +Mutiny layout mimics the desktop layout of Unity. The MATE Dock Applet has been removed and the Mutiny Layout has been optimized to use Plank. Plank theming will be applied automatically. This will be done when switching to Mutiny Layout via Mate Tweak. Both dark and light Yaru themes of Plank are provided. + +Other tweaks and updates have made the Mutiny much more reliability while the look and feel remains the same. + +### Major Application Upgrades + + * Firefox 87 + * LibreOffice 7.1.2.2 + * Evolution 3.40 + * Celluloid 0.20 + + + +### Other Changes + + * Linux command line fans will appreciate commands like neofetch, htop and inxi being included in the default Ubuntu MATE install. + * A Raspberry Pi 21.04 version will be released soon. + * There are no offline upgrade options in Ubuntu MATE. + * New Plank themes introduced for side and bottom docks that matches with the color scheme of Yaru MATE. + * A clean edge styling is applied to Yaru MATE windows manager for side tiled windows. + * It is available in various colors in Ubuntu MATE Welcome. + * Yaru MATE theme snap and icon theme snap has been published in Snap Store + * Yaru MATE PPA published for users of Ubunut MATE 20.04 LTS. + + + +### Download Ubuntu MATE 21.04 + +You can download the ISO from the official website. + +[Ubuntu MATE 21.04][3] + +If you’re curious to learn more about it, [check out the release notes.][4] + +_Are you excited to try out the new Yaru MATE theme? What do you think? Let us know in the comments below._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][5] + * ![][6] ![Ubuntu 21.04 New Features][7] + + + * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][8] + * ![][6] ![No GNOME 40 in Ubuntu 21.04][9] + + + * [Ubuntu 21.04 Beta is Now Available to Download][10] + * ![][6] ![][11] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-mate-21-04-release/ + +作者:[Asesh Basu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/asesh/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUxMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://ubuntu-mate.org/download/ +[4]: https://discourse.ubuntu.com/t/hirsute-hippo-release-notes/19221 +[5]: https://news.itsfoss.com/ubuntu-21-04-features/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu_21_04_features.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[8]: https://news.itsfoss.com/no-gnome-40-in-ubuntu-21-04/ +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/gnome-40-ubuntu-21-04.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[10]: https://news.itsfoss.com/ubuntu-21-04-beta-release/ +[11]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/ubuntu-21-04-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 466fe5d686f8fb753a632daae08836314a2d6ee2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 24 Apr 2021 10:18:24 +0800 Subject: [PATCH 244/307] Rename sources/tech/20210423 Sustainable economic development begins with open thinking.md to sources/talk/20210423 Sustainable economic development begins with open thinking.md --- ... Sustainable economic development begins with open thinking.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210423 Sustainable economic development begins with open thinking.md (100%) diff --git a/sources/tech/20210423 Sustainable economic development begins with open thinking.md b/sources/talk/20210423 Sustainable economic development begins with open thinking.md similarity index 100% rename from sources/tech/20210423 Sustainable economic development begins with open thinking.md rename to sources/talk/20210423 Sustainable economic development begins with open thinking.md From 0be04e5a418c1c6df740e4ea1de5a25ab2f845ab Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sat, 24 Apr 2021 10:48:42 +0800 Subject: [PATCH 245/307] Create 20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...n Arch is a Step in the Right Direction.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md new file mode 100644 index 0000000000..71fbbdea3a --- /dev/null +++ b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -0,0 +1,97 @@ +[#]: subject: (The Guided Installer in Arch is a Step in the Right Direction) +[#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: (Kevin3599 ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Arch Linux中的引导式安装程序是迈向正确的一步 +====== + +20年来,Arch Linux为用户提供了完全定制和独特的系统的权限。多年来,它以牺牲用户友好性为代价赢得了在定制方面独有的声誉。 + +作为滚动发行版本,Arch Linux不提供任何固定发行版本,而是每月更新一次。但是,如果您在最近几周下载了Arch Linux,那么您很可能已经注意到了一个新的附加功能:archinstall。它使Arch Linux更加易于安装。 + +![][3] + +今天,我将探讨archinstall 的发布对未来的Arch Linux项目和发行版意味着什么。 + +### Arch Linux新的发展方向? +![][4] + +尽管很多人对此感到惊讶,但默认情况下包含官方安装程序实际上是非常明智的举动。这意味着ArchLinux的发展方向发生变化,即在保留使其知名的定制性和用户独特性的同时更加侧重用户的易用性。 + +在该安装程式的GitHub页面上有这样的描述: + +> “引导性安装程式会给用户提供一个友好的安装方式,但是关键在于这个安装程式是选择性的,它是可选的并且永远不会强迫用户使用其进行安装。” + +这意味着新的安装程式不会影响高级的进阶用户,同时也使得其可以向更广泛的受众开放,在这一改动所带来的许多优点之中,一个显著的优点即是:更广泛的用户。 + +更多的用户意味着更多的项目,不管其是通过网络捐赠或在Arch Linux下的开发,通过这些项目贡献,不管是新用户还是有经验的用户的使用体验都会得到提升。 + +### “这必然要发生” + +回顾过去,我们可以看到安装介质的许多新增功能对新用户有所帮助。这些示例包括pacstrap(安装基本系统的工具)和反射器(查找最佳pacman镜像的工具)。 + +另外,多年来,用户一直在追求使用脚本安装的方法,新安装程序允许了用户使用安装脚本。同时能够使用Python编写脚本,这使管理员的部署更加容易,这使其成为非常有吸引力的选择。更多可定制性(以某种方式?) + +尽管这看上去可能有些反直觉,但是这个安装程式很可能能够增进Arch Linux的可定制性。当前,Arch定制性的最大瓶颈是用户的技术水平,而这一问题能够通过archinstall解决。 + +通过由ArchLinux提供的安装程序,用户不需要掌握创建完美开发环境的技巧,安装程序可以帮助用户完成这些工作,这提供了广泛的自定义选项,是普通用户难以实现的。 + +###思想总结 + +有了这一新功能,Arch Linux似乎正在向着“用户友好”这一软件设计哲学靠近,新安装程序为新手和高级用户提供了广泛的好处。其中包括更广泛的定制性和更大的用户社区。 + +总而言之,这个新变动对整个ArchLinux社区都会产生积极的影响。 + +你对这个Arch Linux安装程式怎么看?是否已经尝试过它了呢? + +### + +![][7] +我不感兴趣 + +#### 关联 + + * 通过最新的ISO刷新中的更改,现在更容易安装Arch Linux + * ![][8] ![][9] + + + * EndeavourOS的2021年第一个版本带来了Linux内核5.10 LTS,Xfce 4.16等[10] + * ![][8] ![][11] + + + * Linux Kernel 5.9终止了生命。这就是您现在应该做的! + * ![][8] ![Linux kernel 5.9 reached end of life][13] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/arch-new-guided-installer/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[Kevin3599](https://github.com/) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/rolling-release/ +[2]: https://news.itsfoss.com/arch-linux-easy-install/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://man.archlinux.org/man/pacstrap.8 +[6]: https://wiki.archlinux.org/index.php/Reflector +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[10]: https://news.itsfoss.com/endeavouros-2021-release/ +[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 15a7c077c70a9dafd85fe0dc4a6bd33f0f67b272 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Sat, 24 Apr 2021 11:54:12 +0800 Subject: [PATCH 246/307] Delete 20210420 The Guided Installer in Arch is a Step in the Right Direction.md --- ...n Arch is a Step in the Right Direction.md | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md diff --git a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md deleted file mode 100644 index 60263301ae..0000000000 --- a/sources/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: (The Guided Installer in Arch is a Step in the Right Direction) -[#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: (Kevin3599 ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -The Guided Installer in Arch is a Step in the Right Direction -====== - -For 20 years, Arch Linux has provided users access to a completely custom and unique system. Over those years, it has built a reputation for customization, at the expense of user-friendliness. - -As a [rolling release distro][1], Arch doesn’t provide any set releases, instead they just update the image each month. However, if you have downloaded Arch in the last few weeks, you may have noticed a new addition: **archinstall**. It makes [installing Arch Linux way easier][2]. - -![][3] - -Today, I will be discussing what this change represents for the future of the Arch project, and what this could mean for future releases. - -### A New Direction for Arch? - -![][4] - -While many were surprised at this move, having an official installer included by default is actually a very sensible move. It signifies a change in direction for Arch, with a greater focus on accessibility, while still retaining the legendary customization it is known for. - -As the installer’s GitHub page says: - -> The guided installer will provide user-friendly options along the way, but the keyword here is options, they are optional and will never be forced upon anyone - -This means that the new installer doesn’t affect advanced users, yet also opens up the distro to a wider audience. Among the many benefits this change brings, one stands above the crowd: more users. - -More users mean more support for the project, whether that is through donations or development work. And with each of these contributions, the user experience continues to improve for both new and experienced users alike. - -### This was bound to happen - -Looking into the past, we can see many additions to the installation medium that have helped new users. Examples of these include [pacstrap][5] (a tool to install base system) and [reflector][6] (a tool to find the best pacman mirrors). - -Plus, users have been asking for a way to script their installation for years, which the new installer provides. Capable of being scripted in Python, it enables far easier deployment for administrators, making it a very attractive option. - -### More Customizability (Somehow?) - -While it may seem counter-intuitive, the inclusion of an installer actually may improve the customization options of Arch. Currently, the biggest bottleneck with Arch’s incredible customization options is the user’s skill level, an issue eliminated thanks to archinstall. - -With the new installer, you don’t need to have the skills to create your perfect environment, instead taking advantage of the installer to do it for you. This opens up a huge range of customization options that would otherwise be out of reach for the average user. - -### Closing Thoughts - -With this new addition, it seems that Arch Linux has started moving towards a more User-Friendly philosophy. The new installer provides a wide range of benefits to Newbies and advanced users alike. These include wider customization options and a larger community. - -All in all, the new installer will provide a positive impact on the community as a whole. - -_What do you think about the new Arch guided installer? Have you tried it out yet?_ - -![][7] - -I'm not interested - -#### _Related_ - - * [Installing Arch Linux is Now Easier With This Change in the Newest ISO Refresh][2] - * ![][8] ![][9] - - - * [EndeavourOS's First Release of 2021 Brings Linux Kernel 5.10 LTS, Xfce 4.16, and More][10] - * ![][8] ![][11] - - - * [Linux Kernel 5.9 Reached End of Life. Here's What You Should Do Now!][12] - * ![][8] ![Linux kernel 5.9 reached end of life][13] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/arch-new-guided-installer/ - -作者:[Jacob Crume][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/jacob/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/rolling-release/ -[2]: https://news.itsfoss.com/arch-linux-easy-install/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[5]: https://man.archlinux.org/man/pacstrap.8 -[6]: https://wiki.archlinux.org/index.php/Reflector -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[10]: https://news.itsfoss.com/endeavouros-2021-release/ -[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 -[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ -[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 16d460d18378a1d530821c254524bc72376125ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 24 Apr 2021 14:45:26 +0800 Subject: [PATCH 247/307] PRF @stevenzdg988 --- ...ely on for Your Ancient 32-bit Computer.md | 231 ++++++++++++------ 1 file changed, 162 insertions(+), 69 deletions(-) diff --git a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index 294f392832..5284ded94d 100644 --- a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -1,170 +1,255 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) [#]: via: (https://itsfoss.com/32-bit-linux-distributions/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -可以在古老的 32 位计算机上使用的 11 种 Linux 发行版 +14 种可以在古老的 32 位计算机上使用的 Linux 发行版 ====== -如果您紧跟最新的[Linux 发行版][1],那么您一定已经注意到,[大多数流行的 Linux 发行版][2]已经终止了 32 位支持。Arch Linux,Ubuntu,Fedora,每一个都已经放弃了对这种较旧架构的支持。 +如果你一直关注最新的 [Linux 发行版][1],那么你一定已经注意到,[大多数流行的 Linux 发行版][2] 已经终止了 32 位支持。Arch Linux、Ubuntu、Fedora,每一个都已经放弃了对这种较旧架构的支持。 -但是,如果您拥有仍然需要再生的老式硬件,或者想将其用于某些用途,该怎么办?不用担心,还剩下一些 32 位系统选项可供选择。 +但是,如果你拥有仍然需要再利用的老式硬件,或者想将其用于某些用途,该怎么办?不用担心,你的 32 位系统还有一些选择。 -在本文中,我试图编译一些最好的 Linux 发行版,这些发行版将在未来几年继续支持 32 位平台。 +在本文中,我试图汇编一些最好的 Linux 发行版,这些发行版将在未来几年继续支持 32 位平台。 -### 仍提供 32 位支持的最优 Linux 发行版 +### 仍提供 32 位支持的最佳 Linux 发行版 ![][3] -此列表与[较早的支持旧笔记本电脑的 Linux 发行版列表][4]略有不同。如果 64 位计算机是在 2010 年之前发布的,那么甚至可以认为它们是过时的。这就是为什么其中列出的一些建议包括现在仅支持 64 位版本的发行版的原因。 +此列表与 [我们之前的支持旧笔记本电脑的 Linux 发行版列表][4] 略有不同。即使是 64 位计算机,如果是在 2010 年之前发布的,那么也可以认为它们是旧的。这就是为什么其中列出的一些建议包括现在仅支持 64 位版本的发行版的原因。 -根据我的知识和认知,此处提供的信息是正确的,但是如果您发现有误,请在评论部分让我知道。 +根据我的知识和认知,此处提供的信息是正确的,但是如果你发现有误,请在评论部分让我知道。 -在继续之前,我认为您知道[如何检查您拥有的是否是 32 位或 64 位计算机][5]。 +在继续之前,我认为你知道 [如何检查你拥有的是否是 32 位或 64 位计算机][5]。 -#### 1\. Debian +#### 1、Debian ![图片来源: mrneilypops / Deviantart][6] -对于 32 位系统,Debian 是一个绝佳的选择,因为他们仍通过最新的稳定版本支持它。在撰写本文时,最新的稳定发行版 **Debian 10“buster”** 提供了32位版本,并一直支持到2024年。 +对于 32 位系统,[Debian][11] 是一个绝佳的选择,因为他们的最新的稳定版本仍然支持它。在撰写本文时,最新的稳定发行版 **Debian 10 “buster”** 提供了 32 位版本,并一直支持到 2024 年。 -如果您是 Debian 的新手,值得一提的是,您可以在[官方Wiki][7]上获得有关其所有内容的可靠文档。因此,上手应该不是问题。 +如果你是 Debian 的新手,值得一提的是,你可以在 [官方 Wiki][7] 上获得有关其所有内容的可靠文档。因此,上手应该不是问题。 -您可以浏览[可用的安装程序][8]进行安装。但是,在开始之前,除了[安装手册][10]外,我建议您参考[安装 Debian 之前要记住的事情][9]列表。 +你可以浏览 [可用的安装程序][8] 进行安装。但是,在开始之前,除了 [安装手册][10] 外,我建议你参考 [安装 Debian 之前要记住的事情][9] 列表。 -[Debian][11] +最低系统要求: -#### 2\. Slax +- 512 MB 内存 +- 10 GB 磁盘空间 +- 1 GHz 处理器(奔腾 4 或同等水平) + +#### 2、Slax ![][12] -如果您只是想快速启动设备以进行一些临时工作,Slax是一个令人印象深刻的选择。 +如果你只是想快速启动设备以进行一些临时工作,[Slax][13] 是一个令人印象深刻的选择。 -它基于 Debian,但它旨在成为一种便携式且通过 USB 设备或 DVD 运行的快速选项。您可以从他们的网站免费下载 32 位 ISO 文件,或购买预装有 Slax 的可擦写 DVD /**(或)**加密的闪存盘。 +它基于 Debian,但它通过 USB 设备或 DVD 运行旨在成为一种便携且快速的选项。你可以从他们的网站免费下载 32 位 ISO 文件,或购买预装有 Slax 的可擦写 DVD 或加密的闪存盘。 -当然,这并不是要取代传统的桌面操作系统。但是,是的,您确实获得了以 Debian 为基础的 32 位支持。 +当然,这并不是要取代传统的桌面操作系统。但是,是的,你确实获得了以 Debian 为基础的 32 位支持。 -[Slax][13] +最低系统要求: -#### 3\. AntiX +- 内存:128MB(离线使用)/ 512MB(用于网页浏览器使用) +- CPU: i686 或更新版本 -![图片来源: Opensourcefeed(开源提供)][14] +#### 3、AntiX -另一个令人印象深刻的基于 Debian 的发行版。AntiX 通常被称为免系统发行版,该发行版在轻量级安装的同时侧重于性能。 +![图片来源: Opensourcefeed][14] -它完全适合几乎所有老式的 32 位系统。建议至少需要 256 MB 内存和 2.7 GB 存储空间。不仅易于安装,而且用户体验也针对新手和有经验的用户。 +[AntiX][15] 是另一个令人印象深刻的基于 Debian 的发行版。AntiX 是众所周知的无 systemd 发行版,该发行版侧重于性能,是一个轻量级的系统。 -您应该根据 Debian 的最新稳定可用分支获得最新版本。 +它完全适合于所有老式的 32 位系统。它只需要低至 256 MB 内存和 2.7 GB 存储空间。不仅易于安装,而且用户体验也是针对新手和有经验的用户的。 -[AntiX][15] +你应该可以得到基于 Debian 的最新稳定分支的最新版本。 -#### 4\. openSUSE +最低系统要求: + +- 内存:256 MB 的内存 +- CPU:奔腾 3 系统 +- 磁盘空间:5GB 的驱动器空间 + +#### 4、openSUSE ![][16] -openSUSE 是一个独立的 Linux 发行版,也支持 32 位系统。实际上最新的常规版本(Leap)不提供 32 位映像,但滚动发行版本(Tumbleweed)确实提供了 32 位映像。 +[openSUSE][18] 是一个独立的 Linux 发行版,也支持 32 位系统。实际上最新的常规版本(Leap)不提供 32 位镜像,但滚动发行版本(Tumbleweed)确实提供了 32 位镜像。 -如果您是新手,那将是完全不同的体验。但是,我建议您仔细阅读[为什么要使用 openSUSE 的原因。][17] +如果你是新手,那将是完全不同的体验。但是,我建议你仔细阅读 [为什么要使用 openSUSE 的原因][17]。 -它主要面向开发人员和系统管理员,但也可以将其用作普通桌面用户。值得注意的是,openSUSE 不意味在老式硬件上运行-因此必须确保至少有 2 GB 内存,40+ GB存储空间和双核处理器。 +它主要面向开发人员和系统管理员,但也可以将其用作普通桌面用户。值得注意的是,openSUSE 不意味在老式硬件上运行,因此必须确保至少有 2 GB 内存、40+ GB 存储空间和双核处理器。 -[openSUSE][18] +最低系统要求: +- 奔腾 4 1.6 GHz 或更高的处理器 +- 1GB 物理内存 +- 5 GB 硬盘 -#### 5\. Emmabuntüs +#### 5、Emmabuntüs ![][19] -Emmabuntus 是一个有趣的发行版,旨在通过 32 位支持来延长硬件的使用寿命,以减少原材料的浪费。作为一个小组,他们还参与向学校提供计算机和数字技术。 +[Emmanbuntus][20] 是一个有趣的发行版,旨在通过 32 位支持来延长硬件的使用寿命,以减少原材料的浪费。作为一个团体,他们还参与向学校提供计算机和数字技术的工作。 -它提供了两个不同的版本,一个基于 Ubuntu,另一个基于 Debian。如果您需要更长久的 32 位支持,则可能要使用 Debian 版本。它可能不是最好的选择,但是它具有许多预配置的软件来简化 Linux 学习体验并提供 32 位支持,如果您希望在此过程中支持他们的事业,那么这是一个相当不错的选择。 +它提供了两个不同的版本,一个基于 Ubuntu,另一个基于 Debian。如果你需要更长久的 32 位支持,则可能要使用 Debian 版本。它可能不是最好的选择,但是它具有许多预配置的软件来简化 Linux 学习体验,并提供 32 位支持,如果你希望在此过程中支持他们的事业,那么这是一个相当不错的选择。 -[Emmanbuntus][20] +最低系统要求: -#### 6\. NixOS +- 512MB 内存 +- 硬盘驱动器:2GB +- 奔腾处理器或同等配置 + +#### 6、NixOS ![Nixos KDE Edition \(图片来源: Distrowatch\)][21] -NixOS 是另一个独立的支持 32 位系统的 Linux 发行版。它着重于提供一个可靠的系统,其中程序包彼此隔离。 +[NixOS][23] 是另一个支持 32 位系统的独立 Linux 发行版。它着重于提供一个可靠的系统,其中程序包彼此隔离。 -这可能不直接面向普通用户,但它是 KDE 支持的可用发行版,具有独一无二的软件包管理方法。您可以从其官方网站上了解有关其[功能][22]的更多信息。 +这可能不是直接面向普通用户,但它是一个 KDE 支持的可用发行版,具有独特的软件包管理方式。你可以从其官方网站上了解有关其 [功能][22] 的更多信息。 -[NixOS][23] +最低系统要求: -#### 7\. Gentoo Linux +- 内存:768 MB +- 8GB 磁盘空间 +- 奔腾 4 或同等水平 + +#### 7、Gentoo Linux ![][24] -如果您是经验丰富的 Linux 用户,并且正在寻找 32 位 Linux 发行版,那么 Gentoo Linux 应该是一个不错的选择。 +如果你是经验丰富的 Linux 用户,并且正在寻找 32 位 Linux 发行版,那么 [Gentoo Linux][26] 应该是一个不错的选择。 -如果需要,您可以使用 Gentoo Linux 通过软件包管理器轻松配置,编译和安装内核。不仅限于众所周知的可配置性,您还可以在较旧的硬件上运行而不会出现任何问题。 +如果需要,你可以使用 Gentoo Linux 的软件包管理器轻松配置、编译和安装内核。不仅限于众所周知的可配置性,你还可以在较旧的硬件上运行而不会出现任何问题。 -即使您不是经验丰富的用户,也想尝试一下,只需阅读[安装说明][25],就可以大胆尝试了。 +即使你不是经验丰富的用户,也想尝试一下,只需阅读 [安装说明][25],就可以大胆尝试了。 -[Gentoo Linux][26] +最低系统要求: -#### 8\. Devuan +- 256MB 内存 +- 奔腾 4 或 AMD 的同类产品 +- 2.5 GB 磁盘空间 + +#### 8、Devuan ![][27] -[Devuan][28]是另一种免系统的发行版。从技术上讲,它是 Debian的一个分支,只是没有系统化和鼓励[开始自由][29]。 +[Devuan][30] 是另一种无 systemd 的发行版。从技术上讲,它是 Debian 的一个分支,只是没有 systemd ,并鼓励 [初始化系统自由][29]。 -对于普通用户来说,它可能不是一个非常流行的 Linux 发行版,但是如果您想要免系统发行版和 32 位支持,Devuan 应该是一个不错的选择。 +对于普通用户来说,它可能不是一个非常流行的 Linux 发行版,但是如果你想要一个无 systemd 的发行版和 32 位支持,Devuan 应该是一个不错的选择。 -[Devuan][30] +最低系统要求: -#### 9\. Void Linux +- 内存:1GB +- CPU:奔腾 1.0GHz + +#### 9、Void Linux ![][31] -Void Linux 是由志愿者独立开发的有趣发行版。它旨在成为一个通用的 OS(操作系统),同时提供稳定的滚动发布周期。它以 `runit`作为初始系统替代 `systemd`,并具有多个[桌面环境][32]的选项。 +[Void Linux][33] 是由志愿者独立开发的有趣发行版。它旨在成为一个通用的操作系统,同时提供稳定的滚动发布周期。它以 runit 作为初始化系统替代 systemd,并为你提供了多个 [桌面环境][32] 选择。 -它具有令人印象深刻的最低需求规格,只需 96 MB 的内存和 Pentium(奔腾) 4(或等效的)芯片配对。试试看吧! +它具有非常令人印象深刻的最低需求规格,只需 96 MB 的内存配以奔腾 4 或等同的芯片。试试看吧! -[Void Linux][33] +最低系统要求: -#### 10\. Q4OS +- 96MB 内存 +- 奔腾 4 或相当的 AMD 处理器 + +#### 10、Q4OS ![][34] -Q4OS 是另一个基于 Debian 的发行版,致力于提供最小和快速的桌面用户体验。它也恰好是我们列表中的[最佳轻量级 Linux 发行版][4]之一。它的 32 位版本具有[Trinity 桌面][35],您可以在 64 位版本上找到 KDE Plasma 支持。 +[Q4OS][37] 是另一个基于 Debian 的发行版,致力于提供极简和快速的桌面用户体验。它也恰好是我们的 [最佳轻量级 Linux 发行版][4] 列表中的一个。它的 32 位版本具有 [Trinity 桌面][35],你可以在 64 位版本上找到 KDE Plasma 支持。 -与 Void Linux 类似,Q4OS 也至少可以运行在至少 128 MB 的内存和 300 MHz 的 CPU 上,并需要 3 GB 的存储空间。对于任何老式硬件来说,它应该绰绰有余。因此,我想说,您绝对应该尝试一下! +与 Void Linux 类似,Q4OS 可以运行在至低 128 MB 的内存和 300 MHz 的 CPU 上,需要 3 GB 的存储空间。对于任何老式硬件来说,它应该绰绰有余。因此,我想说,你绝对应该尝试一下! -要了解更多信息,您还可以查看[我们对 Q4OS 的回顾][36]。 +要了解更多信息,你还可以查看 [我们对 Q4OS 的点评][36]。 -[Q$OS][37] +Q4OS 的最低要求: -#### 11: MX Linux +- 内存:128MB(Trinity 桌面)/ 1GB(Plasma 桌面) +- CPU:300 MHz(Trinity 桌面)/ 1 GHz(Plasma 桌面) +- 存储空间:5GB(Trinity 桌面)/3GB(Plasma 桌面) + +#### 11、MX Linux ![][38] -如果有一个稍微不错的配置(不完全是老式的,而是旧的),对于 32 位系统,我个人推荐 MX Linux。对于每种类型的用户,它也都会成为[最佳 Linux 发行版][2]之一。 +如果有一个稍微不错的配置(不完全是老式的,而是旧的),对于 32 位系统,我个人推荐 [MX Linux][39]。它也恰好是适合各种类型用户的 [最佳 Linux 发行版][2] 之一。 -通常,MX Linux 是基于 Debian 的出色的轻量级和可自定义发行版。您可以选择从 KDE,XFCE 或 Fluxbox(这是它们自己的用于较旧硬件的桌面环境)中进行选择。您可以在他们的官方网站上找到更多关于它的信息,然后尝试一下。 +通常,MX Linux 是基于 Debian 的出色的轻量级和可定制的发行版。你可以选择 KDE、XFce 或 Fluxbox(这是他们自己为旧硬件设计的桌面环境)。你可以在他们的官方网站上找到更多关于它的信息,并尝试一下。 -[MX Linux][39] +最低系统要求: -### 荣誉提名:Funtoo +- 1GB 内存(建议使用 2GB,以便舒适地使用) +- 15GB 的磁盘空间(建议 20GB) -Funtoo 是基于 Gentoo 社区开发的 Linux 发行版。它着重于为您提供 Gentoo Linux 的最佳性能以及一些额外的软件包,以使用户获得完整的体验。有趣的是,该开发实际上是由 Gentoo Linux 的创建者丹尼尔·罗宾斯(Daniel Robbins)领导的。 -当然,如果您不熟悉 Linux,那么这里可能没有最好的体验。但是,它确实支持 32 位系统,并且可以在许多较旧的 Intel/AMD 芯片组上很好地工作。 +#### 12、Linux Mint Debian Edtion -[Funtoo][40] +![][44] + +[基于 Debian 的 Linux Mint][45]?为什么不可以呢? + +你可以得到同样的 Cinnamon 桌面体验,只是不基于 Ubuntu。它和基于 Ubuntu 的 Linux Mint 一样容易使用,一样可靠。 + +不仅仅是基于 Debian,你还可以得到对 64 位和 32 位系统的支持。如果你不想在 32 位系统上使用一个你从未听说过的 Linux 发行版,这应该是一个不错的选择。 + +最低系统要求: + +- 1GB 内存(建议使用 2GB,以便舒适地使用) +- 15GB 的磁盘空间(建议 20GB) + +#### 13、Sparky Linux + +![][46] + +[Sparky Linux][47] 是 [为初学者定制的最好的轻量级 Linux 发行版][4] 之一。它很容易定制,而且资源占用很少。 + +它可以根据你的要求提供不同的版本,但它确实支持 32 位版本。考虑到你想为你的旧电脑买点东西,我建议你看看它的 MinimalGUI 版本,除非你真的需要像 Xfce 或 LXQt 这样成熟的桌面环境。 + +最低系统要求: + +- 内存:512 MB +- CPU:奔腾 4,或 AMD Athlon +- 磁盘空间:2GB(命令行版),10GB(家庭版),20GB(游戏版) + +#### Mageia + +![][48] + +作为 [Mandriva Linux][49] 的分支,[Mageia Linux][50] 是一个由社区推动的 Linux 发行版,支持 32 位系统。 + +通常情况下,你会注意到每年都有一个重大版本。他们的目的是贡献他们的工作,以提供一个自由的操作系统,这也是潜在的安全。对于 32 位系统来说,它可能不是一个流行的选择,但它支持很多桌面环境(如 KDE Plasma、GNOME),如果你需要,你只需要从它的软件库中安装它。 + +你应该可以从他们的官方网站上得到下载桌面环境特定镜像的选项。 + +最低系统要求: + +- 512MB 内存(推荐 2GB) +- 最小安装需 5GB 存储空间(常规安装 20GB) +- CPU:奔腾4,或 AMD Athlon + +### 荣誉提名:Funtoo & Puppy Linux + +[Funtoo][40] 是基于 Gentoo 的由社区开发的 Linux 发行版。它着重于为你提供 Gentoo Linux 的最佳性能以及一些额外的软件包,以使用户获得完整的体验。有趣的是,该开发实际上是由 Gentoo Linux 的创建者 Daniel Robbins 领导的。 + +[Puppy Linux][51] 是一个很小的 Linux 发行版,除了基本的工具,几乎没有捆绑的软件应用。如果其他选择都不行,而你又想要最轻量级的发行版,Puppy Linux 可能是一个选择。 + +当然,如果你不熟悉 Linux,这两个可能都不能提供最好的体验。但是,它们确实支持 32 位系统,并且可以在许多较旧的 Intel/AMD 芯片组上很好地工作。可以在它们的官方网站上探索更多的信息。 ### 总结 -我将列表集中在基于 Debian 的发行版和一些独立发行版上。但是,如果您不介意长期支持条款,而只想获得 32 位受支持的映像,也可以尝试使用任何基于 Ubuntu 18.04 的发行版(或任何官方版本)。 +我将列表重点放在基于 Debian 的发行版和一些独立发行版上。但是,如果你不介意长期支持条款,而只想获得一个支持 32 位的镜像,也可以尝试使用任何基于 Ubuntu 18.04 的发行版(或任何官方版本)。 -在撰写本文时,他们只剩下几个月的软件支持。因此,我避免将其作为主要选项提及。但是,如果您喜欢基于 Ubuntu 18.04 的发行版或其它任何版本,可以选择 [LXLE][41],[Linux Lite][42],[Zorin Lite 15][43]及其他官方版本。 +在撰写本文时,它们只剩下几个月的软件支持。因此,我避免将其作为主要选项提及。但是,如果你喜欢基于 Ubuntu 18.04 的发行版或其它任何版本,可以选择 [LXLE][41]、[Linux Lite][42]、[Zorin Lite 15][43] 及其他官方版本。 -即使大多数基于 Ubuntu 的现代桌面操作系统都放弃了对 32 位的支持。您仍然有很多选项可以选择。 +即使大多数基于 Ubuntu 的现代桌面操作系统都放弃了对 32 位的支持。你仍然有很多选项可以选择。 -在 32 位系统上更喜欢哪一个?在下面的评论中让我知道您的想法。 +在 32 位系统中更喜欢哪一个?在下面的评论中让我知道你的想法。 -------------------------------------------------------------------------------- @@ -173,7 +258,7 @@ via: https://itsfoss.com/32-bit-linux-distributions/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -222,3 +307,11 @@ via: https://itsfoss.com/32-bit-linux-distributions/ [41]: https://www.lxle.net/ [42]: https://www.linuxliteos.com [43]: https://zorinos.com/download/15/lite/32/ +[44]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/cinnamon-debian-edition.jpg?w=800&ssl=1 +[45]: https://www.linuxmint.com/download_lmde.php +[46]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/sparky-linux.jpg?w=800&ssl=1 +[47]: https://sparkylinux.org/download/stable/ +[48]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/11/mageia.jpg?w=800&ssl=1 +[49]: https://en.wikipedia.org/wiki/Mandriva_Linux +[50]: https://www.mageia.org/en/ +[51]: http://puppylinux.com/ \ No newline at end of file From 97b2c897d7941a1a691ce648ab27f2a9b06d454c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 24 Apr 2021 14:45:58 +0800 Subject: [PATCH 248/307] PUB @stevenzdg988 https://linux.cn/article-13326-1.html --- ...utions You Can Rely on for Your Ancient 32-bit Computer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md (99%) diff --git a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md similarity index 99% rename from translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md rename to published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index 5284ded94d..bbbf03bdcc 100644 --- a/translated/tech/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13326-1.html) [#]: subject: (11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer) [#]: via: (https://itsfoss.com/32-bit-linux-distributions/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 995dd71e7277214f63d4bcf0e99e6763f5521b71 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 24 Apr 2021 14:50:17 +0800 Subject: [PATCH 249/307] PRF --- ...ibutions You Can Rely on for Your Ancient 32-bit Computer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md index bbbf03bdcc..6ab0eb1e6f 100644 --- a/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md +++ b/published/20201106 11 Linux Distributions You Can Rely on for Your Ancient 32-bit Computer.md @@ -217,7 +217,7 @@ Q4OS 的最低要求: - CPU:奔腾 4,或 AMD Athlon - 磁盘空间:2GB(命令行版),10GB(家庭版),20GB(游戏版) -#### Mageia +#### 14、Mageia ![][48] From 51def2df464b3af07a3a9d4d6d6a72896456a4fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 25 Apr 2021 05:03:01 +0800 Subject: [PATCH 250/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210424=20?= =?UTF-8?q?Making=20computers=20more=20accessible=20and=20sustainable=20wi?= =?UTF-8?q?th=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210424 Making computers more accessible and sustainable with Linux.md --- ...e accessible and sustainable with Linux.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20210424 Making computers more accessible and sustainable with Linux.md diff --git a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md new file mode 100644 index 0000000000..9f1db397ff --- /dev/null +++ b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md @@ -0,0 +1,73 @@ +[#]: subject: (Making computers more accessible and sustainable with Linux) +[#]: via: (https://opensource.com/article/21/4/linux-free-geek) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Making computers more accessible and sustainable with Linux +====== +Free Geek is a nonprofit organization that helps decrease the digital +divide by providing Linux computers to people and groups in need. +![Working from home at a laptop][1] + +There are many reasons to choose Linux for your desktop operating system. In [_Why everyone should choose Linux_][2], Opensource.com's Seth Kenlon highlighted many of the best reasons to select Linux and provided lots of ways for people to get started with the operating system. + +This also got me thinking about how I usually introduce folks to Linux. The pandemic has increased the need for people to go online for shopping, doing remote education, and connecting with family and friends [over video conferencing][3]. + +I work with a lot of retirees who have fixed incomes and are not particularly tech-savvy. For most of these folks, buying a computer is a major investment fraught with concern. Some of my friends and clients are uncomfortable going to a retail store during a pandemic, and they're completely unfamiliar with what to look for in a computer, whether it's a desktop or laptop, even in non-pandemic times. They come to me with questions about where to buy one and what to look for. + +I'm always eager to see them get a Linux computer. Many of them cannot afford the Linux units sold by name-brand vendors. Until recently, I've been purchasing refurbished units for them and refitting them with Linux. + +But that all changed when I discovered [Free Geek][4], a nonprofit organization based in Portland, Ore., with the mission "to sustainably reuse technology, enable digital access, and provide education to create a community that empowers people to realize their potential." + +Free Geek has an eBay store where I have purchased several refurbished laptops at affordable prices. Their computers come with [Linux Mint][5] installed. The fact that a computer comes ready-to-use makes it easy to introduce [new users to Linux][6] and help them quickly experience the operating system's power. + +### Keeping computers in service and out of landfills + +Oso Martin launched Free Geek on Earth Day 2000. The organization provides classes and work programs to its volunteers, who are trained to refurbish and rebuild donated computers. Volunteers also receive a donated computer after 24 hours of service. + +The computers are sold in Free Geek's brick-and-mortar store in Portland and [online][7]. The organization also provides computers to people and entities in need through its programs [Plug Into Portland][8], [Gift a Geekbox][9], and [organizational][10] and [community grants][11]. + +The organization says it has "diverted over 2 million items from landfills, granted over 75,000 technology devices to nonprofits, schools, community change organizations, and individuals, and plugged over 5,000 classroom hours from Free Geek learners." + +### Get involved + +Since its inception, Free Geek has grown from a staff of three to almost 50 and has been recognized around the world. It is a member of the City of Portland's [Digital Inclusion Network][12]. + +You can connect with Free Geek on [Twitter][13], [Facebook][14], [LinkedIn][15], [YouTube][16], and [Instagram][17]. You can also subscribe to its [newsletter][18]. Purchasing items from Free Geek's [shop][19] directly supports its work and reduces the digital divide. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-free-geek + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/article/21/2/try-linux +[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing +[4]: https://www.freegeek.org/ +[5]: https://opensource.com/article/21/4/restore-macbook-linux +[6]: https://opensource.com/article/18/12/help-non-techies +[7]: https://www.ebay.com/str/freegeekbasicsstore +[8]: https://www.freegeek.org/our-programs/plug-portland +[9]: https://www.freegeek.org/our-programs/gift-geekbox +[10]: https://www.freegeek.org/our-programs-grants/organizational-hardware-grants +[11]: https://www.freegeek.org/our-programs-grants/community-hardware-grants +[12]: https://www.portlandoregon.gov/oct/73860 +[13]: https://twitter.com/freegeekpdx +[14]: https://www.facebook.com/freegeekmothership +[15]: https://www.linkedin.com/company/free-geek/ +[16]: https://www.youtube.com/user/FreeGeekMothership +[17]: https://www.instagram.com/freegeekmothership/ +[18]: https://app.e2ma.net/app2/audience/signup/1766417/1738557/?v=a +[19]: https://www.freegeek.org/shop From becb88bca2eeeca29ca51f3f7aa9957d25d729c6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 25 Apr 2021 05:03:21 +0800 Subject: [PATCH 251/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210424=20?= =?UTF-8?q?Can=20We=20Recommend=20Linux=20for=20Gaming=20in=202021=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md --- ...n We Recommend Linux for Gaming in 2021.md | 145 ++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md diff --git a/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md b/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md new file mode 100644 index 0000000000..665199a720 --- /dev/null +++ b/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md @@ -0,0 +1,145 @@ +[#]: subject: (Can We Recommend Linux for Gaming in 2021?) +[#]: via: (https://news.itsfoss.com/linux-for-gaming-opinion/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Can We Recommend Linux for Gaming in 2021? +====== + +You will often hear Linux enthusiasts praise about the improved gaming capabilities on Linux. Yes, we have come a long way considering the advancements made to support modern games on Linux desktop. + +Even Lutris’ creator mentions in our interview that the [progress Linux has made in terms of gaming is simply incredible][1]. + +But, is it something to be hyped about? Can we recommend Linux to a gamer? Is Linux suitable for gaming? + +In this article, I want to share a few things about gaming on a Linux system and share what I think about it. + +### You Can Play Games on Linux: Yes! + +If anyone’s ever told you that you cannot game on Linux, **that is not true**. + +You can play a variety of games on Linux without any major hiccups. And, for the most part, it is playable and totally a good experience. + +In fact, we have an ultimate guide for [Gaming on Linux][2] if you do not know where to start. + +### Do I Need a Specific Linux Distro to Play Games? + +Not really. It depends on how convenient you want the experience to be. + +For instance, if you want a Linux distribution to work well with your graphics driver and get the latest hardware support, there’s something for that. Similarly, if you just want to play native Linux indie games with an integrated GPU, any Linux distro can work. + +So, there are a few variables when choosing a Linux distribution for your gaming adventures. + +Fret not, to help you out, we have a useful list of the [best Linux gaming distributions][3]. + +### Virtual Reality Games on Linux: Uh-Oh! + +![][4] + +I’m sure VR gaming is not something widely adopted yet. But, if you want the exciting experience on a VR headset, **choosing Linux as your preferred platform might be a bad idea**. + +You do not have the necessary drivers or applications for a convenient experience on Linux. No distribution can help you solve this problem. + +If you are curious, you can go through the details shed on the **state of virtual reality** in a blog post on [Boiling Steam][5] and an interesting experience with Valve’s VR headset on [GamingOnLinux][6]. + +I’ve linked those blog posts for reference but long story short — avoid Linux if you want to experience VR games (feel free to experiment if you have the time though). + +### Can You Play Windows Exclusive Games on Linux? + +Yes and No. + +You can use [Steam Play to play Windows-only games][7], **but it has its share of issues**. Not every game works. + +For instance, I end up using Windows to play [Forza Horizon 4][8]. If you love car simulation or racing games, this is a masterpiece that you may not want to miss. + +Maybe we will see it working through Steam Play without issues in the near future, who knows? + +So, it is safe to assume that you will encounter many similar games that may not work at all. That’s the bitter truth. + +And, to know if the game works on Linux, head to [ProtonDB][9] and search for the game to see if it has a “**Gold**” status at the very least. + +### Multiplayer Gaming With Anti-Cheat Engines: Does It Work? + +![][10] + +A huge chunk of gamers prefer playing multiplayer games like [Apex Legends][11], [Rainbow Six Siege][12], and [Fortnite][13]. + +However, some of those popular titles that rely on anti-cheat engines do not work on Linux yet. It is still something a work in progress and can be made possible in future Linux Kernel releases — just not yet. + +Do note that multiplayer games like [CS:GO][14], Dota 2, Team Fortress 2, [Valheim][15], and several more offer native Linux support and works great! + +### Would I Recommend Linux for Gaming? + +![][4] + +Considering that you can play a lot of Windows-specific games, native indie games, and a variety of AAA games with native Linux support, I can recommend a first-time user to try gaming on Linux. + +But, that comes with a **caution** — I would suggest you to make a potential list of games that you want to play to make sure that it runs on Linux without any issues. In either case, you may end up wasting a lot of time troubleshooting with no results. + +Not to forget, a big no to VR gaming on Linux, I believe. + +And, if you want to explore all the latest and greatest titles, I will recommend you to stick to your Windows-powered gaming machine. + +**While I should encourage more users to adopt Linux as a gaming platform, but I won’t be ignoring the practical side of why common consumers still prefer a Windows-powered machine to game on.** + +_What do you think? Do you agree with my thoughts? Feel free to share what you feel in the comments below!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][1] + * ![][16] ![][17] + + + * [Popular Game Titles Metro Exodus and Total War: Rome Remastered Releasing for Linux in April][18] + * ![][16] ![][19] + + + * [Good News for Linux Gamers! An Unofficial Epic Games Store Launcher for Linux is in Works][20] + * ![][16] ![Heroic Games Launcher][21] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-for-gaming-opinion/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/lutris-creator-interview/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/linux-gaming-distributions/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://boilingsteam.com/the-state-of-virtual-reality-on-linux/ +[6]: https://www.gamingonlinux.com/2020/08/my-experiences-of-valves-vr-on-linux +[7]: https://itsfoss.com/steam-play/ +[8]: https://forzamotorsport.net/en-US/games/fh4 +[9]: https://www.protondb.com/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: https://www.ea.com/games/apex-legends +[12]: https://www.ubisoft.com/en-us/game/rainbow-six/siege +[13]: https://www.epicgames.com/fortnite/en-US/home +[14]: https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/ +[15]: https://store.steampowered.com/app/892970/Valheim/ +[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ +[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[20]: https://news.itsfoss.com/heroic-games-launcher/ +[21]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/heroic-games-launcher.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 From ed020ee1d6b6392bcfa42a5a85878e5342275b35 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Sun, 25 Apr 2021 08:24:27 +0800 Subject: [PATCH 252/307] =?UTF-8?q?=E8=AF=91=E6=96=87=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...te open source project management tools.md | 194 ------------------ ...te open source project management tools.md | 181 ++++++++++++++++ 2 files changed, 181 insertions(+), 194 deletions(-) delete mode 100644 sources/tech/20210317 My favorite open source project management tools.md create mode 100644 translated/tech/20210317 My favorite open source project management tools.md diff --git a/sources/tech/20210317 My favorite open source project management tools.md b/sources/tech/20210317 My favorite open source project management tools.md deleted file mode 100644 index 5653804680..0000000000 --- a/sources/tech/20210317 My favorite open source project management tools.md +++ /dev/null @@ -1,194 +0,0 @@ -[#]: subject: (My favorite open source project management tools) -[#]: via: (https://opensource.com/article/21/3/open-source-project-management) -[#]: author: (Frank Bergmann https://opensource.com/users/fraber) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -My favorite open source project management tools -====== -If you're managing large and complex projects, try replacing Microsoft -Project with an open source option. -![Kanban-style organization action][1] - -Projects like building a satellite, developing a robot, or launching a new product are all expensive, involve different providers, and contain hard dependencies that must be tracked. - -The approach to project management in the world of large projects is quite simple (in theory at least). You create a project plan and split it into smaller pieces until you can reasonably assign costs, duration, resources, and dependencies to the various activities. Once the project plan is approved by the people in charge of the money, you use it to track the project's execution. Drawing all of the project's activities on a timeline produces a bar chart called a [Gantt chart][2]. - -Gantt charts have always been used in [waterfall project methodologies][3], but they can also be used with agile. For example, large projects may use a Gantt chart for a scrum sprint and ignore other details like user stories, thereby embedding agile phases. Other large projects may include multiple product releases (e.g., minimum viable product [MVP], second version, third version, etc.). In this case, the super-structure is kind of agile, with each phase planned as a Gantt chart to deal with budgets and complex dependencies. - -### Project management tools - -There are literally hundreds of tools available to manage large projects with Gantt charts, and Microsoft Project is probably the most popular. It is part of the Microsoft Office family, scales to hundreds of thousands of activities, and has an incredible number of features that support almost every conceivable way to manage a project schedule. With Project, it's not always clear what is more expensive: the software license or the training courses that teach you how to use the tool. - -Another drawback is that Microsoft Project is a standalone desktop application, and only one person can update a schedule. You would need to buy licenses for Microsoft Project Server, Project for the web, or Microsoft Planner if you want multiple users to collaborate. - -Fortunately, there are open source alternatives to the proprietary tools, including the applications in this article. All are open source and include a Gantt for scheduling hierarchical activities based on resources and dependencies. ProjectLibre, GanttProject, and TaskJuggler are desktop applications for a single project manager; ProjeQtOr and Redmine are web applications for project teams, and ]project-open[ is a web application for managing entire organizations. - -I evaluated the tools based on a single user planning and tracking a single large project. My evaluation criteria includes Gantt editor features, availability on Windows, Linux, and macOS, scalability, import/export, and reporting. (Full disclosure: I'm the founder of ]project-open[, and I've been active in several open source communities for many years. This list includes our product, so my views may be biased, but I tried to focus on each product's best features.) - -### Redmine 4.1.0 - -![Redmine][4] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[Redmine][6] is a web-based project management tool with a focus on agile methodologies. - -The standard installation includes a Gantt timeline view, but it lacks fundamental features like scheduling, drag-and-drop, indent and outdent, and resource assignments. You have to edit task properties individually to change the task tree's structure. - -Redmine has Gantt editor plugins, but they are either outdated (e.g., [Plus Gantt][7]) or proprietary (e.g., [ANKO Gantt chart][8]). If you know of other open source Gantt editor plugins, please share them in the comments. - -Redmine is written in Ruby on Rails and available for Windows, Linux, and macOS. The core is available under a GPLv2 license. - - * **Best for:** IT teams working using agile methodologies - * **Unique selling proposition:** It's the original "upstream" parent project of OpenProject and EasyRedmine. - - - -### ]project-open[ 5.1 - -![\]project-open\[][9] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[]project-open[][10] is a web-based project management system that takes the perspective of an entire organization, similar to an enterprise resource planning (ERP) system. It can also manage project portfolios, budgets, invoicing, sales, human resources, and other functional areas. Specific variants exist for professional services automation (PSA) for running a project company, project management office (PMO) for managing an enterprise's strategic projects, and enterprise project management (EPM) for managing a department's projects. - -The ]po[ Gantt editor includes hierarchical tasks, dependencies, and scheduling based on planned work and assigned resources. It does not support resource calendars and non-human resources. The ]po[ system is quite complex, and the GUI might need a refresh. - -]project-open[ is written in TCL and JavaScript and available for Windows and Linux. The ]po[ core is available under a GPLv2 license with proprietary extensions available for large companies. - - * **Best for:** Medium to large project organizations that need a lot of financial project reporting - * **Unique selling proposition:** ]po[ is an integrated system to run an entire project company or department. - - - -### ProjectLibre 1.9.3 - -![ProjectLibre][11] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[ProjectLibre][12] is probably the closest you can get to Microsoft Project in the open source world. It is a desktop application that supports all-important project planning features, including resource calendars, baselines, and cost management. It also allows you to import and export schedules using MS-Project's file format. - -ProjectLibre is perfectly suitable for planning and executing small or midsized projects. However, it's missing some advanced features in MS-Project, and its GUI is not the prettiest. - -ProjectLibre is written in Java and available for Windows, Linux, and macOS and licensed under an open source Common Public Attribution (CPAL) license. The ProjectLibre team is currently working on a Web offering called ProjectLibre Cloud under a proprietary license. - - * **Best for:** An individual project manager running small to midsized projects or as a viewer for project members who don't have a full MS-Project license - * **Unique selling proposition:** It's the closest you can get to MS-Project with open source. - - - -### GanttProject 2.8.11 - -![GanttProject][13] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[GanttProject][14] is similar to ProjectLibre as a desktop Gantt editor but with a more limited feature set. It doesn't support baselines nor non-human resources, and the reporting functionality is more limited. - -GanttProject is a desktop application written in Java and available for Windows, Linux, and macOS under the GPLv3 license. - - * **Best for:** Simple Gantt charts or learning Gantt-based project management techniques. - * **Unique selling proposition:** It supports program evaluation and review technique ([PERT][15]) charts and collaboration using WebDAV. - - - -### TaskJuggler 3.7.1 - -![TaskJuggler][16] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[TaskJuggler][17] schedules multiple parallel projects in large organizations, focusing on automatically resolving resource assignment conflicts (i.e., resource leveling). - -It is not an interactive Gantt editor but a command-line tool that works similarly to a compiler: It reads a list of tasks from a text file and produces a series of reports with the optimum start and end times for each task depending on the assigned resources, dependencies, priorities, and many other parameters. It supports multiple projects, baselines, resource calendars, shifts, and time zones and has been designed to scale to enterprise scenarios with many projects and resources. - -Writing a TaskJuggler input file with its specific syntax may be beyond the average project manager's capabilities. However, you can use ]project-open[ as a graphical frontend for TaskJuggler to generate input, including absences, task progress, and logged hours. When used this way, TaskJuggler becomes a powerful what-if scenario planner. - -TaskJuggler is written in Ruby and available for Windows, Linux, and macOS under a GPLv2 license. - - * **Best for:** Medium to large departments managed by a true nerd - * **Unique selling proposition:** It excels in automatic resource-leveling. - - - -### ProjeQtOr 9.0.4 - -![ProjeQtOr][18] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - -[ProjeQtOr][19] is a web-based project management application that's suitable for IT projects. It supports risks, budgets, deliverables, and financial documents in addition to projects, tickets, and activities to integrate many aspects of project management into a single system. - -ProjeQtOr provides a Gantt editor with a feature set similar to ProjectLibre, including hierarchical tasks, dependencies, and scheduling based on planned work and assigned resources. However, it doesn't support in-place editing of values (e.g., task name, estimated time, etc.); users must change values in an entry form below the Gantt view and save the values. - -ProjeQtOr is written in PHP and available for Windows, Linux, and macOS under the Affero GPL3 license. - - * **Best for:** IT departments tracking a list of projects - * **Unique selling proposition:** Lets you store a wealth of information for every project, keeping all information in one place. - - - -### Other tools - -The following systems may be valid options for specific use cases but were excluded from the main list for various reasons. - -![LIbrePlan][20] - -(Frank Bergmann, [CC BY-SA 4.0][5]) - - * [**LibrePlan**][21] is a web-based project management application focusing on Gantt charts. It would have figured prominently in the list above due to its feature set, but there is no installation available for recent Linux versions (CentOS 7 or 8). The authors say updated instructions will be available soon. - * [**dotProject**][22] is a web-based project management system written in PHP and available under the GPLv2.x license. It includes a Gantt timeline report, but it doesn't have options to edit it, and dependencies don't work yet (they're "only partially functional"). - * [**Leantime**][23] is a web-based project management system with a pretty GUI written in PHP and available under the GPLv2 license. It includes a Gantt timeline for milestones but without dependencies. - * [**Orangescrum**][24] is a web-based project-management tool. Gantt charts are available as a paid add-on or with a paid subscription. - * [**Talaia/OpenPPM**][25] is a web-based project portfolio management system. However, version 4.6.1 still says "Coming Soon: Interactive Gantt Charts." - * [**Odoo**][26] and [**OpenProject**][27] both restrict some important features to the paid enterprise edition. - - - -In this review, I aimed to include all open source project management systems that include a Gantt editor with dependency scheduling. If I missed a project or misrepresented something, please let me know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/3/open-source-project-management - -作者:[Frank Bergmann][a] -选题:[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/fraber -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) -[2]: https://en.wikipedia.org/wiki/Gantt_chart -[3]: https://opensource.com/article/20/3/agiles-vs-waterfall -[4]: https://opensource.com/sites/default/files/uploads/redmine.png (Redmine) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://www.redmine.org/ -[7]: https://redmine.org/plugins/plus_gantt -[8]: https://www.redmine.org/plugins/anko_gantt_chart -[9]: https://opensource.com/sites/default/files/uploads/project-open.png (]project-open[) -[10]: https://www.project-open.com -[11]: https://opensource.com/sites/default/files/uploads/projectlibre.png (ProjectLibre) -[12]: http://www.projectlibre.org -[13]: https://opensource.com/sites/default/files/uploads/ganttproject.png (GanttProject) -[14]: https://www.ganttproject.biz -[15]: https://en.wikipedia.org/wiki/Program_evaluation_and_review_technique -[16]: https://opensource.com/sites/default/files/uploads/taskjuggler.png (TaskJuggler) -[17]: https://taskjuggler.org/ -[18]: https://opensource.com/sites/default/files/uploads/projeqtor.png (ProjeQtOr) -[19]: https://www.projeqtor.org -[20]: https://opensource.com/sites/default/files/uploads/libreplan.png (LIbrePlan) -[21]: https://www.libreplan.dev/ -[22]: https://dotproject.net/ -[23]: https://leantime.io -[24]: https://orangescrum.org/ -[25]: http://en.talaia-openppm.com/ -[26]: https://odoo.com -[27]: http://openproject.org diff --git a/translated/tech/20210317 My favorite open source project management tools.md b/translated/tech/20210317 My favorite open source project management tools.md new file mode 100644 index 0000000000..36f94cf09f --- /dev/null +++ b/translated/tech/20210317 My favorite open source project management tools.md @@ -0,0 +1,181 @@ +[#]: subject: (My favorite open source project management tools) +[#]: via: (https://opensource.com/article/21/3/open-source-project-management) +[#]: author: (Frank Bergmann https://opensource.com/users/fraber) +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +我最喜欢的开源项目管理工具 +====== +如果您要管理大型复杂的项目,请尝试利用开源选项替换 Microsoft Project(微软项目管理软件)。 +![看板式组织活动][1] + +诸如建造卫星,开发机器人或推出新产品之类的项目都是昂贵的,涉及不同的提供商,并且包含必须跟踪的硬依赖性。 + +大型项目领域中的项目管理方法非常简单(至少在理论上如此)。您可以创建项目计划并将其拆分为较小的部分,直到您可以合理地将成本,持续时间,资源和依赖性分配给各种活动。一旦项目计划获得负责人的批准,您就可以使用它来跟踪项目的执行情况。在时间轴上绘制项目的所有活动将产生一个称为[Gantt chart(甘特图表)][2]的条形图。 + +Gantt(甘特)图一直用于[瀑布项目方法][3],也可以被灵活地使用。例如,大型项目可能将 Gantt chart (甘特图)用于 Scrum 冲刺,而忽略其他像用户需求这样的细节,从而嵌入灵活的阶段。其他大型项目可能包括多个产品版本(例如,最低可行产品 [MVP],第二版本,第三版本等)。在这种情况下,上层结构对灵活性友善,用每个阶段计划作为 Gantt chart (甘特图)处理预算和复杂的依赖关系。 + +### 项目管理工具 + +不夸张地说,有数百种可用工具使用 Gantt chart (甘特图)管理大型项目,Microsoft Project(微软项目管理软件)可能是最受欢迎的工具。它是 Microsoft Office(微软办公软件)系列(家族)的一部分,可扩展到成千上万的活动,并且具有众多(难以置信的数量)功能,可支持几乎所有可能的方式来管理项目进度表。对于 Project(微软项目管理软件)并不总是清楚什么更昂贵:软件许可或如何使用该工具的培训课程。 + +另一个缺点是 Microsoft Project 是一个独立的桌面应用程序,只有一个人可以更新进度表。如果要多个用户进行协作,则需要购买 Microsoft Project Server,Web 版的 Project(微软项目管理软件) 或 Microsoft Planner 的许可证。 + +幸运的是,专有工具还有开源的替代品,包括本文中的应用程序。所有这些都是开源的,并且包括用于安排基于资源和依赖项分层活动的 Gantt (甘特图)。 ProjectLibre,GanttProject 和 TaskJuggler 是单个项目管理的桌面应用程序。ProjeQtOr 和 Redmine 是用于项目团队的 Web 应用程序,而 ]project-open[ 是用于管理整个组织的 Web 应用程序。 + +我根据一个单用户计划并跟踪一个大型项目评估了这些工具。我的评估标准包括 Gantt 编辑器功能,Windows,Linux 和 macOS 上的可用性,可扩展性,导入/导出和报告。(完全披露:我是 ]project-open[ 的创始人,并且我在多个开源社区中活跃了很多年。此列表包括我们的产品,因此我的观点可能有偏见,但我尝试着眼于每个产品的最佳功能。) + +### Redmine 4.1.0 + +![Redmine][4] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[Redmine][6]是一个基于 Web 的专注于灵活原则的项目管理工具。 + +标准安装包括 Gantt (甘特图)时间轴视图,但缺少诸如调度,拖放,缩进(缩排和凸排)以及资源分配之类的基本功能。您必须单独编辑任务属性才能更改任务树的结构。 + +Redmine 具有 Gantt (甘特图)编辑器插件,但是它们已经过时(例如 [Plus Gantt][7])或专有(例如 [ANKO Gantt 图表][8])。如果您知道其他开源 Gantt 编辑器插件,请在评论中分享它们。 + +Redmine 用 Ruby 的 Rails 框架编写,可用于 Windows,Linux 和 macOS。该内核已获得 GPLv2 许可。 + + * **最适合:** 使用灵活方法的 IT 团队 + * **独特的销售主张:** 这是 OpenProject 和 EasyRedmine 的最初“上游”父项目。 + +### ]project-open[ 5.1 + +![\]project-open\[][9] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[]project-open[][10]是一个基于 Web 的项目管理系统,它具有整个组织的透视图,类似于企业资源计划(ERP)系统。它还可以管理项目档案,预算,发票,销售,人力资源和其他功能领域。存在用于运行项目公司的专业服务自动化(PSA),用于管理企业战略项目的项目管理办公室(PMO)和用于管理部门项目的企业项目管理(EPM)的特定变体。 + +Gantt 编辑器包括按等级划分的任务,依赖关系和基于计划的工作和分配资源的计划。它不支持资源日历和非人力资源。]po[ 系统非常复杂,GUI 可能需要刷新。 + +]project-open[ 用 TCL 和 JavaScript 编写,可用于 Windows 和 Linux。 ]po[ 核心已获得 GPLv2 许可,并具有适用于大公司的专有扩展。 + + * **最适合:** 需要大量财务项目报告的中大型项目组织 + * **独特的销售主张:** ]po[ 是运行整个项目公司或部门的集成系统。 + + +### ProjectLibre 1.9.3 + +![ProjectLibre][11] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +在开源世界中,[ProjectLibre][12] 可能是最接近 Microsoft Project 的产品。它是一个桌面应用程序,支持所有重要的项目计划功能,包括资源日历,基线和成本管理。它还允许您使用 MS-Project 的文件格式导入和导出计划。 + +ProjectLibre 非常适合计划和执行中小型项目。然而,它缺少 MS-Project 中的一些高级功能,并且它的 GUI 并不是最漂亮的。 + +ProjectLibre 用 Java 编写,可用于 Windows,Linux 和macOS,并已获得开放源代码通用公共属性(CPAL)许可证。ProjectLibre 团队目前正在专有许可下开发名为 ProjectLibre Cloud 的 Web 产品。 + + * **最适合:** 个人项目经理,负责中小型项目,或者作为没有完整的 MS-Project 许可证的项目成员的查看者 + * **独特的销售主张:** 这是使用开源软件可以最接近 MS-Project。 + +### GanttProject 2.8.11 + +![GanttProject][13] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[GanttProject][14] 与 ProjectLibre 类似,但它是桌面 Gantt (甘特图)编辑器,但功能集更为有限。 它不支持基线,也不支持非人力资源,并且报告功能受到更多限制。 + +GanttProject 是一个用 Java 编写的桌面应用程序,可在 GPLv3 许可下用于 Windows,Linux 和 macOS。 + + * **最适合:** Simple Gantt (甘特图)或学习基于 Gantt 的项目管理技术。 + * **独特的销售主张:** 它支持程序评估和审阅技术([PERT][15])图表以及使用 WebDAV 的协作。 + +### TaskJuggler 3.7.1 + +![TaskJuggler][16] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[TaskJuggler][17]在大型组织中安排多个并行项目,重点是自动解决资源分配冲突(即资源均衡)。 + +它不是交互式的 Gantt 编辑器,而是类似于编译器的命令行工具:它从文本文件中读取任务列表,并生成一系列报告,这些报告根据分配的资源,依赖项,优先级和许多其他参数为每个任务提供最佳的开始和结束时间。它支持多个项目,基线,资源日历,班次和时区,并且已设计为可扩展到具有许多项目和资源的企业方案。 + +使用特定语法编写 TaskJuggler 输入文件可能超出了普通项目经理的能力。但是,您可以使用 ]project-open[ 作为 TaskJuggler 的图形前端来生成输入,包括缺勤,任务进度和记录的工作时间。当以这种方式使用时,TaskJuggler 成为功能强大的假设情景规划师。 + +TaskJuggler 用 Ruby 编写,并且在 GPLv2 许可下可用于 Windows,Linux 和 macOS。 + + * **最适合:** 由真正的书呆子管理的中大型部门 + * **独特的销售主张:** 它在自动资源均衡方面表现出色。 + +### ProjeQtOr 9.0.4 + +![ProjeQtOr][18] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + +[ProjeQtOr][19] 是适用于 IT 项目的基于 Web 的项目管理应用程序。除项目,工单和活动外,它还支持风险,预算,可交付成果和财务文件,以将项目管理的许多方面集成到单个系统中。 + +ProjeQtOr 为 Gantt 编辑器提供了与 ProjectLibre 类似的功能集,包括按等级划分的任务,依赖关系以及基于计划工作和分配资源。但是,它不支持值的就地编辑(例如,任务名称,估计时间等);用户必须在 Gantt 视图下方的输入表单中更改值,然后保存值。 + +ProjeQtOr 用 PHP 编写,并且在 Affero GPL3 许可下可用于 Windows,Linux 和 macOS。 + + * **最适合:** IT 部门跟踪项目列表 + * **独特的销售主张:** 让您为每个项目存储大量信息,将所有信息保存在一个地方。 + +### 其他工具 + +对于特定的用例,以下系统可能是有效的选项,但由于各种原因,它们被排除在主列表之外。 + +![LIbrePlan][20] + +(Frank Bergmann, [CC BY-SA 4.0][5]) + + * [**LibrePlan**][21] 是一个基于 Web 的项目管理应用程序,致力于 Gantt 图。由于其功能集,它在上面的列表中会占主导地位,但是没有可用于最新 Linux 版本(CentOS 7 或 8)的安装。作者说,更新的说明将很快推出。 + * [**dotProject**][22] 是一个用 PHP 编写的基于 Web 的项目管理系统,可在 GPLv2.x 许可下使用。它包含一个 Gantt 时间轴报告,但是没有编辑它的选项,并且依赖项还不起作用(它们“仅部分起作用”)。 + + * [**Leantime**][23] 是一个基于 Web 的项目管理系统,具有漂亮的用 PHP 编写的 GUI,并且可以在 GPLv2 许可下使用。它包括用于时间表的没有依赖关系 Gantt 时间线。 + * [**Orangescrum**][24] 是基于 Web 的项目管理工具。Gantt 图可以作为付费附件或付费订阅使用。 + * [**Talaia/OpenPPM**][25] 是一个基于 Web 的项目组合管理系统。但是,版本 4.6.1 仍显示“即将推出:交互式 Gantt 图”。 + * [**Odoo**][26] 和 [**OpenProject**][27]都将某些重要功能限制在付费企业版中。 + +在这篇评论中,目的是包括所有带有 Gantt 编辑器和依赖调度的开源项目管理系统。如果我错过了一个项目或歪曲了一些东西,请在评论中让我知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/3/open-source-project-management + +作者:[Frank Bergmann][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/fraber +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kanban_trello_organize_teams_520.png?itok=ObNjCpxt (Kanban-style organization action) +[2]: https://en.wikipedia.org/wiki/Gantt_chart +[3]: https://opensource.com/article/20/3/agiles-vs-waterfall +[4]: https://opensource.com/sites/default/files/uploads/redmine.png (Redmine) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://www.redmine.org/ +[7]: https://redmine.org/plugins/plus_gantt +[8]: https://www.redmine.org/plugins/anko_gantt_chart +[9]: https://opensource.com/sites/default/files/uploads/project-open.png (]project-open[) +[10]: https://www.project-open.com +[11]: https://opensource.com/sites/default/files/uploads/projectlibre.png (ProjectLibre) +[12]: http://www.projectlibre.org +[13]: https://opensource.com/sites/default/files/uploads/ganttproject.png (GanttProject) +[14]: https://www.ganttproject.biz +[15]: https://en.wikipedia.org/wiki/Program_evaluation_and_review_technique +[16]: https://opensource.com/sites/default/files/uploads/taskjuggler.png (TaskJuggler) +[17]: https://taskjuggler.org/ +[18]: https://opensource.com/sites/default/files/uploads/projeqtor.png (ProjeQtOr) +[19]: https://www.projeqtor.org +[20]: https://opensource.com/sites/default/files/uploads/libreplan.png (LIbrePlan) +[21]: https://www.libreplan.dev/ +[22]: https://dotproject.net/ +[23]: https://leantime.io +[24]: https://orangescrum.org/ +[25]: http://en.talaia-openppm.com/ +[26]: https://odoo.com +[27]: http://openproject.org From ea27d0be0053ddeab624e2cd4a50d2745b3a7075 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 25 Apr 2021 08:46:30 +0800 Subject: [PATCH 253/307] translating --- ...e Partitions in Linux -Beginner-s Guide.md | 134 ------------------ ...e Partitions in Linux -Beginner-s Guide.md | 134 ++++++++++++++++++ 2 files changed, 134 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md create mode 100644 translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md diff --git a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md deleted file mode 100644 index f38599901c..0000000000 --- a/sources/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: (How to Delete Partitions in Linux [Beginner’s Guide]) -[#]: via: (https://itsfoss.com/delete-partition-linux/) -[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Delete Partitions in Linux [Beginner’s Guide] -====== - -Managing partitions is serious business, especially when you have to remove them. I find myself doing this frequently, especially after using thumb drives as live disks and Linux installers because they create several partitions that I won’t need afterwards. - -In this tutorial, I will show you how to remove partitions in Linux using both command line and GUI tools. - - * [Delete partition in Linux with GUI tool like GParted][1] - * [Delete partition using Linux commands][2] - - - -Warning! - -You delete the partition, you lose your data. Whenever you are playing with partitions, make sure backup your data. A slight typo or slip of finger could prove costly. Don’t say we didn’t warn you! - -### Remove disk partition using GParted [GUI Method] - -As a desktop Linux user, you probably will be more comfortable and perhaps safer with a GUI-based tool. - -There are [several tools that let you manage partitions on Linux][3]. Depending on your distribution you will have one or even more such tool already installed on your system. - -For this tutorial, I am going to use [GParted][4]. It is a popular open source tool and it’s very easy and intuitive to use. - -The first step is [installing GParted][5] if it isn’t already in your system. You should be able to find it in the software center of your distribution. - -![][6] - -Alternatively, you can use your distribution’s package manager for installing it. In Debian and Ubuntu-based Linux distributions, you can [use the apt install command][7]: - -``` -sudo apt install gparted -``` - -Once installed, let’s open **GParted**. Since you are dealing with disk partitions, you’ll be required to have root access. It will ask for authentication and once it opens you should see a window like this one: - -![][8] - -On the right-upper corner you can select the disk and in the lower screen the partition you want to remove. - -Next, select the option **Delete** from the Partition menu: - -![][9] - -The process is incomplete until you rewrite the partition table. This is a safety measure and it gives you the option to review the changes before confirming it. - -To do this just click on the **Apply All Operations** button located in the toolbar and then **Apply** when asked for confirmation. - -![][10] - -After hitting **Apply**, you will see a progress bar and a results message saying that all the operations were successful. You can close the message and the main window and consider your partition completely deleted from our disk. - -Now that you are aware of the GUI method, let’s move on to the command line. - -### Delete partitions using fdisk command - -Almost every Linux distribution comes with [fdisk][11] by default and we are going to use this tool today. The first thing you need to know is what device is assigned to the disk with the partitions you want to remove. To do that, type the following in the terminal: - -``` -sudo fdisk --list -``` - -This will print all the drives and partitions in our system as well as the assigned devices. You [need to have root access][12] in order for it work. - -In this example, I will work with a USB drive that contains two partitions as shown below: - -![][13] - -The device assigned in the system is /sdb and it has two partitions, sdb1 and sdb2. Now that you identified which device contains the partitions, you can start working on it by using `fdisk` and the path to the device: - -``` -sudo fdisk /dev/sdb -``` - -This will start `fdisk` in command mode. You can always press `m` to see a list of options. - -Next, type `p` and press `Enter` to view the partition information and confirm that you are using the right device. If the wrong device is in use you can use the `q` command to exit `fdisk` and start the procedure again. - -Now enter `d` to delete a partition and it will immediately ask for the partition number, that corresponds to the number listed in the Device column, which in this case are numbers 1 and 2 (as can be seen in the screen capture below) but can and will vary according to the current partition table. - -![][14] - -Let’s remove the second partition by typing `2` and pressing `Enter`. You should see a message saying **“Partition 2 has been deleted**“, but actually, it hasn’t been removed yet. `fdisk` needs one more step to rewrite the partition table and apply the changes. Safety net, you see. - -You need to type `w` and press `Enter` to make the changes permanent. No confirmation is asked. - -After this, you should receive some feedback like the one here: - -![][15] - -Now, use `sudo fdisk --list /dev/sdb` to view the current partition table of the device and you can see that the second partition is completely gone. You are done removing your partition using the terminal and `fdisk` command. Success! - -#### Wrapping up - -And so I end this tutorial on how to remove partitions in Linux using both the terminal and GUI tools. Remember, stay always on the safe side, backup your files before manipulating your partitions and double check that you are using the right device. Deleting a partition will delete everything in it with little to no chance of [recovering][16] it. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/delete-partition-linux/ - -作者:[Chris Patrick Carias Stas][a] -选题:[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/chris/ -[b]: https://github.com/lujun9972 -[1]: tmp.Q615QYIwTl#gparted -[2]: tmp.Q615QYIwTl#fdisk -[3]: https://itsfoss.com/partition-managers-linux/ -[4]: https://gparted.org/index.php -[5]: https://itsfoss.com/gparted/ -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gparted-ubuntu-software-center.png?resize=800%2C348&ssl=1 -[7]: https://itsfoss.com/apt-command-guide/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-004.png?resize=800%2C542&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-005.png?resize=800%2C540&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-006.png?resize=800%2C543&ssl=1 -[11]: https://man7.org/linux/man-pages/man8/fdisk.8.html -[12]: https://itsfoss.com/root-user-ubuntu/ -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-001.png?resize=800%2C255&ssl=1 -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-002.png?resize=800%2C362&ssl=1 -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-003.png?resize=800%2C153&ssl=1 -[16]: https://itsfoss.com/recover-deleted-files-linux/ diff --git a/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md b/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md new file mode 100644 index 0000000000..a97eaefd87 --- /dev/null +++ b/translated/tech/20210421 How to Delete Partitions in Linux -Beginner-s Guide.md @@ -0,0 +1,134 @@ +[#]: subject: (How to Delete Partitions in Linux [Beginner’s Guide]) +[#]: via: (https://itsfoss.com/delete-partition-linux/) +[#]: author: (Chris Patrick Carias Stas https://itsfoss.com/author/chris/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Linux 中删除分区(初学者指南) +====== + +管理分区是一件严肃的事情,尤其是当你不得不删除它们时。我发现自己经常这样做,特别是在使用 U 盘作为实时磁盘和 Linux 安装程序之后,因为它们创建了几个我以后不需要的分区。 + +在本教程中,我将告诉你如何使用命令行和 GUI 工具在 Linux 中删除分区。 + + * [用 GParted 等 GUI 工具删除 Linux 中的分区][1] + * [使用 Linux 命令删除分区][2] + + + +警告! + +你删除了分区,就会失去你的数据。无论何时,当你在操作分区时,一定要备份你的数据。一个轻微的打字错误或手滑都可能是昂贵的。不要说我们没有警告你! + +### 使用 GParted 删除磁盘分区 (GUI 方法) + +作为一个桌面 Linux 用户,你可能会对基于 GUI 的工具感到更舒服,也许更安全。 + +有[几个让你在 Linux 上管理分区的工具][3]。根据你的发行版,你的系统上已经安装了一个甚至多个这样的工具。 + +在本教程中,我将使用 [GParted][4]。它是一个流行的开源工具,使用起来非常简单和直观。 + +第一步是[安装 GParted][5],如果它还没有在你的系统中。你应该能够在你的发行版的软件中心找到它。 + +![][6] + +或者,你也可以使用你的发行版的软件包管理器来安装它。在基于 Debian 和 Ubuntu 的 Linux 发行版中,你可以[使用 apt install 命令][7]: + +``` +sudo apt install gparted +``` + +安装完毕后,让我们打开 **GParted**。由于你正在处理磁盘分区,你需要有 root 权限。它将要求进行认证,打开后,你应该看到一个类似这样的窗口: + +![][8] + +在右上角,你可以选择磁盘,在下面选择你想删除的分区。 + +接下来,从分区菜单中选择 **Delete** 选项: + +![][9] + +这个过程是不完整的,直到你重写分区表。这是一项安全措施,它让你在确认之前可以选择审查更改。 + +要完成它,只需点击位于工具栏中的 **Apply All Operations** 按钮,然后在要求确认时点击 **Apply**。 + +![][10] + +点击 **Apply** 后,你会看到一个进度条和一个结果消息说所有的操作都成功了。你可以关闭该信息和主窗口,并认为你的分区已从磁盘中完全删除。 + +现在你已经知道了 GUI 的方法,让我们继续使用命令行。 + +### 使用 fdisk 命令删除分区 + +几乎每个 Linux 发行版都默认带有 [fdisk][11],我们今天就来使用这个工具。你需要知道的第一件事是,你想删除的分区被分配到哪个设备上了。为此,在终端输入以下内容: + +``` +sudo fdisk --list +``` + +这将打印出我们系统中所有的驱动器和分区,以及分配的设备。你[需要有 root 权限][12],以便让它发挥作用。 + +在本例中,我将使用一个包含两个分区的 USB 驱动器,如下图所示: + +![][13] + +系统中分配的设备是 /sdb,它有两个分区,sdb1 和 sdb2。现在你已经确定了哪个设备包含这些分区,你可以通过使用 `fdisk` 和设备的路径开始操作: + +``` +sudo fdisk /dev/sdb +``` + +这将在命令模式下启动 `fdisk`。你可以随时按 `m` 来查看选项列表。 + +接下来,输入 `p`,然后按`回车`查看分区信息,并确认你正在使用正确的设备。如果使用了错误的设备,你可以使用 `q` 命令退出 `fdisk` 并重新开始。 + +现在输入 `d` 来删除一个分区,它将立即询问分区编号,这与 “Device” 列中列出的编号相对应,在这个例子中是 1 和 2(在下面的截图中可以看到),但是可以也会根据当前的分区表而有所不同。 + +![][14] + +让我们通过输入 `2` 并按下`回车`来删除第二个分区。你应该看到一条信息:**“Partition 2 has been deleted”**,但实际上,它还没有被删除。`fdisk` 还需要一个步骤来重写分区表并应用这些变化。你看,这就是完全网。 + +你需要输入 `w`,然后按`回车`来使这些改变成为永久性的。没有再要求确认。 + +在这之后,你应该看到下面这样的反馈: + +![][15] + +现在,使用 `sudo fdisk --list /dev/sdb` 查看该设备的当前分区表,你可以看到第二个分区已经完全消失。你已经完成了使用终端和 `fdisk` 命令来删除你的分区。成功了! + +#### 总结 + +这样,我结束了这个关于如何使用终端和 GUI 工具在 Linux 中删除分区的教程。记住,要始终保持安全,在操作分区之前备份你的文件,并仔细检查你是否使用了正确的设备。删除一个分区将删除其中的所有内容,而几乎没有[恢复][16]的机会。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/delete-partition-linux/ + +作者:[Chris Patrick Carias Stas][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/chris/ +[b]: https://github.com/lujun9972 +[1]: tmp.Q615QYIwTl#gparted +[2]: tmp.Q615QYIwTl#fdisk +[3]: https://itsfoss.com/partition-managers-linux/ +[4]: https://gparted.org/index.php +[5]: https://itsfoss.com/gparted/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/gparted-ubuntu-software-center.png?resize=800%2C348&ssl=1 +[7]: https://itsfoss.com/apt-command-guide/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-004.png?resize=800%2C542&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-005.png?resize=800%2C540&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-006.png?resize=800%2C543&ssl=1 +[11]: https://man7.org/linux/man-pages/man8/fdisk.8.html +[12]: https://itsfoss.com/root-user-ubuntu/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-001.png?resize=800%2C255&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-002.png?resize=800%2C362&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/removing-partitions-linux-003.png?resize=800%2C153&ssl=1 +[16]: https://itsfoss.com/recover-deleted-files-linux/ From bd934840ee17e7fc37ea35345ef73db4ccd3c2a3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 25 Apr 2021 08:58:49 +0800 Subject: [PATCH 254/307] translating --- sources/tech/20210422 Restore an old MacBook with Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210422 Restore an old MacBook with Linux.md b/sources/tech/20210422 Restore an old MacBook with Linux.md index e83554ad66..381613d79c 100644 --- a/sources/tech/20210422 Restore an old MacBook with Linux.md +++ b/sources/tech/20210422 Restore an old MacBook with Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7c0425d94d9f9540b6675291329964129319773a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 25 Apr 2021 10:07:49 +0800 Subject: [PATCH 255/307] Rename sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md to sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md --- .../20210424 Can We Recommend Linux for Gaming in 2021.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210424 Can We Recommend Linux for Gaming in 2021.md (100%) diff --git a/sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md b/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md similarity index 100% rename from sources/news/20210424 Can We Recommend Linux for Gaming in 2021.md rename to sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md From 515a5630a37e937089706efe573f34bc205db7c8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 10:34:13 +0800 Subject: [PATCH 256/307] PRF @Kevin3599 --- ...n Arch is a Step in the Right Direction.md | 83 +++++++------------ 1 file changed, 32 insertions(+), 51 deletions(-) diff --git a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md index 71fbbdea3a..7bcbfa63f7 100644 --- a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ b/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -2,72 +2,59 @@ [#]: via: (https://news.itsfoss.com/arch-new-guided-installer/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: (Kevin3599 ) -[#]: reviewer: ( ) +[#]: translator: (Kevin3599) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -Arch Linux中的引导式安装程序是迈向正确的一步 +Arch Linux 中的引导式安装程序是迈向正确的一步 ====== -20年来,Arch Linux为用户提供了完全定制和独特的系统的权限。多年来,它以牺牲用户友好性为代价赢得了在定制方面独有的声誉。 +> 在 Arch ISO 中加入一个可选的引导式安装程序,对新手和高级用户都有好处。 -作为滚动发行版本,Arch Linux不提供任何固定发行版本,而是每月更新一次。但是,如果您在最近几周下载了Arch Linux,那么您很可能已经注意到了一个新的附加功能:archinstall。它使Arch Linux更加易于安装。 +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-opinion.png?w=1200&ssl=1) + +20 年来,Arch Linux 为用户提供了一个完全定制、独特的系统。这些年来,它以牺牲用户友好性为代价,赢得了在定制方面独有的声誉。 + +作为滚动发行版本,Arch Linux 不提供任何固定发行版本,而是每月更新一次。但是,如果你在最近几周下载了 Arch Linux,那么你很可能已经注意到了一个新的附加功能:archinstall。它使 Arch Linux 更加易于安装。 ![][3] -今天,我将探讨archinstall 的发布对未来的Arch Linux项目和发行版意味着什么。 +今天,我将探讨 archinstall 的发布对未来的 Arch Linux 项目和发行版意味着什么。 + +### Arch Linux 新的发展方向? -### Arch Linux新的发展方向? ![][4] -尽管很多人对此感到惊讶,但默认情况下包含官方安装程序实际上是非常明智的举动。这意味着ArchLinux的发展方向发生变化,即在保留使其知名的定制性和用户独特性的同时更加侧重用户的易用性。 +尽管很多人对此感到惊讶,但默认情况下包含官方安装程序实际上是非常明智的举动。这意味着 Arch Linux 的发展方向发生变化,即在保留使其知名的定制性同时更加侧重用户的易用性。 -在该安装程式的GitHub页面上有这样的描述: +在该安装程序的 GitHub 页面上有这样的描述: -> “引导性安装程式会给用户提供一个友好的安装方式,但是关键在于这个安装程式是选择性的,它是可选的并且永远不会强迫用户使用其进行安装。” +> “引导性安装程序会给用户提供一个友好的逐步安装方式,但是关键在于这个安装程序是个选项,它是可选的,绝不会强迫用户使用其进行安装。” -这意味着新的安装程式不会影响高级的进阶用户,同时也使得其可以向更广泛的受众开放,在这一改动所带来的许多优点之中,一个显著的优点即是:更广泛的用户。 +这意味着新的安装程序不会影响高级用户,同时也使得其可以向更广泛的受众开放,在这一改动所带来的许多优点之中,一个显著的优点即是:更广泛的用户。 -更多的用户意味着更多的项目,不管其是通过网络捐赠或在Arch Linux下的开发,通过这些项目贡献,不管是新用户还是有经验的用户的使用体验都会得到提升。 +更多的用户意味着对项目的更多支持,不管其是通过网络捐赠或参与 Arch Linux 的开发,随着这些项目贡献的增加,不管是新用户还是有经验的用户的使用体验都会得到提升。 -### “这必然要发生” +### 这必然要发生 -回顾过去,我们可以看到安装介质的许多新增功能对新用户有所帮助。这些示例包括pacstrap(安装基本系统的工具)和反射器(查找最佳pacman镜像的工具)。 +回顾过去,我们可以看到安装介质增加了许多对新用户有所帮助的功能。这些示例包括 pacstrap(一个安装基本系统的工具)和 reflector(查找最佳 pacman 镜像的工具)。 -另外,多年来,用户一直在追求使用脚本安装的方法,新安装程序允许了用户使用安装脚本。同时能够使用Python编写脚本,这使管理员的部署更加容易,这使其成为非常有吸引力的选择。更多可定制性(以某种方式?) +另外,多年来,用户一直在追求使用脚本安装的方法,新安装程序允许了用户使用安装脚本。它能够使用 Python 编写脚本,这使得管理员的部署更加容易,成为一个非常有吸引力的选择。 -尽管这看上去可能有些反直觉,但是这个安装程式很可能能够增进Arch Linux的可定制性。当前,Arch定制性的最大瓶颈是用户的技术水平,而这一问题能够通过archinstall解决。 +### 更多可定制性(以某种方式?) -通过由ArchLinux提供的安装程序,用户不需要掌握创建完美开发环境的技巧,安装程序可以帮助用户完成这些工作,这提供了广泛的自定义选项,是普通用户难以实现的。 +尽管这看上去可能有些反直觉,但是这个安装程序实际上能够增进 Arch Linux 的可定制性。当前,Arch Linux 定制性的最大瓶颈是用户的技术水平,而这一问题能够通过 archinstall 解决。 -###思想总结 +有了新的安装程序,用户不需要掌握创建完美开发环境的技巧,安装程序可以帮助用户完成这些工作,这提供了广泛的自定义选项,是普通用户难以实现的。 -有了这一新功能,Arch Linux似乎正在向着“用户友好”这一软件设计哲学靠近,新安装程序为新手和高级用户提供了广泛的好处。其中包括更广泛的定制性和更大的用户社区。 +### 总结 -总而言之,这个新变动对整个ArchLinux社区都会产生积极的影响。 - -你对这个Arch Linux安装程式怎么看?是否已经尝试过它了呢? - -### - -![][7] -我不感兴趣 - -#### 关联 - - * 通过最新的ISO刷新中的更改,现在更容易安装Arch Linux - * ![][8] ![][9] - - - * EndeavourOS的2021年第一个版本带来了Linux内核5.10 LTS,Xfce 4.16等[10] - * ![][8] ![][11] - - - * Linux Kernel 5.9终止了生命。这就是您现在应该做的! - * ![][8] ![Linux kernel 5.9 reached end of life][13] +有了这一新功能,Arch Linux 似乎正在向着“用户友好”这一软件设计哲学靠近,新安装程序为新手和高级用户提供了广泛的好处。其中包括更广泛的定制性和更大的用户社区。 +总而言之,这个新变动对整个 Arch Linux 社区都会产生积极的影响。 +你对这个 Arch Linux 安装程序怎么看?是否已经尝试过它了呢? -------------------------------------------------------------------------------- @@ -75,8 +62,8 @@ via: https://news.itsfoss.com/arch-new-guided-installer/ 作者:[Jacob Crume][a] 选题:[lujun9972][b] -译者:[Kevin3599](https://github.com/) -校对:[校对者ID](https://github.com/校对者ID) +译者:[Kevin3599](https://github.com/Kevin3599) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -84,14 +71,8 @@ via: https://news.itsfoss.com/arch-new-guided-installer/ [b]: https://github.com/lujun9972 [1]: https://itsfoss.com/rolling-release/ [2]: https://news.itsfoss.com/arch-linux-easy-install/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQxMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzM3MScgd2lkdGg9JzM3MScgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[3]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-install-tool.png?resize=780%2C411&ssl=1 +[4]: https://i0.wp.com/github.com/archlinux/archinstall/raw/master/docs/logo.png?resize=371%2C371&ssl=1 [5]: https://man.archlinux.org/man/pacstrap.8 [6]: https://wiki.archlinux.org/index.php/Reflector -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzI1MCcgd2lkdGg9Jzc1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/arch-linux-easy-install-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[10]: https://news.itsfoss.com/endeavouros-2021-release/ -[11]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/endeavouros-2021-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 -[12]: https://news.itsfoss.com/kernel-5-9-end-of-life/ -[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/linux-kerne-5-9-eol.png?fit=1200%2C675&ssl=1&resize=350%2C200 + From 05b4e8f769d25be4704a9fcc99f834b3a482c5d7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 10:36:28 +0800 Subject: [PATCH 257/307] PUB @Kevin3599 https://linux.cn/article-13328-1.html --- ...ided Installer in Arch is a Step in the Right Direction.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210420 The Guided Installer in Arch is a Step in the Right Direction.md (98%) diff --git a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md b/published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md similarity index 98% rename from translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md rename to published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md index 7bcbfa63f7..3a6cc82345 100644 --- a/translated/news/20210420 The Guided Installer in Arch is a Step in the Right Direction.md +++ b/published/20210420 The Guided Installer in Arch is a Step in the Right Direction.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (Kevin3599) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13328-1.html) Arch Linux 中的引导式安装程序是迈向正确的一步 ====== From e20120adea439d58fcfda7797d9bcfaacc7a9f17 Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Sun, 25 Apr 2021 14:31:57 +0800 Subject: [PATCH 258/307] =?UTF-8?q?=E7=94=B3=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...prove your productivity with this Linux automation tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md b/sources/tech/20210203 Improve your productivity with this Linux automation tool.md index 9bd1ea3953..86457a2e54 100644 --- a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md +++ b/sources/tech/20210203 Improve your productivity with this Linux automation tool.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (stevenzdg988) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -167,7 +167,7 @@ via: https://opensource.com/article/21/2/linux-autokey 作者:[Matt Bargenquast][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[stevenzdg988](https://github.com/stevenzdg988) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b21dc4b3d13f1b1cfb49051c38cda0b4af5efed1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 17:41:31 +0800 Subject: [PATCH 259/307] PRF @stevenzdg988 --- ...at You Can Deploy on Your Linux Servers.md | 151 ++++++++---------- 1 file changed, 69 insertions(+), 82 deletions(-) diff --git a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md index 8d397b2c9b..1aadf08382 100644 --- a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ b/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -1,24 +1,24 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) [#]: via: (https://itsfoss.com/open-source-forum-software/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -9 个可以在 Linux 服务器上部署的开源论坛软件 +11 个可以部署在 Linux 服务器上的开源论坛软件 ====== -_**是否想要建立社区论坛或客户支持门户站点?以下是一些可以在服务器上部署的最佳开源论坛软件。**_ +> 是否想要建立社区论坛或客户支持门户站点?以下是一些可以在服务器上部署的最佳开源论坛软件。 -就像我们的 [FOSS 社区][1]论坛一样,重要的是随时建立一个让志趣相投的人可以讨论,互动和寻求支持的平台。 +就像我们的论坛一样,重要的是建立一个让志趣相投的人可以讨论,互动和寻求支持的平台。 -论坛为用户(或客户)提供了一个满足他们大部分在 Internet(互联网)上不容易找到的东西(软件)的空间。 +论坛为用户(或客户)提供了一个空间,让他们可以接触到在互联网上大多数情况下不容易找到的东西。 -如果您是一家企业,则可以聘请开发人员团队并按照自己的方式建立自己的论坛,但这会增加大量预算。 +如果你是一家企业,则可以聘请开发人员团队并按照自己的方式建立自己的论坛,但这会增加大量预算。 -幸运的是,您可以在服务器上部署多种出色的开源论坛软件,而且一切顺利!在此过程中,您将节省很多钱,但仍能获得所需的东西(软件)。 +幸运的是,有几个令人印象深刻的开源论坛软件,你只需要将其部署在你的服务器上就万事大吉了!在此过程中,你将节省很多钱,但仍能获得所需的东西。 在这里,我列出了可以在 Linux 服务器上安装的最佳开源论坛软件列表。 @@ -26,152 +26,139 @@ _**是否想要建立社区论坛或客户支持门户站点?以下是一些 ![][2] -如果您尚未建立过网站,则在部署论坛之前,可能需要看一下[某些开源网站创建工具][3]。 +如果你尚未建立过网站,则在部署论坛之前,可能需要看一下 [某些开源网站创建工具][3]。 -_**注意:** 列表没有特定的排名顺序。_ +**注意:** 此列表没有特定的排名顺序。 -#### 1\. Discourse (现代和流行) +#### 1、Discourse(现代、流行) ![][4] -Discourse 是人们用来部署配置讨论平台的最流行的现代论坛软件。实际上,我们的[FOSS 社区][1]论坛使用了 Discourse 平台。 +[Discourse][7] 是人们用来部署配置讨论平台的最流行的现代论坛软件。实际上,[It's FOSS 社区][1] 论坛使用了 Discourse 平台。 -它提供了我所知道的大多数基本功能,包括电子邮件通知,审核工具,样式自定义选项,像 Slack/WordPress 的第三方集成,甚至更多。 +它提供了我所知道的大多数基本功能,包括电子邮件通知、审核工具、样式自定义选项,Slack/WordPress 等第三方集成等等。 -它是完全免费的自我托管,您也可以在 [GitHub][5]上找到该项目。如果您要减少将其部署在自托管服务器上的麻烦,可以决定选择 [Discourse 提供的自托管服务][6](肯定会很昂贵)。 +它的自托管是完全免费的,你也可以在 [GitHub][5] 上找到该项目。如果你要减少将其部署在自托管服务器上的麻烦,可以选择 [Discourse 提供的托管服务][6](肯定会很昂贵)。 -[Discourse][7] - -#### 2\. Talkyard (来自 Discourse 和 StackOverflow 的灵感) +#### 2、Talkyard(受 Discourse 和 StackOverflow 启发) ![][8] -Talkyard 是完全免费使用的开源项目。它看起来很像“ Discourse ”,但是如果您对其进行检查,则会有区别。 +[Talkyard][10] 是完全免费使用的,是一个开源项目。它看起来很像 Discourse,但是如果你深入了解一下,还是有区别的。 -您可以在这从 StackOverflow 获得大多数关键功能,以及在论坛平台上期望得到的所有基本功能。它可能不是一个流行的论坛解决方案,但是如果您想要类似于 Discourse 的功能以及一些有趣的功能,那么值得尝试一下。 +你可以在这里获得 StackOverflow 的大多数关键功能,以及在论坛平台上期望得到的所有基本功能。它可能不是一个流行的论坛解决方案,但是如果你想要类似于 Discourse 的功能以及一些有趣的功能,那么值得尝试一下。 -您可以在他们的 [GitHub 页面][9] 中进一步了解它。 +你可以在他们的 [GitHub 页面][9] 中进一步了解它。 -[Talkyard][10] +#### 3、Forem (一种独特的社区平台,正在测试中) -#### 3\. NodeBB (现代且功能齐全) +![](https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/dev-community-forem.png?w=800&ssl=1) + +你可能以前没有听说过 [Forem](https://www.forem.com/),但它支持了 [dev.to](https://dev.to/)(这是一个越来越受欢迎的开发者社区网站)。 + +它仍然处于测试阶段,所以你或许不会选择在生产服务器上实验。但是,你可以通过在他们的官方网站上填写一个表格并与他们取得联系,让他们为你托管。 + +尽管没有官方的功能列表来强调所有的东西,但如果我们以 [dev.to](https://dev.to/) 为例,你会得到许多基本的特性和功能,如社区列表、商店、帖子格式化等。你可以在他们的 [公告帖子](https://dev.to/devteam/for-empowering-community-2k6h) 中阅读更多关于它提供的内容,并在 [GitHub](https://github.com/forem/forem) 上探索该项目。 + +#### 4、NodeBB(现代化、功能齐全) ![][11] -NodeBB 是基于[Node.js][12]的开源论坛软件。它的目标是简单,简洁和快速。首先,它面向可用的托管计划的组织和企业。但是,您也可以选择自己托管它。 +[NodeBB][14] 是一个基于 [Node.js][12] 的开源论坛软件。它的目标是简单、优雅和快速。首先,它面向有托管计划的组织和企业。但是,你也可以选择自己托管它。 -您还可以获得具有聊天和通知支持的实时本地分析功能。它还提供一个 API 将其与现有产品中的任何一个集成。它还支持审核工具和打击垃圾邮件的工具。 +你还可以获得实时本地分析功能,以及聊天和通知支持。它还提供一个 API,可以将其与你的现有产品集成。它还支持审核工具和打击垃圾邮件的工具。 -您可以获得一些立即可用的第三方集成支持,例如 WordPress,Mailchimp 等。 +你可以获得一些开箱即用的第三方集成支持,例如 WordPress、Mailchimp 等。 -请在它们的[GitHub页面][13]或官方网站上进一步了解它。 +请在他们的 [GitHub 页面][13] 或官方网站上可以进一步了解它。 -[NodeBB][14] - -#### 4\. Vanilla 论坛(企业版) +#### 5、Vanilla 论坛(面向企业) ![][15] -Vanilla Forums 主要是一款企业版的论坛软件,具有标记平台的基本功能,为客户提供问答,还可以对帖子进行投票。 +[Vanilla 论坛][17] 主要是一款以企业为中心的论坛软件,它的基本功能是为你的平台打造品牌,为客户提供问答,还可以对帖子进行投票。 -用户体验具有现代的外观,并且已被像 EA,Adobe 和其他一些大公司使用。 +用户体验具有现代的外观,并且已被像 EA、Adobe 和其他一些大公司使用。 -当然,如果您想尝试基于云的 Vanilla 论坛(由专业团队管理)以及对某些高级功能的访问权,请随时请求演示。无论哪种情况,您都可以选择社区版,该社区版可以免费使用大多数负责自托管和管理的最新功能。 +当然,如果你想尝试基于云的 Vanilla 论坛(由专业团队管理)以及对某些高级功能的访问权,可以随时申请演示。无论哪种情况,你都可以选择社区版,该社区版可以免费使用大多数最新功能,但需要自己托管和管理。 -您可以在他们的官方网站和[GitHub 页面][16]上进一步了解它。 +你可以在他们的官方网站和 [GitHub 页面][16] 上进一步了解它。 -[Vanilla 论坛][17] - -**推荐阅读:** - -![][18] - -#### [建立在线购物网站的最佳开源电子商务平台][19] - -想要创建一个在线购物网站吗?以下是一些可以在自己的 Linux 服务器上部署的开源电子商务平台。 - -#### 5\. bbPress (来自 WordPress) +#### 6、bbPress (来自 WordPress) ![][20] -bbPress 是由 WordPress 的创建者构建的可靠论坛软件。旨在提供一个简单而活泼的论坛体验。 +[bbPress][22] 是一个可靠的论坛软件,由 WordPress 的创建者建立。旨在提供一个简单而迅速的论坛体验。 -用户界面看起来很老旧,但易于使用,并提供了您通常在论坛软件中需要的基本功能。审核工具既简单又易于设置。您可以使用可用的插件扩展功能,并从几个可用的主题中进行选择以调整论坛的外观。 +用户界面看起来很老旧,但易于使用,它提供了你通常在论坛软件中需要的基本功能。审核工具很好用,易于设置。你可以使用现有的插件扩展功能,并从几个可用的主题中进行选择以调整论坛的外观。 -如果您只想要一个没有花哨功能的简单论坛平台,bbPress 应该是完美的。您也可以查看他们的[GitHub 页面][21]了解更多信息。 +如果你只想要一个没有花哨功能的简单论坛平台,bbPress 应该是完美的。你也可以查看他们的 [GitHub 页面][21] 了解更多信息。 -[bbPress][22] - -#### 6\. phpBB (经典论坛软件) +#### 7、phpBB(经典论坛软件) ![][23] -如果您想要传统的论坛设计而只想要基本功能,则 phpBB 软件是一个不错的选择。当然,您可能无法获得最佳的用户体验或功能,但是作为传统设计论坛平台,它是实用的并且非常有效。 +如果你想要传统的论坛设计,只想要基本功能,则 [phpBB][25] 软件是一个不错的选择。当然,你可能无法获得最佳的用户体验或功能,但是作为按传统设计的论坛平台,它是实用的并且非常有效。 -尤其是,对于习惯使用传统方法的用户而言,这将是一种简单而有效的解决方案。 +尤其是,对于习惯使用传统方式的用户而言,这将是一种简单而有效的解决方案。 -不仅限于简单,而且与普通托管服务提供商一起设置起来更容易。您可以在每个共享主机平台上获得一键式安装功能,因此也不需要太多的技术知识来进行设置。 +不仅仅是简单,而且在一般的托管供应商那里,它的设置也是非常容易的。在任何共享主机平台上,你都能获得一键式安装功能,因此也不需要太多的技术知识来进行设置。 -您可以在他们的官方网站或[GitHub 页面][24]上找到更多有关它的信息。 +你可以在他们的官方网站或 [GitHub 页面][24] 上找到更多有关它的信息。 -[phpBB][25] - -#### 7\. Simple Machines 论坛(另一个经典) +#### 8、Simple Machines 论坛(另一个经典) ![][26] -与 phpBB 类似,Simple Machines (简单机器)论坛是论坛平台的另一种基本(或简单)实现。您可能无法长期(至少不容易)自定义外观,但是默认外观是干净的,并提供了良好的用户体验。 +与 phpBB 类似,[Simple Machines 论坛][27] 是另一种基本(或简单)的论坛。很大程度上你可能无法自定义外观(至少不容易),但是默认外观是干净整洁的,提供了良好的用户体验。 -就个人而言,相比 php BB 我更喜欢它,但是您可以前往他们的[官方网站][27]进行进一步的探索。同样,您可以使用一键安装方法在任何共享的托管服务上轻松安装 Simple Machines 论坛。 +就个人而言,相比 php BB 我更喜欢它,但是你可以前往他们的 [官方网站][27] 进行进一步的探索。同样,你可以使用一键安装方法在任何共享托管服务上轻松安装 Simple Machines 论坛。 -[Simple Machines 论坛][27] - -#### 8\. FluxBB (old school) +#### 9、FluxBB(古典) ![][28] -FluxBB 是另一个简单,轻量级的开源论坛。与其他的相比,它可能维护的不是非常活跃,但是如果您只想部署一个由几个用户组成的基本论坛,则可以轻松尝试一下。 +[FluxBB][30] 是另一个简单、轻量级的开源论坛。与其他的相比,它可能维护的不是非常积极,但是如果你只想部署一个只有很少几个用户的基本论坛,则可以轻松尝试一下。 -您可以在他们的官方网站和 [GitHub 页面][29]上找到更多有关它的信息。 +你可以在他们的官方网站和 [GitHub 页面][29] 上找到更多有关它的信息。 -[FluxBB][30] - -#### 9\. MyBB (不太受欢迎,但值得一看) +#### 10、MyBB(不太流行,但值得看看) ![][31] -MyBB 是一款独特的开源论坛软件,它提供多种样式,并包含您需要的基本功能。 +[MyBB][33] 是一款独特的开源论坛软件,它提供多种样式,并包含你需要的基本功能。 -从插件支持和审核工具开始,您将获得管理大型社区所需的一切。它还支持类似于 Discourse 和类似论坛软件面向个人用户的私人消息传递。 +从插件支持和审核工具开始,你将获得管理大型社区所需的一切。它还支持类似于 Discourse 和同类论坛软件面向个人用户的私人消息传递。 -它可能不是一个流行的选项,但是它可以检查大多数用例,并且完全免费。您可能获得支持并在 [GitHub][32]上探索该项目。 +它可能不是一个流行的选项,但是它可以满足大多数用例,并且完全免费。你可以在 [GitHub][32] 上得到支持和探索这个项目。 -[MyBB][33] - -#### 额外收获: Flarum (测试版) +#### 11、Flarum(测试版) ![][34] -如果您想要更简单和独特的(论坛),请看一下 Flarum。它是一款轻量级的论坛软件,旨在以移动为先,同时提供快速的体验。 +如果你想要更简单和独特的论坛,请看一下 [Flarum][37]。它是一款轻量级的论坛软件,旨在以移动为先,同时提供快速的体验。 -它支持某些第三方集成,也可以使用扩展来扩展功能。就我个人而言,它看起来很漂亮。我没有机会尝试它,您可以看一下它的[文档][35],可以肯定地认为它具有论坛所需的所有必要功能的特征。 +它支持某些第三方集成,也可以使用扩展来扩展功能。就我个人而言,它看起来很漂亮。我没有机会尝试它,你可以看一下它的 [文档][35],可以肯定它具有论坛所需的所有必要功能的特征。 -值得注意的是 Flarum 是相当新的,因此仍处于测试阶段。您可能需要先将其部署在测试服务器上测试后再应用到生产环境。请查看其 [GitHub 页面][36]了解更多详细信息。 +值得注意的是 Flarum 是相当新的,因此仍处于测试阶段。你可能需要先将其部署在测试服务器上测试后,再应用到生产环境。请查看其 [GitHub 页面][36] 了解更多详细信息。 -[Flarum][37] +#### 补充:Lemmy(更像是 Reddit 的替代品,但也是一个不错的选择) -无法自我托管?让我们来帮助您 +![](https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/lemmy-forum.png?w=800&ssl=1) -部署开源应用程序和管理 Linux 服务器需要专业知识和花费一些时间。如果两者都不缺,但仍然希望拥有自己的开源软件实例,我们可以为您提供帮助。 -通过我们的新项目 [High on Cloud][38],您可以在发展社区论坛的过程中将部署和服务器管理部分留给我们。 +一个用 [Rust](https://www.rust-lang.org/) 构建的 Reddit 的联盟式论坛的替代品。它的用户界面很简单,有些人可能觉得它不够直观,无法获得有吸引力的论坛体验。 + +其联盟网络仍在构建中,但如果你想要一个类似 Reddit 的社区平台,你可以很容易地将它部署在你的 Linux 服务器上,并制定好管理规则、版主,然后就可以开始了。它支持跨版发帖(参见 Reddit),以及其他基本功能,如标签、投票、用户头像等。 + +你可以通过其 [官方文档](https://lemmy.ml/docs/about.html) 和 [GitHub 页面](https://github.com/LemmyNet/lemmy) 探索更多信息。 ### 总结 -大多数开源论坛软件都为基本用例提供几乎相同的功能。如果您正在寻找特定的内容,则可能需要浏览其文档。 +大多数开源论坛软件都为基本用例提供了几乎相同的功能。如果你正在寻找特定的功能,则可能需要浏览其文档。 就个人而言,我推荐 Discourse。它很流行,外观现代,拥有大量的用户基础。 -您认为最好的开源论坛软件是什么?我是否错过了你的偏爱?在下面的评论中让我知道。 +你认为最好的开源论坛软件是什么?我是否错过了你的偏爱?在下面的评论中让我知道。 -------------------------------------------------------------------------------- @@ -180,7 +167,7 @@ via: https://itsfoss.com/open-source-forum-software/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c2cc61506fac47ce706fb6e5f13c99331ebfb4f0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 25 Apr 2021 17:42:42 +0800 Subject: [PATCH 260/307] PUB @stevenzdg988 https://linux.cn/article-13329-1.html --- ...orum Software That You Can Deploy on Your Linux Servers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md (99%) diff --git a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md b/published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md similarity index 99% rename from translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md rename to published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md index 1aadf08382..74d7263544 100644 --- a/translated/tech/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md +++ b/published/20201204 9 Open Source Forum Software That You Can Deploy on Your Linux Servers.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13329-1.html) [#]: subject: (9 Open Source Forum Software That You Can Deploy on Your Linux Servers) [#]: via: (https://itsfoss.com/open-source-forum-software/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From 920ce8ed57de2258d1d441dcb673f55830c16b65 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Sun, 25 Apr 2021 21:32:12 +0800 Subject: [PATCH 261/307] Update and rename sources/tech/20210421 Optimize your Python code with C.md to translated/tech/20210421 Optimize your Python code with C.md --- ...210421 Optimize your Python code with C.md | 208 ------------------ ...210421 Optimize your Python code with C.md | 207 +++++++++++++++++ 2 files changed, 207 insertions(+), 208 deletions(-) delete mode 100644 sources/tech/20210421 Optimize your Python code with C.md create mode 100644 translated/tech/20210421 Optimize your Python code with C.md diff --git a/sources/tech/20210421 Optimize your Python code with C.md b/sources/tech/20210421 Optimize your Python code with C.md deleted file mode 100644 index e000b1fbf0..0000000000 --- a/sources/tech/20210421 Optimize your Python code with C.md +++ /dev/null @@ -1,208 +0,0 @@ -[#]: subject: (Optimize your Python code with C) -[#]: via: (https://opensource.com/article/21/4/cython) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (ShuyRoy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Optimize your Python code with C -====== -Cython creates C modules that speed up Python code execution, important -for complex applications where an interpreted language isn't efficient. -![Hands on a keyboard with a Python book ][1] - -Cython is a compiler for the Python programming language meant to optimize performance and form an extended Cython programming language. As an extension of Python, [Cython][2] is also a superset of the Python language, and it supports calling C functions and declaring C types on variables and class attributes. This makes it easy to wrap external C libraries, embed C into existing applications, or write C extensions for Python in syntax as easy as Python itself. - -Cython is commonly used to create C modules that speed up Python code execution. This is important in complex applications where an interpreted language isn't efficient. - -### Install Cython - -You can install Cython on Linux, BSD, Windows, or macOS using Python: - - -``` -`$ python -m pip install Cython` -``` - -Once installed, it's ready to use. - -### Transform Python into C - -A good way to start with Cython is with a simple "hello world" application. It's not the best demonstration of Cython's advantages, but it shows what happens when you're using Cython. - -First, create this simple Python script in a file called `hello.pyx` (the `.pyx` extension isn't magical and it could technically be anything, but it's Cython's default extension): - - -``` -`print("hello world")` -``` - -Next, create a Python setup script. A `setup.py` file is like Python's version of a makefile, and Cython can use it to process your Python code: - - -``` -from setuptools import setup -from Cython.Build import cythonize - -setup( -    ext_modules = cythonize("hello.pyx") -) -``` - -Finally, use Cython to transform your Python script into C code: - - -``` -`$ python setup.py build_ext --inplace` -``` - -You can see the results in your project directory. Cython's `cythonize` module transforms `hello.pyx` into a `hello.c` file and a `.so` library. The C code is 2,648 lines, so it's quite a lot more text than the single line of `hello.pyx` source. The `.so` library is also over 2,000 times larger than its source (54,000 compared to 20 bytes). Then again, Python is required to run a single Python script, so there's a lot of code propping up that single-line `hello.pyx` file. - -To use the C code version of your Python "hello world" script, open a Python prompt and import the new `hello` module you created: - - -``` ->>> import hello -hello world -``` - -### Integrate C code into Python - -A good generic test of computational power is calculating prime numbers. A prime number is a positive number greater than 1 that produces a positive integer only when divided by 1 or itself. It's simple in theory, but as numbers get larger, the calculation requirements also increase. In pure Python, it can be done in under 10 lines of code: - - -``` -import sys - -number = int(sys.argv[1]) -if not number <= 1: -    for i in range(2, number): -        if (number % i) == 0: -            print("Not prime") -            break -else: -    print("Integer must be greater than 1") -``` - -This script is silent upon success and returns a message if the number is not prime: - - -``` -$ ./prime.py 3 -$ ./prime.py 4 -Not prime. -``` - -Converting this to Cython requires a little work, partly to make the code appropriate for use as a library and partly for performance. - -#### Scripts and libraries - -Many users learn Python as a scripting language: you tell Python the steps you want it to perform, and it does the work. As you learn more about Python (and open source programming in general), you learn that much of the most powerful code out there is in the libraries that other applications can harness. The _less_ specific your code is, the more likely it can be repurposed by a programmer (you included) for other applications. It can be a little more work to decouple computation from workflow, but in the end, it's usually worth the effort. - -In the case of this simple prime number calculator, converting it to Cython begins with a setup script: - - -``` -from setuptools import setup -from Cython.Build import cythonize - -setup( -    ext_modules = cythonize("prime.py") -) -``` - -Transform your script into C: - - -``` -`$ python setup.py build_ext --inplace` -``` - -Everything appears to be working well so far, but when you attempt to import and use your new module, you get an error: - - -``` ->>> import prime -Traceback (most recent call last): -  File "<stdin>", line 1, in <module> -  File "prime.py", line 2, in init prime -    number = sys.argv[1] -IndexError: list index out of range -``` - -The problem is that a Python script expects to be run from a terminal, where arguments (in this case, an integer to test as a prime number) are common. You need to modify your script so that it can be used as a library instead. - -#### Write a library - -Libraries don't use system arguments and instead accept arguments from other code. Instead of using `sys.argv` to bring in user input, make your code a function that accepts an argument called `number` (or `num` or whatever variable name you prefer): - - -``` -def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") -``` - -This admittedly makes your script somewhat difficult to test because when you run the code in Python, the `calculate` function is never executed. However, Python programmers have devised a common, if not intuitive, workaround for this problem. When the Python interpreter executes a Python script, there's a special variable called `__name__` that gets set to `__main__`, but when it's imported as a module, `__name__` is set to the module's name. By leveraging this, you can write a library that is both a Python module and a valid Python script: - - -``` -import sys - -def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") - -if __name__ == "__main__": -    number = sys.argv[1]     -    calculate( int(number) ) -``` - -Now you can run the code as a command: - - -``` -$ python ./prime.py 4 -Not a prime -``` - -And you can convert it to Cython for use as a module: - - -``` ->>> import prime ->>> prime.calculate(4) -Not prime -``` - -### C Python - -Converting code from pure Python to C with Cython can be useful. This article demonstrates how to do that part, yet there are Cython features to help you optimize your code before conversion, options to analyze your code to find when Cython interacts with C, and much more. If you're using Python, but you're looking to enhance your code with C code or further your understanding of how libraries provide better extensibility than scripts, or if you're just curious about how Python and C can work together, then start experimenting with Cython. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/cython - -作者:[Alan Smithee][a] -选题:[lujun9972][b] -译者:[ShuyRoy](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alansmithee -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) -[2]: https://cython.org/ diff --git a/translated/tech/20210421 Optimize your Python code with C.md b/translated/tech/20210421 Optimize your Python code with C.md new file mode 100644 index 0000000000..ded4e5abe0 --- /dev/null +++ b/translated/tech/20210421 Optimize your Python code with C.md @@ -0,0 +1,207 @@ +[#]: subject: (Optimize your Python code with C) +[#]: via: (https://opensource.com/article/21/4/cython) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: (ShuyRoy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用C优化你的Python代码 +====== +Cython创建了C模块来加速Python代码的执行,这对使用效率不高的解释型语言编写的复杂的应用是很重要的。 +![Hands on a keyboard with a Python book ][1] + +Cython是Python编程语言的编译器,旨在优化性能并形成一个扩展的Cython编程语言。作为Python的扩展,[Cython][2]也是Python语言的超集,它支持调用C函数和在变量和类属性上声明C类型。这使得包装外部C库、将C嵌入现有应用程序或者为Python编写C扩展语法像Python本身一样简单变得容易。 + +Cython一般用于创建C模块来加速Python代码的执行。这在使用解释型语言编写的效率不高的复杂应用中非常重要。 + +### 安装Cython + +你可以在Linux,BSD,Windows或macOS上安装Cython来使用Python + + +``` +`$ python -m pip install Cython` +``` + +安装好后,就可以使用它了。 + +### 将Python转换成C + +使用Cython的一个好的方式是从一个简单的“hello world”开始。这虽然不是Cython优点的最好的展现方式,但是它展示了使用Cython时发生的情况。 + +首先,创建一个简单的Python脚本,文件命名为`hello.pyx` (`.pyx`扩展名并不神奇,从技术上它可以是任何东西,但它是Cython的默认扩展名): + + +``` +`print("hello world")` +``` + +接下来,创建一个Python设置脚本。一个像Python的生成文件一样的`setup.py`,Cython可以使用它来处理你的Python代码: + + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("hello.pyx") +) +``` + +最后,使用Cython将你的Python脚本转换为C代码: + + +``` +`$ python setup.py build_ext --inplace` +``` + +你可以在你的工程目录中看到结果。Cython的`cythonize`模块将`hello.pyx`转换成一个`hello.c`文件和一个`.so`库。该C代码有2648行,所以它比一个一行的`hello.pyx`源码的文本要多很多。`.so`库也比它的源码大2000倍(即54000字节和20字节相比)。然后,Python需要运行单个Python脚本,所以有很多代码支持这个只有一行的`hello.pyx`文件。 + +要使用Python的“hello world”脚本的C代码版本,请打开一个Python提示符并导入您创建的新`hello`模块: + + +``` +>>> import hello +hello world +``` + +### 将C代码集成到Python中 + +测试计算能力的一个很好的通用测试是计算质数。一个质数是一个比1大的正数,且它只有被1或它自己除后才会产生正整数。虽然理论很简单,但是随着数的变大,计算需求也会增加。在纯Python中,可以用10行以内的代码完成质数的计算。 + + +``` +import sys + +number = int(sys.argv[1]) +if not number <= 1: +    for i in range(2, number): +        if (number % i) == 0: +            print("Not prime") +            break +else: +    print("Integer must be greater than 1") +``` + +这个脚本在成功的时候是不会提醒的,如果这个数不是质数,则返回一条信息: + + +``` +$ ./prime.py 3 +$ ./prime.py 4 +Not prime. +``` + +将这些转换为Cython需要一些工作,一部分是为了使代码适合用作库,另一部分是为了提高性能。 + +#### 脚本和库 + +许多用户将Python当作一种脚本语言来学习:你告诉Python你想让它执行的步骤,然后它来做。随着你对Python(以及一般的开源编程)的了解越多,你可以了解到许多强大的代码都存在于其他应用程序可以利用的库中。你的代码越_不具有针对性_,程序员(包括你)就越可能将其重用于其他的应用程序。将计算和工作流解耦可能需要更多的工作,但最终这通常是值得的。 + + +在这个简单的质数计算的例子中,将Python转换成Cython从一个设置脚本开始: + +``` +from setuptools import setup +from Cython.Build import cythonize + +setup( +    ext_modules = cythonize("prime.py") +) +``` + +将你的脚本转换成C: + + +``` +`$ python setup.py build_ext --inplace` +``` + +到目前为止,一切似乎都工作的很好,但是当你试图导入并使用新模块时,你会看到一个错误: + + +``` +>>> import prime +Traceback (most recent call last): +  File "<stdin>", line 1, in <module> +  File "prime.py", line 2, in init prime +    number = sys.argv[1] +IndexError: list index out of range +``` + +这个问题是Python脚本希望从一个终端运行,其中参数(在这个例子中是要测试是否为质数的整数)是一样的。你需要修改你的脚本这样它就可以作为一个库来使用了。 + +#### 写一个库 + +库不使用系统参数,而是接受其他代码的参数。对于用户输入,不是使用`sys.argv`,而是将你的代码封装成一个函数来接收一个叫`number`(或者`num`,或者任何你喜欢的变量名)的参数: + + +``` +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") +``` + +这确实使你的脚本有些难测试,因为当你在Python中运行代码时,`calculate`函数永远不会被执行。但是,Python编程人员已经为这个问题设计了一个通用但不是很直观的解决方案。当Python解释器执行一个Python脚本时,有一个叫`__name__`的特殊变量,这个变量被设置为`__main__`,但是当它被作为模块导入的时候,`__name__` 被设置为模块的名字。利用这点,你可以写一个既是Python模块又是有效Python脚本的库: + + +``` +import sys + +def calculate(number): +    if not number <= 1: +        for i in range(2, number): +            if (number % i) == 0: +                print("Not prime") +                break +    else: +        print("Integer must be greater than 1") + +if __name__ == "__main__": +    number = sys.argv[1]     +    calculate( int(number) ) +``` + +现在你可以用一个命令来运行代码了: + + +``` +$ python ./prime.py 4 +Not a prime +``` + +你可以将它转换为Cython来用作一个模块: + + +``` +>>> import prime +>>> prime.calculate(4) +Not prime +``` + +### C Python + +用Cython将纯Python的代码转换为C是有用的。这篇文章描述了如何做,但是Cython的特性可以帮助你在转换之前优化你的代码,分析你的代码来找到Cython什么时候与C进行交互,以及更多。如果你正在用Python,但是你希望用C代码改进你的代码,或者进一步理解库是如何提供比脚本更好的扩展性的,或者你只是好奇Python和C是如何协作的,那么就开始使用Cython吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/cython + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[ShuyRoy](https://github.com/ShuyRoy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book ) +[2]: https://cython.org/ From 1c66048ce0cac97ebe6fb9fc63d0199ff6165170 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 26 Apr 2021 05:02:38 +0800 Subject: [PATCH 262/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210425=20?= =?UTF-8?q?Play=20retro=20video=20games=20on=20Linux=20with=20this=20open?= =?UTF-8?q?=20source=20project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210425 Play retro video games on Linux with this open source project.md --- ... on Linux with this open source project.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20210425 Play retro video games on Linux with this open source project.md diff --git a/sources/tech/20210425 Play retro video games on Linux with this open source project.md b/sources/tech/20210425 Play retro video games on Linux with this open source project.md new file mode 100644 index 0000000000..8bcf4a9514 --- /dev/null +++ b/sources/tech/20210425 Play retro video games on Linux with this open source project.md @@ -0,0 +1,129 @@ +[#]: subject: (Play retro video games on Linux with this open source project) +[#]: via: (https://opensource.com/article/21/4/scummvm-retro-gaming) +[#]: author: (Joshua Allen Holm https://opensource.com/users/holmja) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Play retro video games on Linux with this open source project +====== +ScummVM is one of the most straightforward ways to play old video games +on modern hardware. +![Gaming artifacts with joystick, GameBoy, paddle][1] + +Playing adventure games has always been a big part of my experience with computers. From the earliest text-based adventure games to 2D pixel art, full-motion video, and 3D games, the adventure game genre has provided me with a lot of fond memories. + +Sometimes I want to revisit those old games, but many were released before Linux was even a thing, so how do I go about replaying those games? I use [ScummVM][2], which is honestly one of my favorite open source projects. + +### What is ScummVM + +![ScummVM][3] + +(Joshua Allen Holm, [CC BY-SA 4.0][4]) + +ScummVM is a program designed to play old adventure games on modern hardware. Originally designed to run games developed using LucasArt's Script Creation Utility for Maniac Mansion (SCUMM), ScummVM now supports many different game engines. It can play almost all of the classic Sierra On-Line and LucasArts adventure games as well as a wide selection of adventure games from other publishers. ScummVM does not support _every_ adventure game (yet), but it can be used to play hundreds of them. ScummVM is available for multiple platforms, including Windows, macOS, Linux, Android, iOS, and several game consoles. + +### Why use ScummVM + +There are plenty of ways to play old games on modern hardware, but they tend to be more complicated than using ScummVM. [DOSBox][5] can be used to play DOS games, but it requires tweaking to get the settings right so that the game plays at the right speed. Windows games can be played using [WINE][6], but that requires both the game and the game's installer to be compatible with WINE. + +Even if a game runs under WINE, some games still do not work well on modern hardware because the hardware is too fast. One example of this is a puzzle in King's Quest VII that involves taking a lit firecracker somewhere. On modern hardware, the firecracker explodes way too quickly, which makes it impossible to get to the right location without the character dying multiple times. + +ScummVM eliminates many of the problems present in other methods for playing retro adventure games. If ScummVM supports a game, it is straightforward to configure and play. In most cases, copying the game files from the original game discs to a directory and adding that directory in ScummVM is all that is needed to play the game. For games that came on multiple discs, it might be necessary to rename some files to avoid file name conflicts. The instructions for what data files are needed and any renaming instructions are documented on the ScummVM Wiki page for [each supported game][7]. + +One of the wonderful things about ScummVM is how each new release adds support for more games. ScummVM 2.2.0 added support for a dozen interactive fiction interpreters, which means ScummVM can now play hundreds of text-based adventure games. The development branch of ScummVM, which should become version 2.3.0 soon, integrates [ResidualVM][8]'s support for 3D adventure games, so now ScummVM can be used to play Grim Fandango, Myst III: Exile, and The Longest Journey. The development branch also recently added support for games created using [Adventure Game Studio][9], which adds hundreds, possibly thousands, of games to ScummVM's repertoire. + +### How to install ScummVM + +If you want to install ScummVM from your Linux distribution's repositories, the process is very simple. You just need to run one command. However, your distribution might offer an older release of ScummVM that does not support as many games as the latest release, so do keep that in mind. + +**Install ScummVM on Debian/Ubuntu:** + + +``` +`sudo apt install scummvm` +``` + +**Install ScummVM on Fedora:** + + +``` +`sudo dnf install scummvm` +``` + +#### Install ScummVM using Flatpak or Snap + +ScummVM is also available as a Flatpak and as a Snap. If you use one of those options, you can use one of the following commands to install the relevant version, which should always be the latest release of ScummVM: + + +``` +`flatpak install flathub org.scummvm.ScummVM` +``` + +or + + +``` +`snap install scummvm` +``` + +#### Compile the development branch of ScummVM + +If you want to try the latest and greatest features in the not-yet-stable development branch of ScummVM, you can do so by compiling ScummVM from the source code. Do note that the development branch is constantly changing, so things might not always work correctly. If you are still interested in trying out the development branch, follow the instructions below. + +To start, you will need the required development tools and libraries for your distribution, which are listed on the [Compiling ScummVM/GCC page][10] on the ScummVM Wiki. + +Once you have the prerequisites installed, run the following commands: + + +``` +git clone + +cd scummvm + +./configure + +make + +sudo make install +``` + +### Add games to ScummVM + +Adding games to ScummVM is the last thing you need to do before playing. If you do not have any supported adventure games in your collection, you can download 11 wonderful games from the [ScummVM Games page][11]. You can also purchase many of the games supported by ScummVM from [GOG.com][12]. If you purchase a game from GOG.com and need to extract the game files from the GOG download, you can use the [innoextract][13] utility. + +Most games need to be in their own directory (the only exceptions to this are games that consist of a single data file), so it is best to begin by creating a directory to store your ScummVM games. You can do this using the command line or a graphical file manager. Where you store your games does not matter (except in the case of the ScummVM Flatpak, which is a sandbox and requires the games to be stored in the `~/Documents` directory). After creating this directory, place the data files for each game in their own subdirectories. + +Once the files are copied to where you want them, run ScummVM and add the game to the collection by clicking **Add Game…**, selecting the appropriate directory in the file-picker dialog box that opens, and clicking **Choose**. If ScummVM properly detects the game, it will open its settings options. You can select advanced configuration options from the various tabs if you want (which can also be changed later by using the **Edit Game…** button), or you can just click **OK** to add the game with the default options. If the game is not detected, check the [Supported Games pages][14] on the ScummVM Wiki for details about special instructions that might be needed for a particular game's data files. + +The only thing left to do now is select the game in ScummVM's list of games, click on **Start**, and enjoy replaying an old favorite or experiencing a classic adventure game for the first time. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/scummvm-retro-gaming + +作者:[Joshua Allen Holm][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/holmja +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/open_gaming_games_roundup_news.png?itok=KM0ViL0f (Gaming artifacts with joystick, GameBoy, paddle) +[2]: https://www.scummvm.org/ +[3]: https://opensource.com/sites/default/files/uploads/scummvm.png (ScummVM) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.dosbox.com/ +[6]: https://www.winehq.org/ +[7]: https://wiki.scummvm.org/index.php?title=Category:Supported_Games +[8]: https://www.residualvm.org/ +[9]: https://www.adventuregamestudio.co.uk/ +[10]: https://wiki.scummvm.org/index.php/Compiling_ScummVM/GCC +[11]: https://www.scummvm.org/games/ +[12]: https://www.gog.com/ +[13]: https://constexpr.org/innoextract/ +[14]: https://wiki.scummvm.org/index.php/Category:Supported_Games From e5689eb7f37e87eb5204ae397e55d16cf237dcab Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Apr 2021 08:39:02 +0800 Subject: [PATCH 263/307] translating --- ...ervability with Apache Kafka and SigNoz.md | 157 ------------------ ...ervability with Apache Kafka and SigNoz.md | 156 +++++++++++++++++ 2 files changed, 156 insertions(+), 157 deletions(-) delete mode 100644 sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md create mode 100644 translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md diff --git a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md deleted file mode 100644 index 36b52ad61c..0000000000 --- a/sources/tech/20210420 Application observability with Apache Kafka and SigNoz.md +++ /dev/null @@ -1,157 +0,0 @@ -[#]: subject: (Application observability with Apache Kafka and SigNoz) -[#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) -[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Application observability with Apache Kafka and SigNoz -====== -SigNoz helps developers start meeting their observability goals quickly -and with minimum effort. -![Ship captain sailing the Kubernetes seas][1] - -SigNoz is an open source application observability platform. Built in React and Go, SigNoz is written from the ground up to allow developers to get started with their observability goals as soon as possible and with minimum effort. - -This article looks at the software in detail, including the architecture, Kubernetes-based deployment, and some common SigNoz uses. - -### SigNoz architecture - -SigNoz ties several components together to create a scalable, loosely coupled system that is easy to get started with. Some of the most important components are: - - * OpenTelemetry Collector - * Apache Kafka - * Apache Druid - - - -[OpenTelemetry Collector][2] is the trace or metrics data collection engine. This enables SigNoz to ingest data in industry-standard formats, including Jaeger, Zipkin, and OpenConsensus. Then the collected data is forwarded to Apache Kafka. - -SigNoz uses Kafka and stream processors for real-time ingestion of high volumes of observability data. This data is then passed on to Apache Druid, which excels at storing such data for short- and long-term SQL analysis. - -Once the data is flattened and stored in Druid, SigNoz's query service can query and pass the data to the SigNoz React frontend. The front end then creates nice graphs for users to visualize the observability data. - -![SigNoz architecture][3] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -### Install SigNoz - -SigNoz's components include Apache Kafka and Druid. These components are loosely coupled and work in tandem to ensure a seamless experience for the end user. Given all the components, it is best to run SigNoz as a combination of microservices on Kubernetes or Docker Compose (for local testing). - -This example uses a Kubernetes Helm chart-based deployment to install SigNoz on Kubernetes. As a prerequisite, you'll need a Kubernetes cluster. If you don't have a Kubernetes cluster available, you can use tools like [MiniKube][5] or [Kind][6] to create a test cluster on your local machine. Note that the machine should have at least 4GB available for this to work. - -Once you have the cluster available and kubectl configured to communicate with the cluster, run: - - -``` -$ git clone && cd signoz - -$ helm dependency update deploy/kubernetes/platform - -$ kubectl create ns platform - -$ helm -n platform install signoz deploy/kubernetes/platform - -$ kubectl -n platform apply -Rf deploy/kubernetes/jobs - -$ kubectl -n platform apply -f deploy/kubernetes/otel-collector -``` - -This installs SigNoz and related containers on the cluster. To access the user interface (UI), run the `kubectl port-forward` command; for example: - - -``` -`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` -``` - -You should now be able to access your SigNoz dashboard using a local browser on the address `http://localhost:3000`. - -Now that your observability platform is up, you need an application that generates observability data to visualize and trace. For this example, you can use [HotROD][7], a sample application developed by the Jaegar team. - -To install it, run: - - -``` -$ kubectl create ns sample-application - -$ kubectl -n sample-application apply -Rf sample-apps/hotrod/ -``` - -### Explore the features - -You should now have a sample application with proper instrumentation up and running in the demo setup. Look at the SigNoz dashboard for metrics and trace data. As you land on the dashboard's home, you will see a list of all the configured applications that are sending instrumentation data to SigNoz. - -![SigNoz dashboard][8] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -#### Metrics - -When you click on a specific application, you will land on the application's homepage. The Metrics page displays the last 15 minutes worth (this number is configurable) of information, like application latency, average throughput, error rate, and the top endpoints the application is accessing. This gives you a birds-eye view of the application's status. Any spikes in errors, latency, or load are immediately visible. - -![Metrics in SigNoz][9] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -#### Tracing - -The Traces page lists every request in chronological order with high-level details. As soon as you identify a single request of interest (e.g., something taking longer than expected to complete), you can click the trace and look at individual spans for every action that happened inside that request. The drill-down mode offers thorough inspection for each request. - -![Tracing in SigNoz][10] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -![Tracing in SigNoz][11] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -#### Usage Explorer - -Most of the metrics and tracing data are very useful, but only for a certain period. As time passes, the data ceases to be useful in most cases. This means it is important to plan a proper retention duration for data; otherwise, you will pay more for the storage. The Usage Explorer provides an overview of ingested data per hour, day, and week. - -![SigNoz Usage Explorer][12] - -(Nitish Tiwari, [CC BY-SA 4.0][4]) - -### Add instrumentation - -So far, you've been looking at metrics and traces from the sample HotROD application. Ideally, you'll want to instrument your application so that it sends observability data to SigNoz. Do this by following the [Instrumentation Overview][13] on SigNoz's website. - -SigNoz supports a vendor-agnostic instrumentation library, OpenTelemetry, as the primary way to configure instrumentation. OpenTelemetry offers instrumentation libraries for various languages with support for both automatic and manual instrumentation. - -### Learn more - -SigNoz helps developers get started quickly with metrics and tracing applications. To learn more, you can consult the [documentation][14], join the [community][15], and access the source code on [GitHub][16]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/observability-apache-kafka-signoz - -作者:[Nitish Tiwari][a] -选题:[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/tiwarinitish86 -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) -[2]: https://github.com/open-telemetry/opentelemetry-collector -[3]: https://opensource.com/sites/default/files/uploads/signoz_architecture.png (SigNoz architecture) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://minikube.sigs.k8s.io/docs/start/ -[6]: https://kind.sigs.k8s.io/docs/user/quick-start/ -[7]: https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod -[8]: https://opensource.com/sites/default/files/uploads/signoz_dashboard.png (SigNoz dashboard) -[9]: https://opensource.com/sites/default/files/uploads/signoz_applicationmetrics.png (Metrics in SigNoz) -[10]: https://opensource.com/sites/default/files/uploads/signoz_tracing.png (Tracing in SigNoz) -[11]: https://opensource.com/sites/default/files/uploads/signoz_tracing2.png (Tracing in SigNoz) -[12]: https://opensource.com/sites/default/files/uploads/signoz_usageexplorer.png (SigNoz Usage Explorer) -[13]: https://signoz.io/docs/instrumentation/overview/ -[14]: https://signoz.io/docs/ -[15]: https://github.com/SigNoz/signoz#community -[16]: https://github.com/SigNoz/signoz diff --git a/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md b/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md new file mode 100644 index 0000000000..69088936f0 --- /dev/null +++ b/translated/tech/20210420 Application observability with Apache Kafka and SigNoz.md @@ -0,0 +1,156 @@ +[#]: subject: (Application observability with Apache Kafka and SigNoz) +[#]: via: (https://opensource.com/article/21/4/observability-apache-kafka-signoz) +[#]: author: (Nitish Tiwari https://opensource.com/users/tiwarinitish86) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 Apache Kafka 和 SigNoz 实现应用可观测性 +====== +SigNoz 帮助开发者使用最小的精力快速实现他们的可观测性目标。 +![Ship captain sailing the Kubernetes seas][1] + +SigNoz 是一个开源的应用可观察性平台。SigNoz 是用 React 和 Go 编写的,它从头到尾都是为了让开发者能够以最小的精力尽快实现他们的可观察性目标。 + +本文将详细介绍该软件,包括架构、基于 Kubernetes 的部署以及一些常见的 SigNoz 用途。 + +### SigNoz 架构 + +SigNoz 将几个组件捆绑在一起,创建了一个可扩展的、耦合松散的系统,很容易上手使用。其中一些最重要的组件有: + + * OpenTelemetry Collector + * Apache Kafka + * Apache Druid + + + +[OpenTelemetry Collector][2] 是跟踪或度量数据收集引擎。这使得 SigNoz 能够以行业标准格式获取数据,包括 Jaeger、Zipkin 和 OpenConsensus。之后,收集的数据被转发到 Apache Kafka。 + +SigNoz 使用 Kafka 和流处理器来实时获取大量的可观测数据。然后,这些数据被传递到 Apache Druid,它擅长于存储这些数据,用于短期和长期的 SQL 分析。 + +当数据被扁平化并存储在 Druid 中,SigNoz 的查询服务可以查询并将数据传递给 SigNoz React 前端。然后,前端为用户创建漂亮的图表,使可观察性数据可视化。 + +![SigNoz architecture][3] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### 安装 SigNoz + +SigNoz 的组件包括 Apache Kafka 和 Druid。这些组件是松散耦合的,并协同工作,以确保终端用户的无缝体验。鉴于这些组件,最好将 SigNoz 作为 Kubernetes 或 Docker Compose(用于本地测试)上的微服务组合来运行。 + +这个例子使用基于 Kubernetes Helm Chart 的部署在 Kubernetes 上安装 SigNoz。作为先决条件,你需要一个 Kubernetes 集群。如果你没有可用的 Kubernetes 集群,你可以使用 [MiniKube][5] 或 [Kind][6] 等工具,在你的本地机器上创建一个测试集群。注意,这台机器至少要有 4GB 的可用空间才能工作。 + +当你有了可用的集群,并配置了 kubectl 来与集群通信,运行: + + +``` +$ git clone && cd signoz + +$ helm dependency update deploy/kubernetes/platform + +$ kubectl create ns platform + +$ helm -n platform install signoz deploy/kubernetes/platform + +$ kubectl -n platform apply -Rf deploy/kubernetes/jobs + +$ kubectl -n platform apply -f deploy/kubernetes/otel-collector +``` + +这将在集群上安装 SigNoz 和相关容器。要访问用户界面 (UI),运行 `kubectl port-forward` 命令。例如: + + +``` +`$ kubectl -n platform port-forward svc/signoz-frontend 3000:3000` +``` + +现在你应该能够使用本地浏览器访问你的 SigNoz 仪表板,地址为 `http://localhost:3000`。 + +现在你的可观察性平台已经建立起来了,你需要一个能产生可观察性数据的应用来进行可视化和追踪。对于这个例子,你可以使用 [HotROD][7],一个由 Jaegar 团队开发的示例应用。 + +要安装它,请运行: + + +``` +$ kubectl create ns sample-application + +$ kubectl -n sample-application apply -Rf sample-apps/hotrod/ +``` + +### 探索功能 + +现在你应该有一个已经安装合适仪表的应用,并可在演示设置中运行。看看 SigNoz 仪表盘上的指标和跟踪数据。当你登录到仪表盘的主页时,你会看到一个所有已配置的应用列表,这些应用正在向 SigNoz 发送仪表数据。 + +![SigNoz dashboard][8] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### 指标 + +当你点击一个特定的应用时,你会登录到该应用的主页上。指标页面显示最近 15 分钟的信息(这个数字是可配置的),如应用的延迟、平均吞吐量、错误率和应用目前访问最高的接口。这让你对应用的状态有一个大概了解。任何错误、延迟或负载的峰值都可以立即看到。 + +![Metrics in SigNoz][9] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### 追踪 + +追踪页面按时间顺序列出了每个请求的高层细节。当你发现一个感兴趣的请求(例如,比预期时间长的东西),你可以点击追踪,查看该请求中发生的每个行为的单独时间跨度。下探模式提供了对每个请求的彻底检查。 + +![Tracing in SigNoz][10] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +![Tracing in SigNoz][11] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +#### 用量资源管理器 + +大多数指标和跟踪数据都非常有用,但只在一定时期内有用。随着时间的推移,数据在大多数情况下不再有用。这意味着为数据计划一个适当的保留时间是很重要的。否则,你将为存储支付更多的费用。用量资源管理器提供了每小时、每一天和每一周获取数据的概况。 + +![SigNoz Usage Explorer][12] + +(Nitish Tiwari, [CC BY-SA 4.0][4]) + +### 添加仪表 + +到目前为止,你一直在看 HotROD 应用的指标和追踪。理想情况下,你会希望对你的应用进行检测,以便它向 SigNoz 发送可观察数据。参考 SigNoz 网站上的[仪表概览][13]。 + +SigNoz 支持一个与供应商无关的仪表库,OpenTelemetry,作为配置仪表的主要方式。OpenTelemetry 提供了各种语言的仪表库,支持自动和手动仪表。 + +### 了解更多 + +SigNoz 帮助开发者快速开始度量和跟踪应用。要了解更多,你可以查阅 [文档][14],加入[社区][15],并访问 [GitHub][16] 上的源代码。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/observability-apache-kafka-signoz + +作者:[Nitish Tiwari][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/tiwarinitish86 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://github.com/open-telemetry/opentelemetry-collector +[3]: https://opensource.com/sites/default/files/uploads/signoz_architecture.png (SigNoz architecture) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://minikube.sigs.k8s.io/docs/start/ +[6]: https://kind.sigs.k8s.io/docs/user/quick-start/ +[7]: https://github.com/jaegertracing/jaeger/tree/master/examples/hotrod +[8]: https://opensource.com/sites/default/files/uploads/signoz_dashboard.png (SigNoz dashboard) +[9]: https://opensource.com/sites/default/files/uploads/signoz_applicationmetrics.png (Metrics in SigNoz) +[10]: https://opensource.com/sites/default/files/uploads/signoz_tracing.png (Tracing in SigNoz) +[11]: https://opensource.com/sites/default/files/uploads/signoz_tracing2.png (Tracing in SigNoz) +[12]: https://opensource.com/sites/default/files/uploads/signoz_usageexplorer.png (SigNoz Usage Explorer) +[13]: https://signoz.io/docs/instrumentation/overview/ +[14]: https://signoz.io/docs/ +[15]: https://github.com/SigNoz/signoz#community +[16]: https://github.com/SigNoz/signoz From e786053018fc9b8b5c9fd26277f2bf9b5a0157a1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Apr 2021 08:43:39 +0800 Subject: [PATCH 264/307] translating --- ...king computers more accessible and sustainable with Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md index 9f1db397ff..0646d7b75c 100644 --- a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md +++ b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/linux-free-geek) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4f0ea5a4336a89c8768f37daf3f05b734a58b2f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Mon, 26 Apr 2021 09:30:39 +0800 Subject: [PATCH 265/307] Apply for translation(mengxinayan) File Name: 20210204 A guide to understanding Linux software libraries in C.md Translator: mengxinayan --- ...04 A guide to understanding Linux software libraries in C.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md index bfb9d0a880..fe977cd22f 100644 --- a/sources/tech/20210204 A guide to understanding Linux software libraries in C.md +++ b/sources/tech/20210204 A guide to understanding Linux software libraries in C.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b1c8e1cbe989ee8e04cc5f8d01c314ad7b1e469e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 09:46:24 +0800 Subject: [PATCH 266/307] PRF @DCOLIVERSUN --- ...you in Fedora Linux- Let-s get it fixed.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md index 1696d834ff..2e74d36924 100644 --- a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ b/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -3,7 +3,7 @@ [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -12,41 +12,41 @@ Fedora Linux 中有 Bug 吗?一起来修复它! ![][1] -软件有 bug。任何复杂系统都无法保证每个部分都能按计划工作。Fedora Linux是一个 _非常_ 复杂的系统,包含几千个包,这些包由全球无数独立上游项目创建。每周还有数百个更新。因此,问题是不可避免的。本文介绍了 bug 修复过程以及如何确定 bug 优先级。 +软件有 bug。任何复杂系统都无法保证每个部分都能按计划工作。Fedora Linux 是一个 _非常_ 复杂的系统,包含几千个包,这些包由全球无数个独立的上游项目创建。每周还有数百个更新。因此,问题是不可避免的。本文介绍了 bug 修复过程以及如何确定 bug 优先级。 ### 发布开发过程 -作为 Linux 发行项目,我们希望为用户提供完善的、一切正常的体验。我们的发布起始于 “Rawhide”。我们在 Rawhide 中集成了所有更新的免费、开源软件,这些软件都是新版本的。我们一直在不断改进正在进行的测试和持续集成Continuous Integration过程,为了让 Rawhide 可以安全地用来做任何冒险行为。可是,从本质来讲,Rawhide 始终有点粗糙。 +作为一个 Linux 发行项目,我们希望为用户提供完善的、一切正常的体验。我们的发布起始于 “Rawhide”。我们在 Rawhide 中集成了所有更新的自由及开源软件的新版本。我们一直在不断改进正在进行的测试和持续集成Continuous Integration过程,为了让即使是 Rawhide 也能被冒险者安全使用。可是,从本质来讲,Rawhide 始终有点粗糙。 -一年内我们两次把这个粗糙的操作系统先后分支到测试版本、最终版本。当我们这么做时,我们齐心协力地寻找问题。我们在测试日Test Days检查特定的区域和功能。“Candidate builds” 是根据我们的[发布验证测试计划][2]进行检测的。然后我们进入冻结状态freeze state,只有批准的更改可以并入候选版本。这就把候选版本从不断发展的版本中隔离开来,不断发展的版本并入 Rawhide 中。所以,不会引入新的问题。 +每年两次,我们把这个粗糙的操作系统先后分支到测试版本、最终版本。当我们这么做时,我们齐心协力地寻找问题。我们在测试日Test Days检查特定的区域和功能。制作“候选版本Candidate builds”,并根据我们的 [发布验证测试计划][2] 进行检测。然后我们进入冻结状态freeze state,只有批准的更改可以并入候选版本。这就把候选版本从持续的开发隔离开来,持续的开发不断并入 Rawhide 中。所以,不会引入新的问题。 -在发布过程中许多 bug 被压缩,这些 bug 有大有小。当一切按计划进行时,我们为所有用户提供了按计划发布的崭新的 Fedora Linux版本。(在过去几年里,我们已经可靠地重复这一动作——感谢每个人的努力,我们做到了!)如果确实有问题,我们可以将其标记为发布阻碍release blocker。这就意味着我们要等到修复后才能发布。发布阻碍通常代表重大问题,该表达一定会引发对 bug 的关注。 +在发布过程中许多 bug 被粉碎去除,这些 bug 有大有小。当一切按计划进行时,我们为所有用户提供了按计划发布的崭新的 Fedora Linux 版本。(在过去几年里,我们已经可靠地重复这一动作——感谢每一个为之努力工作的人!)如果确实有问题,我们可以将其标记为发布阻碍release blocker。这就意味着我们要等到修复后才能发布。发布阻碍通常代表重大问题,该表达一定会引发对 bug 的关注。 -有时,我们遇到的问题是持续存在的。可能是一两个版本正在发布的内容,或者是我们没有达成共识的解决方案。有些问题确实困扰着许多用户,但个别问题并没有达到阻碍发布的程度。我们可以将这些东西标记为阻碍blocker。但这会像锤子一样砸下来。阻碍可能导致最终破坏该 bug ,但也可能导致周围的破坏。如果进度落后,用户不会对其他所有 bug 修复、改进感兴趣的,更不会对一直开发的特性感兴趣。 +有时,我们遇到的一些问题是持续存在的。可能一些问题已经持续了一两个版本,或者我们还没有达成共识的解决方案。有些问题确实困扰着许多用户,但个别问题并没有达到阻碍发布的程度。我们可以将这些东西标记为阻碍blocker。但这会像锤子一样砸下来。阻碍可能导致最终粉碎该 bug,但也可能导致破坏了周围。如果进度落后,所有其它的 bug 修复、改进以及人们一直在努力的功能,都不能到达用户手中。 ### 按优先顺序排列 bug 流程 -所以,我们有另一种方法来解决烦人的 bug。[按优先顺序排列 bug 流程][3]与其他方式不同,可以标出导致大量用户不满意的问题。这里没有锤子,更像是聚光灯。与发布阻碍不同,按优先顺序排列 bug 流程没有一套严格定义的标准。每个 bug 都是根据影响范围和严重性来评估的。 +所以,我们有另一种方法来解决烦人的 bug。[按优先顺序排列 bug 流程][3],与其他方式不同,可以标出导致大量用户不满意的问题。这里没有锤子,更像是聚光灯。与发布阻碍不同,按优先顺序排列 bug 流程没有一套严格定义的标准。每个 bug 都是根据影响范围和严重性来评估的。 -一组有兴趣的贡献者帮助策划一个简短列表,上面罗列着需要注意的问题。然后,我们的工作是将问题匹配到能够解决它们的人。这有助于减轻发布过程中的压力,因为它没有给问题指定任何特定的截止时间。理论上,我们甚至在进入测试阶段之前就发现并解决问题。我们尽量保持列表简短,不会超过几个,这样才会真正有重点。这种做法有助于团队和个人解决问题,因为他们知道我们尊重他们捉襟见肘的时间与精力。 +一个由感兴趣的贡献者组成的团队帮助策划一个简短列表,上面罗列着需要注意的问题。然后,我们的工作是将问题匹配到能够解决它们的人。这有助于减轻发布过程中的压力,因为它没有给问题指定任何特定的截止时间。理想情况下,我们能在进入测试阶段之前就发现并解决问题。我们尽量保持列表简短,不会超过几个,这样才会真正有重点。这种做法有助于团队和个人解决问题,因为他们知道我们尊重他们捉襟见肘的时间与精力。 -通过这个过程,Fedora 解决了几十个严重而恼人的问题,包括从键盘输入故障到 SELinux 错误,再到千兆字节大小的旧包更新会逐渐填满你的磁盘。但是我们可以做得更多——我们实际上没有收到处理能力上限数量的提案。因此,如果你知道有什么事情导致了长期挫折或影响了很多人,至今没有达成解决方案,遵循[按优先顺序排列 bug 流程][3],提交给我们。 +通过这个过程,Fedora 解决了几十个严重而恼人的问题,包括从键盘输入故障到 SELinux 错误,再到数千兆字节大小的旧包更新会逐渐填满你的磁盘。但是我们可以做得更多——我们实际上收到的提案没有达到我们的处理能力上限。因此,如果你知道有什么事情导致了长期挫折或影响了很多人,至今没有达成解决方案,请遵循 [按优先顺序排列 bug 流程][3],提交给我们。 -### **你可以帮助** +### 你可以帮助我们 -邀请所有 Fedora 贡献者参与按优化顺序排列 bug 流程。每两周评估会议在 IRC 上举办。欢迎任何人加入并帮助我们评估指定的 bug。请参阅[日历][4]了解会议时间和地点。Fedora 程序管理器在会议开始的前一天将议程发送到[分类][5]和[开发][6]邮件列表。 +邀请所有 Fedora 贡献者参与按优化顺序排列 bug 的流程。评估会议每两周在 IRC 上举办一次。欢迎任何人加入并帮助我们评估提名的 bug。会议时间和地点参见 [日历][4]。Fedora 项目经理在会议开始的前一天将议程发送到 [triage][5] 和 [devel][6] 邮件列表。 ### 欢迎报告 bug -当你发现 bug 时,无论大小,我们很感激你能报告 bug。在很多情况下,解决 bug 最好的方式是回到创建该软件的项目中。例如,假设渲染数据相机照片的暗室摄影软件出了问题,最好把它带给暗室摄影软件的开发人员。再举个例子,假设 GNOME 或 KDE 桌面环境或组成部分软件出了问题,将这些问题带到这些项目中通常会得到最好的结果。 +当你发现 bug 时,无论大小,我们很感激你能报告 bug。在很多情况下,解决 bug 最好的方式是交给创建该软件的项目。例如,假设渲染数据相机照片的 Darktable 摄影软件出了问题,最好把它带给 Darktable 摄影软件的开发人员。再举个例子,假设 GNOME 或 KDE 桌面环境或组成部分软件出了问题,将这些问题交给这些项目中通常会得到最好的结果。 -然而, 如果这是一个特定的 Fedora 问题,比如我们的软件构建或配置或者它集成的问题,毫不犹豫地[向我们提交 bug][7]。当你知道我们还没有解决的问题时,也要提交给我们。 +然而, 如果这是一个特定的 Fedora 问题,比如我们的软件构建或配置或者它的集成方式的问题,请毫不犹豫地 [向我们提交 bug][7]。当你知道有一个问题是我们还没有解决的,也要提交给我们。 -我知道这很复杂... 最好有一个一站式的地方来处理所有 bug。但是请记住,Fedora 包装者大部分是志愿者,他们负责获取上游软件并将其配置到我们系统中。即便是对我们正在使用的软件,他们也不总是最了解代码的专家。有疑问的时候,你可以随时提交一个 [Fedora bug][7]。Fedora 中负责相应包的人员可以协助把它们连接到上游软件项目中。 +我知道这很复杂……最好有一个一站式的地方来处理所有 bug。但是请记住,Fedora 打包者大部分是志愿者,他们负责获取上游软件并将其配置到我们系统中。他们并不总是对他们正在使用的软件的代码有深入研究的专家。有疑问的时候,你可以随时提交一个 [Fedora bug][7]。Fedora 中负责相应软件包的人可以通过他们与上游软件项目的联系提供帮助。 -请记住,当你发现一个已通过但尚未得到良好修复的 bug 时,当你看到影响很多人的问题时,或者当有一个长期存在的问题没有得到关注时,请将其指定为高优先级 bug。我们来看看能做些什么! +请记住,当你发现一个已通过诊断但尚未得到良好修复的 bug 时,当你看到影响很多人的问题时,或者当有一个长期存在的问题没有得到关注时,请将其提名为高优先级 bug。我们会看以看能做些什么。 -_附言:标题中的著名图片当然是来自哈佛大学马克 2 号计算机的日志,这里曾是格蕾丝·赫柏少将工作的地方。但是与这个故事的普遍看法相背,这并不是 “bug” 一词第一次用于系统问题——它在工程中已经很常见了,发现字面上的 bug 代表问题原因这一现象是很有趣的,这就是原因。 #nowyouknow #jokeexplainer_ +_附言:标题中的著名图片当然是来自哈佛大学马克 2 号计算机的日志,这里曾是格蕾丝·赫柏少将工作的地方。但是与这个故事的普遍看法相背,这并不是 “bug” 一词第一次用于表示系统问题——它在工程中已经很常见了,这就是为什么发现一个字面上的 “bug” 作为问题的原因是很有趣的。 #nowyouknow #jokeexplainer_ -------------------------------------------------------------------------------- @@ -55,7 +55,7 @@ via: https://fedoramagazine.org/something-bugging-you-in-fedora-linux-lets-get-i 作者:[Matthew Miller][a] 选题:[lujun9972][b] 译者:[DCOLIVERSUN](https://github.com/DCOLIVERSUN) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8d7eda9d276a8c114cf3b6772bca006e05404d89 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 09:50:05 +0800 Subject: [PATCH 267/307] PUB @DCOLIVERSUN https://linux.cn/article-13333-1.html --- ...mething bugging you in Fedora Linux- Let-s get it fixed.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md (99%) diff --git a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md b/published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md similarity index 99% rename from translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md rename to published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md index 2e74d36924..c379370092 100644 --- a/translated/tech/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md +++ b/published/20210419 Something bugging you in Fedora Linux- Let-s get it fixed.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (DCOLIVERSUN) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13333-1.html) Fedora Linux 中有 Bug 吗?一起来修复它! ====== From 34331fc10dff48663ea19fb2caa10c592987bb31 Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Mon, 26 Apr 2021 10:18:22 +0800 Subject: [PATCH 268/307] Update 20210421 Build smaller containers.md --- sources/tech/20210421 Build smaller containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210421 Build smaller containers.md b/sources/tech/20210421 Build smaller containers.md index a4e71cd974..5e22fa232c 100644 --- a/sources/tech/20210421 Build smaller containers.md +++ b/sources/tech/20210421 Build smaller containers.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/build-smaller-containers/) [#]: author: (Daniel Schier https://fedoramagazine.org/author/danielwtd/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (ShuyRoy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -332,7 +332,7 @@ via: https://fedoramagazine.org/build-smaller-containers/ 作者:[Daniel Schier][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[ShuyRoy](https://github.com/Shuyroy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 28e636e4a759f6df5833ae52fb78bfbd1fbac2fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 19:15:50 +0800 Subject: [PATCH 269/307] PRF @geekpi --- ...in Ubuntu and Other Linux Distributions.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index 6a9000c8ba..f81bf3c9c2 100644 --- a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,32 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Ubuntu 和其他 Linux 发行版中添加指纹登录 +如何在 Ubuntu 中添加指纹登录 ====== -现在很多高端笔记本都配备了指纹识别器。Windows 和 macOS 支持指纹登录已经有一段时间了。在桌面 Linux 中,对指纹登录的支持更多的是极客的调整,但 [GNOME][1] 和 [KDE][2] 已经开始通过系统设置来支持它。 +![](https://img.linux.net.cn/data/attachment/album/202104/26/191530msmenm3ges3kgyet.jpg) + +现在很多高端笔记本都配备了指纹识别器。Windows 和 macOS 支持指纹登录已经有一段时间了。在桌面 Linux 中,对指纹登录的支持更多需要极客的调整,但 [GNOME][1] 和 [KDE][2] 已经开始通过系统设置来支持它。 这意味着在新的 Linux 发行版上,你可以轻松使用指纹识别。在这里我将在 Ubuntu 中启用指纹登录,但你也可以在其他运行 GNOME 3.38 的发行版上使用这些步骤。 -前提条件 - -当然,这是显而易见的。你的电脑必须有一个指纹识别器。 - -这个方法适用于任何运行 GNOME 3.38 或更高版本的 Linux 发行版。如果你不确定,你可以[检查你使用的桌面环境版本][3]。 - -KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同。 +> **前提条件** +> +> 当然,这是显而易见的。你的电脑必须有一个指纹识别器。 +> +> 这个方法适用于任何运行 GNOME 3.38 或更高版本的 Linux 发行版。如果你不确定,你可以[检查你使用的桌面环境版本][3]。 +> +> KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同。 ### 在 Ubuntu 和其他 Linux 发行版中添加指纹登录功能 -进入 **Settings** ,然后点击左边栏的 **Users**。你应该可以看到系统中所有的用户账号。你会看到几个选项,包括 **Fingerprint Login**。 +进入 “设置”,然后点击左边栏的 “用户”。你应该可以看到系统中所有的用户账号。你会看到几个选项,包括 “指纹登录”。 -点击这里的指纹登录选项。 +点击启用这里的指纹登录选项。 ![Enable fingerprint login in Ubuntu][4] @@ -44,17 +46,17 @@ KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同 ![Fingerprint successfully added][7] -如果你想马上测试一下,在 Ubuntu 中按 Super+L 快捷键锁定屏幕,然后使用指纹进行登录。 +如果你想马上测试一下,在 Ubuntu 中按 `Super+L` 快捷键锁定屏幕,然后使用指纹进行登录。 ![Login With Fingerprint in Ubuntu][8] #### 在 Ubuntu 上使用指纹登录的经验 -指纹登录顾名思义就是用指纹登录。就是这样。当它要求对需要 sudo 访问的程序进行认证时,你不能使用手指。它不能代替你的密码。 +指纹登录顾名思义就是使用你的指纹来登录系统。就是这样。当要求对需要 `sudo` 访问的程序进行认证时,你不能使用手指。它不能代替你的密码。 -还有一件事。指纹登录可以让你登录,但当系统要求输入 sudo 密码时,你不能用手指。Ubuntu 中的 [keyring][9] 也仍然是锁定的。 +还有一件事。指纹登录可以让你登录,但当系统要求输入 `sudo` 密码时,你不能用手指。Ubuntu 中的 [钥匙环][9] 也仍然是锁定的。 -另一件烦人的事情是因为 GNOME 的 GDM 登录界面。当你登录时,你必须先点击你的账户才能进入密码界面。你在这可以使用手指。如果不用麻烦先点击用户帐户 ID 就更好了。 +另一件烦人的事情是因为 GNOME 的 GDM 登录界面。当你登录时,你必须先点击你的账户才能进入密码界面。你在这可以使用手指。如果能省去先点击用户帐户 ID 的麻烦就更好了。 我还注意到,指纹识别没有 Windows 中那么流畅和快速。不过,它可以使用。 @@ -64,13 +66,13 @@ KDE 5.21 也有一个指纹管理器。当然,截图看起来会有所不同 禁用指纹登录和最初启用指纹登录差不多。 -进入 **Settings→User**,然后点击指纹登录选项。它会显示一个有添加更多指纹或删除现有指纹的页面。你需要删除现有的指纹。 +进入 “设置→用户”,然后点击指纹登录选项。它会显示一个有添加更多指纹或删除现有指纹的页面。你需要删除现有的指纹。 ![Disable Fingerprint Login][10] -指纹登录确实有一些好处,特别是对于我这种懒人来说。我不用每次锁屏时输入密码,我也对这段有限的使用感到满意。 +指纹登录确实有一些好处,特别是对于我这种懒人来说。我不用每次锁屏时输入密码,我也对这种有限的使用感到满意。 -用 [PAM][11] 启用指纹解锁 sudo 应该不是完全不可能。我记得我[在 Ubuntu 中设置脸部解锁][12]时,也可以用于 sudo。看看以后的版本是否会增加这个功能吧。 +用 [PAM][11] 启用指纹解锁 `sudo` 应该不是完全不可能。我记得我 [在 Ubuntu 中设置脸部解锁][12]时,也可以用于 `sudo`。看看以后的版本是否会增加这个功能吧。 你有带指纹识别器的笔记本吗?你是否经常使用它,或者它只是你不关心的东西之一? @@ -81,7 +83,7 @@ via: https://itsfoss.com/fingerprint-login-ubuntu/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2d3b551f6aae59c3211de0f2285e6de00abdd965 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 19:17:25 +0800 Subject: [PATCH 270/307] PUB @geekpi https://linux.cn/article-13337-1.html --- ...ngerprint Login in Ubuntu and Other Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md (98%) diff --git a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md b/published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md similarity index 98% rename from translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md rename to published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md index f81bf3c9c2..19bf109db5 100644 --- a/translated/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md +++ b/published/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13337-1.html) [#]: subject: (How to Add Fingerprint Login in Ubuntu and Other Linux Distributions) [#]: via: (https://itsfoss.com/fingerprint-login-ubuntu/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From 39c789a94677e97175dc0c6495b9559da7f0f53a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 23:07:40 +0800 Subject: [PATCH 271/307] PRF @ShuyRoy --- ...210421 Optimize your Python code with C.md | 143 ++++++++---------- 1 file changed, 66 insertions(+), 77 deletions(-) diff --git a/translated/tech/20210421 Optimize your Python code with C.md b/translated/tech/20210421 Optimize your Python code with C.md index ded4e5abe0..131c8901a8 100644 --- a/translated/tech/20210421 Optimize your Python code with C.md +++ b/translated/tech/20210421 Optimize your Python code with C.md @@ -3,43 +3,42 @@ [#]: author: (Alan Smithee https://opensource.com/users/alansmithee) [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -使用C优化你的Python代码 +使用 C 优化你的 Python 代码 ====== -Cython创建了C模块来加速Python代码的执行,这对使用效率不高的解释型语言编写的复杂的应用是很重要的。 -![Hands on a keyboard with a Python book ][1] -Cython是Python编程语言的编译器,旨在优化性能并形成一个扩展的Cython编程语言。作为Python的扩展,[Cython][2]也是Python语言的超集,它支持调用C函数和在变量和类属性上声明C类型。这使得包装外部C库、将C嵌入现有应用程序或者为Python编写C扩展语法像Python本身一样简单变得容易。 +> Cython 创建的 C 模块可以加速 Python 代码的执行,这对使用效率不高的解释型语言编写的复杂应用是很重要的。 -Cython一般用于创建C模块来加速Python代码的执行。这在使用解释型语言编写的效率不高的复杂应用中非常重要。 +![](https://img.linux.net.cn/data/attachment/album/202104/26/230709qz64z4af3t9b9jab.jpg) -### 安装Cython +Cython 是 Python 编程语言的编译器,旨在优化性能并形成一个扩展的 Cython 编程语言。作为 Python 的扩展,[Cython][2] 也是 Python 语言的超集,它支持调用 C 函数和在变量和类属性上声明 C 类型。这使得包装外部 C 库、将 C 嵌入现有应用程序或者为 Python 编写像 Python 一样简单的 C 语言扩展语法变得容易。 -你可以在Linux,BSD,Windows或macOS上安装Cython来使用Python +Cython 一般用于创建 C 模块来加速 Python 代码的执行。这在使用解释型语言编写的效率不高的复杂应用中非常重要。 +### 安装 Cython + +你可以在 Linux、BSD、Windows 或 macOS 上安装 Cython 来使用 Python: ``` -`$ python -m pip install Cython` +$ python -m pip install Cython ``` 安装好后,就可以使用它了。 -### 将Python转换成C +### 将 Python 转换成 C -使用Cython的一个好的方式是从一个简单的“hello world”开始。这虽然不是Cython优点的最好的展现方式,但是它展示了使用Cython时发生的情况。 - -首先,创建一个简单的Python脚本,文件命名为`hello.pyx` (`.pyx`扩展名并不神奇,从技术上它可以是任何东西,但它是Cython的默认扩展名): +使用 Cython 的一个好的方式是从一个简单的 “hello world” 开始。这虽然不是展示 Cython 优点的最好方式,但是它展示了使用 Cython 时发生的情况。 +首先,创建一个简单的 Python 脚本,文件命名为 `hello.pyx`(`.pyx` 扩展名并不神奇,从技术上它可以是任何东西,但它是 Cython 的默认扩展名): ``` -`print("hello world")` +print("hello world") ``` -接下来,创建一个Python设置脚本。一个像Python的生成文件一样的`setup.py`,Cython可以使用它来处理你的Python代码: - +接下来,创建一个 Python 设置脚本。一个像 Python 的 makefile 一样的 `setup.py`,Cython 可以使用它来处理你的 Python 代码: ``` from setuptools import setup @@ -50,58 +49,54 @@ setup( ) ``` -最后,使用Cython将你的Python脚本转换为C代码: +最后,使用 Cython 将你的 Python 脚本转换为 C 代码: + +``` +$ python setup.py build_ext --inplace +``` + +你可以在你的工程目录中看到结果。Cython 的 `cythonize` 模块将 `hello.pyx` 转换成一个 `hello.c` 文件和一个 `.so` 库。这些 C 代码有 2648 行,所以它比一个一行的 `hello.pyx` 源码的文本要多很多。`.so` 库也比它的源码大 2000 倍(即 54000 字节和 20 字节相比)。然后,Python 需要运行单个 Python 脚本,所以有很多代码支持这个只有一行的 `hello.pyx` 文件。 + +要使用 Python 的 “hello world” 脚本的 C 代码版本,请打开一个 Python 提示符并导入你创建的新 `hello` 模块: ``` -`$ python setup.py build_ext --inplace` -``` - -你可以在你的工程目录中看到结果。Cython的`cythonize`模块将`hello.pyx`转换成一个`hello.c`文件和一个`.so`库。该C代码有2648行,所以它比一个一行的`hello.pyx`源码的文本要多很多。`.so`库也比它的源码大2000倍(即54000字节和20字节相比)。然后,Python需要运行单个Python脚本,所以有很多代码支持这个只有一行的`hello.pyx`文件。 - -要使用Python的“hello world”脚本的C代码版本,请打开一个Python提示符并导入您创建的新`hello`模块: - - -``` ->>> import hello +>>> import hello hello world ``` -### 将C代码集成到Python中 - -测试计算能力的一个很好的通用测试是计算质数。一个质数是一个比1大的正数,且它只有被1或它自己除后才会产生正整数。虽然理论很简单,但是随着数的变大,计算需求也会增加。在纯Python中,可以用10行以内的代码完成质数的计算。 +### 将 C 代码集成到 Python 中 +测试计算能力的一个很好的通用测试是计算质数。质数是一个比 1 大的正数,且它只有被 1 或它自己除后才会产生正整数。虽然理论很简单,但是随着数的变大,计算需求也会增加。在纯 Python 中,可以用 10 行以内的代码完成质数的计算。 ``` import sys number = int(sys.argv[1]) -if not number <= 1: -    for i in range(2, number): -        if (number % i) == 0: -            print("Not prime") -            break +if not number <= 1: + for i in range(2, number): + if (number % i) == 0: + print("Not prime") + break else: -    print("Integer must be greater than 1") + print("Integer must be greater than 1") ``` 这个脚本在成功的时候是不会提醒的,如果这个数不是质数,则返回一条信息: - ``` $ ./prime.py 3 $ ./prime.py 4 Not prime. ``` -将这些转换为Cython需要一些工作,一部分是为了使代码适合用作库,另一部分是为了提高性能。 +将这些转换为 Cython 需要一些工作,一部分是为了使代码适合用作库,另一部分是为了提高性能。 #### 脚本和库 -许多用户将Python当作一种脚本语言来学习:你告诉Python你想让它执行的步骤,然后它来做。随着你对Python(以及一般的开源编程)的了解越多,你可以了解到许多强大的代码都存在于其他应用程序可以利用的库中。你的代码越_不具有针对性_,程序员(包括你)就越可能将其重用于其他的应用程序。将计算和工作流解耦可能需要更多的工作,但最终这通常是值得的。 +许多用户将 Python 当作一种脚本语言来学习:你告诉 Python 想让它执行的步骤,然后它来做。随着你对 Python(以及一般的开源编程)的了解越多,你可以了解到许多强大的代码都存在于其他应用程序可以利用的库中。你的代码越 _不具有针对性_,程序员(包括你)就越可能将其重用于其他的应用程序。将计算和工作流解耦可能需要更多的工作,但最终这通常是值得的。 - -在这个简单的质数计算的例子中,将Python转换成Cython从一个设置脚本开始: +在这个简单的质数计算的例子中,将其转换成 Cython,首先是一个设置脚本: ``` from setuptools import setup @@ -112,83 +107,77 @@ setup( ) ``` -将你的脚本转换成C: - +将你的脚本转换成 C: ``` -`$ python setup.py build_ext --inplace` +$ python setup.py build_ext --inplace ``` 到目前为止,一切似乎都工作的很好,但是当你试图导入并使用新模块时,你会看到一个错误: - ``` ->>> import prime +>>> import prime Traceback (most recent call last): -  File "<stdin>", line 1, in <module> -  File "prime.py", line 2, in init prime -    number = sys.argv[1] + File "", line 1, in + File "prime.py", line 2, in init prime + number = sys.argv[1] IndexError: list index out of range ``` -这个问题是Python脚本希望从一个终端运行,其中参数(在这个例子中是要测试是否为质数的整数)是一样的。你需要修改你的脚本这样它就可以作为一个库来使用了。 +这个问题是 Python 脚本希望从一个终端运行,其中参数(在这个例子中是要测试是否为质数的整数)是一样的。你需要修改你的脚本,使它可以作为一个库来使用。 #### 写一个库 -库不使用系统参数,而是接受其他代码的参数。对于用户输入,不是使用`sys.argv`,而是将你的代码封装成一个函数来接收一个叫`number`(或者`num`,或者任何你喜欢的变量名)的参数: - +库不使用系统参数,而是接受其他代码的参数。对于用户输入,与其使用 `sys.argv`,不如将你的代码封装成一个函数来接收一个叫 `number`(或者 `num`,或者任何你喜欢的变量名)的参数: ``` def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") + if not number <= 1: + for i in range(2, number): + if (number % i) == 0: + print("Not prime") + break + else: + print("Integer must be greater than 1") ``` -这确实使你的脚本有些难测试,因为当你在Python中运行代码时,`calculate`函数永远不会被执行。但是,Python编程人员已经为这个问题设计了一个通用但不是很直观的解决方案。当Python解释器执行一个Python脚本时,有一个叫`__name__`的特殊变量,这个变量被设置为`__main__`,但是当它被作为模块导入的时候,`__name__` 被设置为模块的名字。利用这点,你可以写一个既是Python模块又是有效Python脚本的库: - +这确实使你的脚本有些难以测试,因为当你在 Python 中运行代码时,`calculate` 函数永远不会被执行。但是,Python 编程人员已经为这个问题设计了一个通用、还算直观的解决方案。当 Python 解释器执行一个 Python 脚本时,有一个叫 `__name__` 的特殊变量,这个变量被设置为 `__main__`,但是当它被作为模块导入的时候,`__name__` 被设置为模块的名字。利用这点,你可以写一个既是 Python 模块又是有效 Python 脚本的库: ``` import sys def calculate(number): -    if not number <= 1: -        for i in range(2, number): -            if (number % i) == 0: -                print("Not prime") -                break -    else: -        print("Integer must be greater than 1") + if not number <= 1: + for i in range(2, number): + if (number % i) == 0: + print("Not prime") + break + else: + print("Integer must be greater than 1") if __name__ == "__main__": -    number = sys.argv[1]     -    calculate( int(number) ) + number = sys.argv[1] + calculate( int(number) ) ``` 现在你可以用一个命令来运行代码了: - ``` $ python ./prime.py 4 Not a prime ``` -你可以将它转换为Cython来用作一个模块: - +你可以将它转换为 Cython 来用作一个模块: ``` ->>> import prime ->>> prime.calculate(4) +>>> import prime +>>> prime.calculate(4) Not prime ``` ### C Python -用Cython将纯Python的代码转换为C是有用的。这篇文章描述了如何做,但是Cython的特性可以帮助你在转换之前优化你的代码,分析你的代码来找到Cython什么时候与C进行交互,以及更多。如果你正在用Python,但是你希望用C代码改进你的代码,或者进一步理解库是如何提供比脚本更好的扩展性的,或者你只是好奇Python和C是如何协作的,那么就开始使用Cython吧。 +用 Cython 将纯 Python 的代码转换为 C 代码是有用的。这篇文章描述了如何做,然而,Cython 还有功能可以帮助你在转换之前优化你的代码,分析你的代码来找到 Cython 什么时候与 C 进行交互,以及更多。如果你正在用 Python,但是你希望用 C 代码改进你的代码,或者进一步理解库是如何提供比脚本更好的扩展性的,或者你只是好奇 Python 和 C 是如何协作的,那么就开始使用 Cython 吧。 -------------------------------------------------------------------------------- @@ -197,7 +186,7 @@ via: https://opensource.com/article/21/4/cython 作者:[Alan Smithee][a] 选题:[lujun9972][b] 译者:[ShuyRoy](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 661b6f8df503cbb5b22136940c335ef72ebc4e69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Apr 2021 23:08:46 +0800 Subject: [PATCH 272/307] PUB @ShuyRoy https://linux.cn/article-13338-1.html --- .../20210421 Optimize your Python code with C.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210421 Optimize your Python code with C.md (99%) diff --git a/translated/tech/20210421 Optimize your Python code with C.md b/published/20210421 Optimize your Python code with C.md similarity index 99% rename from translated/tech/20210421 Optimize your Python code with C.md rename to published/20210421 Optimize your Python code with C.md index 131c8901a8..0384f49be6 100644 --- a/translated/tech/20210421 Optimize your Python code with C.md +++ b/published/20210421 Optimize your Python code with C.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13338-1.html) 使用 C 优化你的 Python 代码 ====== From 1c0e846d7e45fc52cddf5904862d7d5cc840099f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:02:33 +0800 Subject: [PATCH 273/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210426=20?= =?UTF-8?q?Exploring=20the=20world=20of=20declarative=20programming?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210426 Exploring the world of declarative programming.md --- ...ng the world of declarative programming.md | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 sources/tech/20210426 Exploring the world of declarative programming.md diff --git a/sources/tech/20210426 Exploring the world of declarative programming.md b/sources/tech/20210426 Exploring the world of declarative programming.md new file mode 100644 index 0000000000..b5ffce076e --- /dev/null +++ b/sources/tech/20210426 Exploring the world of declarative programming.md @@ -0,0 +1,196 @@ +[#]: subject: (Exploring the world of declarative programming) +[#]: via: (https://fedoramagazine.org/exploring-the-world-of-declarative-programming/) +[#]: author: (pampelmuse https://fedoramagazine.org/author/pampelmuse/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Exploring the world of declarative programming +====== + +![][1] + +Photo by [Stefan Cosma][2] on [Unsplash][3] + +### Introduction + +Most of us use imperative programming languages like C, Python, or Java at home. But the universe of programming languages is endless and there are languages where no imperative command has gone before. That which may sound impossible at the first glance is feasible with Prolog and other so called declarative languages. This article will demonstrate how to split a programming task between Python and Prolog. + +In this article I do not want to teach Prolog. There are [resources available][4] for that. We will demonstrate how simple it is to solve a puzzle solely by describing the solution. After that it is up to the reader how far this idea will take them. + +To proceed, you should have a basic understanding of Python. Installation of Prolog and the Python-Prolog bridge is accomplished using this command: + +dnf install pl python3-pyswip + +Our exploration uses [SWI-Prolog][5], an actively developed Prolog which has the Fedora package name “pl”. The Python/SWI-Prolog bridge is [pyswip][6]. + +If you are a bold adventurer you are welcome to follow me exploring the world of declarative programming. + +### Puzzle + +The example problem for our exploration will be a puzzle similar to what you may have seen before. + +**How many triangles are there?** + +![][7] + +### Getting started + +Get started by opening a fresh text file with your favorite text editor. Copy all three text blocks in the sections below (Input, Process and Output) together into one file. + +#### Input + +This section sets up access to the Prolog interface and defines data for the problem. This is a simple case so it is fastest to write the data lines by hand. In larger problems you may get your input data from a file or from a database. + +``` +#!/usr/bin/python + +from pyswip import Prolog + +prolog = Prolog() +prolog.assertz("line([a, e, k])") +prolog.assertz("line([a, d, f, j])") +prolog.assertz("line([a, c, g, i])") +prolog.assertz("line([a, b, h])") +prolog.assertz("line([b, c, d, e])") +prolog.assertz("line([e, f, g, h])") +prolog.assertz("line([h, i, j, k])") +``` + + * The first line is the UNIX way to tell that this text file is a Python program. +Don’t forget to make your file executable by using _chmod +x yourfile.py_ . + * The second line imports a Python module which is doing the Python/Prolog bridge. + * The third line makes a Prolog instance available inside Python. + * Next lines are puzzle related. They describe the picture you see above. +Single **small** letters stand for concrete points. +_[a,e,k]_ is the Prolog way to describe a list of three points. +_line()_ declares that it is true that the list inside parentheses is a line . + + + +The idea is to let Python do the work and to feed Prolog. + +#### “Process” + +This section title is quoted because nothing is actually processed here. This is simply the description (declaration) of the solution. + +There is no single variable which gets a new value. Technically the processing is done in the section titled Output below where you find the command _prolog.query()_. + +``` +prolog.assertz(""" +triangle(A, B, C) :- + line(L1), + line(L2), + line(L3), + L1 \= L2, + member(A, L1), + member(B, L1), + member(A, L2), + member(C, L2), + member(B, L3), + member(C, L3), + A @< B, + B @< C""") +``` + +First of all: All capital letters and strings starting with a capital letter are Prolog variables! + +The statements here are the description of what a triangle is and you can read this like: + + * **If** all lines after _“:-“_ are true, **then** _triangle(A, B, C)_ is a triangle + * There must exist three lines (L1 to L3). + * Two lines must be different. “\_=_” means not equal in Prolog. We do not want to count a triangle where all three points are on the same line! So we check if at least two different lines are used. + * _member()_ is a Prolog predicate which is true if the first argument is inside the second argument which must be a list. In sum these six lines express that the three points must be pairwise on different lines. + * The last two lines are only true if the three points are in alphabetical order. (“_@<_” compares terms in Prolog.) This is necessary, otherwise [a, h, k] and [a, k, h] would count as two triangles. Also, the case where a triangle contains the same point two or even three times is excluded by these final two lines. + + + +As you can see, it is often not that obvious what defines a triangle. But for a computed approach you must be rather strict and rigorous. + +#### Output + +After the hard work in the process chapter the rest is easy. Just have Python ask Prolog to search for triangles and count them all. + +``` +total = 0 +for result in prolog.query("triangle(A, B, C)"): + print(result) + total += 1 +print("There are", total, "triangles.") +``` + +Run the program using this command in the directory containing _yourfile.py_ : + +``` +./yourfile.py +``` + +The output shows the listing of each triangle found and the final count. + +``` +{'A': 'a', 'B': 'e', 'C': 'f'} +{'A': 'a', 'B': 'e', 'C': 'g'} +{'A': 'a', 'B': 'e', 'C': 'h'} +{'A': 'a', 'B': 'd', 'C': 'e'} +{'A': 'a', 'B': 'j', 'C': 'k'} +{'A': 'a', 'B': 'f', 'C': 'g'} +{'A': 'a', 'B': 'f', 'C': 'h'} +{'A': 'a', 'B': 'c', 'C': 'e'} +{'A': 'a', 'B': 'i', 'C': 'k'} +{'A': 'a', 'B': 'c', 'C': 'd'} +{'A': 'a', 'B': 'i', 'C': 'j'} +{'A': 'a', 'B': 'g', 'C': 'h'} +{'A': 'a', 'B': 'b', 'C': 'e'} +{'A': 'a', 'B': 'h', 'C': 'k'} +{'A': 'a', 'B': 'b', 'C': 'd'} +{'A': 'a', 'B': 'h', 'C': 'j'} +{'A': 'a', 'B': 'b', 'C': 'c'} +{'A': 'a', 'B': 'h', 'C': 'i'} +{'A': 'd', 'B': 'e', 'C': 'f'} +{'A': 'c', 'B': 'e', 'C': 'g'} +{'A': 'b', 'B': 'e', 'C': 'h'} +{'A': 'e', 'B': 'h', 'C': 'k'} +{'A': 'f', 'B': 'h', 'C': 'j'} +{'A': 'g', 'B': 'h', 'C': 'i'} +There are 24 triangles. +``` + +There are certainly more elegant ways to display this output but the point is: +**Python should do the output handling for Prolog.** + +If you are a star programmer you can make the output look like this: + +``` +*************************** +* There are 24 triangles. * +*************************** +``` + +### Conclusion + +Splitting a programming task between Python and Prolog makes it easy to keep the Prolog part pure and monotonic, which is good for logic reasoning. It is also easy to make the input and output handling with Python. + +Be aware that Prolog is a bit more complicated and can do much more than what I explained here. You can find a really good and modern introduction here: [The Power of Prolog][4]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/exploring-the-world-of-declarative-programming/ + +作者:[pampelmuse][a] +选题:[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/pampelmuse/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/explore_declarative-816x345.jpg +[2]: https://unsplash.com/@stefanbc?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/star-trek?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://www.metalevel.at/prolog +[5]: https://www.swi-prolog.org/ +[6]: https://github.com/yuce/pyswip +[7]: https://fedoramagazine.org/wp-content/uploads/2021/04/triangle2.png From 543d125b2272637e88e7256ef42fc1e04e3bce93 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:02:55 +0800 Subject: [PATCH 274/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427=20?= =?UTF-8?q?An=20Open-Source=20App=20to=20Control=20All=20Your=20RGB=20Ligh?= =?UTF-8?q?ting=20Settings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md --- ... Control All Your RGB Lighting Settings.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md diff --git a/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md new file mode 100644 index 0000000000..e114fbb740 --- /dev/null +++ b/sources/tech/20210427 An Open-Source App to Control All Your RGB Lighting Settings.md @@ -0,0 +1,92 @@ +[#]: subject: (An Open-Source App to Control All Your RGB Lighting Settings) +[#]: via: (https://itsfoss.com/openrgb/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +An Open-Source App to Control All Your RGB Lighting Settings +====== + +**_Brief_:** _OpenRGB is a useful open-source utility to manage all your RGB lighting under a single roof. Let’s find out more about it._ + +No matter whether it is your keyboard, mouse, CPU fan, AIO, and other connected peripherals or components, Linux does not have official software support to control the RGB lighting. + +And, OpenRGB seems to be an all-in-one RGB lighting control utility for Linux. + +### OpenRGB: An All-in-One RGB Lighting Control Center + +![][1] + +Yes, you may find different tools to tweak the settings like **Piper** to specifically [configure a gaming mouse on Linux][2]. But, if you have a variety of components or peripherals, it will be a cumbersome task to set them all to your preference of RGB color. + +OpenRGB is an impressive utility that not only focuses on Linux but also available for Windows and macOS. + +It is not just an idea to have all the RGB lighting settings under one roof, but it aims to get rid of all the bloatware apps that you need to install to tweak lighting settings. + +Even if you are using a Windows-powered machine, you probably know that software tools like Razer Synapse are resource hogs and come with their share of issues. So, OpenRGB is not just limited for Linux users but for every user looking to tweak RGB settings. + +It supports a long list of devices, but you should not expect support for everything. + +### Features of OpenRGB + +![][3] + +It empowers you with many useful functionalities while offering a simple user experience. Some of the features are: + + * Lightweight user interface + * Cross-platform support + * Ability to extend functionality using plugins + * Set colors and effects + * Ability to save and load profiles + * View device information + * Connect multiple instances of OpenRGB to synchronize lighting across multiple PCs + + + +![][4] + +Along with all the above-mentioned features, you get a good control over the lighting zones, color mode, colors, and more. + +### Installing OpenRGB in Linux + +You can find AppImage files and DEB packages on their official website. For Arch Linux users, you can also find it in [AUR][5]. + +For additional help, you can refer to our [AppImage guide][6] and [ways to install DEB files][7] to set it up. + +The official website should let you download packages for other platforms as well. But, if you want to explore more about it or compile it yourself, head to its [GitLab page][8]. + +[OpenRGB][9] + +### Closing Thoughts + +Even though I do not have many RGB-enabled devices/components, I could tweak my Logitech G502 mouse successfully. + +I would definitely recommend you to give it a try if you want to get rid of multiple applications and use a lightweight interface to manage all your RGB lighting. + +Have you tried it already? Feel free to share what you think about it in the comments! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/openrgb/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb.jpg?resize=800%2C406&ssl=1 +[2]: https://itsfoss.com/piper-configure-gaming-mouse-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-supported-devices.jpg?resize=800%2C404&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/openrgb-logi.jpg?resize=800%2C398&ssl=1 +[5]: https://itsfoss.com/aur-arch-linux/ +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://itsfoss.com/install-deb-files-ubuntu/ +[8]: https://gitlab.com/CalcProgrammer1/OpenRGB +[9]: https://openrgb.org/ From 21e88d53fa9e869b30226c9ca6c4dc3ff23c6c66 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:12 +0800 Subject: [PATCH 275/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210426=20?= =?UTF-8?q?3=20beloved=20USB=20drive=20Linux=20distros?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210426 3 beloved USB drive Linux distros.md --- ...10426 3 beloved USB drive Linux distros.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210426 3 beloved USB drive Linux distros.md diff --git a/sources/tech/20210426 3 beloved USB drive Linux distros.md b/sources/tech/20210426 3 beloved USB drive Linux distros.md new file mode 100644 index 0000000000..99247ee961 --- /dev/null +++ b/sources/tech/20210426 3 beloved USB drive Linux distros.md @@ -0,0 +1,87 @@ +[#]: subject: (3 beloved USB drive Linux distros) +[#]: via: (https://opensource.com/article/21/4/usb-drive-linux-distro) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +3 beloved USB drive Linux distros +====== +Open source technologists weigh in. +![Linux keys on the keyboard for a desktop computer][1] + +There are few Linux users who don't remember the first time they discovered you could boot a computer and run Linux on it without ever actually installing it. Sure, many users are aware that you can boot a computer to an operating system installer, but with Linux it's different: there doesn't need to be an install at all! Your computer doesn't even need to have a hard drive in it. You can run Linux for months or even _years_ off of a USB drive. + +Naturally, there are a few different "live" Linux distributions to choose from. We asked our writers for their favourites, and their responses represent the full spectrum of what's available. + +### 1\. Puppy Linux + +"As a prior **Puppy Linux** ****developer, my views on this are rather biased. But what originally attracted me to Puppy was: + + * its focus on lower-end and older hardware which is readily available in 3rd world countries; this opens up computing for disadvantaged areas that can't afford the latest modern systems + * its ability to run in RAM, which when utilized can offer some interesting security benefits + * the way it handles user files and sessions in a single SFS file making backing up, restoring, or moving your existing desktop/applications/files to another install with a single copy command" + + + +—[JT Pennington][2] + +"It has always been **Puppy Linux** for me. It boots up quickly and supports old hardware. The GUI is super easy to convince someone to try Linux for the first time." —[Sachin Patil][3] + +"Puppy is the live distro that truly runs on anything. I had an old discarded microATX tower with a broken optical drive, literally no hard drive (it had been removed for data security), and hardly any RAM. I slotted Puppy into its SD card slot and ran it for years." —[Seth Kenlon][4] + +"I don't have that much experience in using USB drive Linux distros but my vote goes to **Puppy Linux**. It's light and perfectly suitable for old machines." —[Sergey Zarubin][5] + +### 2\. Fedora and Red Hat + +"My favourite USB distro is actually just the **Fedora Live USB**. It has a browser, disk utilities, and a terminal emulator so I can use it to rescue data from a machine or I can browse the web or ssh to other machines to do some work if needed. All this without storing any data on the stick or the machine in use to be exposed if compromised." —[Steve Morris][6] + +"I used to use Puppy and DSL. These days I have two USB Keys: **RHEL7 and RHEL8**. These are both configured as full working environments with the ability to boot for UEFI and BIOS. These have been real-life and time savers when I'm faced with a random piece of hardware where we're having issues troubleshooting an issue." —[Steven Ellis][7] + +### 3\. Porteus + +"Not long ago, I installed VMs of every version of Porteus OS. That was fun, so maybe I'll take another look at them. Whenever the topic of tiny distros comes up, I'm always reminded of the first one that I can remember using: **tomsrtbt**. It was always designed to fit on a floppy. I'm not sure how useful it is these days, but just thought I'd throw it in the mix." —[Alan Formy-Duval][8] + +"As a longtime Slackware user, I appreciate **Porteus** for providing a current build of Slack, and a flexible environment. You can boot with Porteus running in RAM so there's no need to keep the USB drive attached to your computer, or you can run it off the drive so you can retain your changes. Packaging applications is easy, and there are lots of existing packages available from the Slacker community. It's the only live distro I need." —[Seth Kenlon][4] + +### Bonus: Knoppix + +"I haven't used **Knoppix **in a while but I used it a lot at one time to save Windows computers that had been damaged by malware. It was originally released in September 2000 and has been under continuous development since then. It was originally developed and named after Linux consultant Klaus Knopper and designed to be used as a Live CD. We used it to rescue user files on Windows systems that had become inaccessible due to malware and viruses." —[Don Watkins][9] + +"Knoppix was hugely influencial to live Linux, but it's also one of the most accessible distributions for blind users. Its [ADRIANE interface][10] is designed to be used without a visual display, and can handle all the most common tasks any user is likely to require from a computer." —[Seth Kenlon][11] + +### Choose your live Linux + +There are many that haven't been mentioned, such as [Slax][12] (a Debian-based live distro), [Tiny Core][13], [Slitaz][14], [Kali][15] (a security-focused utility distro), [E-live][16], and more. If you have a spare USB drive, put Linux on it and use Linux on any computer, any time! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/usb-drive-linux-distro + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/jtpennington +[3]: https://opensource.com/users/psachin +[4]: http://opensource.com/users/seth +[5]: https://opensource.com/users/sergey-zarubin +[6]: https://opensource.com/users/smorris12 +[7]: https://opensource.com/users/steven-ellis +[8]: https://opensource.com/users/alanfdoss +[9]: https://opensource.com/users/don-watkins +[10]: https://opensource.com/life/16/7/knoppix-adriane-interface +[11]: https://opensource.com/article/21/4/opensource.com/users/seth +[12]: http://slax.org +[13]: http://www.tinycorelinux.net/ +[14]: http://www.slitaz.org/en/ +[15]: http://kali.org +[16]: https://www.elivecd.org/ From 1b7cf16847ad1ea8f01bd416eebe49a5b86e230e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:25 +0800 Subject: [PATCH 276/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210426=20?= =?UTF-8?q?How=20we=20built=20an=20open=20source=20design=20system=20to=20?= =?UTF-8?q?create=20new=20community=20logos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210426 How we built an open source design system to create new community logos.md --- ...gn system to create new community logos.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210426 How we built an open source design system to create new community logos.md diff --git a/sources/tech/20210426 How we built an open source design system to create new community logos.md b/sources/tech/20210426 How we built an open source design system to create new community logos.md new file mode 100644 index 0000000000..81089c3c74 --- /dev/null +++ b/sources/tech/20210426 How we built an open source design system to create new community logos.md @@ -0,0 +1,134 @@ +[#]: subject: (How we built an open source design system to create new community logos) +[#]: via: (https://opensource.com/article/21/4/ansible-community-logos) +[#]: author: (Fiona Lin https://opensource.com/users/fionalin) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +How we built an open source design system to create new community logos +====== +Learn how Ansible's new logos were developed with stakeholder input to +ensure a consistent brand across the entire project. +![UX design Mac computer with mobile and laptop][1] + +As interaction designers on Red Hat's User Experience (UX) Design and Ansible product teams, we worked for about six months to build a logo family with the Ansible community. This journey started even earlier when a project manager asked us for a "quick and easy" logo for a slide deck. After gathering a few requirements, we presented a logo to the stakeholders within a few days and without much need for iteration. A few months later, another stakeholder decided they would also benefit from having imagery for their materials, so we repeated the process. + +At this point, we noticed a pattern: logo resources like these no longer represented individual requests but rather a common need across the Ansible project. After completing several logo requests, we had built a makeshift series that—without conscious branding and design conventions—created the potential for visual inconsistencies across the Ansible brand. As the logo collection grew, we recognized this looming problem and the need to combat it. + +Our solution was to create an Ansible design system, a brand-specific resource to guide consistent logo design well into the future. + +### What is a design system? + +A design system is a collection of reusable assets and guidelines that help inform the visual language of any digital product suite. Design systems create patterns to bring separate products together and elevate brands through scalability and consistency. + +Especially in a large corporation with multiple products in the portfolio, scaling does not come easily without standardization as different teams contribute to each product. Design systems work as a baseline for each team to build new assets on. With a standardized look and feel, products are unified as one family across the portfolio. + +### Getting started building a design system + +After receiving a series of requests from stakeholders to create logos for the open source Ansible community, such as Ansible Builder, Ansible Runner, and Project Receptor, we decided to design a structure for our workflow and create a single source of truth to work for moving forward. + +First, we conducted a visual audit of the existing logos to determine what we had to work with. Ansible's original logo family consists of four main images: the Angry Spud for AWX, the Ansibull for Ansible Core/Engine, and the monitor with wings for AWX. Most of the logos were tied together with a consistent shade of red and bull imagery, but the stroke width, stroke color, line quality, and typography were vast and varied. + +![Original Ansible logos][2] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +The Angry Spud uses a tan outline and a hand-drawn style, while the bull is a symmetrical, geometric vector. The AWX monitor was the outlier with its thin line-art wings, blue vector rectangle, and Old English typeface (not included here, but an exception from the rest of the family, which uses a modern sans serif). + +### Establishing new design criteria + +Taking color palette, typography, and imagery into consideration, we generated a consistent composition that features the Ansibull for all core Ansible products, along with bold lines and vibrant colors. + +![Ansible design system][4] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +The new Ansible community logo design style guide details the color palette, typography, sizing, spacing, and logo variations for Ansible product logos. + +The new style guide presents a brand new, modern custom typeface based on GT America by [Grilli Type][5], an independent Swiss type foundry. We created a softer look for the typeface to match the imagery's roundedness by rounding out certain corners of each letter. + +We decided to curate a more lively, saturated, and universal color palette by incorporating more colors in the spectrum and basing them on primary colors. The new palette features light blue, yellow, and pink, each with a lighter highlight and darker shadow. This broader color scope allows more flexibility within the system and introduces a 3D look and feel. + +![New Ansible logos][6] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +We also introduced new imagery, such as the hexagons in the Receptor and AWX logos for visual continuity. Finally, we made sure each logo works on both light and dark backgrounds for maximum flexibility. + +### Expanding the design portfolio + +Once we established the core logo family, we moved onto creating badges for Ansible services, such as Ansible Demo and Ansible Workshop. To differentiate services from products, we decided to enclose service graphics in a circle that contains the name of the service in the same custom typography. The new service badges show the baby Ansibull (from the Ansible Builder logo) completing tasks related to each service, such as pointing to a whiteboard for Ansible Demo or using building tools for Ansible Workshop. + +![New Ansible services logos][7] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +### Using open source for design decisions + +The original AWX logo was influenced by rock-and-roll imagery, such as the wings and the heavy metal typeface (omitted from the image here). + +![Original AWX logo][8] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +Several members of the Ansible community, including the Red Hat Diversity and Inclusion group, brought to our attention that these elements resemble imagery used by hate groups. + +Given the social implications of the original logo's imagery, we had to work quickly with the Ansible community to design a replacement. Instead of working in a silo, as we did for the initial logos, we broadened the project's scope to carefully consider a wider range of stakeholders, including the Ansible community, Red Hat Diversity and Inclusion group, and Red Hat Legal team. + +We started brainstorming by reaching out to the Ansible open source community for ideas. One of the Ansible engineers, Rebeccah Hunter, contributed in the sketching phase and later became an embedded part of our design team. Part of the challenge of involving a large group of stakeholders was that we had a variety of ideas for new logo concepts, ranging from an auxiliary cable to a bowl of ramen. + +We sketched five community-surfaced logos, each featuring a different branded visual: a sprout, a rocket, a monitor, a bowl of ramen, and an auxiliary cable. + +![AWX logo concepts][9] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +After completing these initial concept sketches, we set up a virtual voting mechanism that we used throughout the iteration process. This voting system allowed us to use community feedback to narrow from five initial concepts down to three: the rocket, the bowl of ramen, and the monitor. We further iterated on these three directions and presented back, via a Slack channel dedicated to this effort, until we landed on one direction, the AWX monitor, that aligned with the community's vision. + +![New AWX logo][10] + +(Fiona Lin and Taufique Rahman, [CC BY-SA 4.0][3]) + +With community voices as our guide, we pursued the monitor logo concept for AWX. We preserved the monitor element from the original logo while modernizing the look and feel to match our updated design system. We used a more vibrant color palette, a cleaner sans-serif typeface, and elements, including the hexagon motif, from the Project Receptor logo. + +By engaging with our community from the beginning of the process, we were able to design and iterate in the open with a sense of inclusiveness from all stakeholders. In the end, we felt this was the best approach for replacing a controversial logo. The final version was handed off to the Red Hat Legal team, and after approval, we replaced all current assets with this new logo. + +### Key takeaways + +Creating a set of rules and assets for a design system keeps your digital products consistent across the board, eliminates brand confusion, and enables scalability. + +As you explore building a design system with your own community, you may benefit from these key takeaways we learned along our path: + + * Scaling new logos with a design system is a much easier process than without one. + * Juggling design options becomes less daunting when you use a polling system to validate results. + * Directing a large audience's attention on sets of three eliminates decision fatigue and focuses community feedback. + + + +We hope this article provides insight into designing a system with an open source community and helps you recognize the benefit of developing a system early in your process. If you are creating a new design system, what questions do you have? And if you have created one, what lessons have you learned? Please share your ideas in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/ansible-community-logos + +作者:[Fiona Lin][a] +选题:[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/fionalin +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ux-design-mac-laptop.jpg?itok=9-HKgXa9 (UX design Mac computer with mobile and laptop) +[2]: https://opensource.com/sites/default/files/pictures/original_logos.png (Original Ansible logos) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/pictures/design_system.png (Ansible design system) +[5]: https://www.grillitype.com/ +[6]: https://opensource.com/sites/default/files/pictures/new_logos.png (New Ansible logos) +[7]: https://opensource.com/sites/default/files/pictures/new_service_badges.png (New Ansible services logos) +[8]: https://opensource.com/sites/default/files/uploads/awx_original.png (Original AWX logo) +[9]: https://opensource.com/sites/default/files/uploads/awx_concepts.png (AWX logo concepts) +[10]: https://opensource.com/sites/default/files/uploads/awx.png (New AWX logo) From c36d61941b971b8129c1af4719898cca961fad6b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:45 +0800 Subject: [PATCH 277/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210426=20?= =?UTF-8?q?KDE=20Announces=20Various=20App=20Upgrades=20With=20Cutting-Edg?= =?UTF-8?q?e=20Features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md --- ...App Upgrades With Cutting-Edge Features.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md diff --git a/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md b/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md new file mode 100644 index 0000000000..aa92c51969 --- /dev/null +++ b/sources/news/20210426 KDE Announces Various App Upgrades With Cutting-Edge Features.md @@ -0,0 +1,169 @@ +[#]: subject: (KDE Announces Various App Upgrades With Cutting-Edge Features) +[#]: via: (https://news.itsfoss.com/kde-gear-app-release/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +KDE Announces Various App Upgrades With Cutting-Edge Features +====== + +Alongside their Plasma Desktop Environment, KDE develops a huge range of other apps collectively named KDE Gear. These range from content creation apps such as **Kdenlive** and **Kwave** to utilities such as Dolphin, Discover, and Index. + +KDE Gear is something new. It includes heaps of improvements to almost all the KDE apps, which we will be exploring here. + +### What Is KDE Gear? + +![][1] + +For many people, this name will sound unfamiliar. This is because [KDE Gear][2] is the new name for the [KDE Applications][3]. Previously, they were released individually. The new name aims to unify their marketing and provide greater clarity to users. + +According to **KDE developer Jonathan Riddell**: + +> KDE Gear is the new name for the app (and libraries and plugins) bundle of projects that want the release faff taken off their hands… It was once called just KDE, then KDE SC, then KDE Applications, then the unbranded release service, and now we’re banding it again as KDE Gear. + +This rebrand makes sense, especially as the KDE logo itself is pretty much a glorified gear. + +### Major KDE App Upgrades + +KDE Gear contains many applications, each with its purpose. Here, we will be looking at a few of the key highlights. These include: + + * Kdenlive + * Dolphin + * Elisa + * Index + + + +We have also covered the new [Kate editor release challenging Microsoft’s Visual Studio Code][4] separately, if you are curious. + +#### Kdenlive + +![][5] + +KDE’s video editor has improved massively over the past few years, with heaps of new features added with this release. It involves: + + * Online Resources tool + * Speech-To-Text + * New AV1 support + + + +The Online resources tool is a fairly recent addition. The main purpose of this tool is to download free stock footage for use in your videos. + +The Speech-To-Text tool is a nifty little tool that will automatically create subtitles for you, with surprising accuracy. It is also effortless to use, with it being launched in just 3 clicks. + +Finally, we get to see the main new feature in the 21.04 release: AV1 codec support. This is a relatively new video format with features such as higher compression, and a royalty-free license. + +#### Dolphin + +![][5] + +Dolphin, the file manager for Plasma 5, is one of the most advanced file managers existing. Some of its notable features include a built-in terminal emulator and file previews. + +With this release, there are a multitude of new features, including the ability to: + + * Decompress multiple files at once + * Open a folder in a new tab by holding the control key + * Modify the options in the context menu + + + +While minor, these new features are sure to make using Dolphin an even smoother experience. + +#### Elisa + +![][6] + +Elisa is one of the most exciting additions to KDE Gear. For those who don’t know about it yet, Elisa is a new music player based on [Kirigami][7]. The result of this is an app capable of running on both desktop and mobile. + +With this release, the list of features offered by this application has grown quite a bit longer. Some of these new features include: + + * Support for AAC audio files + * Support for .m3u8 playlists + * Reduced memory usage + + + +As always, the inclusion of support for more formats is welcome. As the KDE release announcement says: + +> But [the new features] don’t mean Elisa has become clunkier. Quite the contrary: the new version released with KDE Gear today actually consumes less memory when you scroll around the app, making it snappy and a joy to use. + +This app is becoming better with each release, and is becoming one of my favorite apps for Linux. At the rate it is improving, we can expect Elisa to become one of the best music players in existence. + +#### Index + +Index is the file manager for Plasma Mobile. Based on Kirigami technologies, it adapts to both mobile and desktop screens well. + +Alongside this convergence advantage, it has almost reached feature-parity with Dolphin, making it a viable alternative on the desktop as well. Because it is constantly being updated with new features and is an evolving application, there isn’t a set list of new features. + +If you want to check out its latest version, feel free to [download it from the project website.][8] + +### Other App Updates + +![][5] + +In addition to the above-mentioned app upgrades, you will also find significant improvements for **Okular**, **KMail**, and other KDE applications. + +To learn more about the app updates, you can check out the [official announcement page][9]. + +### Wrapping Up + +The new KDE Gear 21.04 release includes a wide range of new features and updates all the KDE apps. These promise better performance, usability, and compatibility. + +I am really excited about Elisa and Index, especially as they make use of Kirigami. + +_What do you think about_ _the latest KDE app updates? Let me know your thoughts down in the comments below!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Linux Release Roundup #21.17: Ubuntu 21.04, VirtualBox 6.1.20, Firefox 88, and More New Releases][10] + * ![][11] ![Linux Release Roundups][12] + + + * [KDE Plasma 5.21 Brings in a New Application Launcher, Wayland Support, and Other Exciting Additions][13] + * ![][11] ![][14] + + + * [SparkyLinux 2021.03 Release Introduces a KDE Plasma Edition, Xfce 4.16 Update, and More Upgrades][15] + * ![][11] ![][16] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-gear-app-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMxOCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[2]: https://kde.org/announcements/gear/21.04/ +[3]: https://apps.kde.org/ +[4]: https://news.itsfoss.com/kate/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQzOScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzczMCcgd2lkdGg9JzYwMCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://develop.kde.org/frameworks/kirigami// +[8]: https://download.kde.org/stable/maui/index/1.2.1/index-v1.2.1-amd64.AppImage +[9]: https://kde.org/announcements/releases/2020-04-apps-update/ +[10]: https://news.itsfoss.com/linux-release-roundup-2021-17/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/kde-plasma-5-21-release/ +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/kde-plasma-5-21-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[15]: https://news.itsfoss.com/sparkylinux-2021-03-release/ +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/sparky-linux-feat.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 3d32868507989780610c5024e891adc7d9ff3c48 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Apr 2021 05:03:58 +0800 Subject: [PATCH 278/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210426=20?= =?UTF-8?q?Next=20Mainline=20Linux=20Kernel=205.12=20Released=20with=20Ess?= =?UTF-8?q?ential=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md --- ...12 Released with Essential Improvements.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md diff --git a/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md b/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md new file mode 100644 index 0000000000..e6727ae724 --- /dev/null +++ b/sources/news/20210426 Next Mainline Linux Kernel 5.12 Released with Essential Improvements.md @@ -0,0 +1,146 @@ +[#]: subject: (Next Mainline Linux Kernel 5.12 Released with Essential Improvements) +[#]: via: (https://news.itsfoss.com/linux-kernel-5-12-release/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Next Mainline Linux Kernel 5.12 Released with Essential Improvements +====== + +[Linux Kernel 5.11][1] was an impressive release with the support for new hardware that’s probably out-of-stock till the end of 2022. + +Now, almost after 2 months of work and a week of delay for a release candidate version 8, Linux Kernel 5.12 is here. + +The improvements span across many things that include processor support, laptop support, new hardware support, storage enhancements, and a few more essential driver additions. + +Here, I will highlight the key changes with this release to give you an overview. + +### Linux Kernel 5.12: Essential Improvements & Additions + +Linux Kernel 5.12 is a neat release with many essential additions. Also, it is worth noting that Linux [5.13 would be the first Linux Kernel to add initial support for Apple M1 devices][2] if you were expecting it here. + +With the [release announcement][3], Linus Torvalds mentioned: + +> Thanks to everybody who made last week very calm indeed, which just makes me feel much happier about the final 5.12 release. +> +> Both the shortlog and the diffstat are absolutely tiny, and it’s mainly just a random collection of small fixes in various areas: arm64 devicetree files, some x86 perf event fixes (and a couple of tooling ones), various minor driver fixes (amd and i915 gpu fixes stand out, but honestly, that’s not because they are big, but because the rest is even smaller), a couple of small reverts, and a few locking fixes (one kvm serialization fix, one memory ordering fix for rwlocks). + +Let us take a look at what’s new overall. + +#### Official PlayStation 5 Controller Driver + +Sony’s open-source driver for controllers were pushed back last cycle, but it has been included with Linux 5.12 Kernel. + +Not just as a one-time open-source driver addition but Sony has committed to its maintenance as well. + +So, if you were looking to use Sony’s DualSense PlayStation 5 Controller, now would be a good time to test it out. + +#### AMD FreeSync HDMI Support + +While AMD has been keeping up with good improvements for its Linux graphics drivers, there was no [FreeSync][4] support over HDMI port. + +With Linux Kernel 5.12, a patch has been merged to the driver that enables FreeSync support on HDMI ports. + +#### Intel Adaptive-Sync for Xe Graphics + +Intel’s 12th gen Xe Graphics is an exciting improvement for many users. Now, with Linux Kernel 5.12, adaptive sync support (variable refresh rate) will be added to connections over the Display Port. + +Of course, considering that AMD has managed to add FreeSync support with HDMI, Intel would probably be working on the same for the next Linux Kernel release. + +#### Nintendo 64 Support + +Nintendo 64 is a popular but very [old home video game console][5]. For this reason, it might be totally dropped as an obsolete platform but it is good to see the added support (for those few users out there) in Linux Kernel 5.12. + +#### OverDrive Overclocking for Radeon 4000 Series + +Overlocking support for AMD’s latest GPU’s was not yet supporting using the command-line based OverDrive utility. + +Even though OverDrive has been officially discontinued, there is no GUI-based utility by AMD for Linux. So, this should help meanwhile. + +#### Open-Source Nvidia Driver Support for Ampere Cards + +The open-source Nvidia [Nouveau][6] drivers introduces improved support for Ampere-based cards with Linux Kernel 5.12, which is a step-up from Linux Kernel 5.11 improvements. + +With the upcoming Linux Kernel 5.13, you should start seeing 3D acceleration support as well. + +#### Improvements to exFAT Filesystem + +There have been significant optimizations for [exFAT Filesytem][7] that should allow you to delete big files much faster. + +#### Intel’s Open-Source Driver to Display Laptop Hinge/Keyboard Angle + +If you have a modern Intel laptop, you are in luck. Intel has contributed another open-source driver to help display the laptop hinge angle in reference to the ground. + +Maybe you are someone who’s writing a script to get something done in your Laptop when the hinge reaches a certain angle or who knows what else? Tinkerers would mostly benefit from this addition by harnessing the information they did not have. + +### Other Improvements + +In addition to the key additions I mentioned above, there are numerous other improvements that include: + + * Improved battery reporting for Logitech peripherals + * Improved Microsoft Surface laptop support + * Snapdragon 888 support + * Getting rid of obsolete ARM platforms + * Networking improvements + * Security improvements + + + +You might want to check out the [full changelog][8] to know all the technical details. + +If you think Linux 5.12 could be a useful upgrade for you, I’d suggest you to wait for your Linux distribution to push an update or make it available for you to select it as your Linux Kernel from the repository. + +It is also directly available in [The Linux Kernel Archives][9] as a tarball if you want to compile it from source. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Linux Release Roundup #21.14: AlmaLinux OS, Linux Lite 5.4, Ubuntu 21.04 and More New Releases][10] + * ![][11] ![Linux Release Roundups][12] + + + * [Linux Kernel 5.11 Released With Support for Wi-Fi 6E, RTX 'Ampere' GPUs, Intel Iris Xe and More][1] + * ![][11] ![][13] + + + * [Nitrux 1.3.8 Release Packs in KDE Plasma 5.21, Linux 5.11, and More Changes][14] + * ![][11] ![][15] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-kernel-5-12-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-kernel-5-11-release/ +[2]: https://news.itsfoss.com/linux-kernel-5-13-apple-m1/ +[3]: https://lore.kernel.org/lkml/CAHk-=wj3ANm8QrkC7GTAxQyXyurS0_yxMR3WwjhD9r7kTiOSTw@mail.gmail.com/ +[4]: https://en.wikipedia.org/wiki/FreeSync +[5]: https://en.wikipedia.org/wiki/Nintendo_64 +[6]: https://nouveau.freedesktop.org +[7]: https://en.wikipedia.org/wiki/ExFAT +[8]: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.12 +[9]: https://www.kernel.org/ +[10]: https://news.itsfoss.com/linux-release-roundup-2021-14/ +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/linux-kernel-5-11-release.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[14]: https://news.itsfoss.com/nitrux-1-3-8-release/ +[15]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/nitrux-1-3-8.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 03d2e84f875c61ef32178143af6a617b014f31d2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Apr 2021 08:41:44 +0800 Subject: [PATCH 279/307] translated --- ...10422 Restore an old MacBook with Linux.md | 104 ------------------ ...10422 Restore an old MacBook with Linux.md | 103 +++++++++++++++++ 2 files changed, 103 insertions(+), 104 deletions(-) delete mode 100644 sources/tech/20210422 Restore an old MacBook with Linux.md create mode 100644 translated/tech/20210422 Restore an old MacBook with Linux.md diff --git a/sources/tech/20210422 Restore an old MacBook with Linux.md b/sources/tech/20210422 Restore an old MacBook with Linux.md deleted file mode 100644 index 381613d79c..0000000000 --- a/sources/tech/20210422 Restore an old MacBook with Linux.md +++ /dev/null @@ -1,104 +0,0 @@ -[#]: subject: (Restore an old MacBook with Linux) -[#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Restore an old MacBook with Linux -====== -Don't throw your old, slow MacBook into the recycling bin; extend its -life with Linux Mint. -![Writing Hand][1] - -Last year, I wrote about how you can give [new life to an old MacBook][2] with Linux, specifically Elementary OS in that instance. Recently, I returned to that circa 2015 MacBook Air and discovered I had lost my login password. I downloaded the latest Elementary OS 5.1.7 Hera release and could not get the live boot to recognize my Broadcom 4360 wireless chipset. - -Lately, I have been using [Linux Mint][3] to refurbish older laptops, and I thought I would give it a try on this MacBook Air. I downloaded the Linux Mint 20.1 ISO and created a USB boot drive using the [Popsicle][4] software on my Linux desktop computer. - -![Popsicle ISO burner][5] - -(Don Watkins, [CC BY-SA 4.0][6]) - -Next, I connected the Thunderbolt Ethernet adapter to the MacBook and inserted the USB boot drive. I powered on the system and pressed the Option key on the MacBook to instruct it to start it from a USB drive. - -Linux Mint started up nicely in live-boot mode, but the operating system didn't recognize a wireless connection. - -### Where's my wireless? - -This is because Broadcom, the company that makes WiFi cards for Apple devices, doesn't release open source drivers. This is in contrast to Intel, Atheros, and many other chip manufacturers—but it's the chipset used by Apple, so it's a common problem on MacBooks. - -I had a hard-wired Ethernet connection to the internet through my Thunderbolt adapter, so I _was_ online. From prior research, I knew that to get the wireless adapter working on this MacBook, I would need to issue three separate commands in the Bash terminal. However, during the installation process, I learned that Linux Mint has a nice built-in Driver Manager that provides an easy graphical user interface to assist with installing the software. - -![Linux Mint Driver Manager][7] - -(Don Watkins, [CC BY-SA 4.0][6]) - -Once that operation completed, I rebooted and brought up my newly refurbished MacBook Air with Linux Mint 20.1 installed. The Broadcom wireless adapter was working properly, allowing me to connect to my wireless network easily. - -### Installing wireless the manual way - -You can accomplish the same task from a terminal. First, purge any vestige of the Broadcom kernel source: - - -``` -`$ sudo apt-get purge bcmwl-kernel-source` -``` - -Then add a firmware installer: - - -``` -`$ sudo apt install firmware-b43-installer` -``` - -Finally, install the new firmware for the system: - - -``` -`$ sudo apt install linux-firmware` -``` - -### Using Linux as your Mac - -I installed [Phoronix Test Suite][8] to get a good snapshot of the MacBook Air. - -![MacBook Phoronix Test Suite output][9] - -(Don Watkins, [CC BY-SA 4.0][6]) - -The system works very well. A recent update to kernel 5.4.0-64-generic revealed that the wireless connection survived, and I have an 866Mbps connection to my home network. The Broadcom FaceTime camera does not work, but everything else works fine. - -I really like the [Linux Mint Cinnamon 20.1][10] desktop on this MacBook. - -![Linux Mint Cinnamon][11] - -(Don Watkins, [CC BY-SA 4.0][6]) - -I recommend giving Linux Mint a try if you have an older MacBook that has been rendered slow and inoperable due to macOS updates. I am very impressed with the distribution, and especially how it works on my MacBook Air. It has definitely extended the life expectancy of this powerful little laptop. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/restore-macbook-linux - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/write-hand_0.jpg?itok=Uw5RJD03 (Writing Hand) -[2]: https://opensource.com/article/20/2/macbook-linux-elementary -[3]: https://linuxmint.com/ -[4]: https://github.com/pop-os/popsicle -[5]: https://opensource.com/sites/default/files/uploads/popsicle.png (Popsicle ISO burner) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://opensource.com/sites/default/files/uploads/mint_drivermanager.png (Linux Mint Driver Manager) -[8]: https://www.phoronix-test-suite.com/ -[9]: https://opensource.com/sites/default/files/uploads/macbook_specs.png (MacBook Phoronix Test Suite output) -[10]: https://www.linuxmint.com/edition.php?id=284 -[11]: https://opensource.com/sites/default/files/uploads/mintcinnamon.png (Linux Mint Cinnamon) diff --git a/translated/tech/20210422 Restore an old MacBook with Linux.md b/translated/tech/20210422 Restore an old MacBook with Linux.md new file mode 100644 index 0000000000..1cececa127 --- /dev/null +++ b/translated/tech/20210422 Restore an old MacBook with Linux.md @@ -0,0 +1,103 @@ +[#]: subject: (Restore an old MacBook with Linux) +[#]: via: (https://opensource.com/article/21/4/restore-macbook-linux) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Linux 翻新旧的 MacBook +====== +不要把你又旧又慢的 MacBook 扔进垃圾桶。用 Linux Mint 延长它的寿命。 +![Writing Hand][1] + +去年,我写了篇关于如何用 Linux 赋予[旧 MacBook 的新生命][2]的文章,在例子中提到了 Elementary OS。最近,我用回那台 2015 年左右的 MacBook Air,发现遗失了我的登录密码。我下载了最新的 Elementary OS 5.1.7 Hera,但无法让实时启动识别我的 Broadcom 4360 无线芯片组。 + +最近,我一直在使用 [Linux Mint][3] 来翻新旧的笔记本电脑,我想在这台 MacBook Air 上试一下。我下载了 Linux Mint 20.1 ISO,并在我的 Linux 台式电脑上使用 [Popsicle][4] 创建了一个 USB 启动器。 + +![Popsicle ISO burner][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +接下来,我将 Thunderbolt 以太网适配器连接到 MacBook,并插入 USB 启动器。我打开系统电源,按下 MacBook 上的 Option 键,指示它从 USB 驱动器启动系统。 + +Linux Mint 在实时启动模式下启动没问题,但操作系统没有识别出无线连接。 + +### 我的无线网络在哪里? + +这是因为为苹果设备制造 WiFi 卡的公司 Broadcom 没有发布开源驱动程序。这与英特尔、Atheros 和许多其他芯片制造商形成鲜明对比,但它是苹果公司使用的芯片组,所以这是 MacBook 上的一个常见问题。 + +我通过我的 Thunderbolt 适配器有线连接到以太网,因此我_是_在线的。通过之前的研究,我知道要让无线适配器在这台 MacBook 上工作,我需要在 Bash 终端执行三条独立的命令。然而,在安装过程中,我了解到 Linux Mint 有一个很好的内置驱动管理器,它提供了一个简单的图形用户界面来协助安装软件。 + +![Linux Mint Driver Manager][7] + +(Don Watkins, [CC BY-SA 4.0][6]) + +该操作完成后,我重启了安装了 Linux Mint 20.1 的新近翻新的 MacBook Air。Broadcom 无线适配器工作正常,使我能够轻松地连接到我的无线网络。 + +### 手动安装无线 + +你可以从终端完成同样的任务。首先,清除 Broadcom 内核源码的残余。 + + +``` +`$ sudo apt-get purge bcmwl-kernel-source` +``` + +然后添加一个固件安装程序: + + +``` +`$ sudo apt install firmware-b43-installer` +``` + +最后,为系统安装新固件: + + +``` +`$ sudo apt install linux-firmware` +``` + +### 将 Linux 作为你的 Mac 使用 + +我安装了 [Phoronix 测试套件][8]以获得 MacBook Air 的快照。 + +![MacBook Phoronix Test Suite output][9] + +(Don Watkins, [CC BY-SA 4.0][6]) + +系统工作良好。对内核5 .4.0-64-generic 的最新更新显示,无线连接仍然存在,并且我与家庭网络之间的连接为 866Mbps。Broadcom 的 FaceTime 摄像头不能工作,但其他东西都能正常工作。 + +我非常喜欢这台 MacBook 上的 [Linux Mint Cinnamon 20.1][10] 桌面。 + +![Linux Mint Cinnamon][11] + +(Don Watkins, [CC BY-SA 4.0][6]) + +如果你有一台因 macOS 更新而变得缓慢且无法使用的旧 MacBook,我建议你试一下 Linux Mint。我对这个发行版印象非常深刻,尤其是它在我的 MacBook Air 上的工作情况。它无疑延长了这个强大的小笔记本电脑的寿命。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/restore-macbook-linux + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/write-hand_0.jpg?itok=Uw5RJD03 (Writing Hand) +[2]: https://opensource.com/article/20/2/macbook-linux-elementary +[3]: https://linuxmint.com/ +[4]: https://github.com/pop-os/popsicle +[5]: https://opensource.com/sites/default/files/uploads/popsicle.png (Popsicle ISO burner) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/mint_drivermanager.png (Linux Mint Driver Manager) +[8]: https://www.phoronix-test-suite.com/ +[9]: https://opensource.com/sites/default/files/uploads/macbook_specs.png (MacBook Phoronix Test Suite output) +[10]: https://www.linuxmint.com/edition.php?id=284 +[11]: https://opensource.com/sites/default/files/uploads/mintcinnamon.png (Linux Mint Cinnamon) From 84c97cdacc33a1ce557adc02dade0f8e1bd6626f Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Apr 2021 08:52:43 +0800 Subject: [PATCH 280/307] translating --- .../tech/20210416 Play a fun math game with Linux commands.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210416 Play a fun math game with Linux commands.md b/sources/tech/20210416 Play a fun math game with Linux commands.md index 6a179e1ba6..cbb55f7f4e 100644 --- a/sources/tech/20210416 Play a fun math game with Linux commands.md +++ b/sources/tech/20210416 Play a fun math game with Linux commands.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1d0b3d157a60be11915f1977ed85b96970a2d4fb Mon Sep 17 00:00:00 2001 From: hustdemg Date: Tue, 27 Apr 2021 10:23:35 +0800 Subject: [PATCH 281/307] Update 20210420 A beginner-s guide to network management.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译申请 --- ... beginner-s guide to network management.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/tech/20210420 A beginner-s guide to network management.md b/sources/tech/20210420 A beginner-s guide to network management.md index 9dc5f8b77f..d123c31ea3 100644 --- a/sources/tech/20210420 A beginner-s guide to network management.md +++ b/sources/tech/20210420 A beginner-s guide to network management.md @@ -1,11 +1,11 @@ -[#]: subject: (A beginner's guide to network management) -[#]: via: (https://opensource.com/article/21/4/network-management) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: subject: "A beginner's guide to network management" +[#]: via: "https://opensource.com/article/21/4/network-management" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "ddl-hust" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " A beginner's guide to network management ====== @@ -206,13 +206,13 @@ via: https://opensource.com/article/21/4/network-management [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk "Tips and gears turning" [2]: https://tools.ietf.org/html/rfc793 [3]: https://tools.ietf.org/html/rfc791 -[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg (Crossover cable) +[4]: https://opensource.com/sites/default/files/uploads/crossover.jpg "Crossover cable" [5]: https://creativecommons.org/licenses/by-sa/4.0/ [6]: https://opensource.com/article/17/4/build-your-own-name-server [7]: http://redhat.com [8]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd [9]: https://opensource.com/article/20/1/open-source-networking -[10]: https://opensource.com/downloads/cheat-sheet-networking +[10]: https://opensource.com/downloads/cheat-sheet-networking \ No newline at end of file From 14e365880e12a075ce92deaa1f07b1edc0dcc182 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 27 Apr 2021 22:19:32 +0800 Subject: [PATCH 282/307] PUB @wxy https://linux.cn/article-13340-1.html --- ...07 Using network bound disk encryption with Stratis.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20210407 Using network bound disk encryption with Stratis.md (98%) diff --git a/translated/tech/20210407 Using network bound disk encryption with Stratis.md b/published/20210407 Using network bound disk encryption with Stratis.md similarity index 98% rename from translated/tech/20210407 Using network bound disk encryption with Stratis.md rename to published/20210407 Using network bound disk encryption with Stratis.md index 69d8a6987f..4c1440fd56 100644 --- a/translated/tech/20210407 Using network bound disk encryption with Stratis.md +++ b/published/20210407 Using network bound disk encryption with Stratis.md @@ -4,13 +4,13 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13340-1.html) 使用 Stratis 的网络绑定磁盘加密 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202104/27/221704gyzyvyroyyrybany.jpg) 在一个有许多加密磁盘的环境中,解锁所有的磁盘是一项困难的任务。网络绑定磁盘加密Network bound disk encryption(NBDE)有助于自动解锁 Stratis 卷的过程。这是在大型环境中的一个关键要求。Stratis 2.1 版本增加了对加密的支持,这在《[Stratis 加密入门][4]》一文中介绍过。Stratis 2.3 版本最近在使用加密的 Stratis 池时引入了对网络绑定磁盘加密(NBDE)的支持,这是本文的主题。 @@ -277,7 +277,7 @@ via: https://fedoramagazine.org/network-bound-disk-encryption-with-stratis/ [1]: https://fedoramagazine.org/wp-content/uploads/2021/03/stratis-nbde-816x345.jpg [2]: https://unsplash.com/@imattsmart?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText [3]: https://unsplash.com/s/photos/lock?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/getting-started-with-stratis-encryption/ +[4]: https://linux.cn/article-13311-1.html [5]: https://stratis-storage.github.io/ [6]: https://www.youtube.com/watch?v=CJu3kmY-f5o [7]: https://github.com/latchset/tang From e3e539e7e9e3c80f73657ff9078aa3ac7633c5ad Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 27 Apr 2021 22:53:07 +0800 Subject: [PATCH 283/307] PRF @geekpi --- ...10422 Restore an old MacBook with Linux.md | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210422 Restore an old MacBook with Linux.md b/translated/tech/20210422 Restore an old MacBook with Linux.md index 1cececa127..f124af7bdf 100644 --- a/translated/tech/20210422 Restore an old MacBook with Linux.md +++ b/translated/tech/20210422 Restore an old MacBook with Linux.md @@ -3,14 +3,16 @@ [#]: author: (Don Watkins https://opensource.com/users/don-watkins) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 用 Linux 翻新旧的 MacBook ====== -不要把你又旧又慢的 MacBook 扔进垃圾桶。用 Linux Mint 延长它的寿命。 -![Writing Hand][1] + +> 不要把你又旧又慢的 MacBook 扔进垃圾桶。用 Linux Mint 延长它的寿命。 + +![](https://img.linux.net.cn/data/attachment/album/202104/27/225241mdbp59t67699r9de.jpg) 去年,我写了篇关于如何用 Linux 赋予[旧 MacBook 的新生命][2]的文章,在例子中提到了 Elementary OS。最近,我用回那台 2015 年左右的 MacBook Air,发现遗失了我的登录密码。我下载了最新的 Elementary OS 5.1.7 Hera,但无法让实时启动识别我的 Broadcom 4360 无线芯片组。 @@ -18,8 +20,6 @@ ![Popsicle ISO burner][5] -(Don Watkins, [CC BY-SA 4.0][6]) - 接下来,我将 Thunderbolt 以太网适配器连接到 MacBook,并插入 USB 启动器。我打开系统电源,按下 MacBook 上的 Option 键,指示它从 USB 驱动器启动系统。 Linux Mint 在实时启动模式下启动没问题,但操作系统没有识别出无线连接。 @@ -28,53 +28,44 @@ Linux Mint 在实时启动模式下启动没问题,但操作系统没有识别 这是因为为苹果设备制造 WiFi 卡的公司 Broadcom 没有发布开源驱动程序。这与英特尔、Atheros 和许多其他芯片制造商形成鲜明对比,但它是苹果公司使用的芯片组,所以这是 MacBook 上的一个常见问题。 -我通过我的 Thunderbolt 适配器有线连接到以太网,因此我_是_在线的。通过之前的研究,我知道要让无线适配器在这台 MacBook 上工作,我需要在 Bash 终端执行三条独立的命令。然而,在安装过程中,我了解到 Linux Mint 有一个很好的内置驱动管理器,它提供了一个简单的图形用户界面来协助安装软件。 +我通过我的 Thunderbolt 适配器有线连接到以太网,因此我 _是_ 在线的。通过之前的研究,我知道要让无线适配器在这台 MacBook 上工作,我需要在 Bash 终端执行三条独立的命令。然而,在安装过程中,我了解到 Linux Mint 有一个很好的内置驱动管理器,它提供了一个简单的图形用户界面来协助安装软件。 ![Linux Mint Driver Manager][7] -(Don Watkins, [CC BY-SA 4.0][6]) - 该操作完成后,我重启了安装了 Linux Mint 20.1 的新近翻新的 MacBook Air。Broadcom 无线适配器工作正常,使我能够轻松地连接到我的无线网络。 ### 手动安装无线 你可以从终端完成同样的任务。首先,清除 Broadcom 内核源码的残余。 - ``` -`$ sudo apt-get purge bcmwl-kernel-source` +$ sudo apt-get purge bcmwl-kernel-source ``` 然后添加一个固件安装程序: - ``` -`$ sudo apt install firmware-b43-installer` +$ sudo apt install firmware-b43-installer ``` 最后,为系统安装新固件: - ``` -`$ sudo apt install linux-firmware` +$ sudo apt install linux-firmware ``` ### 将 Linux 作为你的 Mac 使用 -我安装了 [Phoronix 测试套件][8]以获得 MacBook Air 的快照。 +我安装了 [Phoronix 测试套件][8] 以获得 MacBook Air 的系统信息。 ![MacBook Phoronix Test Suite output][9] -(Don Watkins, [CC BY-SA 4.0][6]) - -系统工作良好。对内核5 .4.0-64-generic 的最新更新显示,无线连接仍然存在,并且我与家庭网络之间的连接为 866Mbps。Broadcom 的 FaceTime 摄像头不能工作,但其他东西都能正常工作。 +系统工作良好。对内核 5.4.0-64-generic 的最新更新显示,无线连接仍然存在,并且我与家庭网络之间的连接为 866Mbps。Broadcom 的 FaceTime 摄像头不能工作,但其他东西都能正常工作。 我非常喜欢这台 MacBook 上的 [Linux Mint Cinnamon 20.1][10] 桌面。 ![Linux Mint Cinnamon][11] -(Don Watkins, [CC BY-SA 4.0][6]) - 如果你有一台因 macOS 更新而变得缓慢且无法使用的旧 MacBook,我建议你试一下 Linux Mint。我对这个发行版印象非常深刻,尤其是它在我的 MacBook Air 上的工作情况。它无疑延长了这个强大的小笔记本电脑的寿命。 -------------------------------------------------------------------------------- @@ -84,7 +75,7 @@ via: https://opensource.com/article/21/4/restore-macbook-linux 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2651192f27025df3ada437f67abbf87b2f29fe51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 27 Apr 2021 22:54:31 +0800 Subject: [PATCH 284/307] PUB @geekpi https://linux.cn/article-13341-1.html --- .../20210422 Restore an old MacBook with Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210422 Restore an old MacBook with Linux.md (98%) diff --git a/translated/tech/20210422 Restore an old MacBook with Linux.md b/published/20210422 Restore an old MacBook with Linux.md similarity index 98% rename from translated/tech/20210422 Restore an old MacBook with Linux.md rename to published/20210422 Restore an old MacBook with Linux.md index f124af7bdf..6e28e972f5 100644 --- a/translated/tech/20210422 Restore an old MacBook with Linux.md +++ b/published/20210422 Restore an old MacBook with Linux.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13341-1.html) 用 Linux 翻新旧的 MacBook ====== From d7118c1490a82216812f432303c403bf3790962d Mon Sep 17 00:00:00 2001 From: stevenzdg988 <3442417@qq.com> Date: Tue, 27 Apr 2021 23:00:36 +0800 Subject: [PATCH 285/307] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ctivity with this Linux automation tool.md | 190 ------------------ ...ctivity with this Linux automation tool.md | 183 +++++++++++++++++ 2 files changed, 183 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20210203 Improve your productivity with this Linux automation tool.md create mode 100644 translated/tech/20210203 Improve your productivity with this Linux automation tool.md diff --git a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md b/sources/tech/20210203 Improve your productivity with this Linux automation tool.md deleted file mode 100644 index 86457a2e54..0000000000 --- a/sources/tech/20210203 Improve your productivity with this Linux automation tool.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (stevenzdg988) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Improve your productivity with this Linux automation tool) -[#]: via: (https://opensource.com/article/21/2/linux-autokey) -[#]: author: (Matt Bargenquast https://opensource.com/users/mbargenquast) - -Improve your productivity with this Linux automation tool -====== -Configure your keyboard to correct common typos, enter frequently used -phrases, and more with AutoKey. -![Linux keys on the keyboard for a desktop computer][1] - -[AutoKey][2] is an open source Linux desktop automation tool that, once it's part of your workflow, you'll wonder how you ever managed without. It can be a transformative tool to improve your productivity or simply a way to reduce the physical stress associated with typing. - -This article will look at how to install and start using AutoKey, cover some simple recipes you can immediately use in your workflow, and explore some of the advanced features that AutoKey power users may find attractive. - -### Install and set up AutoKey - -AutoKey is available as a software package on many Linux distributions. The project's [installation guide][3] contains directions for many platforms, including building from source. This article uses Fedora as the operating platform. - -AutoKey comes in two variants: autokey-gtk, designed for [GTK][4]-based environments such as GNOME, and autokey-qt, which is [QT][5]-based. - -You can install either variant from the command line: - - -``` -`sudo dnf install autokey-gtk` -``` - -Once it's installed, run it by using `autokey-gtk` (or `autokey-qt`). - -### Explore the interface - -Before you set AutoKey to run in the background and automatically perform actions, you will first want to configure it. Bring up the configuration user interface (UI): - - -``` -`autokey-gtk -c` -``` - -AutoKey comes preconfigured with some examples. You may wish to leave them while you're getting familiar with the UI, but you can delete them if you wish. - -![AutoKey UI][6] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -The left pane contains a folder-based hierarchy of phrases and scripts. _Phrases_ are text that you want AutoKey to enter on your behalf. _Scripts_ are dynamic, programmatic equivalents that can be written using Python and achieve basically the same result of making the keyboard send keystrokes to an active window. - -The right pane is where the phrases and scripts are built and configured. - -Once you're happy with your configuration, you'll probably want to run AutoKey automatically when you log in so that you don't have to start it up every time. You can configure this in the **Preferences** menu (**Edit -> Preferences**) by selecting **Automatically start AutoKey at login**. - -![Automatically start AutoKey at login][8] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -### Correct common typos with AutoKey - -Fixing common typos is an easy problem for AutoKey to fix. For example, I consistently type "gerp" instead of "grep." Here's how to configure AutoKey to fix these types of problems for you. - -Create a new subfolder where you can group all your "typo correction" configurations. Select **My Phrases** in the left pane, then **File -> New -> Subfolder**. Name the subfolder **Typos**. - -Create a new phrase in **File -> New -> Phrase**, and call it "grep." - -Configure AutoKey to insert the correct word by highlighting the phrase "grep" then entering "grep" in the **Enter phrase contents** section (replacing the default "Enter phrase contents" text). - -Next, set up how AutoKey triggers this phrase by defining an Abbreviation. Click the **Set** button next to **Abbreviations** at the bottom of the UI. - -In the dialog box that pops up, click the **Add** button and add "gerp" as a new abbreviation. Leave **Remove typed abbreviation** checked; this is what instructs AutoKey to replace any typed occurrence of the word "gerp" with "grep." Leave **Trigger when typed as part of a word** unchecked so that if you type a word containing "gerp" (such as "fingerprint"), it _won't_ attempt to turn that into "fingreprint." It will work only when "gerp" is typed as an isolated word. - -![Set abbreviation in AutoKey][9] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -### Restrict corrections to specific applications - -You may want a correction to apply only when you make the typo in certain applications (such as a terminal window). You can configure this by setting a Window Filter. Click the **Set** button to define one. - -The easiest way to set a Window Filter is to let AutoKey detect the window type for you: - - 1. Start a new terminal window. - 2. Back in AutoKey, click the **Detect Window Properties** button. - 3. Click on the terminal window. - - - -This will auto-populate the Window Filter, likely with a Window class value of `gnome-terminal-server.Gnome-terminal`. This is sufficient, so click **OK**. - -![AutoKey Window Filter][10] - -(Matt Bargenquast, [CC BY-SA 4.0][7]) - -### Save and test - -Once you're satisfied with your new configuration, make sure to save it. Click **File** and choose **Save** to make the change active. - -Now for the grand test! In your terminal window, type "gerp" followed by a space, and it should automatically correct to "grep." To validate the Window Filter is working, try typing the word "gerp" in a browser URL bar or some other application. It should not change. - -You may be thinking that this problem could have been solved just as easily with a [shell alias][11], and I'd totally agree! Unlike aliases, which are command-line oriented, AutoKey can correct mistakes regardless of what application you're using. - -For example, another common typo I make is "openshfit" instead of "openshift," which I type into browsers, integrated development environments, and terminals. Aliases can't quite help with this problem, whereas AutoKey can correct it in any occasion. - -### Type frequently used phrases with AutoKey - -There are numerous other ways you can invoke AutoKey's phrases to help you. For example, as a site reliability engineer (SRE) working on OpenShift, I frequently type Kubernetes namespace names on the command line: - - -``` -`oc get pods -n openshift-managed-upgrade-operator` -``` - -These namespaces are static, so they are ideal phrases that AutoKey can insert for me when typing ad-hoc commands. - -For this, I created a phrase subfolder named **Namespaces** and added a phrase entry for each namespace I type frequently. - -### Assign hotkeys - -Next, and most crucially, I assign the subfolder a **hotkey**. Whenever I press that hotkey, it opens a menu where I can select (either with **Arrow key**+**Enter** or using a number) the phrase I want to insert. This cuts down on the number of keystrokes I need to enter those commands to just a few keystrokes. - -AutoKey's pre-configured examples in the **My Phrases** folder are configured with a **Ctrl**+**F7** hotkey. If you kept the examples in AutoKey's default configuration, try it out. You should see a menu of all the phrases available there. Select the item you want with the number or arrow keys. - -### Advanced AutoKeying - -AutoKey's [scripting engine][12] allows users to run Python scripts that can be invoked through the same abbreviation and hotkey system. These scripts can do things like switching windows, sending keystrokes, or performing mouse clicks through supporting API functions. - -AutoKey users have embraced this feature by publishing custom scripts for others to adopt. For example, the [NumpadIME script][13] transforms a numeric keyboard into an old cellphone-style text entry method, and [Emojis-AutoKey][14] makes it easy to insert emojis by converting phrases such as `:smile:` into their emoji equivalent. - -Here's a small script I set up that enters Tmux's copy mode to copy the first word from the preceding line into the paste buffer: - - -``` -from time import sleep - -# Send the tmux command prefix (changed from b to s) -keyboard.send_keys("<ctrl>+s") -# Enter copy mode -keyboard.send_key("[") -sleep(0.01) -# Move cursor up one line -keyboard.send_keys("k") -sleep(0.01) -# Move cursor to start of line -keyboard.send_keys("0") -sleep(0.01) -# Start mark -keyboard.send_keys(" ") -sleep(0.01) -# Move cursor to end of word -keyboard.send_keys("e") -sleep(0.01) -# Add to copy buffer -keyboard.send_keys("<ctrl>+m") -``` - -The sleeps are there because occasionally Tmux can't keep up with how fast AutoKey sends the keystrokes, and they have a negligible effect on the overall execution time. - -### Automate with AutoKey - -I hope you've enjoyed this excursion into keyboard automation with AutoKey and it gives you some bright ideas about how it can improve your workflow. If you're using AutoKey in a helpful or novel way, be sure to share it in the comments below. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/linux-autokey - -作者:[Matt Bargenquast][a] -选题:[lujun9972][b] -译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/mbargenquast -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://github.com/autokey/autokey -[3]: https://github.com/autokey/autokey/wiki/Installing -[4]: https://www.gtk.org/ -[5]: https://www.qt.io/ -[6]: https://opensource.com/sites/default/files/uploads/autokey-defaults.png (AutoKey UI) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/startautokey.png (Automatically start AutoKey at login) -[9]: https://opensource.com/sites/default/files/uploads/autokey-set_abbreviation.png (Set abbreviation in AutoKey) -[10]: https://opensource.com/sites/default/files/uploads/autokey-window_filter.png (AutoKey Window Filter) -[11]: https://opensource.com/article/19/7/bash-aliases -[12]: https://autokey.github.io/index.html -[13]: https://github.com/luziferius/autokey_scripts -[14]: https://github.com/AlienKevin/Emojis-AutoKey diff --git a/translated/tech/20210203 Improve your productivity with this Linux automation tool.md b/translated/tech/20210203 Improve your productivity with this Linux automation tool.md new file mode 100644 index 0000000000..ee56421cea --- /dev/null +++ b/translated/tech/20210203 Improve your productivity with this Linux automation tool.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: (stevenzdg988) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Improve your productivity with this Linux automation tool) +[#]: via: (https://opensource.com/article/21/2/linux-autokey) +[#]: author: (Matt Bargenquast https://opensource.com/users/mbargenquast) + +使用 Linux 自动化工具提高生产率 +====== +配置键盘(按键)以纠正常见的打字排版错误,输入常用的短语,以及更多的使用 AutoKey (功能)。 +![台式机键盘上的Linux键][1] + +[AutoKey][2]是一个开源的 Linux 桌面自动化工具,一旦它成为你工作流程的一部分,你会想知道没有它究竟将如何管理。它可以成为一种提高生产率的有改革能力的工具或者仅仅是减少与打字有关的物理压力的一种方式。 + +本文将研究如何安装和开始使用 AutoKey ,介绍一些可以立即在工作流程中使用的简单方法,并探讨 AutoKey 高级用户可能会感兴趣的一些高级功能。 + +### 安装并设置 AutoKey + +AutoKey 在许多 Linux 发行版中作为一个可用软件包。该项目的[安装指南][3]包含许多平台的说明,包括从源代码进行构建。本文使用 Fedora 作为操作平台。 + +AutoKey 有两个变体:为像 GNOME 等基于 [GTK][4] 环境而设计的 autokey-gtk 和基于 [QT][5] 的 autokey-qt。 + +您可以从命令行安装任一变体: + +``` +`sudo dnf install autokey-gtk` +``` + +安装完成后,使用 `autokey-gtk`(或 `autokey-qt`)运行它。 + +### 探究界面 + +在将 AutoKey 设置为在后台运行并自动执行操作之前,您首先需要对其进行配置。调出用户界面(UI)配置: + +``` +`autokey-gtk -c` +``` + +AutoKey 提供了一些预设配置的示例。您可能希望在熟悉 UI 时将他们留作备用,但是可以根据需要删除它们。 + +![AutoKey 用户界面][6] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +左侧窗格包含基于层次结构的短语和脚本的文件夹。_Phrases_ 代表要让 AutoKey 输入的文本。_Scripts_ 是动态的有计划的等效项,可以使用 Python 编写,并且获得与键盘击键发送到活动窗口基本相同的结果。 + +右侧窗格构建和配置短语和脚本。 + +对配置满意后,您可能希望在登录时自动运行 AutoKey,这样就不必每次都启动它。您可以通过在 **Preferences**(首选)菜单(**Edit -> Preferences**(编辑 -> 首选项))中勾选 **Automatically start AutoKey at login**(登录时自动启动 AutoKey)进行配置。 + +![登录时自动启动 AutoKey][8] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +### 使用 AutoKey 纠正常见的打字排版错误 + +修复常见的打字排版错误对于 AutoKey 来说是一个容易解决的问题。例如,我始终键入 "gerp" 来代替 "grep"。这里是如何配置 AutoKey 为您解决这些类型问题。 + +创建一个新的子文件夹,可以在其中将所有“打字排版错误校正”配置分组。在左侧窗格中选择 **My Phrases** ,然后选择 **File -> New -> Subfolder**。将子文件夹命名为 **Typos**。 + +在 **File -> New -> Phrase** 中创建一个新短语。并将其称为 "grep"。 + +通过高亮显示短语 "grep",然后在 **Enter phrase contents**(输入短语内容)部分(替换默认的“输入短语内容”文本)中输入 "grep" ,配置 AutoKey 插入正确的关键词。 + +接下来,通过定义缩写来设置 AutoKey 如何触发此短语。 点击用户界面底部紧邻 **Abbreviations**(缩写)的 **Set**(设置)按钮("gerp")。 + +在弹出的对话框中,单击 **Add** 按钮,然后将 "gerp" 添加为新的缩写。勾选 **Remove typed abbreviation**(**删除键入的缩写**);此选项是命令 AutoKey 将出现 "gerp" 一词的任何键入替换为 "grep"。请不要勾选 **Trigger when typed as part of a word**(**在键入单词的一部分时触发**),这样,如果您键入包含 "grep"(例如 "fingerprint"(指纹))的单词,就不会尝试将其转换为 "fingreprint"。仅当将 "grep" 作为独立的单词键入时,此功能才有效。 + +![在 AutoKey 中设置缩写][9] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +### 限制对特定应用程序的更正 + +您可能希望仅在某些应用程序(例如终端窗口)中打字排版错误时才应用校正。您可以通过设置 Window Filter (窗口过滤器)进行配置。单击 **Set** 按钮来定义。 + +设置 Window Filter (窗口过滤器)的最简单方法是让 AutoKey 为您检测窗口类型: + + 1. 启动一个新的终端窗口。 + 2. 返回 AutoKey,单击 **Detect Window Properties** (**检测窗口属性**)按钮。 + 3. 单击终端窗口。 + +这将自动填充 Window Filter,可能窗口类值为 `gnome-terminal-server.Gnome-terminal`。这足够了,因此单击 **OK**。 + +![AutoKey 窗口过滤器][10] + +(Matt Bargenquast, [CC BY-SA 4.0][7]) + +### 保存并测试 + +对新配置满意后,请确保将其保存。 单击 **File** ,然后选择 **Save** 以使更改生效。 + +现在进行重要的测试!在您的终端窗口中,键入 "gerp" 紧跟一个空格,它将自动更正为 "grep"。要验证 Window Filter 是否正在运行,请尝试在浏览器 URL 栏或其他应用程序中键入单词 "gerp"。它并没有变化。 + +您可能会认为,使用 [shell 别名][11]可以轻松解决此问题,我完全赞成!与别名不同,只要是面向命令行,无论您使用什么应用程序,AutoKey 都可以按规则纠正错误。 + +例如,我在浏览器,集成开发环境和终端中输入的另一个常见打字排版错误 "openshfit" 替代为 "openshift"。别名不能完全解决此问题,而 AutoKey 可以在任何情况下纠正它。 + +### 键入常用短语 + +您可以通过许多其他方法来调用 AutoKey 的短语来帮助您。例如,作为从事 OpenShift 的站点可靠性工程师(SRE),我经常在命令行上输入 Kubernetes 命名空间名称: + +``` +`oc get pods -n openshift-managed-upgrade-operator` +``` + +这些名称空间是静态的,因此它们是键入特定命令时 AutoKey 可以为我插入的理想短语。 + +为此,我创建了一个名为 **Namespaces** 的短语子文件夹,并为我经常键入的每个命名空间添加了一个短语条目。 + +### 分配热键 + +接下来,也是最关键的一点,我为子文件夹分配了一个 **hotkey**。每当我按下该热键时,它都会打开一个菜单,我可以在其中选择(要么使用 **Arrow key(方向键)**+**Enter(键)** (组合键)要么使用数字(键))要插入的短语。这减少了我仅需几次击键就可以输入这些命令的击键次数。 + +**My Phrases** 文件夹中 AutoKey 的预配置示例使用 **Ctrl**+**F7** 热键进行配置。如果您将示例保留在 AutoKey 的默认配置中,请尝试一下。您应该在此处看到所有可用短语的菜单。使用数字或箭头键选择所需的项目。 + +### 高级自动键入 + +AutoKey 的[脚本引擎][12]允许用户运行可以通过相同的缩写和热键系统调用的 Python 脚本。这些脚本可以通过支持 API 的功能来完成诸如切换窗口,发送按键或执行鼠标单击之类的操作。 + +AutoKey 用户已经欣然接受通过发布自定义脚本为其他用户采用的这项功能。例如,[NumpadIME 脚本][13]将数字键盘转换为旧的手机样式的文本输入方法,[Emojis-AutoKey][14] 可以通过将诸如: `:smile:` 之类的短语转换为他们等价的表情符号来轻松插入。 + +这是我设置的一个小脚本,该脚本进入 Tmux 的复制模式,以将前一行中的第一个单词复制到粘贴缓冲区中: + +``` +from time import sleep + +# 发送 Tmux 命令前缀(b更改为s) +keyboard.send_keys("<ctrl>+s") +# Enter copy mode +keyboard.send_key("[") +sleep(0.01) +# Move cursor up one line +keyboard.send_keys("k") +sleep(0.01) +# Move cursor to start of line +keyboard.send_keys("0") +sleep(0.01) +# Start mark +keyboard.send_keys(" ") +sleep(0.01) +# Move cursor to end of word +keyboard.send_keys("e") +sleep(0.01) +# Add to copy buffer +keyboard.send_keys("<ctrl>+m") +``` + +睡眠之所以存在,是因为 Tmux 有时无法跟上 AutoKey 发送击键的速度,并且它们对整体执行时间的影响可忽略不计。 + +### 使用 AutoKey 自动化 + +我希望您喜欢使用 AutoKey 进行键盘自动化的这次旅行,它为您提供了有关如何改善工作流程的一些好主意。如果使用 AutoKey 对您来说有帮助或是新颖的方式,请务必在下面的评论中分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-autokey + +作者:[Matt Bargenquast][a] +选题:[lujun9972][b] +译者:[stevenzdg988](https://github.com/stevenzdg988) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mbargenquast +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://github.com/autokey/autokey +[3]: https://github.com/autokey/autokey/wiki/Installing +[4]: https://www.gtk.org/ +[5]: https://www.qt.io/ +[6]: https://opensource.com/sites/default/files/uploads/autokey-defaults.png (AutoKey UI) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/startautokey.png (Automatically start AutoKey at login) +[9]: https://opensource.com/sites/default/files/uploads/autokey-set_abbreviation.png (Set abbreviation in AutoKey) +[10]: https://opensource.com/sites/default/files/uploads/autokey-window_filter.png (AutoKey Window Filter) +[11]: https://opensource.com/article/19/7/bash-aliases +[12]: https://autokey.github.io/index.html +[13]: https://github.com/luziferius/autokey_scripts +[14]: https://github.com/AlienKevin/Emojis-AutoKey From 08b88f7c50a4448ece7a2103432e127f98f9e40d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:02:45 +0800 Subject: [PATCH 286/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427=20?= =?UTF-8?q?What=E2=80=99s=20new=20in=20Fedora=20Workstation=2034?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 What-s new in Fedora Workstation 34.md --- ...427 What-s new in Fedora Workstation 34.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20210427 What-s new in Fedora Workstation 34.md diff --git a/sources/tech/20210427 What-s new in Fedora Workstation 34.md b/sources/tech/20210427 What-s new in Fedora Workstation 34.md new file mode 100644 index 0000000000..7141e775ec --- /dev/null +++ b/sources/tech/20210427 What-s new in Fedora Workstation 34.md @@ -0,0 +1,106 @@ +[#]: subject: (What’s new in Fedora Workstation 34) +[#]: via: (https://fedoramagazine.org/whats-new-fedora-34-workstation/) +[#]: author: (Christian Fredrik Schaller https://fedoramagazine.org/author/uraeus/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +What’s new in Fedora Workstation 34 +====== + +![][1] + +Fedora Workstation 34 is the latest version of our leading-edge operating system and this time there are major improvements heading your way. Best of all, you can download it from [the official website][2]. What’s new, I hear you ask!?  Well let’s get to it. + +### GNOME 40 + +[GNOME 40][3] is a major update to the GNOME desktop, which Fedora community members played a key role in designing and implementing, so you can be sure that the needs of Fedora users were taken into account. + +The first thing you notice as you log into the GNOME 40 desktop is that you are now taken directly to a redesigned overview screen. You will notice that the dash bar has moved to the bottom of the screen. Another major change to GNOME 40 is the virtual work spaces are now horizontal which brings GNOME more in line with most other desktops out there and should thus make getting used to GNOME and Fedora easier for new users. + +Work has also been done to improve gesture support in the desktop with 3-finger horizontal swipes for switching workspaces, and 3-finger vertical swipes for bringing up the overview. + +![][4] + +The updated overview design brings a collection of other improvements, including: + + * The dash now separates favorite and non-favorite running apps. This makes it clear which apps have been favorited and which haven’t. + * Window thumbnails have been improved, and now have an app icon over each one, to help identification. + * When workspaces are set to be on all displays, the workspace switcher is now shown on all displays rather than just the primary one. + * App launcher drag and drop has been improved, to make it easier to customize the arrangement of the app grid. + + + +The changes in GNOME 40 underwent a good deal of user testing, and have had a very positive reaction so far, so we’re excited to be introducing them to the Fedora community. For more information, see [forty.gnome.org][3] or the [GNOME 40 release notes][5]. + +### App Improvements + +GNOME Weather has been redesigned for this release with two views, one for the hourly forecast for the next 48 hours, and one for the daily forecast for the next 10 days. + +The new version now shows more information, and is more mobile-friendly, as it supports narrower sizes. + +![][6] + +Other apps which have been improved include Files, Maps, Software and Settings. See the [GNOME 40 release notes][5] for more details. + +### **PipeWire** + +PipeWire is the new audio and video server, created by Wim Taymans, who also co-created the GStreamer multimedia framework. Until now, it has only been used for video capture, but in Fedora Workstation 34 we are making the jump to also use it for audio, replacing PulseAudio. + +PipeWire is designed to be compatible with both PulseAudio and Jack, so applications should generally work as before. We have also worked with Firefox and Chrome to ensure that they work well with PipeWire. PipeWire support is also coming soon in OBS Studio, so if you are a podcaster, we’ve got you covered. + +PipeWire has had a very positive reception from the pro-audio community. It is prudent to say that there may be pro-audio applications that will not work 100% from day one, but we are receiving a constant stream of test reports and patches, which we will be using to continue the pro-audio PipeWire experience during the Fedora Workstation 34 lifecycle. + +### **Improved Wayland support** + +Support for running Wayland on top of the proprietary NVIDIA driver is expected to be resolved within the Fedora Workstation 34 lifetime. Support for running a pure Wayland client on the NVIDIA driver already exists. However, this currently lacks support for the Xwayland compatibility layer, which is used by many applications. This is why Fedora still defaults to X.Org when you install the NVIDIA driver. + +We are [working upstream with NVIDIA][7]  to ensure Xwayland  works in Fedora with NVIDIA hardware acceleration. + +### **QtGNOME platform and Adwaita-Qt** + +Jan Grulich has continued his great work on the QtGNOME platform and Adawaita-qt themes, ensuring that  Qt applications integrate well with Fedora Workstation. The Adwaita theme that we use in Fedora has evolved over the years, but with the updates to QtGNOME platform and Adwaita-Qt in Fedora 34, Qt applications will more closely match the current GTK style in Fedora Workstation 34. + +As part of this work, the appearance and styling of Fedora Media Writer has also been improved. + +![][8] + +### **Toolbox** + +Toolbox is our great tool for creating development environments that are isolated from your host system, and it has seen lots of improvements for Fedora 34. For instance we have put a lot of work into improving the CI system integration for toolbox to avoid breakages in our stack causing Toolbox to stop working. + +A lot of work has been put into the RHEL integration in Toolbox, which means that you can easily set up a containerized RHEL environment on a Fedora system, and thus conveniently do development for RHEL servers and cloud instances. Creating a RHEL environment on Fedora is now as easy as running: toolbox create –distro rhel –release 8.4.  + +This gives you the advantage of an up to date desktop which supports the latest hardware, while being able to do RHEL-targeted development in a way that feels completely native. +![][9] + +### **Btrfs** + +Fedora Workstation has been using Btrfs as its default file system since Fedora 33. Btrfs is a modern filesystem that is developed by many companies and projects. Workstation’s adoption of Btrfs came about through fantastic collaboration between Facebook and the Fedora community. Based on user feedback so far, people feel that Btrfs provides a snappier and more responsive experience, compared with the old ext4 filesystem. + +With Fedora 34, new workstation installs now use Btrfs transparent compression by default. This saves significant disk space compared with uncompressed Btrfs, often in the range of 20-40%. It also increases the lifespan of SSDs and other flash media. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/whats-new-fedora-34-workstation/ + +作者:[Christian Fredrik Schaller][a] +选题:[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/uraeus/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-workstation-816x345.jpg +[2]: https://getfedora.org/workstation +[3]: https://forty.gnome.org/ +[4]: https://lh3.googleusercontent.com/xDklMWAGBWvRGRp2kby-XKr6b0Jvan8Obmn11sfmkKnsnXizKePYV9aWdEgyxmJetcvwMifYRUm6TcPRCH9szZfZOE9pCpv2bkjQhnq2II05Yu6o_DjEBmqTlRUGvvUyMN_VRtq8zkk2J7GUmA +[5]: https://help.gnome.org/misc/release-notes/40.0/ +[6]: https://lh6.googleusercontent.com/pQ3IIAvJDYrdfXoTUnrOcCQBjtpXqd_5Rmbo4xwxIj2qMCXt7ZxJEQ12OoV7yUSF8zpVR0VFXkMP0M8UK1nLbU7jhgQPJAHPayzjAscQmTtqqGsohyzth6-xFDjUXogmeFmcP-yR9GWXfXv-yw +[7]: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/587 +[8]: https://lh6.googleusercontent.com/PDXxFS7SBFGI-3jRtR-TmqupvJRxy_CbWTfjB4sc1CKyO1myXkqfpg4jGHQJRK2e1vUh1KD_jyBsy8TURwCIkgAJcETCOlSPFBabqB5yDeWj3cvygOOQVe3X0tLFjuOz3e-ZX6owNZJSqIEHOQ +[9]: https://lh6.googleusercontent.com/dVRCL14LGE9WpmdiH3nI97OW2C1TkiZqREvBlHClNKdVcYvR1nZpZgWfup_GP5SN17iQtSJf59FxX2GYqoajXbdXLRfOwAREn7gVJ1fa_bspmcTZ81zkUQC4tNUx3f7D7uD7Peeg2Zc9Kldpww From 6e1660d74c8b3ba14b75e1dbd148d35d32efb3e1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:03:05 +0800 Subject: [PATCH 287/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427=20?= =?UTF-8?q?Fedora=20Linux=2034=20is=20officially=20here!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 Fedora Linux 34 is officially here.md --- ...0427 Fedora Linux 34 is officially here.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20210427 Fedora Linux 34 is officially here.md diff --git a/sources/tech/20210427 Fedora Linux 34 is officially here.md b/sources/tech/20210427 Fedora Linux 34 is officially here.md new file mode 100644 index 0000000000..bf9d38fb2b --- /dev/null +++ b/sources/tech/20210427 Fedora Linux 34 is officially here.md @@ -0,0 +1,75 @@ +[#]: subject: (Fedora Linux 34 is officially here!) +[#]: via: (https://fedoramagazine.org/announcing-fedora-34/) +[#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora Linux 34 is officially here! +====== + +![][1] + +Today, I’m excited to share the results of the hard work of thousands of contributors to the Fedora Project: our latest release, Fedora Linux 34, is here! I know a lot of you have been waiting… I’ve seen more “is it out yet???” anticipation on social media and forums than I can remember for any previous release. So, if you want, wait no longer — [upgrade now][2] or go to [Get Fedora][3] to download an install image. Or, if you’d like to learn more first, read on.  + +The first thing you might notice is our beautiful new logo. Developed by the Fedora Design Team with input from the wider community, this new logo solves a lot of the technical problems with our old logo while keeping its Fedoraness. Stay tuned for new Fedora swag featuring the new design! + +### A Fedora Linux for every use case + +Fedora Editions are targeted outputs geared toward specific “showcase” uses on the desktop, in server & cloud environments, and the Internet of Things. + +Fedora Workstation focuses on the desktop, and in particular, it’s geared toward software developers who want a “just works” Linux operating system experience. This release features [GNOME 40][4], the next step in focused, distraction-free computing. GNOME 40 brings improvements to navigation whether you use a trackpad, a keyboard, or a mouse. The app grid and settings have been redesigned to make interaction more intuitive. You can read more about [what changed and why in a Fedora Magazine article][5] from March. + +Fedora CoreOS is an emerging Fedora Edition. It’s an automatically-updating, minimal operating system for running containerized workloads securely and at scale. It offers several update streams that can be followed for automatic updates that occur roughly every two weeks. Currently the next stream is based on Fedora Linux 34, with the testing and stable streams to follow. You can find information about released artifacts that follow the next stream from the [download page][6] and information about how to use those artifacts in the [Fedora CoreOS Documentation][7]. + +Fedora IoT provides a strong foundation for IoT ecosystems and edge computing use cases. With this release, we’ve improved support for popular ARM devices like Pine64, RockPro64, and Jetson Xavier NX. Some i.MX8 system on a chip devices like the 96boards Thor96 and Solid Run HummingBoard-M have improved hardware support. In addition, Fedora IoT 34 improves support for hardware watchdogs for automated system recovery.” + +Of course, we produce more than just the Editions. [Fedora Spins][8] and [Labs][9] target a variety of audiences and use cases, including [Fedora Jam][10], which allows you to unleash your inner musician, and desktop environments like the new Fedora i3 Spin, which provides a tiling window manager. And, don’t forget our alternate architectures: [ARM AArch64, Power, and S390x][11]. + +### General improvements + +No matter what variant of Fedora you use, you’re getting the latest the open source world has to offer. Following our “[First][12]” foundation, we’ve updated key programming language and system library packages, including Ruby 3.0 and Golang 1.16. In Fedora KDE Plasma, we’ve switched from X11 to Wayland as the default. + +Following the introduction of BTRFS as the default filesystem on desktop variants in Fedora Linux 33, we’ve introduced [transparent compression on BTRFS filesystems][13]. + +We’re excited for you to try out the new release! Go to and download it now. Or if you’re already running Fedora Linux, follow the [easy upgrade instructions][2]. For more information on the new features in Fedora Linux 34, see the [release notes][14]. + +### In the unlikely event of a problem… + +If you run into a problem, check out the [Fedora 34 Common Bugs page][15], and if you have questions, visit our Ask Fedora user-support platform. + +### Thank you everyone + +Thanks to the thousands of people who contributed to the Fedora Project in this release cycle, and especially to those of you who worked extra hard to make this another on-time release during a pandemic. Fedora is a community, and it’s great to see how much we’ve supported each other. Be sure to join us on April 30 and May 1 for a [virtual release party][16]! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/announcing-fedora-34/ + +作者:[Matthew Miller][a] +选题:[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/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/04/f34-final-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/quick-docs/upgrading/ +[3]: https://getfedora.org +[4]: https://forty.gnome.org/ +[5]: https://fedoramagazine.org/fedora-34-feature-focus-updated-activities-overview/ +[6]: https://getfedora.org/en/coreos +[7]: https://docs.fedoraproject.org/en-US/fedora-coreos/ +[8]: https://spins.fedoraproject.org/ +[9]: https://labs.fedoraproject.org/ +[10]: https://labs.fedoraproject.org/en/jam/ +[11]: https://alt.fedoraproject.org/alt/ +[12]: https://docs.fedoraproject.org/en-US/project/#_first +[13]: https://fedoramagazine.org/fedora-workstation-34-feature-focus-btrfs-transparent-compression/ +[14]: https://docs.fedoraproject.org/en-US/fedora/f34/release-notes/ +[15]: https://fedoraproject.org/wiki/Common_F34_bugs +[16]: https://hopin.com/events/fedora-linux-34-release-party From 96a3e765d8674aba6544edfdff6e555241e5530c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:03:27 +0800 Subject: [PATCH 288/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427=20?= =?UTF-8?q?Upgrade=20your=20Linux=20PC=20hardware=C2=A0using=20open=20sour?= =?UTF-8?q?ce=20tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md --- ...nux PC hardware-using open source tools.md | 253 ++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md diff --git a/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md new file mode 100644 index 0000000000..d24bf27bd8 --- /dev/null +++ b/sources/tech/20210427 Upgrade your Linux PC hardware-using open source tools.md @@ -0,0 +1,253 @@ +[#]: subject: (Upgrade your Linux PC hardware using open source tools) +[#]: via: (https://opensource.com/article/21/4/upgrade-linux-hardware) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Upgrade your Linux PC hardware using open source tools +====== +Get more performance from your PC with the hardware upgrades that will +give you the biggest payback. +![Business woman on laptop sitting in front of window][1] + +In my article on [identifying Linux performance bottlenecks using open source tools][2], I explained some simple ways to monitor Linux performance using open source graphical user interface (GUI) tools. I focused on identifying _performance bottlenecks_, situations where a hardware resource reaches its limits and holds back your PC's performance. + +How can you address a performance bottleneck? You could tune the applications or system software. Or you could run more efficient apps. You could even alter your behavior using your computer, for example, by scheduling background programs for off-hours. + +You can also improve your PC's performance through a hardware upgrade. This article focuses on the upgrades that give you the biggest payback. + +Open source tools are the key. GUI tools help you monitor your system to predict which hardware improvements will be effective. Otherwise, you might buy hardware and find that it doesn't improve performance. After an upgrade, these tools also help verify that the upgrade produced the benefits you expected. + +This article outlines a simple approach to PC hardware upgrades. The "secret sauce" is open source GUI tools. + +### How to upgrade memory + +Years ago, memory upgrades were a no-brainer. Adding memory nearly always improved performance. + +Today, that's no longer the case. PCs come with much more memory, and Linux uses it very efficiently. If you buy memory your system doesn't need, you've wasted money. + +So you'll want to spend some time monitoring your computer to see if a memory upgrade will help its performance. For example, watch memory use while you go about your typical day. And be sure to check what happens during memory-intensive workloads. + +A wide variety of open source tools can help with this monitoring, but I'll use the [GNOME System Monitor][3]. It's available in most Linux repositories. + +When you start up the System Monitor, its **Resources** panel displays this output: + +![Monitoring memory with GNOME System Monitor][4] + +Fig. 1. Monitoring memory with GNOME System Monitor (Howard Fosdick, [CC BY-SA 4.0][5]) + +The middle of the screen shows memory use. [Swap][6] is disk space that Linux uses when it runs low on memory. Linux effectively increases memory by using swap as a slower extension to memory. + +Since swap is slower than memory, if swap activity becomes significant, adding memory will improve your computer's performance. How much improvement you'll get depends on the amount of swap activity and the speed of your swap device. + +If a lot of swap space is used, you'll get a bigger performance improvement by adding memory than if only a small amount of swap is used. + +And if swap resides on a slow mechanical hard drive, you'll see a greater improvement by adding memory than you will if swap resides on the fastest available solid-state disk. + +Here's an example of when to add memory. This computer shows increased swap activity after memory utilization hits 80%. It becomes unresponsive as memory use surpasses 90%: + +![System Monitor - Out Of Memory Condition][7] + +Fig. 2. A memory upgrade will help (Howard Fosdick, [CC BY-SA 4.0][5]) + +#### How to perform a memory upgrade + +Before you upgrade, you need to determine how many memory slots you have, how many are open, the kinds of memory sticks they require, and your motherboard's maximum allowable memory. + +You can read your computer's documentation to get those answers. Or, you can just enter these Linux line commands: + +_What are the characteristics of the installed memory sticks?_ | `sudo lshw -short -C memory` +---|--- +_What is the maximum allowable memory for this computer?_ | `sudo dmidecode -t memory | grep -i max` +_How many memory slots are open?_ (A null response means none are available) | `sudo lshw -short -C memory | grep -i empty` + +As with all hardware upgrades, unplug the computer beforehand. Ground yourself before you touch your hardware—even the tiniest shock can damage circuitry. Fully seat the memory sticks into the motherboard slots. + +After the upgrade, start System Monitor. Run the same programs that overloaded your memory before. + +System Monitor should show your expanded memory, and you should see better performance. + +### How to upgrade storage + +We're in an era of rapid storage improvements. Even computers that are only a few years old can benefit from disk upgrades. But first, you'll want to make sure an upgrade makes sense for your computer and workload. + +Start by finding out what disk you have. Many open source tools will tell you. [Hardinfo][8] or [GNOME Disks][9] are good options because both are widely available, and their output is easy to understand. These apps will tell you your disk's make, model, and other details. + +Next, determine your disk's performance by benchmarking it. GNOME Disks makes this easy. Just start the tool and click on its **Benchmark Disk** option. This gives you disk read and write rates and the average disk access time: + +![GNOME Disks benchmark][10] + +Fig. 3. GNOME Disks benchmark output (Howard Fosdick, [CC BY-SA 4.0][5]) + +With this information, you can compare your disk to others at benchmarking websites like [PassMark Software][11] and [UserBenchmark][12]. Those provide performance statistics, speed rankings, and even price and performance numbers. You can get an idea of how your disk compares to possible replacements. + +Here's an example of some of the detailed disk info you'll find at UserBenchmark: + +![Disk comparisons at UserBenchmark][13] + +Fig. 4. Disk comparisons at [UserBenchmark][14] + +#### Monitor disk utilization + +Just as you did with memory, monitor your disk in real time to see if a replacement would improve performance. The [`atop` line command][15] tells you how busy a disk is. + +In its output below, you can see that device `sdb` is `busy 101%`. And one of the processors is waiting on that disk to do its work 85% of the time (`cpu001 w 85%`): + +![atop command shows disk utilization][16] + +Fig. 5. atop command shows disk utilization (Howard Fosdick, [CC BY-SA 4.0][5]) + +Clearly, you could improve performance with a faster disk. + +You'll also want to know which program(s) are causing all that disk usage. Just start up the System Monitor and click on its **Processes** tab. + +Now you know how busy your disk is and what program(s) are using it, so you can make an educated judgment whether a faster disk would be worth the expense. + +#### Buying the disk + +You'll encounter three major technologies when buying a new internal disk: + + * Mechanical hard drives (HDDs) + * SATA-connected solid-state disks (SSDs) + * PCIe-connected NVMe solid-state disks (NVMe SSDs) + + + +What are their speed differences? You'll see varying numbers all over the web. Here's a typical example: + +![Relative disk speeds][17] + +Fig. 6. Relative speeds of internal disk technologies ([Unihost][18]) + + * **Red bar:** Mechanical hard disks offer the cheapest bulk storage. But in terms of performance, they're slowest by far. + * **Green bar:** SSDs are faster than mechanical hard drives. But if an SSD uses a SATA interface, that limits its performance. This is because the SATA interface was designed over a decade ago for mechanical hard drives. + * **Blue bar:** The fastest technology for internal disks is the new [PCIe-connected NVMe solid-state disk][19]. These can be roughly five times faster than SATA-connected SSDs and 20 times faster than mechanical hard disks. + + + +For external SSDs, you'll find that the [latest Thunderbolt and USB interfaces][20] are the fastest. + +#### How to install an internal disk + +Before purchasing any disk, verify that your computer can support the necessary physical interface. + +For example, many NVMe SSDs use the popular new M.2 (2280) form factor. That requires either a tailor-made motherboard slot, a PCIe adapter card, or an external USB adapter. Your choice could affect your new disk's performance. + +Always back up your data and operating system before installing a new disk. Then copy them to the new disk. Open source [tools][21] like Clonezilla, Mondo Rescue, or GParted can do the job. Or you could use Linux line commands like `dd` or `cp`. + +Be sure to use your fast new disk in situations where it will have the most impact. Employ it as a boot drive, for storing your operating system and apps, for swap space, and for your most frequently processed data. + +After the upgrade, run GNOME Disks to benchmark your new disk. This helps you verify that you got the performance boost you expected. You can verify real-time operation with the `atop` command. + +### How to upgrade USB ports + +Like disk storage, USB performance has shown great strides in the past several years. Many computers only a few years old could get a big performance boost simply by adding a cheap USB port card. + +Whether the upgrade is worthwhile depends on how frequently you use your ports. Use them rarely, and it doesn't matter if they're slow. Use them frequently, and an upgrade might really impact your work. + +Here's how dramatically maximum USB data rates vary across port standards:  + +![USB speeds][22] + +Fig. 7. USB speeds vary greatly (Howard Fosdick, [CC BY-SA 4.0][5], based on data from [Tripplite][23] and [Wikipedia][24]) + +To see the actual USB speeds you're getting, start GNOME Disks. GNOME Disks can benchmark a USB-connected device just like it can an internal disk. Select its **Benchmark Disk** option. + +The device you plug in and the USB port together determine the speed you'll get. If the port and device are mismatched, you'll experience the slower speed of the two. + +For example, connect a device that supports USB 3.1 speeds to a 2.0 port, and you'll get the 2.0 data rate. (And your system won't tell you this unless you investigate with a tool like GNOME Disks.) Conversely, connect a 2.0 device to a 3.1 port, and you'll also get the 2.0 speed. So for best results, always match your port and device speeds. + +To monitor a USB-connected device in real time, use the `atop` command and System Monitor together, the same way you did to monitor an internal disk. This helps you see if you're bumping into your current setup's limit and could benefit by upgrading. + +Upgrading your ports is easy. Just buy a USB card that fits into an open PCIe slot. + +USB 3.0 cards are only about $25. Newer, more expensive cards offer USB 3.1 and 3.2 ports. Nearly all USB cards are plug-and-play, so Linux automatically recognizes them. (But always verify before you buy.) + +Be sure to run GNOME Disks after the upgrade to verify the new speeds. + +### How to upgrade your internet connection + +Upgrading your internet bandwidth is easy. Just write a check to your ISP. + +The question is: should you? + +System Monitor shows your bandwidth use (see Figure 1). If you consistently bump against the limit you pay your ISP for, you'll benefit from buying a higher limit. + +But first, verify that you don't have a problem you could fix yourself. I've seen many cases where someone thinks they need to buy more bandwidth from their ISP when they actually just have a connection problem they could fix themselves. + +Start by testing your maximum internet speed at websites like [Speedtest][25] or [Fast.com][26]. For accurate results, close all programs and run _only_ the speed test; turn off your VPN; run tests at different times of day; and compare the results from several testing sites. If you use WiFi, test with it and without it (by directly cabling your laptop to the modem). + +If you have a separate router, test with and without it. That will tell you if your router is a bottleneck. Sometimes just repositioning the router in your home or updating its firmware will improve connection speed. + +These tests will verify that you're getting the speeds you're paying your ISP for. They'll also expose any local WiFi or router problem you could fix yourself. + +Only after you've done these tests should you conclude that you need to purchase more internet bandwidth. + +### Should you upgrade your CPU or GPU? + +What about upgrading your CPU (central processing unit) or GPU (graphics processing unit)? + +Laptop owners typically can't upgrade either because they're soldered to the motherboard. + +Most desktop motherboards support a range of CPUs and are upgradeable—assuming you're not already using the topmost processor in the series. + +Use System Monitor to watch your CPU and determine if an upgrade would help. Its **Resources** panel will show your CPU load. If all your logical processors consistently stay above 80% or 90%, you could benefit from more CPU power. + +It's a fun project to upgrade your CPU. Anyone can do it if they're careful. + +Unfortunately, it's rarely cost-effective. Most sellers charge a premium for an individual CPU chip versus the deal they'll give you on a new system unit. So for many people, a CPU upgrade doesn't make economic sense. + +If you plug your display monitor directly into your desktop's motherboard, you might benefit by upgrading your graphics processing. Just add a video card. + +The trick is to achieve a balanced workload between the new video card and your CPU. This [online tool][27] identifies exactly which video cards will best work with your CPU. [This article][28] provides a detailed explanation of how to go about upgrading your graphics processing. + +### Gather data before you upgrade + +Personal computer users sometimes upgrade their Linux hardware based on gut feel. A better way is to monitor performance and gather some data first. Open source GUI tools make this easy. They help predict whether a hardware upgrade will be worth your time and money. Then, after your upgrade, you can use them to verify that your changes had the intended effect. + +These are the most popular hardware upgrades. With a little effort and the right open source tools, any Linux user can cost-effectively upgrade a PC. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/upgrade-linux-hardware + +作者:[Howard Fosdick][a] +选题:[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/howtech +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/21/3/linux-performance-bottlenecks +[3]: https://vitux.com/how-to-install-and-use-task-manager-system-monitor-in-ubuntu/ +[4]: https://opensource.com/sites/default/files/uploads/system_monitor_-_resources_panel_0.jpg (Monitoring memory with GNOME System Monitor) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/18/9/swap-space-linux-systems +[7]: https://opensource.com/sites/default/files/uploads/system_monitor_-_out_of_memory_0.jpg (System Monitor - Out Of Memory Condition) +[8]: https://itsfoss.com/hardinfo/ +[9]: https://en.wikipedia.org/wiki/GNOME_Disks +[10]: https://opensource.com/sites/default/files/uploads/gnome_disks_-_benchmark_0.jpg (GNOME Disks benchmark) +[11]: https://www.harddrivebenchmark.net/ +[12]: https://www.userbenchmark.com/ +[13]: https://opensource.com/sites/default/files/uploads/userbenchmark_disk_comparisons_0.jpg (Disk comparisons at UserBenchmark) +[14]: https://ssd.userbenchmark.com/ +[15]: https://opensource.com/life/16/2/open-source-tools-system-monitoring +[16]: https://opensource.com/sites/default/files/uploads/atop_-_storage_bottleneck_0.jpg (atop command shows disk utilization) +[17]: https://opensource.com/sites/default/files/uploads/hdd_vs_ssd_vs_nvme_speeds_0.jpg (Relative disk speeds) +[18]: https://unihost.com/help/nvme-vs-ssd-vs-hdd-overview-and-comparison/ +[19]: https://www.trentonsystems.com/blog/pcie-gen4-vs-gen3-slots-speeds +[20]: https://www.howtogeek.com/449991/thunderbolt-3-vs.-usb-c-whats-the-difference/ +[21]: https://www.linuxlinks.com/diskcloning/ +[22]: https://opensource.com/sites/default/files/uploads/usb_standards_-_speeds_0.jpg (USB speeds) +[23]: https://www.tripplite.com/products/usb-connectivity-types-standards +[24]: https://en.wikipedia.org/wiki/USB +[25]: https://www.speedtest.net/ +[26]: https://fast.com/ +[27]: https://www.gpucheck.com/gpu-benchmark-comparison +[28]: https://helpdeskgeek.com/how-to/see-how-much-your-cpu-bottlenecks-your-gpu-before-you-buy-it/ From 772059896cb6340bfe5a0be36ee7fd62de885e7a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:03:41 +0800 Subject: [PATCH 289/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210427=20?= =?UTF-8?q?Perform=20Linux=20memory=20forensics=20with=20this=20open=20sou?= =?UTF-8?q?rce=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210427 Perform Linux memory forensics with this open source tool.md --- ...ry forensics with this open source tool.md | 510 ++++++++++++++++++ 1 file changed, 510 insertions(+) create mode 100644 sources/tech/20210427 Perform Linux memory forensics with this open source tool.md diff --git a/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md b/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md new file mode 100644 index 0000000000..87f9d8aaa5 --- /dev/null +++ b/sources/tech/20210427 Perform Linux memory forensics with this open source tool.md @@ -0,0 +1,510 @@ +[#]: subject: (Perform Linux memory forensics with this open source tool) +[#]: via: (https://opensource.com/article/21/4/linux-memory-forensics) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Perform Linux memory forensics with this open source tool +====== +Find out what's going on with applications, network connections, kernel +modules, files, and much more with Volatility +![Brain on a computer screen][1] + +A computer's operating system and applications use the primary memory (or RAM) to perform various tasks. This volatile memory, containing a wealth of information about running applications, network connections, kernel modules, open files, and just about everything else is wiped out each time the computer restarts. + +Memory forensics is a way to find and extract this valuable information from memory. [Volatility][2] is an open source tool that uses plugins to process this type of information. However, there's a problem: Before you can process this information, you must dump the physical memory into a file, and Volatility does not have this ability. + +Therefore, this article has two parts: + + * The first part deals with acquiring the physical memory and dumping it into a file. + * The second part uses Volatility to read and process information from this memory dump. + + + +I used the following test system for this tutorial, but it will work on any Linux distribution: + + +``` +$ cat /etc/redhat-release +Red Hat Enterprise Linux release 8.3 (Ootpa) +$ +$ uname -r +4.18.0-240.el8.x86_64 +$ +``` + +> **A note of caution:** Part 1 involves compiling and loading a kernel module. Don't worry; it isn't as difficult as it sounds. Some guidelines: +> +> * Follow the steps. +> * Do not try any of these steps on a production system or your primary machine. +> * Always use a test virtual machine (VM) to try things out until you are comfortable using the tools and understand how they work. +> + + +### Install the required packages + +Before you get started, install the requisite tools. If you are using a Debian-based distro, use the equivalent `apt-get` commands. Most of these packages provide the required kernel information and tools to compile the code: + + +``` +`$ yum install kernel-headers kernel-devel gcc elfutils-libelf-devel make git libdwarf-tools python2-devel.x86_64-y` +``` + +### Part 1: Use LiME to acquire memory and dump it to a file + +Before you can begin to analyze memory, you need a memory dump at your disposal. In an actual forensics event, this could come from a compromised or hacked system. Such information is often collected and stored to analyze how the intrusion happened and its impact. Since you probably do not have a memory dump available, you can take a memory dump of your test VM and use that to perform memory forensics. + +Linux Memory Extractor ([LiME][3]) is a popular tool for acquiring memory on a Linux system. Get LiME with: + + +``` +$ git clone +$ +$ cd LiME/src/ +$ +$ ls +deflate.c  disk.c  hash.c  lime.h  main.c  Makefile  Makefile.sample  tcp.c +$ +``` + +#### Build the LiME kernel module + +Run the `make` command inside the `src` folder. This creates a kernel module with a .ko extension. Ideally, the `lime.ko` file will be renamed using the format `lime-.ko` at the end of `make`: + + +``` +$ make +make -C /lib/modules/4.18.0-240.el8.x86_64/build M="/root/LiME/src" modules +make[1]: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64' + +<< snip >> + +make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' +strip --strip-unneeded lime.ko +mv lime.ko lime-4.18.0-240.el8.x86_64.ko +$ +$ +$ ls -l lime-4.18.0-240.el8.x86_64.ko +-rw-r--r--. 1 root root 25696 Apr 17 14:45 lime-4.18.0-240.el8.x86_64.ko +$ +$ file lime-4.18.0-240.el8.x86_64.ko +lime-4.18.0-240.el8.x86_64.ko: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), BuildID[sha1]=1d0b5cf932389000d960a7e6b57c428b8e46c9cf, not stripped +$ +``` + +#### Load the LiME kernel module + +Now it's time to load the kernel module to acquire the system memory. The `insmod` command helps load the kernel module; once loaded, the module reads the primary memory (RAM) on your system and dumps the memory's contents to the file provided in the `path` directory on the command line. Another important parameter is `format`; keep the format `lime`, as shown below. After inserting the kernel module, verify that it loaded using the `lsmod` command: + + +``` +$ lsmod  | grep lime +$ +$ insmod ./lime-4.18.0-240.el8.x86_64.ko "path=../RHEL8.3_64bit.mem format=lime" +$ +$ lsmod  | grep lime +lime                   16384  0 +$ +``` + +You should see that the file given to the `path` command was created, and the file size is (not surprisingly) the same as the physical memory size (RAM) on your system. Once you have the memory dump, you can remove the kernel module using the `rmmod` command: + + +``` +$ +$ ls -l ~/LiME/RHEL8.3_64bit.mem +-r--r--r--. 1 root root 4294544480 Apr 17 14:47 /root/LiME/RHEL8.3_64bit.mem +$ +$ du -sh ~/LiME/RHEL8.3_64bit.mem +4.0G    /root/LiME/RHEL8.3_64bit.mem +$ +$ free -m +              total        used        free      shared  buff/cache   available +Mem:           3736         220         366           8        3149        3259 +Swap:          4059           8        4051 +$ +$ rmmod lime +$ +$ lsmod  | grep lime +$ +``` + +#### What's in the memory dump? + +This dump file is just raw data, as you can see using the `file` command below. You cannot make much sense out of it manually; yes, there are some ASCII strings in there somewhere, but you can't open the file in an editor and read it out. The hexdump output shows that the initial few bytes are `EmiL`; this is because your request format was "lime" in the command above: + + +``` +$ file ~/LiME/RHEL8.3_64bit.mem +/root/LiME/RHEL8.3_64bit.mem: data +$ + +$ hexdump -C ~/LiME/RHEL8.3_64bit.mem | head +00000000  45 4d 69 4c 01 00 00 00  00 10 00 00 00 00 00 00  |EMiL............| +00000010  ff fb 09 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| +00000020  b8 fe 4c cd 21 44 00 32  20 00 00 2a 2a 2a 2a 2a  |..L.!D.2 ..*****| +00000030  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************| +00000040  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 20 00 20  |************* . | +00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| +* +00000080  00 00 00 00 00 00 00 00  00 00 00 00 70 78 65 6c  |............pxel| +00000090  69 6e 75 78 2e 30 00 00  00 00 00 00 00 00 00 00  |inux.0..........| +000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................| +$ +``` + +### Part 2: Get Volatility and use it to analyze your memory dump + +Now that you have a sample memory dump to analyze, get the Volatility software with the command below. Volatility has been rewritten in Python 3, but this tutorial uses the original Volatility package, which uses Python 2. If you want to experiment with Volatility 3, download it from the appropriate Git repo and use Python 3 instead of Python 2 in the following commands: + + +``` +$ git clone +$ +$ cd volatility/ +$ +$ ls +AUTHORS.txt    contrib      LEGAL.txt    Makefile     PKG-INFO     pyinstaller.spec  resources  tools       vol.py +CHANGELOG.txt  CREDITS.txt  LICENSE.txt  MANIFEST.in  pyinstaller  README.txt        setup.py   volatility +$ +``` + +Volatility uses two Python libraries for some functionality, so please install them using the following commands. Otherwise, you might see some import errors when you run the Volatility tool; you can ignore them unless you are running a plugin that needs these libraries; in that case, the tool will error out: + + +``` +$ pip2 install pycrypto +$ pip2 install distorm3 +``` + +#### List Volatility's Linux profiles + +The first Volatility command you'll want to run lists what Linux profiles are available. The main entry point to running any Volatility commands is the `vol.py` script. Invoke it using the Python 2 interpreter and provide the `--info` option. To narrow down the output, look for strings that begin with Linux. As you can see, not many Linux profiles are listed: + + +``` +$ python2 vol.py --info  | grep ^Linux +Volatility Foundation Volatility Framework 2.6.1 +LinuxAMD64PagedMemory          - Linux-specific AMD 64-bit address space. +$ +``` + +#### Build your own Linux profile + +Linux distros are varied and built for various architectures. This why profiles are essential—Volatility must know the system and architecture that the memory dump was acquired from before extracting information. There are Volatility commands to find this information; however, this method is time-consuming. To speed things up, build a custom Linux profile using the following commands. + +Move to the `tools/linux` directory within the Volatility repo, and run the `make` command: + + +``` +$ cd tools/linux/ +$ +$ pwd +/root/volatility/tools/linux +$ +$ ls +kcore  Makefile  Makefile.enterprise  module.c +$ +$ make +make -C //lib/modules/4.18.0-240.el8.x86_64/build CONFIG_DEBUG_INFO=y M="/root/volatility/tools/linux" modules +make[1]: Entering directory '/usr/src/kernels/4.18.0-240.el8.x86_64' +<< snip >> +make[1]: Leaving directory '/usr/src/kernels/4.18.0-240.el8.x86_64' +$ +``` + +You should see a new `module.dwarf` file. You also need the `System.map` file from the `/boot` directory, as it contains all of the symbols related to the currently running kernel: + + +``` +$ ls +kcore  Makefile  Makefile.enterprise  module.c  module.dwarf +$ +$ ls -l module.dwarf +-rw-r--r--. 1 root root 3987904 Apr 17 15:17 module.dwarf +$ +$ ls -l /boot/System.map-4.18.0-240.el8.x86_64 +-rw-------. 1 root root 4032815 Sep 23  2020 /boot/System.map-4.18.0-240.el8.x86_64 +$ +$ +``` + +To create a custom profile, move back to the Volatility directory and run the command below. The first argument provides a custom .zip with a file name of your choice. I used the operating system and kernel versions in the name. The next argument is the `module.dwarf` file created above, and the final argument is the `System.map` file from the `/boot` directory: + + +``` +$ +$ cd volatility/ +$ +$ zip volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip tools/linux/module.dwarf /boot/System.map-4.18.0-240.el8.x86_64 +  adding: tools/linux/module.dwarf (deflated 91%) +  adding: boot/System.map-4.18.0-240.el8.x86_64 (deflated 79%) +$ +``` + +Your custom profile is now ready, so verify the .zip file was created at the location given above. If you want to know if Volatility detects this custom profile, run the `--info` command again. This time, you should see the new profile listed below: + + +``` +$ +$ ls -l volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip +-rw-r--r--. 1 root root 1190360 Apr 17 15:20 volatility/plugins/overlays/linux/Redhat8.3_4.18.0-240.zip +$ +$ +$ python2 vol.py --info  | grep Redhat +Volatility Foundation Volatility Framework 2.6.1 +LinuxRedhat8_3_4_18_0-240x64 - A Profile for Linux Redhat8.3_4.18.0-240 x64 +$ +$ +``` + +#### Start using Volatility + +Now you are all set to do some actual memory forensics. Remember, Volatility is made up of custom plugins that you can run against a memory dump to get information. The command's general format is: + + +``` +`python2 vol.py -f --profile=` +``` + +Armed with this information, run the **linux_banner** plugin to see if you can identify the correct distro information from the memory dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_banner --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +Linux version 4.18.0-240.el8.x86_64 ([mockbuild@vm09.test.com][4]) (gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)) #1 SMP Wed Sep 23 05:13:10 EDT 2020 +$ +``` + +#### Find Linux plugins + +That worked well, so now you're probably curious about how to find all the names of all the Linux plugins. There is an easy trick: run the `--info` command and `grep` for the `linux_` string. There are a variety of plugins available for different uses. Here is a partial list: + + +``` +$ python2 vol.py --info  | grep linux_ +Volatility Foundation Volatility Framework 2.6.1 +linux_apihooks             - Checks for userland apihooks +linux_arp                  - Print the ARP table +linux_aslr_shift           - Automatically detect the Linux ASLR shift + +<< snip >> + +linux_banner               - Prints the Linux banner information +linux_vma_cache            - Gather VMAs from the vm_area_struct cache +linux_volshell             - Shell in the memory image +linux_yarascan             - A shell in the Linux memory image +$ +``` + +Check which processes were running on the system when you took the memory dump using the **linux_psaux** plugin. Notice the last command in the list: it's the `insmod` command you ran before the dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_psaux --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +Pid    Uid    Gid    Arguments                                                       +1      0      0      /usr/lib/systemd/systemd --switched-root --system --deserialize 18 +2      0      0      [kthreadd]                                                       +3      0      0      [rcu_gp]                                                         +4      0      0      [rcu_par_gp]                                                     +861    0      0      /usr/libexec/platform-python -Es /usr/sbin/tuned -l -P           +869    0      0      /usr/bin/rhsmcertd                                               +875    0      0      /usr/libexec/sssd/sssd_be --domain implicit_files --uid 0 --gid 0 --logger=files +878    0      0      /usr/libexec/sssd/sssd_nss --uid 0 --gid 0 --logger=files       + +<<< snip >>> + +11064  89     89     qmgr -l -t unix -u                                               +227148 0      0      [kworker/0:0]                                                   +227298 0      0      -bash                                                           +227374 0      0      [kworker/u2:1]                                                   +227375 0      0      [kworker/0:2]                                                   +227884 0      0      [kworker/0:3]                                                   +228573 0      0      insmod ./lime-4.18.0-240.el8.x86_64.ko path=../RHEL8.3_64bit.mem format=lime +228576 0      0                                                                       +$ +``` + +Want to know about the system's network stats? Run the **linux_netstat** plugin to find the state of the network connections during the memory dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_netstat --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +UNIX 18113              systemd/1     /run/systemd/private +UNIX 11411              systemd/1     /run/systemd/notify +UNIX 11413              systemd/1     /run/systemd/cgroups-agent +UNIX 11415              systemd/1     +UNIX 11416              systemd/1     +<< snip>> +$ +``` + +Next, use the **linux_mount** plugin to see which filesystems were mounted during the memory dump: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_mount --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +tmpfs                     /sys/fs/cgroup                      tmpfs        ro,nosuid,nodev,noexec                   +cgroup                    /sys/fs/cgroup/pids                 cgroup       rw,relatime,nosuid,nodev,noexec         +systemd-1                 /proc/sys/fs/binfmt_misc            autofs       rw,relatime                             +sunrpc                    /var/lib/nfs/rpc_pipefs             rpc_pipefs   rw,relatime                             +/dev/mapper/rhel_kvm--03--guest11-root /                                   xfs          rw,relatime                 +tmpfs                     /dev/shm                            tmpfs        rw,nosuid,nodev                         +selinuxfs                 /sys/fs/selinux                     selinuxfs    rw,relatime                                                       +<< snip>> + +cgroup                    /sys/fs/cgroup/net_cls,net_prio     cgroup       rw,relatime,nosuid,nodev,noexec         +cgroup                    /sys/fs/cgroup/cpu,cpuacct          cgroup       rw,relatime,nosuid,nodev,noexec         +bpf                       /sys/fs/bpf                         bpf          rw,relatime,nosuid,nodev,noexec         +cgroup                    /sys/fs/cgroup/memory               cgroup       ro,relatime,nosuid,nodev,noexec         +cgroup                    /sys/fs/cgroup/cpuset               cgroup       rw,relatime,nosuid,nodev,noexec         +mqueue                    /dev/mqueue                         mqueue       rw,relatime                             +$ +``` + +Curious what kernel modules were loaded? Volatility has a plugin for that too, aptly named **linux_lsmod**: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_lsmod --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +ffffffffc0535040 lime 20480 +ffffffffc0530540 binfmt_misc 20480 +ffffffffc05e8040 sunrpc 479232 +<< snip >> +ffffffffc04f9540 nfit 65536 +ffffffffc0266280 dm_mirror 28672 +ffffffffc025e040 dm_region_hash 20480 +ffffffffc0258180 dm_log 20480 +ffffffffc024bbc0 dm_mod 151552 +$ +``` + +Want to find all the commands the user ran that were stored in the Bash history? Run the **linux_bash** plugin: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_bash --profile=LinuxRedhat8_3_4_18_0-240x64 -v +Volatility Foundation Volatility Framework 2.6.1 +Pid      Name                 Command Time                   Command +\-------- -------------------- ------------------------------ ------- +  227221 bash                 2021-04-17 18:38:24 UTC+0000   lsmod +  227221 bash                 2021-04-17 18:38:24 UTC+0000   rm -f .log +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls -l /etc/zzz +  227221 bash                 2021-04-17 18:38:24 UTC+0000   cat ~/.vimrc +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls +  227221 bash                 2021-04-17 18:38:24 UTC+0000   cat /proc/817/cwd +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls -l /proc/817/cwd +  227221 bash                 2021-04-17 18:38:24 UTC+0000   ls /proc/817/ +<< snip >> +  227298 bash                 2021-04-17 18:40:30 UTC+0000   gcc prt.c +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ls +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ./a.out +  227298 bash                 2021-04-17 18:40:30 UTC+0000   vim prt.c +  227298 bash                 2021-04-17 18:40:30 UTC+0000   gcc prt.c +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ./a.out +  227298 bash                 2021-04-17 18:40:30 UTC+0000   ls +$ +``` + +Want to know what files were opened by which processes? Use the **linux_lsof** plugin to list that information: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_lsof --profile=LinuxRedhat8_3_4_18_0-240x64 +Volatility Foundation Volatility Framework 2.6.1 +Offset             Name                           Pid      FD       Path +\------------------ ------------------------------ -------- -------- ---- +0xffff9c83fb1e9f40 rsyslogd                          71194        0 /dev/null +0xffff9c83fb1e9f40 rsyslogd                          71194        1 /dev/null +0xffff9c83fb1e9f40 rsyslogd                          71194        2 /dev/null +0xffff9c83fb1e9f40 rsyslogd                          71194        3 /dev/urandom +0xffff9c83fb1e9f40 rsyslogd                          71194        4 socket:[83565] +0xffff9c83fb1e9f40 rsyslogd                          71194        5 /var/log/messages +0xffff9c83fb1e9f40 rsyslogd                          71194        6 anon_inode:[9063] +0xffff9c83fb1e9f40 rsyslogd                          71194        7 /var/log/secure + +<< snip >> + +0xffff9c8365761f40 insmod                           228573        0 /dev/pts/0 +0xffff9c8365761f40 insmod                           228573        1 /dev/pts/0 +0xffff9c8365761f40 insmod                           228573        2 /dev/pts/0 +0xffff9c8365761f40 insmod                           228573        3 /root/LiME/src/lime-4.18.0-240.el8.x86_64.ko +$ +``` + +#### Access the Linux plugins scripts location + +You can get a lot more information by reading the memory dump and processing the information. If you know Python and are curious how this information was processed, go to the directory where all the plugins are stored, pick one that interests you, and see how Volatility gets this information: + + +``` +$ ls volatility/plugins/linux/ +apihooks.py              common.py            kernel_opened_files.py   malfind.py          psaux.py +apihooks.pyc             common.pyc           kernel_opened_files.pyc  malfind.pyc         psaux.pyc +arp.py                   cpuinfo.py           keyboard_notifiers.py    mount_cache.py      psenv.py +arp.pyc                  cpuinfo.pyc          keyboard_notifiers.pyc   mount_cache.pyc     psenv.pyc +aslr_shift.py            dentry_cache.py      ld_env.py                mount.py            pslist_cache.py +aslr_shift.pyc           dentry_cache.pyc     ld_env.pyc               mount.pyc           pslist_cache.pyc +<< snip >> +check_syscall_arm.py     __init__.py          lsmod.py                 proc_maps.py        tty_check.py +check_syscall_arm.pyc    __init__.pyc         lsmod.pyc                proc_maps.pyc       tty_check.pyc +check_syscall.py         iomem.py             lsof.py                  proc_maps_rb.py     vma_cache.py +check_syscall.pyc        iomem.pyc            lsof.pyc                 proc_maps_rb.pyc    vma_cache.pyc +$ +$ +``` + +One reason I like Volatility is that it provides a lot of security plugins. This information would be difficult to acquire manually: + + +``` +linux_hidden_modules       - Carves memory to find hidden kernel modules +linux_malfind              - Looks for suspicious process mappings +linux_truecrypt_passphrase - Recovers cached Truecrypt passphrases +``` + +Volatility also allows you to open a shell within the memory dump, so instead of running all the commands above, you can run shell commands instead and get the same information: + + +``` +$ python2 vol.py -f ~/LiME/RHEL8.3_64bit.mem linux_volshell --profile=LinuxRedhat8_3_4_18_0-240x64 -v +Volatility Foundation Volatility Framework 2.6.1 +Current context: process systemd, pid=1 DTB=0x1042dc000 +Welcome to volshell! Current memory image is: +file:///root/LiME/RHEL8.3_64bit.mem +To get help, type 'hh()' +>>> +>>> sc() +Current context: process systemd, pid=1 DTB=0x1042dc000 +>>> +``` + +### Next steps + +Memory forensics is a good way to learn more about Linux internals. Try all of Volatility's plugins and study their output in detail. Then think about ways this information can help you identify an intrusion or a security issue. Dive into how the plugins work, and maybe even try to improve them. And if you didn't find a plugin for what you want to do, write one and submit it to Volatility so others can use it, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-memory-forensics + +作者:[Gaurav Kamathe][a] +选题:[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/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen) +[2]: https://github.com/volatilityfoundation/volatility +[3]: https://github.com/504ensicsLabs/LiME +[4]: mailto:mockbuild@vm09.test.com From 85334309b0a2cd5e75783edb64f2bcb477f1ff4b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:04:02 +0800 Subject: [PATCH 290/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210427=20?= =?UTF-8?q?Fedora=2034=20Releases=20with=20GNOME=2040,=20Linux=20Kernel=20?= =?UTF-8?q?5.11,=20and=20a=20New=20i3=20Spin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md --- ...0, Linux Kernel 5.11, and a New i3 Spin.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md diff --git a/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md new file mode 100644 index 0000000000..d7a6d56c71 --- /dev/null +++ b/sources/news/20210427 Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin.md @@ -0,0 +1,118 @@ +[#]: subject: (Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin) +[#]: via: (https://news.itsfoss.com/fedora-34-release/) +[#]: author: (Arish V https://news.itsfoss.com/author/arish/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Fedora 34 Releases with GNOME 40, Linux Kernel 5.11, and a New i3 Spin +====== + +After the release of the [Fedora 34 beta][1] a week ago, Fedora 34 stable release is finally here with exciting changes and improvements. + +As expected this release of Fedora arrives with the latest Linux kernel 5.11 along with significant changes such as [Gnome 40][2], [PipeWire][3], availability of a [Fedora i3 Spin][4], and various other changes. + +Let’s take a look at the important changes coming to Fedora 34. + +### Major Highlights of Fedora 34 Release + +Here is an overview of the major changes in this release of Fedora. + +#### Desktop Environment Updates + +![][5] + +One of the biggest highlights is the arrival of the [GNOME 40][2] desktop. Fedora 34 is one of the few distributions in which you can experience the latest Gnome 40 right now. So, this change is worth noting. + +Taking a look at KDE Plasma, Wayland becomes the default display server for KDE Plasma in Fedora 34. Moreover, KDE Plasma Desktop image is available for AArch64 ARM devices as well. + +Coming to other Desktop Environments, the latest Xfce 4.16 is available with this release of Fedora and LXQT also receives an update to the latest version LXQT 0.16. + +#### PipeWire to Replace PulseAudio + +A noteworthy change happening with this release of Fedora is the replacement of PulseAudio by PipeWire. It replaces PulseAudio and JACK by providing a PulseAudio-compatible server implementation and ABI-compatible libraries for JACK clients. + +![][6] + +Besides, with this release, there’s also a Fedora i3 Spin that provides the popular i3 tiling window manager and offers a complete experience with a minimalist user interface. + +####  Zstd Compression by Default + +BTRSF file system was made default with Fedora 34, with this release zstd algorithm is made default for transparent compression when using BTRSF. The developers hope that this would increase the life span of flash-based media by reducing write amplification. + +#### Other Changes + +Some of the other changes include package the following package updates. + + * Binutils 2.53 + * Golang 1.16 + * Ruby 3.0 + * BIND 9.16 + *  MariaDB 10.5 + * Ruby on Rails 6.1 + * Stratis 2.3.0 + + + +Other changes include replacement of The ntp package with ntpsec. Also, the collection packages xorg-x11 are revoked, and the individual utilities within them will be packaged separately. + +If you want to see the entire list of changes in Fedora 34, please take a look at the [official announcement post][7] and the [changeset][8] for more technical details. + +### Wrapping up + +Most of the above changes in Fedora 34 were expected changes, and fortunately nothing went south after the beta release last week. Above all Fedora 34 in powered by the latest Linux kernel 5.11, and you can experience the latest GNOME desktop as well. + +_So, what do you think about these exciting additions to Fedora 34? Let me know in the comments below._ + +  + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Fedora 34 Beta Arrives With Awesome GNOME 40 (Unlike Ubuntu 21.04)][1] + * ![][9] ![][10] + + + * [Linux Release Roundup #21.13: GNOME 40, Manjaro 21.0, Fedora 34 and More New Releases][11] + * ![][9] ![Linux Release Roundups][12] + + + * [Manjaro 21.0 Ornara Comes Packed With GNOME 3.38, KDE Plasma 5.21, Xfce 4.16 and Linux Kernel 5.10][13] + * ![][9] ![][14] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/fedora-34-release/ + +作者:[Arish V][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/arish/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/fedora-34-beta-release/ +[2]: https://news.itsfoss.com/gnome-40-release/ +[3]: https://pipewire.org/ +[4]: https://spins.fedoraproject.org/i3/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzQ2OCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUzNicgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://fedoramagazine.org/announcing-fedora-34/ +[8]: https://fedoraproject.org/wiki/Releases/34/ChangeSet#i3_Spin +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/fedora-34-beta-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[11]: https://news.itsfoss.com/linux-release-roundup-2021-13/ +[12]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Linux-release-roundups.png?fit=800%2C450&ssl=1&resize=350%2C200 +[13]: https://news.itsfoss.com/manjaro-21-0-ornara-release/ +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/manjaro-21.png?fit=1200%2C675&ssl=1&resize=350%2C200 From 4978488c61307e8f5eed3654cf43cf12ecb00637 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 28 Apr 2021 05:04:16 +0800 Subject: [PATCH 291/307] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210427=20?= =?UTF-8?q?CloudLinux=20Announces=20Commercial=20Support=20for=20its=20Cen?= =?UTF-8?q?tOS=20Alternative=20AlmaLinux=20OS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md --- ...for its CentOS Alternative AlmaLinux OS.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md diff --git a/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md b/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md new file mode 100644 index 0000000000..98bdb1ce07 --- /dev/null +++ b/sources/news/20210427 CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS.md @@ -0,0 +1,90 @@ +[#]: subject: (CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS) +[#]: via: (https://news.itsfoss.com/almalinux-commercial-support/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +CloudLinux Announces Commercial Support for its CentOS Alternative AlmaLinux OS +====== + +CentOS alternative [AlmaLinux][1] announced the availability of their [first stable release][2] a month back. + +If you are planning to replace your CentOS deployments or have already started to utilize AlmaLinux OS, you will be happy to know that you are about to get commercial support and premium support soon. + +CloudLinux, the sponsor of the project announced that it will start providing multiple support options next month. + +### More About the Support Options + +According to the press release, they aim to offer reasonable pricing for the support tiers: + +> “Support services for AlmaLinux OS from CloudLinux provides both the highest quality support from the OS sponsor along with the benefits of an independent technology partnership,” said Jim Jackson, president and chief revenue officer, CloudLinux. “Reasonably priced and flexible support services keep systems running on AlmaLinux OS continuously updated and secure for production workloads.” + +They also clarify that the support tiers will include update delivery commitments and 24/7 incident response services. + +This means that you will be getting regular patches and updates for the Linux kernel and core packages, patch delivery service-level agreements (SLAs), and 24/7 incident support. + +For any business or enterprise, this should be the perfect incentive to start replacing CentOS on their server if looking for a [CentOS alternative][3]. + +In addition to the plans for the next month, they also plan to offer a premium support option for enterprise use-cases and more: + +> CloudLinux is also planning to introduce a premium support tier for enterprises that require enhanced services, as well as Product NodeOS Support for AlmaLinux OS, explicitly tailored to the needs of vendors and OEMs that are planning to use AlmaLinux as a node OS underlying their commercial products and services. + +This is definitely exciting and should grab the attention of OEMs, and businesses looking for a CentOS alternative with a long-term support until 2029 at least. + +They also added what the community manager of AlmaLinux OS thinks about it going forward: + +> “Since launch, we’ve received tremendous interest and support from both the community as well as many commercial vendors, many of whom have begun using AlmaLinux OS for some pretty amazing use cases,” said Jack Aboutboul, community manager of AlmaLinux. “Our thriving community has supported each other since day one which led to rapid adoption amongst organizations and requests for commercial support.” + +The support service options should start rolling out in **May 2021** (next month). If you want to know more about it before the release or how you can use it for your AlmaLinux OS deployments, fill up the form in the [official support page][4]. + +[Commercial Support for AlmaLinux OS][4] + +_So, what do you think about AlmaLinux OS as a CentOS alternative now with the imminent availability of commercial support? Do you have big hopes for it? Feel free to share what you think!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +#### _Related_ + + * [Much-Anticipated CentOS Alternative 'AlmaLinux' Beta Released for Testing][5] + * ![][6] ![][7] + + + * [AlmaLinux OS First Stable Release is Here to Replace CentOS][2] + * ![][6] ![][8] + + + * [After Rocky Linux, We Have Another RHEL Fork in Works to Replace CentOS][9] + * ![][6] ![CloudLinux][10] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/almalinux-commercial-support/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://almalinux.org/ +[2]: https://news.itsfoss.com/almalinux-first-stable-release/ +[3]: https://itsfoss.com/rhel-based-server-distributions/ +[4]: https://almalinux.org/support/ +[5]: https://news.itsfoss.com/almalinux-beta-released/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/almalinux-ft.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/almalinux-first-iso-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[9]: https://news.itsfoss.com/rhel-fork-by-cloudlinux/ +[10]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2020/12/Untitled-design-2.png?fit=800%2C450&ssl=1&resize=350%2C200 From 63623e4e9f1620976f9ba5307ab9f23c0f948748 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 28 Apr 2021 08:45:20 +0800 Subject: [PATCH 292/307] translated --- ...e accessible and sustainable with Linux.md | 73 ------------------- ...e accessible and sustainable with Linux.md | 72 ++++++++++++++++++ 2 files changed, 72 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20210424 Making computers more accessible and sustainable with Linux.md create mode 100644 translated/tech/20210424 Making computers more accessible and sustainable with Linux.md diff --git a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md b/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md deleted file mode 100644 index 0646d7b75c..0000000000 --- a/sources/tech/20210424 Making computers more accessible and sustainable with Linux.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: subject: (Making computers more accessible and sustainable with Linux) -[#]: via: (https://opensource.com/article/21/4/linux-free-geek) -[#]: author: (Don Watkins https://opensource.com/users/don-watkins) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Making computers more accessible and sustainable with Linux -====== -Free Geek is a nonprofit organization that helps decrease the digital -divide by providing Linux computers to people and groups in need. -![Working from home at a laptop][1] - -There are many reasons to choose Linux for your desktop operating system. In [_Why everyone should choose Linux_][2], Opensource.com's Seth Kenlon highlighted many of the best reasons to select Linux and provided lots of ways for people to get started with the operating system. - -This also got me thinking about how I usually introduce folks to Linux. The pandemic has increased the need for people to go online for shopping, doing remote education, and connecting with family and friends [over video conferencing][3]. - -I work with a lot of retirees who have fixed incomes and are not particularly tech-savvy. For most of these folks, buying a computer is a major investment fraught with concern. Some of my friends and clients are uncomfortable going to a retail store during a pandemic, and they're completely unfamiliar with what to look for in a computer, whether it's a desktop or laptop, even in non-pandemic times. They come to me with questions about where to buy one and what to look for. - -I'm always eager to see them get a Linux computer. Many of them cannot afford the Linux units sold by name-brand vendors. Until recently, I've been purchasing refurbished units for them and refitting them with Linux. - -But that all changed when I discovered [Free Geek][4], a nonprofit organization based in Portland, Ore., with the mission "to sustainably reuse technology, enable digital access, and provide education to create a community that empowers people to realize their potential." - -Free Geek has an eBay store where I have purchased several refurbished laptops at affordable prices. Their computers come with [Linux Mint][5] installed. The fact that a computer comes ready-to-use makes it easy to introduce [new users to Linux][6] and help them quickly experience the operating system's power. - -### Keeping computers in service and out of landfills - -Oso Martin launched Free Geek on Earth Day 2000. The organization provides classes and work programs to its volunteers, who are trained to refurbish and rebuild donated computers. Volunteers also receive a donated computer after 24 hours of service. - -The computers are sold in Free Geek's brick-and-mortar store in Portland and [online][7]. The organization also provides computers to people and entities in need through its programs [Plug Into Portland][8], [Gift a Geekbox][9], and [organizational][10] and [community grants][11]. - -The organization says it has "diverted over 2 million items from landfills, granted over 75,000 technology devices to nonprofits, schools, community change organizations, and individuals, and plugged over 5,000 classroom hours from Free Geek learners." - -### Get involved - -Since its inception, Free Geek has grown from a staff of three to almost 50 and has been recognized around the world. It is a member of the City of Portland's [Digital Inclusion Network][12]. - -You can connect with Free Geek on [Twitter][13], [Facebook][14], [LinkedIn][15], [YouTube][16], and [Instagram][17]. You can also subscribe to its [newsletter][18]. Purchasing items from Free Geek's [shop][19] directly supports its work and reduces the digital divide. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/linux-free-geek - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) -[2]: https://opensource.com/article/21/2/try-linux -[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing -[4]: https://www.freegeek.org/ -[5]: https://opensource.com/article/21/4/restore-macbook-linux -[6]: https://opensource.com/article/18/12/help-non-techies -[7]: https://www.ebay.com/str/freegeekbasicsstore -[8]: https://www.freegeek.org/our-programs/plug-portland -[9]: https://www.freegeek.org/our-programs/gift-geekbox -[10]: https://www.freegeek.org/our-programs-grants/organizational-hardware-grants -[11]: https://www.freegeek.org/our-programs-grants/community-hardware-grants -[12]: https://www.portlandoregon.gov/oct/73860 -[13]: https://twitter.com/freegeekpdx -[14]: https://www.facebook.com/freegeekmothership -[15]: https://www.linkedin.com/company/free-geek/ -[16]: https://www.youtube.com/user/FreeGeekMothership -[17]: https://www.instagram.com/freegeekmothership/ -[18]: https://app.e2ma.net/app2/audience/signup/1766417/1738557/?v=a -[19]: https://www.freegeek.org/shop diff --git a/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md b/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md new file mode 100644 index 0000000000..1fc0ad6745 --- /dev/null +++ b/translated/tech/20210424 Making computers more accessible and sustainable with Linux.md @@ -0,0 +1,72 @@ +[#]: subject: (Making computers more accessible and sustainable with Linux) +[#]: via: (https://opensource.com/article/21/4/linux-free-geek) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Linux 使计算机更容易使用和可持续 +====== +Free Geek 是一个非营利组织,通过向有需要的人和团体提供 Linux 电脑,帮助减少数字鸿沟。 +![Working from home at a laptop][1] + +有很多理由选择 Linux 作为你的桌面操作系统。在[_为什么每个人都应该选择 Linux_][2]中,Opensource.com 的 Seth Kenlon 强调了许多选择 Linux 的最佳理由,并为人们提供了许多开始使用该操作系统的方法。 + +这也让我想到了我通常向人们介绍 Linux 的方式。这场大流行增加了人们上网购物、远程教育以及与家人和朋友[通过视频会议][3]联系的需求。 + +我和很多有固定收入的退休人员一起工作,他们并不特别精通技术。对于这些人中的大多数人来说,购买电脑是一项充满担忧的大投资。我的一些朋友和客户对在大流行期间去零售店感到不舒服,而且他们完全不熟悉在电脑中寻找什么,无论是台式机还是笔记本电脑,即使在非大流行时期。他们来找我,询问在哪里买,要注意些什么。 + +我总是急于看到他们得到一台 Linux 电脑。他们中的许多人买不起名牌供应商出售的 Linux 设备。直到最近,我一直在为他们购买翻新的设备,然后用 Linux 改装它们。 + +但是,当我发现 [Free Geek][4] 时,这一切都改变了,这是一个位于俄勒冈州波特兰的非营利组织,它的使命是“可持续地重复使用技术,实现数字访问,并提供教育,以创建一个使人们能够实现其潜力的社区。” + +Free Geek 有一个 eBay 商店,我在那里以可承受的价格购买了几台翻新的笔记本电脑。他们的电脑都安装了 [Linux Mint][5]。 事实上,电脑可以立即使用,这使得向[新用户介绍 Linux][6] 很容易,并帮助他们快速体验操作系统的力量。 + +### 让电脑继续使用,远离垃圾填埋场 + +Oso Martin 在 2000 年地球日发起了 Free Geek。该组织为其志愿者提供课程和工作计划,对他们进行翻新和重建捐赠电脑的培训。志愿者们在服务 24 小时后还会收到一台捐赠的电脑。 + +这些电脑在波特兰的 Free Geek 实体店和[网上][7]出售。该组织还通过其项目 [Plug Into Portland][8]、[Gift a Geekbox][9] 以及[组织][10]和[社区资助][11]向有需要的人和实体提供电脑。 + +该组织表示,它已经“从垃圾填埋场转移了 200 多万件物品,向非营利组织、学校、社区变革组织和个人提供了 75000 多件技术设备,并从 Free Geek 学习者那里插入了 5000 多课时”。 + +### 参与其中 + +自成立以来,Free Geek 已经从 3 名员工发展到近 50 名员工,并得到了世界各地的认可。它是波特兰市的[数字包容网络][12]的成员。 + +你可以在 [Twitter][13]、[Facebook][14]、[LinkedIn][15]、[YouTube][16] 和 [Instagram][17] 上与 Free Geek 联系。你也可以订阅它的[通讯][18]。从 Free Geek 的[商店][19]购买物品,可以直接支持其工作,减少数字鸿沟。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/linux-free-geek + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://opensource.com/article/21/2/try-linux +[3]: https://opensource.com/article/20/8/linux-laptop-video-conferencing +[4]: https://www.freegeek.org/ +[5]: https://opensource.com/article/21/4/restore-macbook-linux +[6]: https://opensource.com/article/18/12/help-non-techies +[7]: https://www.ebay.com/str/freegeekbasicsstore +[8]: https://www.freegeek.org/our-programs/plug-portland +[9]: https://www.freegeek.org/our-programs/gift-geekbox +[10]: https://www.freegeek.org/our-programs-grants/organizational-hardware-grants +[11]: https://www.freegeek.org/our-programs-grants/community-hardware-grants +[12]: https://www.portlandoregon.gov/oct/73860 +[13]: https://twitter.com/freegeekpdx +[14]: https://www.facebook.com/freegeekmothership +[15]: https://www.linkedin.com/company/free-geek/ +[16]: https://www.youtube.com/user/FreeGeekMothership +[17]: https://www.instagram.com/freegeekmothership/ +[18]: https://app.e2ma.net/app2/audience/signup/1766417/1738557/?v=a +[19]: https://www.freegeek.org/shop From a8b0c4b71d1f8b86682562465a4a21d7305916af Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 28 Apr 2021 08:57:10 +0800 Subject: [PATCH 293/307] translating --- sources/tech/20210426 3 beloved USB drive Linux distros.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210426 3 beloved USB drive Linux distros.md b/sources/tech/20210426 3 beloved USB drive Linux distros.md index 99247ee961..2e35d8cd7e 100644 --- a/sources/tech/20210426 3 beloved USB drive Linux distros.md +++ b/sources/tech/20210426 3 beloved USB drive Linux distros.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/usb-drive-linux-distro) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 267a22471c71ffb01a35b3ef6697ca73fcf3e970 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 29 Apr 2021 05:02:58 +0800 Subject: [PATCH 294/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210429=20?= =?UTF-8?q?Experiencing=20the=20/e/=20OS:=20The=20Open=20Source=20De-Googl?= =?UTF-8?q?ed=20Android=20Version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md --- ... Open Source De-Googled Android Version.md | 133 ++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md diff --git a/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md new file mode 100644 index 0000000000..80541c80bd --- /dev/null +++ b/sources/tech/20210429 Experiencing the -e- OS- The Open Source De-Googled Android Version.md @@ -0,0 +1,133 @@ +[#]: subject: (Experiencing the /e/ OS: The Open Source De-Googled Android Version) +[#]: via: (https://itsfoss.com/e-os-review/) +[#]: author: (Dimitrios https://itsfoss.com/author/dimitrios/) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Experiencing the /e/ OS: The Open Source De-Googled Android Version +====== + +/e/ Android operating system is a privacy oriented, Google-free mobile operating system, fork of Lineage OS and was founded in mid-2018 by [Gaël Duval][1], creator of Mandrake Linux (now [Mandriva Linux)][2]. + +Despite making Android an open source project in 2007, Google replaced some OS elements with proprietary software when Android gained popularity. /e/ Foundation has replaced the proprietary apps and services with [MicroG][3], an open source alternative framework which minimizes tracking and device activity. + +It’s FOSS received [Fairphone 3][4] with /e/ OS preinstalled, an [ethically created smartphone][5] from the /e/ Foundation. I used the device for a month before returning it to them and I am going to share my experience with this privacy device. I forgot to take screenshots so I’ll be sharing the generic images from the official website. + +### Experiencing the /e/ mobile operating system on the ethical Fairphone device + +Before I go any further, let me clear that Fairphone 3 is not the only option to get /e/ in your hands. The /e/ foundation gives you [a few smartphone options to choose][6] if you are buying a device from them. + +You don’t have to buy a device to use /e/ OS. As per the /e/ Foundation, you can [use it on over 100 supported devices][7]. + +Despite I enjoyed using the Fairphone 3, and my personal beliefs are in line with the Fairphone manifesto, I won’t focus my attention on the device but to the /e/ operating system only. + +#### Apps with rated privacy + +![][8] + +I used Fairphone 3 as my daily driver for a couple of days, to compare the usage with my “ordinary” Android phone in reality. + +First and foremost I wanted to see if all the apps that I use, are available at the “[App Store][9]” /e/ foundation has created. The /e/ App Store contains apps with privacy ratings. + +![/e/ OS app store has privacy ratings of the apps][10] + +I could find many applications, including apps from Google. This means that if someone really wants to use some Google service, it is still available as an option to download. Though unlike other Andriod devices, Google services are not forced down your throat. + +Though there are lot of apps available, I could not find the mobile banking app I use in the UK. I have to admit that the mobile banking app can contribute to a level of convenience. As an alternative, I had to access a computer to use the online banking platform if needed. + +From a usability point of view, /e/ OS could replace my “standard” Android OS with minor hiccups like the banking apps. + +#### If not Google, then what? + +Wondering what essential apps /e/ OS uses instead of the ones from Google? Here’s a quick list: + + * [Magic Earth][11] – Turn by turn navigation + * Web-browser – an ungoogled fork of Chromium + * Mail – a fork of [K9-mail][12] + * SMS – a fork of QKSMS + * Camera – a fork of OpenCamera + * Weather – a fork of GoodWeather + * OpenTasks – Task organizer + * Calendar -Calendar: a fork of [Etar calendar][13] + + + +#### Bliss Launcher and overall design + +![][14] + +The default launcher application of /e/ OS is called “Bliss Launcher” which aims to an attractive look and feel. To me, the design felt similar to iOS. + +By Swiping to the left panel, you can access a few useful widgets /e/ has selected. + +![][15] + + * Search: Quick search of pre-installed apps or search the web + * APP Suggestions: The top 4 most used apps will appear on this widget + * Weather: The weather widget is showing the local weather. It doesn’t automatically detect the location and it needs to be configured. + * Edit: If you want more widgets on the screen, you can add them by clicking the edit button + + + +All in all, the user interface is clean and neat. Being simple and straightforward enhances a pleasant user experience. + +#### DeGoogled and privacy oriented OS + +As mentioned earlier /e/ OS is a Google-free operating system which is based on an open source core of [Lineage OS][16]. All the Google apps have been removed and the Google services have been replaced with the Micro G framework. The /e/ OS is still compatible with all Android apps. + +##### Key privacy features: + + * Google search engine has been replaced with alternatives such as DuckDuckGo + * Google Services have been replaced by microG framework + * Alternative default apps are used instead of Google Apps + * Connectivity check against Google servers is removed + * NTP servers have been replaced with the standard NTP service: pool.ntp.orgs + * DNS default servers are replaced by 9.9.9.9 and can be edited to user’s choice + * Geolocation is using Mozilla Location Services on top of GPS + + + +Privacy notice + +Please be mindful that using a smartphone, provided by /e/ foundation doesn’t automatically mean that your privacy is guaranteed no matter what you do. Social media apps that share your personal information should be used under your awareness. + +#### Conclusion + +I have been an Android user for more than a decade. /e/ OS surprised me positively. A privacy concerned user can find this solution very appealing, and depending on the selected apps and settings can feel secure again using a smartphone. + +I could recommend it to you if you are a privacy aware tech-savvy and can find your way around things on your own. The /e/ ecosystem is likely to be overwhelming for people who are used to of mainstream Google services. + +Have you used /e/ OS? How was your experience with it? What do you think of projects like these that focus on privacy? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/e-os-review/ + +作者:[Dimitrios][a] +选题:[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/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/Ga%C3%ABl_Duval +[2]: https://en.wikipedia.org/wiki/Mandriva_Linux +[3]: https://en.wikipedia.org/wiki/MicroG +[4]: https://esolutions.shop/shop/e-os-fairphone-3-fr/ +[5]: https://www.fairphone.com/en/story/?ref=header +[6]: https://esolutions.shop/shop/ +[7]: https://doc.e.foundation/devices/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-ecosystem.png?resize=768%2C510&ssl=1 +[9]: https://e.foundation/e-os-available-applications/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-os-apps-privacy-ratings.png?resize=300%2C539&ssl=1 +[11]: https://www.magicearth.com/ +[12]: https://k9mail.app/ +[13]: https://github.com/Etar-Group/Etar-Calendar +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/fairphone.jpg?resize=600%2C367&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/04/e-bliss-launcher.jpg?resize=300%2C533&ssl=1 +[16]: https://lineageos.org/ From 3b3b56a0c80b8f4b9a8fa4d5accb7551c957390f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 29 Apr 2021 05:03:17 +0800 Subject: [PATCH 295/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210428=20?= =?UTF-8?q?Share=20files=20between=20Linux=20and=20Windows=20computers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210428 Share files between Linux and Windows computers.md --- ...les between Linux and Windows computers.md | 274 ++++++++++++++++++ 1 file changed, 274 insertions(+) create mode 100644 sources/tech/20210428 Share files between Linux and Windows computers.md diff --git a/sources/tech/20210428 Share files between Linux and Windows computers.md b/sources/tech/20210428 Share files between Linux and Windows computers.md new file mode 100644 index 0000000000..8ba6282397 --- /dev/null +++ b/sources/tech/20210428 Share files between Linux and Windows computers.md @@ -0,0 +1,274 @@ +[#]: subject: (Share files between Linux and Windows computers) +[#]: via: (https://opensource.com/article/21/4/share-files-linux-windows) +[#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Share files between Linux and Windows computers +====== +Set up cross-platform file sharing with Samba. +![Blue folders flying in the clouds above a city skyline][1] + +If you work with different operating systems, it's handy to be able to share files between them. This article explains how to set up file access between Linux ([Fedora 33][2]) and Windows 10 using [Samba][3] and [mount.cifs][4]. + +Samba is the Linux implementation of the [SMB/CIFS][5] protocol, allowing direct access to shared folders and printers over a network. Mount.cifs is part of the Samba suite and allows you to mount the [CIFS][5] filesystem under Linux. + +> **Caution**: These instructions are for sharing files within your private local network or in a virtualized host-only network between a Linux host machine and a virtualized Windows guest. Don't consider this article a guideline for your corporate network, as it doesn't implement the necessary cybersecurity considerations. + +### Access Linux from Windows + +This section explains how to access a user's Linux home directory from Windows File Explorer. + +#### 1\. Install and configure Samba + +Start on your Linux system by installing Samba: + + +``` +`dnf install samba` +``` + +Samba is a system daemon, and its configuration file is located in `/etc/samba/smb.conf`. Its default configuration should work. If not, this minimal configuration should do the job: + + +``` +[global] +        workgroup = SAMBA +        server string = %h server (Samba %v) +        invalid users = root +        security = user +[homes] +        comment = Home Directories +        browseable = no +        valid users = %S +        writable = yes +``` + +You can find a detailed description of the parameters in the [smb.conf][6] section of the project's website. + +#### 2\. Modify LinuxSE + +If your Linux distribution is protected by [SELinux][7] (as Fedora is), you have to enable Samba to be able to access the user's home directory: + + +``` +`setsebool -P samba_enable_home_dirs on` +``` + +Check that the value is set by typing: + + +``` +`getsebool samba_enable_home_dirs` +``` + +Your output should look like this: + +![Sebool][8] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 3\. Enable your user + +Samba uses a set of users and passwords that have permission to connect. Add your Linux user to the set by typing: + + +``` +`smbpasswd -a ` +``` + +You will be prompted for a password. This is a _completely new_ password; it is not the current password for your account. Enter the password you want to use to log in to Samba. + +To get a list of allowed user types: + + +``` +`pdbedit -L -v` +``` + +Remove a user by typing: + + +``` +`smbpasswd -x ` +``` + +#### 4\. Start Samba + +Because Samba is a system daemon, you can start it on Fedora with: + + +``` +`systemctl start smb` +``` + +This starts Samba for the current session. If you want Samba to start automatically on system startup, enter: + + +``` +`systemctl enable smb` +``` + +On some systems, the Samba daemon is registered as `smbd`. + +#### 4\. Configure the firewall + +By default, Samba is blocked by your firewall. Allow Samba to access the network permanently by configuring the firewall. + +You can do it on the command line with: + + +``` +`firewall-cmd --add-service=samba --permanent` +``` + +Or you do it graphically with the firewall-config tool: + +![firewall-config][10] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 5\. Access Samba from Windows + +In Windows, open File Explorer. On the address line, type in two backslashes followed by your Linux machine's address (IP address or hostname): + +![Accessing Linux machine from Windows][11] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +You will be prompted for your login information. Type in the username and password combination from step 3. You should now be able to access your home directory on your Linux machine: + +![Accessing Linux machine from Windows][12] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +### Access Windows from Linux + +The following steps explain how to access a shared Windows folder from Linux. To implement them, you need Administrator rights on your Windows user account. + +#### 1\. Enable file sharing + +Open the** Network and Sharing Center** either by clicking on the + +**Windows Button > Settings > Network & Internet** + +or by right-clicking the little monitor icon on the bottom-right of your taskbar: + +![Open network and sharing center][13] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +In the window that opens, find the connection you want to use and note its profile. I used **Ethernet 3**, which is tagged as a **Public network**. + +> **Caution**: Consider changing your local machine's connection profile to **Private** if your PC is frequently connected to public networks. + +Remember your network profile and click on **Change advanced sharing settings**: + +![Change advanced sharing settings][14] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +Select the profile that corresponds to your connection and turn on **network discovery** and **file and printer sharing**: + +![Network sharing settings][15] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 2\. Define a shared folder + +Open the context menu by right-clicking on the folder you want to share, navigate to **Give access to**, and select **Specific people...** : + +![Give access][16] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +Check whether your current username is on the list. Click on **Share** to tag this folder as shared: + +![Tag as shared][17] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +You can display a list of all shared folders by entering `\\localhost` in File Explorer's address line: + +![Shared folders][18] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +![Shared folders][19] + +(Stephan Avenwedde, [CC BY-SA 4.0][9]) + +#### 3\. Mount the shared folder under Linux + +Go back to your Linux system, open a command shell, and create a new folder where you want to mount the Windows share: + + +``` +`mkdir ~/WindowsShare` +``` + +Mounting Windows shares is done with mount.cifs, which should be installed by default. To mount your shared folder temporarily, use: + + +``` +`sudo mount.cifs ///MySharedFolder ~/WindowsShare/ -o user=,uid=$UID` +``` + +In this command: + + * `` is the Windows PC's address info (IP or hostname) + * ``is the user that is allowed to access the shared folder (from step 2) + + + +You will be prompted for your Windows password. Enter it, and you will be able to access the shared folder on Windows with your normal Linux user. + +To unmount the shared folder: + + +``` +`sudo umount ~/WindowsShare/` +``` + +You can also mount a Windows shared folder on system startup. Follow [these steps][20] to configure your system accordingly. + +### Summary + +This shows how to establish temporary shared folder access that must be renewed after each boot. It is relatively easy to modify this configuration for permanent access. I often switch back and forth between different systems, so I consider it incredibly practical to set up direct file access. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/share-files-linux-windows + +作者:[Stephan Avenwedde][a] +选题:[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/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_cloud21x_cc.png?itok=5UwC92dO (Blue folders flying in the clouds above a city skyline) +[2]: https://getfedora.org/en/workstation/download/ +[3]: https://www.samba.org/ +[4]: https://linux.die.net/man/8/mount.cifs +[5]: https://en.wikipedia.org/wiki/Server_Message_Block +[6]: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html +[7]: https://www.redhat.com/en/topics/linux/what-is-selinux +[8]: https://opensource.com/sites/default/files/uploads/sebool.png (Enabling Samba to enable user directory access) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/uploads/firewall_configuration.png (firewall-config tool) +[11]: https://opensource.com/sites/default/files/uploads/windows_access_shared_1.png (Accessing Linux machine from Windows) +[12]: https://opensource.com/sites/default/files/uploads/windows_acess_shared_2.png (Accessing Linux machine from Windows) +[13]: https://opensource.com/sites/default/files/uploads/open_network_and_sharing_center.png (Open network and sharing center) +[14]: https://opensource.com/sites/default/files/uploads/network_and_sharing_center_2.png (Change advanced sharing settings) +[15]: https://opensource.com/sites/default/files/uploads/network_sharing.png (Network sharing settings) +[16]: https://opensource.com/sites/default/files/pictures/give_access_to.png (Give access) +[17]: https://opensource.com/sites/default/files/pictures/tag_as_shared.png (Tag as shared) +[18]: https://opensource.com/sites/default/files/uploads/show_shared_folder_1.png (Shared folders) +[19]: https://opensource.com/sites/default/files/uploads/show_shared_folder_2.png (Shared folders) +[20]: https://timlehr.com/auto-mount-samba-cifs-shares-via-fstab-on-linux/ From b3a43ea0a869ef78ee51c6848d8586b774d15829 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 29 Apr 2021 05:03:30 +0800 Subject: [PATCH 296/307] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210428=20?= =?UTF-8?q?5=20ways=20to=20process=20JSON=20data=20in=20Ansible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210428 5 ways to process JSON data in Ansible.md --- ... 5 ways to process JSON data in Ansible.md | 347 ++++++++++++++++++ 1 file changed, 347 insertions(+) create mode 100644 sources/tech/20210428 5 ways to process JSON data in Ansible.md diff --git a/sources/tech/20210428 5 ways to process JSON data in Ansible.md b/sources/tech/20210428 5 ways to process JSON data in Ansible.md new file mode 100644 index 0000000000..ea61f1f7f3 --- /dev/null +++ b/sources/tech/20210428 5 ways to process JSON data in Ansible.md @@ -0,0 +1,347 @@ +[#]: subject: (5 ways to process JSON data in Ansible) +[#]: via: (https://opensource.com/article/21/4/process-json-data-ansible) +[#]: author: (Nicolas Leiva https://opensource.com/users/nicolas-leiva) +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +5 ways to process JSON data in Ansible +====== +Structured data is friendly for automation, and you can take full +advantage of it with Ansible. +![Net catching 1s and 0s or data in the clouds][1] + +Exploring and validating data from an environment is a common practice for preventing service disruptions. You can choose to run the process periodically or on-demand, and the data you're checking can come from different sources: telemetry, command outputs, etc. + +If the data is _unstructured_, you must do some custom regex magic to retrieve key performance indicators (KPIs) relevant for specific scenarios. If the data is _structured_, you can leverage a wide array of options to make parsing it simpler and more consistent. Structured data conforms to a data model, which allows access to each data field separately. The data for these models is exchanged as key/value pairs and encoded using different formats. JSON, which is widely used in Ansible, is one of them. + +There are many resources available in Ansible to work with JSON data, and this article presents five of them. While all these resources are used together in sequence in the examples, it is probably sufficient to use just one or two in most real-life scenarios. + +![Magnifying glass looking at 0's and 1's][2] + +([Geralt][3], Pixabay License) + +The following code snippet is a short JSON document used as input for the examples in this article. If you just want to see the code, it's available in my [GitHub repository][4]. + +This is sample [pyATS][5] output from a `show ip ospf neighbors` command on a Cisco IOS-XE device: + + +``` +{ +   "parsed": { +      "interfaces": { +          "Tunnel0": { +              "neighbors": { +                  "203.0.113.2": { +                      "address": "198.51.100.2", +                      "dead_time": "00:00:39", +                      "priority": 0, +                      "state": "FULL/  -" +                  } +              } +          }, +          "Tunnel1": { +              "neighbors": { +                  "203.0.113.2": { +                      "address": "192.0.2.2", +                      "dead_time": "00:00:36", +                      "priority": 0, +                      "state": "INIT/  -" +                  } +              } +          } +      } +   } +} +``` + +This document lists various interfaces from a networking device describing the Open Shortest Path First ([OSPF][6]) state of any OSPF neighbor present per interface. The goal is to validate that the state of all these OSPF sessions is good (i.e., **FULL**). + +This goal is visually simple, but if you have a lot of entries, it wouldn't be. Fortunately, as the following examples demonstrate, you can do this at scale with Ansible. + +### 1\. Access a subset of the data + +If you are only interested in a specific branch of the data tree, a reference to its path will take you down the JSON structure hierarchy and allow you to select only that portion of the JSON object. The path is made of dot-separated key names. + +To begin, create a variable (`input`) in Ansible that reads the JSON-formatted message from a file. + +To go two levels down, for example, you need to follow the hierarchy of the key names to that point, which translates to `input.parsed.interfaces`, in this case. `input` is the variable that stores the JSON data, `parsed` the top-level key, and `interfaces` is the subsequent one. In a playbook, this will looks like: + + +``` +\- name: Go down the JSON file 2 levels +  hosts: localhost +  vars: +    input: "{{ lookup('file','output.json') | from_json }}" + +  tasks: +   - name: Create interfaces Dictionary +     set_fact: +       interfaces: "{{ input.parsed.interfaces }}" + +   - name: Print out interfaces +     debug: +       var: interfaces +``` + +It gives the following output: + + +``` +TASK [Print out interfaces] ************************************************************************************************************************************* +ok: [localhost] => { +    "msg": { +        "Tunnel0": { +            "neighbors": { +                "203.0.113.2": { +                    "address": "198.51.100.2", +                    "dead_time": "00:00:39", +                    "priority": 0, +                    "state": "FULL/  -" +                } +            } +        }, +        "Tunnel1": { +            "neighbors": { +                "203.0.113.2": { +                    "address": "192.0.2.2", +                    "dead_time": "00:00:36", +                    "priority": 0, +                    "state": "INIT/  -" +                } +            } +        } +    } +} +``` + +The view hasn't changed much; you only trimmed the edges. Baby steps! + +### 2\. Flatten out the content + +If the previous output doesn't help or you want a better understanding of the data hierarchy, you can produce a more compact output with the `to_paths` filter: + + +``` +\- name: Print out flatten interfaces input +  debug: +    msg: "{{ lookup('ansible.utils.to_paths', interfaces) }}" +``` + +This will print out as: + + +``` +TASK [Print out flatten interfaces input] *********************************************************************************************************************** +ok: [localhost] => { +    "msg": { +        "Tunnel0.neighbors['203.0.113.2'].address": "198.51.100.2", +        "Tunnel0.neighbors['203.0.113.2'].dead_time": "00:00:39", +        "Tunnel0.neighbors['203.0.113.2'].priority": 0, +        "Tunnel0.neighbors['203.0.113.2'].state": "FULL/  -", +        "Tunnel1.neighbors['203.0.113.2'].address": "192.0.2.2", +        "Tunnel1.neighbors['203.0.113.2'].dead_time": "00:00:36", +        "Tunnel1.neighbors['203.0.113.2'].priority": 0, +        "Tunnel1.neighbors['203.0.113.2'].state": "INIT/  -" +    } +} +``` + +### 3\. Use json_query filter (JMESPath) + +If you are familiar with a JSON query language such as [JMESPath][7], then Ansible's json_query filter is your friend because it is built upon JMESPath, and you can use the same syntax. If this is new to you, there are plenty of JMESPath examples you can learn from in [JMESPath examples][8]. It is a good resource to have in your toolbox. + +Here's how to use it to create a list of the neighbors for all interfaces. The query executed in this is `*.neighbors`: + + +``` +\- name: Create neighbors dictionary (this is now per interface) +  set_fact: +    neighbors: "{{ interfaces | json_query('*.neighbors') }}" + +\- name: Print out neighbors +  debug: +    msg: "{{ neighbors }}" +``` + +Which returns a list you can iterate over: + + +``` +TASK [Print out neighbors] ************************************************************************************************************************************** +ok: [localhost] => { +    "msg": [ +        { +            "203.0.113.2": { +                "address": "198.51.100.2", +                "dead_time": "00:00:39", +                "priority": 0, +                "state": "FULL/  -" +            } +        }, +        { +            "203.0.113.2": { +                "address": "192.0.2.2", +                "dead_time": "00:00:36", +                "priority": 0, +                "state": "INIT/  -" +            } +        } +    ] +} +``` + +Other options to query JSON are [jq][9] or [Dq][10] (for pyATS). + +### 4\. Access specific data fields + +Now you can go through the list of neighbors in a loop to access individual data. This example is interested in the `state` of each one. Based on the field's value, you can trigger an action. + +This will generate a message to alert the user if the state of a session isn't **FULL**. Typically, you would notify users through mechanisms like email or a chat message rather than just a log entry, as in this example. + +As you loop over the `neighbors` list generated in the previous step, it executes the tasks described in `tasks.yml` to instruct Ansible to print out a **WARNING** message only if the state of the neighbor isn't **FULL** (i.e., `info.value.state is not match("FULL.*")`): + + +``` +\- name: Loop over neighbors +  include_tasks: tasks.yml +  with_items: "{{ neighbors }}" +``` + +The `tasks.yml` file considers `info` as the dictionary item produced for each neighbor in the list you iterate over: + + +``` +\- name: Print out a WARNING if OSPF state is not FULL + debug: +   msg: "WARNING: Neighbor {{ info.key }}, with address {{ info.value.address }} is in state {{ info.value.state[0:4]  }}" + vars: +   info: "{{ lookup('dict', item) }}" + when: info.value.state is not match("FULL.*") +``` + +This produces a custom-generated message with different data fields for each neighbor that isn't operational: + + +``` +TASK [Print out a WARNING if OSPF state is not FULL] ************************************************************************************************************ +ok: [localhost] => { +    "msg": "WARNING: Neighbor 203.0.113.2, with address 192.0.2.2 is in state INIT" +} +``` + +> Note: Filter JSON data in Ansible using [json_query][11]. + +### 5\. Use a JSON schema to validate your data + +A more sophisticated way to validate the data from a JSON message is by using a JSON schema. This gives you more flexibility and a wider array of options to validate different types of data. A schema for this example would need to specify `state` is a `string` that starts with **FULL** if that's the only state you want to be valid (you can access this code in my [GitHub repository][12]): + + +``` +{ + "$schema": "", + "definitions": { +     "neighbor" : { +         "type" : "object", +         "properties" : { +             "address" : {"type" : "string"}, +             "dead_time" : {"type" : "string"}, +             "priority" : {"type" : "number"}, +             "state" : { +                 "type" : "string", +                 "pattern" : "^FULL" +                 } +             }, +         "required" : [ "address","state" ] +     } + }, + "type": "object", + "patternProperties": { +     ".*" : { "$ref" : "#/definitions/neighbor" } + } +} +``` + +As you loop over the neighbors, it reads this schema (`schema.json`) and uses it to validate each neighbor item with the module `validate` and engine `jsonschema`: + + +``` +\- name: Validate state of the neighbor is FULL +  ansible.utils.validate: +    data: "{{ item }}" +    criteria: +     - "{{ lookup('file',  'schema.json') | from_json }}" +    engine: ansible.utils.jsonschema +  ignore_errors: true +  register: result + +\- name: Print the neighbor that does not satisfy the desired state +  ansible.builtin.debug: +    msg: +     - "WARNING: Neighbor {{ info.key }}, with address {{ info.value.address }} is in state {{ info.value.state[0:4] }}" +     - "{{ error.data_path }}, found: {{ error.found }}, expected: {{ error.expected }}" +  when: "'errors' in result" +  vars: +    info: "{{ lookup('dict', item) }}" +    error: "{{ result['errors'][0] }}" +``` + +Save the output of the ones that fail the validation so that you can alert the user with a message: + + +``` +TASK [Validate state of the neighbor is FULL] ******************************************************************************************************************* +fatal: [localhost]: FAILED! => {"changed": false, "errors": [{"data_path": "203.0.113.2.state", "expected": "^FULL", "found": "INIT/  -", "json_path": "$.203.0.113.2.state", "message": "'INIT/  -' does not match '^FULL'", "relative_schema": {"pattern": "^FULL", "type": "string"}, "schema_path": "patternProperties..*.properties.state.pattern", "validator": "pattern"}], "msg": "Validation errors were found.\nAt 'patternProperties..*.properties.state.pattern' 'INIT/  -' does not match '^FULL'. "} +...ignoring + +TASK [Print the neighbor that does not satisfy the desired state] *********************************************************************************************** +ok: [localhost] => { +    "msg": [ +        "WARNING: Neighbor 203.0.113.2, with address 192.0.2.2 is in state INIT", +        "203.0.113.2.state, found: INIT/  -, expected: ^FULL" +    ] +} +``` + +If you'd like a deeper dive: + + * You can find a more elaborated example and references in [Using new Ansible utilities for operational state management and remediation][13]. + * A good resource to practice JSON schema generation is the [JSON Schema Validator and Generator][14]. + * A similar approach is the [Schema Enforcer][15], which lets you create the schema in YAML (helpful if you prefer that syntax). + + + +### Conclusion + +Structured data is friendly for automation, and you can take full advantage of it with Ansible. As you determine your KPIs, you can automate checks on them to give you peace of mind in situations such as before and after a maintenance window. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/process-json-data-ansible + +作者:[Nicolas Leiva][a] +选题:[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/nicolas-leiva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_analytics_cloud.png?itok=eE4uIoaB (Net catching 1s and 0s or data in the clouds) +[2]: https://opensource.com/sites/default/files/uploads/data_pixabay.jpg (Magnifying glass looking at 0's and 1's) +[3]: https://pixabay.com/illustrations/window-hand-magnifying-glass-binary-4354467/ +[4]: https://github.com/nleiva/ansible-networking/blob/master/test-json.md#parsing-json-outputs +[5]: https://pypi.org/project/pyats/ +[6]: https://en.wikipedia.org/wiki/Open_Shortest_Path_First +[7]: https://jmespath.org/ +[8]: https://jmespath.org/examples.html +[9]: https://stedolan.github.io/jq/ +[10]: https://pubhub.devnetcloud.com/media/genie-docs/docs/userguide/utils/index.html +[11]: https://blog.networktocode.com/post/ansible-filtering-json-query/ +[12]: https://github.com/nleiva/ansible-networking/blob/master/files/schema.json +[13]: https://www.ansible.com/blog/using-new-ansible-utilities-for-operational-state-management-and-remediation +[14]: https://extendsclass.com/json-schema-validator.html +[15]: https://blog.networktocode.com/post/introducing_schema_enforcer/ From ab701029d4a1dedcf306d30a2104d6e4bcaba5e3 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 08:04:36 +0800 Subject: [PATCH 297/307] Update 20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md --- ...0210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md index 825ad149af..116213a55c 100644 --- a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md +++ b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0b8396ba8813ae5394f4d26e5d518c76080d5498 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 08:17:21 +0800 Subject: [PATCH 298/307] Update 20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md --- ...0210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md index 116213a55c..825ad149af 100644 --- a/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md +++ b/sources/news/20210422 Hurrah- Ubuntu 21.04 is Now Available to Download.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/ubuntu-21-04-release/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: (Kevin3599) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d3010b3912f6c89415b210d504216804a90ad1ef Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 08:17:54 +0800 Subject: [PATCH 299/307] Update 20210423 What-s New in Ubuntu MATE 21.04.md --- sources/news/20210423 What-s New in Ubuntu MATE 21.04.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md index ff6ebd416a..7c793ba25c 100644 --- a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/ubuntu-mate-21-04-release/) [#]: author: (Asesh Basu https://news.itsfoss.com/author/asesh/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Kevin3599 ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 30318ad708c1c2f15ae1f6d7c92e22658bd29c57 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 29 Apr 2021 08:48:30 +0800 Subject: [PATCH 300/307] translated --- ...lay a fun math game with Linux commands.md | 209 ------------------ ...lay a fun math game with Linux commands.md | 209 ++++++++++++++++++ 2 files changed, 209 insertions(+), 209 deletions(-) delete mode 100644 sources/tech/20210416 Play a fun math game with Linux commands.md create mode 100644 translated/tech/20210416 Play a fun math game with Linux commands.md diff --git a/sources/tech/20210416 Play a fun math game with Linux commands.md b/sources/tech/20210416 Play a fun math game with Linux commands.md deleted file mode 100644 index cbb55f7f4e..0000000000 --- a/sources/tech/20210416 Play a fun math game with Linux commands.md +++ /dev/null @@ -1,209 +0,0 @@ -[#]: subject: (Play a fun math game with Linux commands) -[#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Play a fun math game with Linux commands -====== -Play the numbers game from the popular British game show "Countdown" at -home. -![Math formulas in green writing][1] - -Like many people, I've been exploring lots of new TV shows during the pandemic. I recently discovered a British game show called _[Countdown][2]_, where contestants play two types of games: a _words_ game, where they try to make the longest word out of a jumble of letters, and a _numbers_ game, where they calculate a target number from a random selection of numbers. Because I enjoy mathematics, I've found myself drawn to the numbers game. - -The numbers game can be a fun addition to your next family game night, so I wanted to share my own variation of it. You start with a collection of random numbers, divided into "small" numbers from 1 to 10 and "large" numbers that are 15, 20, 25, and so on until 100. You pick any combination of six numbers from both large and small numbers. - -Next, you generate a random "target" number between 200 and 999. Then use simple arithmetic operations with your six numbers to try to calculate the target number using each "small" and "large" number no more than once. You get the highest number of points if you calculate the target number exactly and fewer points if you can get within 10 of the target number. - -For example, if your random numbers were 75, 100, 2, 3, 4, and 1, and your target number was 505, you might say _2+3=5_, _5×100=500_, _4+1=5_, and _5+500=505_. Or more directly: (**2**+**3**)×**100** \+ **4** \+ **1** = **505**. - -### Randomize lists on the command line - -I've found the best way to play this game at home is to pull four "small" numbers from a pool of 1 to 10 and two "large" numbers from multiples of five from 15 to 100. You can use the Linux command line to create these random numbers for you. - -Let's start with the "small" numbers. I want these to be in the range of 1 to 10. You can generate a sequence of numbers using the Linux `seq` command. You can run `seq` a few different ways, but the simplest form is to provide the starting and ending numbers for the sequence. To generate a list from 1 to 10, you might run this command: - - -``` -$ seq 1 10 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -``` - -To randomize this list, you can use the Linux `shuf` ("shuffle") command. `shuf` will randomize the order of whatever you give it, usually a file. For example, if you send the output of the `seq` command to the `shuf` command, you will receive a randomized list of numbers between 1 and 10: - - -``` -$ seq 1 10 | shuf -3 -6 -8 -10 -7 -4 -5 -2 -1 -9 -``` - -To select just four random numbers from a list of 1 to 10, you can send the output to the `head` command, which prints out the first few lines of its input. Use the `-4` option to specify that `head` should print only the first four lines: - - -``` -$ seq 1 10 | shuf | head -4 -6 -1 -8 -4 -``` - -Note that this list is different from the earlier example because `shuf` will generate a random order every time. - -Now you can take the next step to generate the random list of "large" numbers. The first step is to generate a list of possible numbers starting at 15, incrementing by five, until you reach 100. You can generate this list with the Linux `seq` command. To increment each number by five, insert another option for the `seq` command to indicate the _step_: - - -``` -$ seq 15 5 100 -15 -20 -25 -30 -35 -40 -45 -50 -55 -60 -65 -70 -75 -80 -85 -90 -95 -100 -``` - -And just as before, you can randomize this list and select two of the "large" numbers: - - -``` -$ seq 15 5 100 | shuf | head -2 -75 -40 -``` - -### Generate a random number with Bash - -I suppose you could use a similar method to select the game's target number from the range 200 to 999. But the simplest solution to generate a single random value is to use the `RANDOM` variable directly in Bash. When you reference this built-in variable, Bash generates a large random number. To put this in the range of 200 to 999, you need to put the random number into the range 0 to 799 first, then add 200. - -To put a random number into a specific range starting at 0, you can use the **modulo** arithmetic operation. Modulo calculates the _remainder_ after dividing two numbers. If I started with 801 and divided by 800, the result is 1 _with a remainder of_ 1 (the modulo is 1). Dividing 800 by 800 gives 1 _with a remainder of_ 0 (the modulo is 0). And dividing 799 by 800 results in 0 _with a remainder of_ 799 (the modulo is 799). - -Bash supports arithmetic expansion with the `$(( ))` construct. Between the double parentheses, Bash will perform arithmetic operations on the values you provide. To calculate the modulo of 801 divided by 800, then add 200, you would type: - - -``` -$ echo $(( 801 % 800 + 200 )) -201 -``` - -With that operation, you can calculate a random target number between 200 and 999: - - -``` -$ echo $(( RANDOM % 800 + 200 )) -673 -``` - -You might wonder why I used `RANDOM` instead of `$RANDOM` in my Bash statement. In arithmetic expansion, Bash will automatically expand any variables within the double parentheses. You don't need the `$` on the `$RANDOM` variable to reference the value of the variable because Bash will do it for you. - -### Playing the numbers game - -Let's put all that together to play the numbers game. Generate two random "large" numbers, four random "small" values, and the target value: - - -``` -$ seq 15 5 100 | shuf | head -2 -75 -100 -$ seq 1 10 | shuf | head -4 -4 -3 -10 -2 -$ echo $(( RANDOM % 800 + 200 )) -868 -``` - -My numbers are **75**, **100**, **4**, **3**, **10**, and **2**, and my target number is **868**. - -I can get close to the target number if I do these arithmetic operations using each of the "small" and "large" numbers no more than once: - - -``` -10×75 = 750 -750+100 = 850 - -and: - -4×3 = 12 -850+12 = 862 -862+2 = 864 -``` - -That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: - - -``` -4×2 = 8 -8×100 = 800 - -and: - -75-10+3 = 68 -800+68 = 868 -``` - -Or I could perform _these_ calculations to get the target number exactly. This uses only five of the six random numbers: - - -``` -4×3 = 12 -75+12 = 87 - -and: - -87×10 = 870 -870-2 = 868 -``` - -Give the _Countdown_ numbers game a try, and let us know how well you did in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/4/math-game-linux-commands - -作者:[Jim Hall][a] -选题:[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/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/edu_math_formulas.png?itok=B59mYTG3 (Math formulas in green writing) -[2]: https://en.wikipedia.org/wiki/Countdown_%28game_show%29 diff --git a/translated/tech/20210416 Play a fun math game with Linux commands.md b/translated/tech/20210416 Play a fun math game with Linux commands.md new file mode 100644 index 0000000000..c4aad23a15 --- /dev/null +++ b/translated/tech/20210416 Play a fun math game with Linux commands.md @@ -0,0 +1,209 @@ +[#]: subject: (Play a fun math game with Linux commands) +[#]: via: (https://opensource.com/article/21/4/math-game-linux-commands) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +用 Linux 命令玩一个有趣的数学游戏 +====== +在家玩流行的英国游戏节目 “Countdown” 中的数字游戏。 +![Math formulas in green writing][1] + +像许多人一样,我在大流行期间探索了许多新的电视节目。我最近发现了一个英国的游戏节目,叫做 _[Countdown][2]_,参赛者在其中玩两种游戏:一种是_单词_游戏,他们试图从杂乱的字母中找出最长的单词;另一种是_数字_游戏,他们从随机选择的数字中计算出一个目标数字。因为我喜欢数学,我发现自己被数字游戏所吸引。 + +数字游戏可以为你的下一个家庭游戏之夜增添乐趣,所以我想分享我自己的变化。你以一组随机数字开始,分为 1 到 10 的“小”数字和 15、20、25 的“大”数字,以此类推,直到 100。你从大数字和小数字中挑选六个数字的任何组合。 + +接下来,你生成一个 200 到 999 之间的随机“目标”数字。然后用你的六个数字进行简单的算术运算,尝试用每个“小”和“大”数字计算出目标数字,但使用不能超过一次。如果你能准确地计算出目标数字,你就能得到最高分,如果距离目标数字 10 以内就得到较低的分数。 + +例如,如果你的随机数是 75、100、2、3、4 和 1,而你的目标数是 505,你可以说 _2+3=5_,_5×100=500_,_4+1=5_,以及 _5+500=505_。或者更直接地:(**2**+**3**)×**100** \+ **4** \+ **1** = **505**. + +### 在命令行中随机化列表 + +我发现在家里玩这个游戏的最好方法是从 1 到 10 的池子里抽出四个“小”数字,从 15 到 100 的 5 的倍数中抽出两个“大”数字。你可以使用 Linux 命令行来为你创建这些随机数。 + +让我们从“小”数字开始。我希望这些数字在 1 到 10 的范围内。你可以使用 Linux 的 `seq` 命令生成一个数字序列。你可以用几种不同的方式运行 `seq`,但最简单的形式是提供序列的起始和结束数字。要生成一个从 1 到 10 的列表,你可以运行这个命令: + +``` +$ seq 1 10 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +``` + +为了随机化这个列表,你可以使用 Linux 的 `shuf`("shuffle")命令。`shuf` 将随机化你给它的东西的顺序,通常是一个文件。例如,如果你把 `seq` 命令的输出发送到 `shuf` 命令,你会收到一个 1 到 10 之间的随机数字列表: + + +``` +$ seq 1 10 | shuf +3 +6 +8 +10 +7 +4 +5 +2 +1 +9 +``` + +要从 1 到 10 的列表中只选择四个随机数,你可以将输出发送到 `head` 命令,它将打印出输入的前几行。使用 `-4` 选项来指定 `head` 只打印前四行: + + +``` +$ seq 1 10 | shuf | head -4 +6 +1 +8 +4 +``` + +注意,这个列表与前面的例子不同,因为 `shuf` 每次都会生成一个随机顺序。 + +现在你可以采取下一步措施来生成”大“数字的随机列表。第一步是生成一个可能的数字列表,从 15 开始,以 5 为单位递增,直到达到 100。你可以用 Linux 的 `seq` 命令生成这个列表。为了使每个数字以 5 为单位递增,在 `seq` 命令中插入另一个选项来表示_步进_: + + +``` +$ seq 15 5 100 +15 +20 +25 +30 +35 +40 +45 +50 +55 +60 +65 +70 +75 +80 +85 +90 +95 +100 +``` + +就像以前一样,你可以随机化这个列表,选择两个”大“数字: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +40 +``` + +### 用 Bash 生成一个随机数 + +我想你可以用类似的方法从 200 到 999 的范围内选择游戏的目标数字。但是生成单个随机数的最简单的方案是直接在 Bash 中使用 `RANDOM` 变量。当你引用这个内置变量时,Bash 会生成一个大的随机数。要把它放到 200 到 999 的范围内,你需要先把随机数放到 0 到 799 的范围内,然后加上 200。 + +要把随机数放到从 0 开始的特定范围内,你可以使用**模数**算术运算符。模数计算的是两个数字相除后的_余数_。如果我用 801 除以 800,结果是 1,余数是 1(模数是 1)。800 除以 800 的结果是 1,余数是 0(模数是 0)。而用 799 除以 800 的结果是 0,余数是 799(模数是 799)。 + +Bash 通过 `$(())` 结构支持算术扩展。在双括号之间,Bash 将对你提供的数值进行算术运算。要计算 801 除以 800 的模数,然后加上 200,你可以输入: + + + +``` +$ echo $(( 801 % 800 + 200 )) +201 +``` + +通过这个操作,你可以计算出一个 200 到 999 之间的随机目标数: + + +``` +$ echo $(( RANDOM % 800 + 200 )) +673 +``` + +你可能想知道为什么我在 Bash 语句中使用 `RANDOM` 而不是 `$RANDOM`。在算术扩展中, Bash 会自动扩展双括号内的任何变量. 你不需要在 `$RANDOM` 变量上的 `$` 来引用该变量的值, 因为 Bash 会帮你做这件事。 + +### 玩数字游戏 + +让我们把所有这些放在一起,玩玩数字游戏。产生两个随机的”大“数字, 四个随机的”小“数值,以及目标值: + + +``` +$ seq 15 5 100 | shuf | head -2 +75 +100 +$ seq 1 10 | shuf | head -4 +4 +3 +10 +2 +$ echo $(( RANDOM % 800 + 200 )) +868 +``` + +我的数字是 **75**、**100**、**4**、**3**、**10** 和 **2**,而我的目标数字是 **868**。 + +如果我用每个”小“和”大“数字做这些算术运算,并不超过一次,我就能接近目标数字了: + + +``` +10×75 = 750 +750+100 = 850 + +然后: + +4×3 = 12 +850+12 = 862 +862+2 = 864 +``` + +That's only four away—not bad! But I found this way to calculate the exact number using each random number no more than once: +只相差 4 了,不错!但我发现这样可以用每个随机数不超过一次来计算出准确的数字: + + +``` +4×2 = 8 +8×100 = 800 + +然后: + +75-10+3 = 68 +800+68 = 868 +``` + +或者我可以做_这些_计算来准确地得到目标数字。这只用了六个随机数中的五个: + + +``` +4×3 = 12 +75+12 = 87 + +然后: + +87×10 = 870 +870-2 = 868 +``` + +试一试 _Countdown_ 数字游戏,并在评论中告诉我们你做得如何。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/4/math-game-linux-commands + +作者:[Jim Hall][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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/edu_math_formulas.png?itok=B59mYTG3 (Math formulas in green writing) +[2]: https://en.wikipedia.org/wiki/Countdown_%28game_show%29 From 57ed7376693c95b8d2d3c93f950564753f35d095 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 29 Apr 2021 08:53:05 +0800 Subject: [PATCH 301/307] tanslating --- sources/tech/20210427 Fedora Linux 34 is officially here.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210427 Fedora Linux 34 is officially here.md b/sources/tech/20210427 Fedora Linux 34 is officially here.md index bf9d38fb2b..f7b4396726 100644 --- a/sources/tech/20210427 Fedora Linux 34 is officially here.md +++ b/sources/tech/20210427 Fedora Linux 34 is officially here.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/announcing-fedora-34/) [#]: author: (Matthew Miller https://fedoramagazine.org/author/mattdm/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ab1dfd028e9482383b338d03c680fee9b8833631 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 09:48:40 +0800 Subject: [PATCH 302/307] PRF @geekpi --- ...e App With Variety of Sounds to Stay Focused.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md index 146a292ad9..17c011e7c3 100644 --- a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ b/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -3,14 +3,16 @@ [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) Blanket:拥有各种环境噪音的应用,帮助保持注意力集中 ====== -_**简介:一个开源的环境噪音播放器,提供各种声音,帮助你集中注意力或入睡。**_ +> 一个开源的环境噪音播放器,提供各种声音,帮助你集中注意力或入睡。 + +![](https://img.linux.net.cn/data/attachment/album/202104/29/094813oxcitipetajxjiex.jpg) 随着你周围活动的增加,要保持冷静和专注往往是很困难的。 @@ -44,13 +46,13 @@ flatpak install flathub com.rafaelmardojai.Blanket 如果你是 Flatpak 的新手,你可能想通过我们的 [Flatpak 指南][5]了解。 -如果你不喜欢使用 Flatpaks,你可以使用该项目中的贡献者维护的 PPA 来安装它。对于 Arch Linux 用户,你可以在 [AUR][6] 中找到它,以方便安装。 +如果你不喜欢使用 Flatpak,你可以使用该项目中的贡献者维护的 PPA 来安装它。对于 Arch Linux 用户,你可以在 [AUR][6] 中找到它,以方便安装。 -此外,你还可以找到 Fedora 和 openSUSE 的软件包。要探索所有可用的软件包,你可以前往其 [GitHub 页面][7]。 +此外,你还可以找到 Fedora 和 openSUSE 的软件包。要探索所有现成的软件包,你可以前往其 [GitHub 页面][7]。 ### 结束语 -对于一个简单的环境噪音播放器来说,用户体验是相当好的。我有一副 HyperX Alpha S 耳机,我必须要说声音的质量很好。 +对于一个简单的环境噪音播放器来说,用户体验是相当好的。我有一副 HyperX Alpha S 耳机,我必须要说,声音的质量很好。 换句话说,它听起来很舒缓,如果你想体验环境声音来集中注意力,摆脱焦虑或只是睡着,我建议你试试。 @@ -63,7 +65,7 @@ via: https://itsfoss.com/blanket-ambient-noise-app/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7b733fd694d47a977e6d044192f9f47f9da2cd5c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 09:50:35 +0800 Subject: [PATCH 303/307] PUB @geekpi https://linux.cn/article-13343-1.html --- ...mbient Noise App With Variety of Sounds to Stay Focused.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md (98%) diff --git a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md b/published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md similarity index 98% rename from translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md rename to published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md index 17c011e7c3..5c9c76d025 100644 --- a/translated/tech/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md +++ b/published/20210420 Blanket- Ambient Noise App With Variety of Sounds to Stay Focused.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13343-1.html) Blanket:拥有各种环境噪音的应用,帮助保持注意力集中 ====== From dd8f0a136e6b7319bf9297d35584b348e68cd1c5 Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:43:54 +0800 Subject: [PATCH 304/307] Update 20210423 What-s New in Ubuntu MATE 21.04.md --- ...0210423 What-s New in Ubuntu MATE 21.04.md | 104 +++++++++--------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md index 7c793ba25c..34195f0f90 100644 --- a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md +++ b/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md @@ -7,104 +7,104 @@ [#]: publisher: ( ) [#]: url: ( ) -What’s New in Ubuntu MATE 21.04 +Ubuntu MATE 21.04更新,多项新功能来袭 ====== -Since 18.10, Yaru has been the default user interface. This year, the Yaru team along with the Canonical Design and Ubuntu Desktop Teams joined forces to create a new visual look for Ubuntu MATE 21.04. +自从18.10发行版以来,yaru一直都是Ubuntu的默认用户桌面,今年,Yaru团队与Canonical Design和Ubuntu桌面团队携手合作,为Ubuntu MATE 21.04创建了新的外观界面。 -### What’s New in Ubuntu MATE 21.04? +### Ubuntu21.04有什么新变化? -Here are all the key changes that comes with this release. +以下就是Ubuntu MATE 21.04此次发布中的主要变更 -### MATE Desktop +### MATE桌面 -This time there are no new features but just bug fixes and translation updates. The MATE packaging in Debian has been updated to receive all the new bug fixes and updates. +此次更新的MATE桌面相比以往并没有较大改动,此次更更新只是修复了错误BUG同时更新了语言翻译,Debian中的MATE软件包已经更新,用户可以下载所有的BUG修复和更新。 -### Ayatana Indicators +### Avatana指示器 ![][1] -It is a system that controls the action, layout, behaviour of the panel indicator area that is also known as your system tray. You can now change settings of Ayatana Indicators from Control Center. +这是一个控制面板指示器(也称为系统托盘),面板指示区域也就是您的系统托盘。现在,您可以从控制中心更改Ayatana指示器的设置。 -A new printer indication has been added and RedShift has been removed to maintain stability. +添加了新的打印机标识,并删除了RedShift以保持稳定。 -### Yaru MATE Theme +### Yaru MATE主题 -Yaru MATE is now a derivative of the Yaru theme. Yaru MATE will now be provided with a light and dark theme, the light theme being the default one. This should ensure better application compatibility. +Yaru MATE现在是Yaru主题的派生产品。 Yaru MATE将提供浅色和深色主题,浅色作为默认主题。来确保更好的应用程序兼容性。 -Users will now have access to GTK 2.x, 3.x, 4.x light and dark themes collectively. You can also use Suru icons along with some new icons. +从现在开始,用户可以使用GTK 2.x,3.x,4.x浅色和深色主题。也可以将Suru图标和某些新图标一起使用。 -LibreOffice will have a new Yaru MATE icon theming applied by default. Font contrast has been improved as well. As a result of this, you will find it easier to read tiny texts and/or reading from a distance. +LibreOffice在MATE上会有新的默认桌面图标,字体对比度也得到了改善。您会发现阅读小字体文本或远距离阅读更加容易。 -Websites will now maintain the Dark Mode, if selected, at an Operating System level. To get dark theme in websites along with the rest of your system, just enable the Yaru MATE Dark theme. +网页依旧是深色模式,要在网站以及其他发行版中使用深色主题,只需启用Yaru MATE深色主题即可。 -Windows manager themes for Macro, Metacity, Compiz now have SVG icons. What this means is that if you have a large screen, the icons won’t look pixelated, that’s a subtle but useful addition! +现在,Macro,Metacity和Compiz的管理器主题使用了矢量图标。这意味着,如果您的屏幕较大,图标将不会像素画,又是一个小细节! -### Yaru MATE Snaps +### Yaru MATE 快照 -Although you can’t install Yaru MATE themes right now, you will soon be able to! The gtk-theme-yaru-mate and icon-theme-yaru-mate snaps are pre-installed and ready to be used when you need to connect the themes to compatible snaps. +尽管您现在无法真正安装MATE主题,但是不要着急,它马上就来了!gtk-theme-yaru-mate和icon-theme-yaru-mate快照已经是预安装的,可以在需要将主题连接到兼容快照使用。 -As per the announcement, snapd will automatically connect your theme to compatible snaps soon: +根据官方发布的公告,该功能将很快自动将您的主题连接到兼容的快照: -> `snapd` will soon be able to automatically install snaps of themes that match your currently active theme. The snaps we’ve created are ready to integrate with that capability when it is available. +> 快照功能很快将能够自动安装与您当前主题匹配的主题快照。创建的快照可以随时与该功能集成。 +> +### Mutiny Layout的新变化 -### Mutiny Layout Changes +![Mutiny Layout实装深色主题][2] -![Mutiny Layout with dark Yaru theme applied.][2] +Mutiny布局模仿Unity的桌面布局。删除了MATE Dock Applet,并且对Mutiny Layout进行了优化以使用Plank。Plank主题被系统自动应用。操作是通过Mate Tweak切换到Mutiny Layout。Plank的深色和浅色Yaru主题都包含在内。 -Mutiny layout mimics the desktop layout of Unity. The MATE Dock Applet has been removed and the Mutiny Layout has been optimized to use Plank. Plank theming will be applied automatically. This will be done when switching to Mutiny Layout via Mate Tweak. Both dark and light Yaru themes of Plank are provided. +其他调整和更新使得mutiny在不改变整体风格的前提下具备了更高的可靠性 -Other tweaks and updates have made the Mutiny much more reliability while the look and feel remains the same. +### 主要应用升级 -### Major Application Upgrades - - * Firefox 87 - * LibreOffice 7.1.2.2 - * Evolution 3.40 - * Celluloid 0.20 + * Firefox 87(火狐浏览器) + * LibreOffice 7.1.2.2(办公软件) + * Evolution 3.40(邮件) + * Celluloid 0.20(视频播放器) -### Other Changes +### 其他更改 - * Linux command line fans will appreciate commands like neofetch, htop and inxi being included in the default Ubuntu MATE install. - * A Raspberry Pi 21.04 version will be released soon. - * There are no offline upgrade options in Ubuntu MATE. - * New Plank themes introduced for side and bottom docks that matches with the color scheme of Yaru MATE. - * A clean edge styling is applied to Yaru MATE windows manager for side tiled windows. - * It is available in various colors in Ubuntu MATE Welcome. - * Yaru MATE theme snap and icon theme snap has been published in Snap Store - * Yaru MATE PPA published for users of Ubunut MATE 20.04 LTS. + * Linux命令的忠实用户会喜欢在Ubuntu MATEZ中默认安装的neofetch,htop和inxi之类的命令。 + * 树莓派版本很快将会发布。 + * Ubuntu MATE上没有离线更新选项 + * 针对侧边软件坞和底部软件坞引入了新的Plank主题,使其与Yaru MATE的配色方案相匹配。 + * 简洁的边缘样式已应用于Yaru MATE窗口管理器,用于侧面窗口。 + * 多彩的Ubuntu MATE欢迎界面现在已启用。 + * Yaru MATE主题快照和图标主题快照已在Snap Store中发布 + * 为Ubuntu MATE 20.04 LTS的用户发行了Yaru MATE PPA。 -### Download Ubuntu MATE 21.04 +### 下载Ubuntu MATE 21.04 -You can download the ISO from the official website. +你可以从官网上下载镜像 [Ubuntu MATE 21.04][3] -If you’re curious to learn more about it, [check out the release notes.][4] +如果你对此感兴趣, [请查看发行说明][4] -_Are you excited to try out the new Yaru MATE theme? What do you think? Let us know in the comments below._ +你对尝试Yaru MATE感到兴奋吗?你怎么看?请看评论区。 -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! +#### 大科技网站获得数百万收入! -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. +如果您喜欢我们在这里所做的事情,请考虑捐赠以支持我们的独立出版物。您的支持将帮助我们继续发布专注于桌面Linux和开源软件的内容。 -I'm not interested +我不感兴趣 -#### _Related_ +#### _关联_ - * [Ubuntu 21.04 is Releasing This Week! Take a Look at the New Features][5] - * ![][6] ![Ubuntu 21.04 New Features][7] + * [Ubuntu 21.04本周正在发布!看看新功能][5] + * ![][6] ![Ubuntu 21.04 新特征][7] - * [No GNOME 40 for Ubuntu 21.04 [And That's a Good Thing]][8] - * ![][6] ![No GNOME 40 in Ubuntu 21.04][9] + * [Ubuntu 21.04没有Gnome 40 [这是一件好事]][8] + * ![][6] ![Ubuntu 21.04没有GNOME40][9] - * [Ubuntu 21.04 Beta is Now Available to Download][10] + * [Ubuntu 21.04 Beta 现在已经可以下载了!][10] * ![][6] ![][11] @@ -115,7 +115,7 @@ via: https://news.itsfoss.com/ubuntu-mate-21-04-release/ 作者:[Asesh Basu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Kevin3599](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cf21526136960408d7e8cda37e884b020af334bf Mon Sep 17 00:00:00 2001 From: Kevin3599 <69574926+Kevin3599@users.noreply.github.com> Date: Thu, 29 Apr 2021 10:44:38 +0800 Subject: [PATCH 305/307] Rename sources/news/20210423 What-s New in Ubuntu MATE 21.04.md to translated/news/20210423 What-s New in Ubuntu MATE 21.04.md --- .../news/20210423 What-s New in Ubuntu MATE 21.04.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20210423 What-s New in Ubuntu MATE 21.04.md (100%) diff --git a/sources/news/20210423 What-s New in Ubuntu MATE 21.04.md b/translated/news/20210423 What-s New in Ubuntu MATE 21.04.md similarity index 100% rename from sources/news/20210423 What-s New in Ubuntu MATE 21.04.md rename to translated/news/20210423 What-s New in Ubuntu MATE 21.04.md From 83dd06f5a5007c6a5b8d6bd15dd3dd4366eaf49d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 15:00:08 +0800 Subject: [PATCH 306/307] PRF @stevenzdg988 --- ...te open source project management tools.md | 116 ++++++++---------- 1 file changed, 51 insertions(+), 65 deletions(-) diff --git a/translated/tech/20210317 My favorite open source project management tools.md b/translated/tech/20210317 My favorite open source project management tools.md index 36f94cf09f..699eb3a06b 100644 --- a/translated/tech/20210317 My favorite open source project management tools.md +++ b/translated/tech/20210317 My favorite open source project management tools.md @@ -3,141 +3,127 @@ [#]: author: (Frank Bergmann https://opensource.com/users/fraber) [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 我最喜欢的开源项目管理工具 ====== -如果您要管理大型复杂的项目,请尝试利用开源选项替换 Microsoft Project(微软项目管理软件)。 -![看板式组织活动][1] -诸如建造卫星,开发机器人或推出新产品之类的项目都是昂贵的,涉及不同的提供商,并且包含必须跟踪的硬依赖性。 +> 如果你要管理大型复杂的项目,请尝试利用开源选择替换 MS-Project。 -大型项目领域中的项目管理方法非常简单(至少在理论上如此)。您可以创建项目计划并将其拆分为较小的部分,直到您可以合理地将成本,持续时间,资源和依赖性分配给各种活动。一旦项目计划获得负责人的批准,您就可以使用它来跟踪项目的执行情况。在时间轴上绘制项目的所有活动将产生一个称为[Gantt chart(甘特图表)][2]的条形图。 +![](https://img.linux.net.cn/data/attachment/album/202104/29/145942py6qcc3lz1dyt1s6.jpg) -Gantt(甘特)图一直用于[瀑布项目方法][3],也可以被灵活地使用。例如,大型项目可能将 Gantt chart (甘特图)用于 Scrum 冲刺,而忽略其他像用户需求这样的细节,从而嵌入灵活的阶段。其他大型项目可能包括多个产品版本(例如,最低可行产品 [MVP],第二版本,第三版本等)。在这种情况下,上层结构对灵活性友善,用每个阶段计划作为 Gantt chart (甘特图)处理预算和复杂的依赖关系。 +诸如建造卫星、开发机器人或推出新产品之类的项目都是昂贵的,涉及不同的提供商,并且包含必须跟踪的硬依赖性。 + +大型项目领域中的项目管理方法非常简单(至少在理论上如此)。你可以创建项目计划并将其拆分为较小的部分,直到你可以合理地将成本、持续时间、资源和依赖性分配给各种活动。一旦项目计划获得负责人的批准,你就可以使用它来跟踪项目的执行情况。在时间轴上绘制项目的所有活动将产生一个称为[甘特图][2]Gantt chart的条形图。 + +甘特图一直被用于 [瀑布项目方法][3],也可以用于敏捷方法。例如,大型项目可能将甘特图用于 Scrum 冲刺,而忽略其他像用户需求这样的细节,从而嵌入敏捷阶段。其他大型项目可能包括多个产品版本(例如,最低可行产品 [MVP]、第二版本、第三版本等)。在这种情况下,上层结构是一种敏捷方法,而每个阶段都计划为甘特图,以处理预算和复杂的依赖关系。 ### 项目管理工具 -不夸张地说,有数百种可用工具使用 Gantt chart (甘特图)管理大型项目,Microsoft Project(微软项目管理软件)可能是最受欢迎的工具。它是 Microsoft Office(微软办公软件)系列(家族)的一部分,可扩展到成千上万的活动,并且具有众多(难以置信的数量)功能,可支持几乎所有可能的方式来管理项目进度表。对于 Project(微软项目管理软件)并不总是清楚什么更昂贵:软件许可或如何使用该工具的培训课程。 +不夸张地说,有数百种现成的工具使用甘特图管理大型项目,而 MS-Project 可能是最受欢迎的工具。它是微软办公软件家族的一部分,可支持到成千上万的活动,并且有大量的功能,支持几乎所有可以想象到的管理项目进度的方式。对于 MS-Project,有时候你并不知道什么更昂贵:是软件许可证还是该工具的培训课程。 -另一个缺点是 Microsoft Project 是一个独立的桌面应用程序,只有一个人可以更新进度表。如果要多个用户进行协作,则需要购买 Microsoft Project Server,Web 版的 Project(微软项目管理软件) 或 Microsoft Planner 的许可证。 +另一个缺点是 MS-Project 是一个独立的桌面应用程序,只有一个人可以更新进度表。如果要多个用户进行协作,则需要购买微软 Project 服务器、Web 版的 Project 或 Planner 的许可证。 -幸运的是,专有工具还有开源的替代品,包括本文中的应用程序。所有这些都是开源的,并且包括用于安排基于资源和依赖项分层活动的 Gantt (甘特图)。 ProjectLibre,GanttProject 和 TaskJuggler 是单个项目管理的桌面应用程序。ProjeQtOr 和 Redmine 是用于项目团队的 Web 应用程序,而 ]project-open[ 是用于管理整个组织的 Web 应用程序。 +幸运的是,专有工具还有开源的替代品,包括本文中提及的应用程序。所有这些都是开源的,并且包括基于资源和依赖项的分层活动调度的甘特图。ProjectLibre、GanttProject 和 TaskJuggler 都针对单个项目经理的桌面应用程序。ProjeQtOr 和 Redmine 是用于项目团队的 Web 应用程序,而 ]project-open[ 是用于管理整个组织的 Web 应用程序。 -我根据一个单用户计划并跟踪一个大型项目评估了这些工具。我的评估标准包括 Gantt 编辑器功能,Windows,Linux 和 macOS 上的可用性,可扩展性,导入/导出和报告。(完全披露:我是 ]project-open[ 的创始人,并且我在多个开源社区中活跃了很多年。此列表包括我们的产品,因此我的观点可能有偏见,但我尝试着眼于每个产品的最佳功能。) +我根据一个单用户计划和对一个大型项目的跟踪评估了这些工具。我的评估标准包括甘特图编辑器功能、Windows/Linux/macOS 上的可用性、可扩展性、导入/导出和报告。(背景披露:我是 ]project-open[ 的创始人,我在多个开源社区中活跃了很多年。此列表包括我们的产品,因此我的观点可能有偏见,但我尝试着眼于每个产品的最佳功能。) ### Redmine 4.1.0 ![Redmine][4] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[Redmine][6] 是一个基于 Web 的专注于敏捷方法论的项目管理工具。 -[Redmine][6]是一个基于 Web 的专注于灵活原则的项目管理工具。 +其标准安装包括一个甘特图时间轴视图,但缺少诸如调度、拖放、缩进(缩排和凸排)以及资源分配之类的基本功能。你必须单独编辑任务属性才能更改任务树的结构。 -标准安装包括 Gantt (甘特图)时间轴视图,但缺少诸如调度,拖放,缩进(缩排和凸排)以及资源分配之类的基本功能。您必须单独编辑任务属性才能更改任务树的结构。 +Redmine 具有甘特图编辑器插件,但是它们要么已经过时(例如 [Plus Gantt][7]),要么是专有的(例如 [ANKO 甘特图][8])。如果你知道其他开源的甘特图编辑器插件,请在评论中分享它们。 -Redmine 具有 Gantt (甘特图)编辑器插件,但是它们已经过时(例如 [Plus Gantt][7])或专有(例如 [ANKO Gantt 图表][8])。如果您知道其他开源 Gantt 编辑器插件,请在评论中分享它们。 +Redmine 用 Ruby on Rails 框架编写,可用于 Windows、Linux 和 macOS。其核心部分采用 GPLv2 许可证。 -Redmine 用 Ruby 的 Rails 框架编写,可用于 Windows,Linux 和 macOS。该内核已获得 GPLv2 许可。 - - * **最适合:** 使用灵活方法的 IT 团队 - * **独特的销售主张:** 这是 OpenProject 和 EasyRedmine 的最初“上游”父项目。 + * **适合于:** 使用敏捷方法的 IT 团队。 + * **独特卖点:** 这是 OpenProject 和 EasyRedmine 的原始“上游”父项目。 ### ]project-open[ 5.1 ![\]project-open\[][9] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[\]project-open\[][10] 是一个基于 Web 的项目管理系统,从整个组织的角度看类似于企业资源计划enterprise resource planning(ERP)系统。它还可以管理项目档案、预算、发票、销售、人力资源和其他功能领域。有一些不同的变体,如用于管理项目公司的专业服务自动化professional services automation(PSA)、用于管理企业战略项目的项目管理办公室project management office(PMO)和用于管理部门项目的企业项目管理enterprise project management(EPM)。 -[]project-open[][10]是一个基于 Web 的项目管理系统,它具有整个组织的透视图,类似于企业资源计划(ERP)系统。它还可以管理项目档案,预算,发票,销售,人力资源和其他功能领域。存在用于运行项目公司的专业服务自动化(PSA),用于管理企业战略项目的项目管理办公室(PMO)和用于管理部门项目的企业项目管理(EPM)的特定变体。 +]project-open[ 甘特图编辑器包括按等级划分的任务、依赖关系和基于计划工作和分配资源的调度。它不支持资源日历和非人力资源。]project-open[ 系统非常复杂,其 GUI 可能需要刷新。 -Gantt 编辑器包括按等级划分的任务,依赖关系和基于计划的工作和分配资源的计划。它不支持资源日历和非人力资源。]po[ 系统非常复杂,GUI 可能需要刷新。 - -]project-open[ 用 TCL 和 JavaScript 编写,可用于 Windows 和 Linux。 ]po[ 核心已获得 GPLv2 许可,并具有适用于大公司的专有扩展。 - - * **最适合:** 需要大量财务项目报告的中大型项目组织 - * **独特的销售主张:** ]po[ 是运行整个项目公司或部门的集成系统。 +]project-open[ 是用 TCL 和 JavaScript 编写的,可用于 Windows 和 Linux。 ]project-open[ 核心采用 GPLv2 许可证,并具有适用于大公司的专有扩展。 + * **适合于:** 需要大量财务项目报告的大中型项目组织。 + * **独特卖点:** ]project-open[ 是一个综合系统,可以运行整个项目公司或部门。 ### ProjectLibre 1.9.3 ![ProjectLibre][11] -(Frank Bergmann, [CC BY-SA 4.0][5]) - -在开源世界中,[ProjectLibre][12] 可能是最接近 Microsoft Project 的产品。它是一个桌面应用程序,支持所有重要的项目计划功能,包括资源日历,基线和成本管理。它还允许您使用 MS-Project 的文件格式导入和导出计划。 +在开源世界中,[ProjectLibre][12] 可能是最接近 MS-Project 的产品。它是一个桌面应用程序,支持所有重要的项目计划功能,包括资源日历、基线和成本管理。它还允许你使用 MS-Project 的文件格式导入和导出计划。 ProjectLibre 非常适合计划和执行中小型项目。然而,它缺少 MS-Project 中的一些高级功能,并且它的 GUI 并不是最漂亮的。 -ProjectLibre 用 Java 编写,可用于 Windows,Linux 和macOS,并已获得开放源代码通用公共属性(CPAL)许可证。ProjectLibre 团队目前正在专有许可下开发名为 ProjectLibre Cloud 的 Web 产品。 +ProjectLibre 用 Java 编写,可用于 Windows、Linux 和macOS,并在开源的通用公共署名许可证Common Public Attribution License(CPAL)下授权。ProjectLibre 团队目前正在开发一个名为 ProjectLibre Cloud 的 Web 产品,并采用专有许可证。 - * **最适合:** 个人项目经理,负责中小型项目,或者作为没有完整的 MS-Project 许可证的项目成员的查看者 - * **独特的销售主张:** 这是使用开源软件可以最接近 MS-Project。 + * **适合于:** 负责中小型项目的个人项目管理者,或者作为没有完整的 MS-Project 许可证的项目成员的查看器。 + * **独特卖点:** 这是最接近 MS-Project 的开源软件。 ### GanttProject 2.8.11 ![GanttProject][13] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[GanttProject][14] 与 ProjectLibre 类似,它是一个桌面甘特图编辑器,但功能集更为有限。它不支持基线,也不支持非人力资源,并且报告功能比较有限。 -[GanttProject][14] 与 ProjectLibre 类似,但它是桌面 Gantt (甘特图)编辑器,但功能集更为有限。 它不支持基线,也不支持非人力资源,并且报告功能受到更多限制。 +GanttProject 是一个用 Java 编写的桌面应用程序,可在 GPLv3 许可下用于 Windows、Linux 和 macOS。 -GanttProject 是一个用 Java 编写的桌面应用程序,可在 GPLv3 许可下用于 Windows,Linux 和 macOS。 - - * **最适合:** Simple Gantt (甘特图)或学习基于 Gantt 的项目管理技术。 - * **独特的销售主张:** 它支持程序评估和审阅技术([PERT][15])图表以及使用 WebDAV 的协作。 + * **适合于:** 简单的甘特图或学习基于甘特图的项目管理技术。 + * **独特卖点:** 它支持流程评估和审阅技术program evaluation and review technique([PERT][15])图表,并使用 WebDAV 的协作。 ### TaskJuggler 3.7.1 ![TaskJuggler][16] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[TaskJuggler][17] 用于在大型组织中安排多个并行项目,重点是自动解决资源分配冲突(即资源均衡)。 -[TaskJuggler][17]在大型组织中安排多个并行项目,重点是自动解决资源分配冲突(即资源均衡)。 +它不是交互式的甘特图编辑器,而是一个命令行工具,其工作方式类似于一个编译器:它从文本文件中读取任务列表,并生成一系列报告,这些报告根据分配的资源、依赖项、优先级和许多其他参数为每个任务提供最佳的开始和结束时间。它支持多个项目、基线、资源日历、班次和时区,并且被设计为可扩展到具有许多项目和资源的企业场景。 -它不是交互式的 Gantt 编辑器,而是类似于编译器的命令行工具:它从文本文件中读取任务列表,并生成一系列报告,这些报告根据分配的资源,依赖项,优先级和许多其他参数为每个任务提供最佳的开始和结束时间。它支持多个项目,基线,资源日历,班次和时区,并且已设计为可扩展到具有许多项目和资源的企业方案。 +使用特定语法编写 TaskJuggler 输入文件可能超出了普通项目经理的能力。但是,你可以使用 ]project-open[ 作为 TaskJuggler 的图形前端来生成输入,包括缺勤、任务进度和记录的工作时间。当以这种方式使用时,TaskJuggler 就成为了功能强大的假设情景规划器。 -使用特定语法编写 TaskJuggler 输入文件可能超出了普通项目经理的能力。但是,您可以使用 ]project-open[ 作为 TaskJuggler 的图形前端来生成输入,包括缺勤,任务进度和记录的工作时间。当以这种方式使用时,TaskJuggler 成为功能强大的假设情景规划师。 +TaskJuggler 用 Ruby 编写,并且在 GPLv2 许可证下可用于 Windows、Linux 和 macOS。 -TaskJuggler 用 Ruby 编写,并且在 GPLv2 许可下可用于 Windows,Linux 和 macOS。 - - * **最适合:** 由真正的书呆子管理的中大型部门 - * **独特的销售主张:** 它在自动资源均衡方面表现出色。 + * **适合于:** 由真正的技术极客管理的中大型部门。 + * **独特卖点:** 它在自动资源均衡方面表现出色。 ### ProjeQtOr 9.0.4 ![ProjeQtOr][18] -(Frank Bergmann, [CC BY-SA 4.0][5]) +[ProjeQtOr][19] 是适用于 IT 项目的、基于 Web 的项目管理应用程序。除了项目、工单和活动外,它还支持风险、预算、可交付成果和财务文件,以将项目管理的许多方面集成到单个系统中。 -[ProjeQtOr][19] 是适用于 IT 项目的基于 Web 的项目管理应用程序。除项目,工单和活动外,它还支持风险,预算,可交付成果和财务文件,以将项目管理的许多方面集成到单个系统中。 +ProjeQtOr 提供了一个甘特图编辑器,与 ProjectLibre 功能类似,包括按等级划分的任务、依赖关系以及基于计划工作和分配资源。但是,它不支持取值的就地编辑(例如,任务名称、估计时间等);用户必须在甘特图视图下方的输入表单中更改取值,然后保存。 -ProjeQtOr 为 Gantt 编辑器提供了与 ProjectLibre 类似的功能集,包括按等级划分的任务,依赖关系以及基于计划工作和分配资源。但是,它不支持值的就地编辑(例如,任务名称,估计时间等);用户必须在 Gantt 视图下方的输入表单中更改值,然后保存值。 +ProjeQtOr 用 PHP 编写,并且在 Affero GPL3 许可下可用于 Windows、Linux 和 macOS。 -ProjeQtOr 用 PHP 编写,并且在 Affero GPL3 许可下可用于 Windows,Linux 和 macOS。 - - * **最适合:** IT 部门跟踪项目列表 - * **独特的销售主张:** 让您为每个项目存储大量信息,将所有信息保存在一个地方。 + * **适合于:** 跟踪项目列表的 IT 部门。 + * **独特卖点:** 让你为存储每个项目的大量信息,将所有信息保存在一个地方。 ### 其他工具 -对于特定的用例,以下系统可能是有效的选项,但由于各种原因,它们被排除在主列表之外。 +对于特定的用例,以下系统可能是有效的选择,但由于各种原因,它们被排除在主列表之外。 ![LIbrePlan][20] -(Frank Bergmann, [CC BY-SA 4.0][5]) + * [LibrePlan][21] 是一个基于 Web 的项目管理应用程序,专注于甘特图。由于其功能集,它本来会在上面的列表中会占主导地位,但是没有可用于最新 Linux 版本(CentOS 7 或 8)的安装。作者说,更新的说明将很快推出。 + * [dotProject][22] 是一个用 PHP 编写的基于 Web 的项目管理系统,可在 GPLv2.x 许可证下使用。它包含一个甘特图时间轴报告,但是没有编辑它的选项,并且依赖项还不起作用(它们“仅部分起作用”)。 + * [Leantime][23] 是一个基于 Web 的项目管理系统,具有漂亮的用 PHP 编写的 GUI,并且可以在 GPLv2 许可证下使用。它包括一个里程碑的甘特时间线,但没有依赖性。 + * [Orangescrum][24] 是基于 Web 的项目管理工具。甘特图图可以作为付费附件或付费订阅使用。 + * [Talaia/OpenPPM][25] 是一个基于 Web 的项目组合管理系统。但是,版本 4.6.1 仍显示“即将推出:交互式甘特图”。 + * [Odoo][26] 和 [OpenProject][27] 都将某些重要功能限制在付费企业版中。 - * [**LibrePlan**][21] 是一个基于 Web 的项目管理应用程序,致力于 Gantt 图。由于其功能集,它在上面的列表中会占主导地位,但是没有可用于最新 Linux 版本(CentOS 7 或 8)的安装。作者说,更新的说明将很快推出。 - * [**dotProject**][22] 是一个用 PHP 编写的基于 Web 的项目管理系统,可在 GPLv2.x 许可下使用。它包含一个 Gantt 时间轴报告,但是没有编辑它的选项,并且依赖项还不起作用(它们“仅部分起作用”)。 - - * [**Leantime**][23] 是一个基于 Web 的项目管理系统,具有漂亮的用 PHP 编写的 GUI,并且可以在 GPLv2 许可下使用。它包括用于时间表的没有依赖关系 Gantt 时间线。 - * [**Orangescrum**][24] 是基于 Web 的项目管理工具。Gantt 图可以作为付费附件或付费订阅使用。 - * [**Talaia/OpenPPM**][25] 是一个基于 Web 的项目组合管理系统。但是,版本 4.6.1 仍显示“即将推出:交互式 Gantt 图”。 - * [**Odoo**][26] 和 [**OpenProject**][27]都将某些重要功能限制在付费企业版中。 - -在这篇评论中,目的是包括所有带有 Gantt 编辑器和依赖调度的开源项目管理系统。如果我错过了一个项目或歪曲了一些东西,请在评论中让我知道。 +在这篇评论中,目的是包括所有带有甘特图编辑器和依赖调度的开源项目管理系统。如果我错过了一个项目或误导了什么,请在评论中让我知道。 -------------------------------------------------------------------------------- @@ -146,7 +132,7 @@ via: https://opensource.com/article/21/3/open-source-project-management 作者:[Frank Bergmann][a] 选题:[lujun9972][b] 译者:[stevenzdg988](https://github.com/stevenzdg988) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 39d757fb1f00bd9063c0bd7914f81b568916ad69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 29 Apr 2021 15:01:38 +0800 Subject: [PATCH 307/307] PUB @stevenzdg988 https://linux.cn/article-13344-1.html --- ...210317 My favorite open source project management tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210317 My favorite open source project management tools.md (99%) diff --git a/translated/tech/20210317 My favorite open source project management tools.md b/published/20210317 My favorite open source project management tools.md similarity index 99% rename from translated/tech/20210317 My favorite open source project management tools.md rename to published/20210317 My favorite open source project management tools.md index 699eb3a06b..e52c2a9a92 100644 --- a/translated/tech/20210317 My favorite open source project management tools.md +++ b/published/20210317 My favorite open source project management tools.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13344-1.html) 我最喜欢的开源项目管理工具 ======