From 6c064795a3a953ca8ab79c4a407ef27c3a8a60b7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Jan 2021 05:03:37 +0800 Subject: [PATCH 001/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210126=20?= =?UTF-8?q?Movim:=20An=20Open-Source=20Decentralized=20Social=20Platform?= =?UTF-8?q?=20Based=20on=20XMPP=20Network?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210126 Movim- An Open-Source Decentralized Social Platform Based on XMPP Network.md --- ...d Social Platform Based on XMPP Network.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20210126 Movim- An Open-Source Decentralized Social Platform Based on XMPP Network.md diff --git a/sources/tech/20210126 Movim- An Open-Source Decentralized Social Platform Based on XMPP Network.md b/sources/tech/20210126 Movim- An Open-Source Decentralized Social Platform Based on XMPP Network.md new file mode 100644 index 0000000000..0a9565bd73 --- /dev/null +++ b/sources/tech/20210126 Movim- An Open-Source Decentralized Social Platform Based on XMPP Network.md @@ -0,0 +1,107 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Movim: An Open-Source Decentralized Social Platform Based on XMPP Network) +[#]: via: (https://itsfoss.com/movim/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Movim: An Open-Source Decentralized Social Platform Based on XMPP Network +====== + +_**Brief: Movim is an open-source decentralized social media platform that relies on XMPP network and can communicate with other applications using XMPP.**_ + +We’ve already highlighted some [open-source alternatives to mainstream social media platforms][1]. In addition to those options available, I have come across another open-source social media platform that focuses on privacy and decentralization. + +### Movim: Open-Source Web-based Social Platform + +![][2] + +Just like some other XMPP desktop clients, [Movim][3] is a web-based XMPP front-end to let you utilize it as a federated social media. + +Since it relies on [XMPP network][4], you can interact with other users utilizing XMPP clients such as [Conversations][5] (for Android) and [Dino][6] (for Desktop). + +In case you didn’t know, XMPP is an open-standard for messaging. + +So, Movim can act as your decentralized messaging app or a full-fledged social media platform giving you an all-in-one experience without relying on a centralized network. + +It offers many features that can appeal to a wide variety of users. Let me briefly highlight most of the important ones. + +![][7] + +### Features of Movim + + * Chatroom + * Ability to organize video conferences + * Publish articles/stories publicly to all federated network + * Tweak the privacy setting of your post + * Easily talk with other Movim users or XMPP users with different clients + * Automatically embed your links and images to your post + * Explore topics easily using hashtags + * Ability to follow a topic or publication + * Auto-save to draft when you type in a post + * Supports Markdown syntax to let you publish informative posts and start a publication on the network for free + * React to chat messages + * Supports GIFs and funny Stickers + * Edit or delete your messages + * Supports screen sharing + * Supports night mode + * Self-hosting option available + * Offers a free public instance as well + * Cross-platform web support + + + +### Using Movim XMPP Client + +![][8] + +In addition to all the features listed above, it is also worth noting that you can also find a Movim mobile app on [F-Droid][9]. + +If you have an iOS device, you might have a hard time looking for a good XMPP client (I’m not aware of any decent options). If you rule that out, you should not have any issues using it on your Android device. + +For desktop, you can simply use Movim’s [public instance][10], sign up for an account, and use it on your favorite browser no matter which platform you’re on. + +You can also deploy your instance by using the Docker Compose script, the Debian package, or any other methods mentioned in their [GitHub page][11]. + +[Movim][3] + +### Concluding Thoughts + +While the idea of decentralized social media platforms is good, not everyone would prefer to use it because they probably do not have friends on it and the user experience is not the best out there. + +That being said, XMPP clients like Movim are trying to make a federated social platform that a general consumer can easily use without any hiccups. + +Just like it took a while for users to look for [WhatsApp alternatives][12], the craze for decentralized social media platform like Movim and [Mastodon][13] is a possibility in the near future as well. + +If you like it, do consider making a donation to their project. + +What do you think about Movim? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/movim/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/mainstream-social-media-alternaives/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/movim-dark-mode.jpg?resize=800%2C486&ssl=1 +[3]: https://movim.eu/ +[4]: https://xmpp.org/ +[5]: https://conversations.im/ +[6]: https://itsfoss.com/dino-xmpp-client/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/movim-discover.png?resize=800%2C466&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/movim-eu.jpg?resize=800%2C464&ssl=1 +[9]: https://f-droid.org/packages/com.movim.movim/ +[10]: https://nl.movim.eu +[11]: https://github.com/movim/movim +[12]: https://itsfoss.com/private-whatsapp-alternatives/ +[13]: https://itsfoss.com/mastodon-open-source-alternative-twitter/ From 3d555adb69b84f0c585bb0a17031e590a6042467 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Jan 2021 05:03:59 +0800 Subject: [PATCH 002/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210125=20?= =?UTF-8?q?Explore=20binaries=20using=20this=20full-featured=20Linux=20too?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210125 Explore binaries using this full-featured Linux tool.md --- ...ies using this full-featured Linux tool.md | 656 ++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 sources/tech/20210125 Explore binaries using this full-featured Linux tool.md diff --git a/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md b/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md new file mode 100644 index 0000000000..1126cfe3ab --- /dev/null +++ b/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md @@ -0,0 +1,656 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Explore binaries using this full-featured Linux tool) +[#]: via: (https://opensource.com/article/21/1/linux-radare2) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +Explore binaries using this full-featured Linux tool +====== +Radare2 is an open source tool custom-made for binary analysis. +![Binary code on a computer screen][1] + +In [_10 ways to analyze binary files on Linux_][2], I explained how to use Linux's rich set of native tools to analyze binaries. But if you want to explore your binary further, you need a tool that is custom-made for binary analysis. If you are new to binary analysis and have mostly worked with scripting languages, [_9 essential GNU binutils tools_][3] will help you get started learning the compilation process and what constitutes a binary. + +### Why do I need another tool? + +It's natural to ask why you need yet another tool if existing Linux-native tools do similar things. Well, it's for the same reasons you use your cellphone as your alarm clock, to take notes, as a camera, to listen to music, to surf the internet, and occasionally to make and receive calls. Previously, separate devices and tools handled these functions — like a physical camera for taking pictures, a small notepad for taking notes, a bedside alarm clock to wake up, and so on. Having one device to do multiple (but related) things is _convenient_ for the user. Also, the killer feature is _interoperability_ between the separate functions. + +Similarly, even though many Linux tools have a specific purpose, having similar (and better) functionality bundled into a single tool is very helpful. This is why I think [Radare2][4] should be your go-to tool whenever you need to work with binaries. + +Radare2 (also known as r2) is a "Unix-like reverse engineering framework and command-line toolset," according to its [GitHub profile][5]. The "2" in its name is because this version was rewritten from scratch to make it more modular. + +### Why Radare2? + +There are tons of (non-native) Linux tools out there that are used for binary analysis, so why should you choose Radare2? My reasons are simple. + +First, it's an open source project with an active and healthy community. If you are looking for slick, new features or availability of bug fixes, this matters a lot. + +Second, Radare2 can be used on the command line, and it has a rich graphical user interface (GUI) environment called Cutter for those who are more comfortable with GUIs. Being a long-time Linux user, I feed more comfortable on the shell. While there is a slight learning curve to getting familiar with Radare2's commands, I would compare it to [learning Vim][6]. You learn basic things first, and once you master them, you move on to more advanced stuff. In no time, it becomes second nature. + +Third, Radare2 has good support for external tools via plugins. For example, the recently open sourced [Ghidra][7] binary analysis and reversing tool is popular for its decompiler feature, which is a critical element of reversing software. You can install and use the Ghidra decompiler right from the Radare2 console, which is amazing and gives you the best of both worlds. + +### Get started with Radare2 + +To install Radare2, simply clone the repo and run the `user.sh` script. You might need to install some prerequisite packages if they aren't already on your system. Once the installation is complete, run the `r2 -v` command to see if Radare2 was installed properly: + + +``` +$ git clone +$ cd radare2 +$ sys/user.sh + +# version + +$ r2 -v +radare2 4.6.0-git 25266 @ linux-x86-64 git.4.4.0-930-g48047b317 +commit: 48047b3171e6ed0480a71a04c3693a0650d03543 build: 2020-11-17__09:31:03 +$ +``` + +#### Get a sample test binary + +Now that r2 is installed, you need a sample binary to try it out. You could use any system binary (`ls`, `bash`, and so on), but to keep things simple for this tutorial, compile the following C program: + + +``` +$ cat adder.c +#include <stdio.h> + +int adder(int num) { +        return num + 1; +} + +int main() { +        int res, num1 = 100; +        res = adder(num1); +        printf("Number now is  : %d\n", res); +        return 0; +} +$ +$ +$ gcc adder.c -o adder +$ +$ file adder +adder: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=9d4366f7160e1ffb46b14466e8e0d70f10de2240, not stripped +$ +$ ./adder +Number now is  : 101 +$ +``` + +#### Load the binary + +To analyze the binary, you have to load it in Radare2. Load it by providing the file as a command line argument to the `r2` command. You're dropped into a separate Radare2 console different from your shell. To exit the console, you can type **Quit** or **Exit** or hit **Ctrl**+**D**: + + +``` +$ r2 ./adder + -- Learn pancake as if you were radare! +[0x004004b0]> quit +$ +``` + +#### Analyze the binary + +Before you can explore the binary, you have to ask r2 to analyze it for you. You can do that by running the `aaa` command in the r2 console; + + +``` +$ r2 ./adder + -- Sorry, radare2 has experienced an internal error. +[0x004004b0]> +[0x004004b0]> +[0x004004b0]> aaa +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. +[0x004004b0]> +``` + +This means that each time you pick a binary for analysis, you have to type an additional command to `aaa` after loading the binary. You can bypass this by calling r2 with `-A` followed by the binary name; this tells r2 to auto-analyze the binary for you: + + +``` +$ r2 -A ./adder +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. + -- Already up-to-date. +[0x004004b0]> +``` + +#### Get some basic information about the binary + +Before you begin analyzing a binary, you need a starting point. In many cases, this can be the binary's file format (ELF, PE, and so on), the architecture the binary was built for (x86, AMD, ARM, and so on), and whether the binary is 32 bit or 64 bit. R2's handy `iI` command can provide the required information: + + +``` +[0x004004b0]> iI +arch     x86 +baddr    0x400000 +binsz    14724 +bintype  elf +bits     64 +canary   false +class    ELF64 +compiler GCC: (GNU) 8.3.1 20190507 (Red Hat 8.3.1-4) +crypto   false +endian   little +havecode true +intrp    /lib64/ld-linux-x86-64.so.2 +laddr    0x0 +lang     c +linenum  true +lsyms    true +machine  AMD x86-64 architecture +maxopsz  16 +minopsz  1 +nx       true +os       linux +pcalign  0 +pic      false +relocs   true +relro    partial +rpath    NONE +sanitiz  false +static   false +stripped false +subsys   linux +va       true + +[0x004004b0]> +[0x004004b0]> +``` + +### Imports and exports + +Often, once you know what kind of file you are dealing with, you want to know what kind of standard library functions the binary uses or learn the program's potential functionalities. In the sample C program in this tutorial, the only library function is `printf` to print a message. You can see this by running the `ii` command, which shows all of the binary's imports: + + +``` +[0x004004b0]> ii +[Imports] +nth vaddr      bind   type   lib name +――――――――――――――――――――――――――――――――――――― +1   0x00000000 WEAK   NOTYPE     _ITM_deregisterTMCloneTable +2   0x004004a0 GLOBAL FUNC       printf +3   0x00000000 GLOBAL FUNC       __libc_start_main +4   0x00000000 WEAK   NOTYPE     __gmon_start__ +5   0x00000000 WEAK   NOTYPE     _ITM_registerTMCloneTable +``` + +The binary can also have its own symbols, functions, or data. These functions are usually shown under `Exports`. The test binary has two functions—main and adder—that are exported. The rest of the functions are added during the compilation phase when the binary is being built. The loader needs these to load the binary (don't worry too much about them for now): + + +``` +[0x004004b0]> +[0x004004b0]> iE +[Exports] + +nth paddr       vaddr      bind   type   size lib name +―――――――――――――――――――――――――――――――――――――――――――――――――――――― +82   0x00000650 0x00400650 GLOBAL FUNC   5        __libc_csu_fini +85   ---------- 0x00601024 GLOBAL NOTYPE 0        _edata +86   0x00000658 0x00400658 GLOBAL FUNC   0        _fini +89   0x00001020 0x00601020 GLOBAL NOTYPE 0        __data_start +90   0x00000596 0x00400596 GLOBAL FUNC   15       adder +92   0x00000670 0x00400670 GLOBAL OBJ    0        __dso_handle +93   0x00000668 0x00400668 GLOBAL OBJ    4        _IO_stdin_used +94   0x000005e0 0x004005e0 GLOBAL FUNC   101      __libc_csu_init +95   ---------- 0x00601028 GLOBAL NOTYPE 0        _end +96   0x000004e0 0x004004e0 GLOBAL FUNC   5        _dl_relocate_static_pie +97   0x000004b0 0x004004b0 GLOBAL FUNC   47       _start +98   ---------- 0x00601024 GLOBAL NOTYPE 0        __bss_start +99   0x000005a5 0x004005a5 GLOBAL FUNC   55       main +100  ---------- 0x00601028 GLOBAL OBJ    0        __TMC_END__ +102  0x00000468 0x00400468 GLOBAL FUNC   0        _init + +[0x004004b0]> +``` + +### Hash info + +How do you know if two binaries are similar? You can't exactly open a binary and view the source code inside it. In most cases, a binary's hash—md5sum, sha1, sha256—is used to uniquely identify it. You can find the binary hash using the `it` command: + + +``` +[0x004004b0]> it +md5 7e6732f2b11dec4a0c7612852cede670 +sha1 d5fa848c4b53021f6570dd9b18d115595a2290ae +sha256 13dd5a492219dac1443a816ef5f91db8d149e8edbf26f24539c220861769e1c2 +[0x004004b0]> +``` + +### Functions + +Code is grouped into functions; to list which functions are present within a binary, run the `afl` command. The following list shows the main and adder functions. Usually, functions that start with `sym.imp` are imported from the standard library (glibc in this case): + + +``` +[0x004004b0]> afl +0x004004b0    1 46           entry0 +0x004004f0    4 41   -> 34   sym.deregister_tm_clones +0x00400520    4 57   -> 51   sym.register_tm_clones +0x00400560    3 33   -> 32   sym.__do_global_dtors_aux +0x00400590    1 6            entry.init0 +0x00400650    1 5            sym.__libc_csu_fini +0x00400658    1 13           sym._fini +0x00400596    1 15           sym.adder +0x004005e0    4 101          loc..annobin_elf_init.c +0x004004e0    1 5            loc..annobin_static_reloc.c +0x004005a5    1 55           main +0x004004a0    1 6            sym.imp.printf +0x00400468    3 27           sym._init +[0x004004b0]> +``` + +### Cross-references + +In C, the main function is where a program starts its execution. Ideally, other functions are called from main and, upon exiting a program, the main function returns an exit status to the operating system. This is evident in the source code; however, what about a binary? How can you tell where the adder function is called? + +You can use the `axt` command followed by the function name to see where the adder function is called; as you can see below, it is called from the main function. This is known as cross-referencing. But what calls the main function itself? The `axt main` function below shows that it is called by `entry0` (I'll leave learning about `entry0` as an exercise for the reader): + + +``` +[0x004004b0]> axt sym.adder +main 0x4005b9 [CALL] call sym.adder +[0x004004b0]> +[0x004004b0]> axt main +entry0 0x4004d1 [DATA] mov rdi, main +[0x004004b0]> +``` + +### Seek locations + +When working with text files, you often move within a file by referencing a line number followed by a row or a column number; in a binary, you use addresses. These are hexadecimal numbers starting with `0x` followed by an address. To find where you are in a binary, run the `s` command. To move to a different location, use the `s` command followed by the address. + +Function names are like labels, which are represented by addresses internally. If the function name is in the binary (not stripped), you can use the `s` command followed by the function name to jump to a specific function address. Similarly, if you want to jump to the start of the binary, type `s 0`: + + +``` +[0x004004b0]> s +0x4004b0 +[0x004004b0]> +[0x004004b0]> s main +[0x004005a5]> +[0x004005a5]> s +0x4005a5 +[0x004005a5]> +[0x004005a5]> s sym.adder +[0x00400596]> +[0x00400596]> s +0x400596 +[0x00400596]> +[0x00400596]> s 0 +[0x00000000]> +[0x00000000]> s +0x0 +[0x00000000]> +``` + +### Hexadecimal view + +Oftentimes, the raw binary doesn't make sense. It can help to view the binary in hexadecimal mode alongside its equivalent ASCII representation: + + +``` +[0x004004b0]> s main +[0x004005a5]> +[0x004005a5]> px +\- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF +0x004005a5  5548 89e5 4883 ec10 c745 fc64 0000 008b  UH..H....E.d.... +0x004005b5  45fc 89c7 e8d8 ffff ff89 45f8 8b45 f889  E.........E..E.. +0x004005c5  c6bf 7806 4000 b800 0000 00e8 cbfe ffff  ..x.@........... +0x004005d5  b800 0000 00c9 c30f 1f40 00f3 0f1e fa41  .........@.....A +0x004005e5  5749 89d7 4156 4989 f641 5541 89fd 4154  WI..AVI..AUA..AT +0x004005f5  4c8d 2504 0820 0055 488d 2d04 0820 0053  L.%.. .UH.-.. .S +0x00400605  4c29 e548 83ec 08e8 57fe ffff 48c1 fd03  L).H....W...H... +0x00400615  741f 31db 0f1f 8000 0000 004c 89fa 4c89  t.1........L..L. +0x00400625  f644 89ef 41ff 14dc 4883 c301 4839 dd75  .D..A...H...H9.u +0x00400635  ea48 83c4 085b 5d41 5c41 5d41 5e41 5fc3  .H...[]A\A]A^A_. +0x00400645  9066 2e0f 1f84 0000 0000 00f3 0f1e fac3  .f.............. +0x00400655  0000 00f3 0f1e fa48 83ec 0848 83c4 08c3  .......H...H.... +0x00400665  0000 0001 0002 0000 0000 0000 0000 0000  ................ +0x00400675  0000 004e 756d 6265 7220 6e6f 7720 6973  ...Number now is +0x00400685  2020 3a20 2564 0a00 0000 0001 1b03 3b44    : %d........;D +0x00400695  0000 0007 0000 0000 feff ff88 0000 0020  ............... +[0x004005a5]> +``` + +### Disassembly + +If you are working with compiled binaries, there is no source code you can view. The compiler translates the source code into machine language instructions that the CPU can understand and execute; the result is the binary or executable. However, you can view assembly instructions (mnemonics) to make sense of what the program is doing. For example, if you want to see what the main function is doing, you can seek the address of the main function using `s main` and then run the `pdf` command to view the disassembly instructions. + +To understand the assembly instructions, you need to refer to the architecture manual (x86 in this case), its application binary interface (its ABI, or calling conventions), and have a basic understanding of how the stack works: + + +``` +[0x004004b0]> s main +[0x004005a5]> +[0x004005a5]> s +0x4005a5 +[0x004005a5]> +[0x004005a5]> pdf +            ; DATA XREF from entry0 @ 0x4004d1 +┌ 55: int main (int argc, char **argv, char **envp); +│           ; var int64_t var_8h @ rbp-0x8 +│           ; var int64_t var_4h @ rbp-0x4 +│           0x004005a5      55             push rbp +│           0x004005a6      4889e5         mov rbp, rsp +│           0x004005a9      4883ec10       sub rsp, 0x10 +│           0x004005ad      c745fc640000.  mov dword [var_4h], 0x64    ; 'd' ; 100 +│           0x004005b4      8b45fc         mov eax, dword [var_4h] +│           0x004005b7      89c7           mov edi, eax +│           0x004005b9      e8d8ffffff     call sym.adder +│           0x004005be      8945f8         mov dword [var_8h], eax +│           0x004005c1      8b45f8         mov eax, dword [var_8h] +│           0x004005c4      89c6           mov esi, eax +│           0x004005c6      bf78064000     mov edi, str.Number_now_is__:__d ; 0x400678 ; "Number now is  : %d\n" ; const char *format +│           0x004005cb      b800000000     mov eax, 0 +│           0x004005d0      e8cbfeffff     call sym.imp.printf         ; int printf(const char *format) +│           0x004005d5      b800000000     mov eax, 0 +│           0x004005da      c9             leave +└           0x004005db      c3             ret +[0x004005a5]> +``` + +Here is the disassembly for the adder function: + + +``` +[0x004005a5]> s sym.adder +[0x00400596]> +[0x00400596]> s +0x400596 +[0x00400596]> +[0x00400596]> pdf +            ; CALL XREF from main @ 0x4005b9 +┌ 15: sym.adder (int64_t arg1); +│           ; var int64_t var_4h @ rbp-0x4 +│           ; arg int64_t arg1 @ rdi +│           0x00400596      55             push rbp +│           0x00400597      4889e5         mov rbp, rsp +│           0x0040059a      897dfc         mov dword [var_4h], edi     ; arg1 +│           0x0040059d      8b45fc         mov eax, dword [var_4h] +│           0x004005a0      83c001         add eax, 1 +│           0x004005a3      5d             pop rbp +└           0x004005a4      c3             ret +[0x00400596]> +``` + +### Strings + +Seeing which strings are present within the binary can be a starting point to binary analysis. Strings are hardcoded into a binary and often provide important hints to shift your focus to analyze certain areas. Run the `iz` command within the binary to list all the strings. The test binary has only one string hardcoded in the binary: + + +``` +[0x004004b0]> iz +[Strings] +nth paddr      vaddr      len size section type  string +――――――――――――――――――――――――――――――――――――――――――――――――――――――― +0   0x00000678 0x00400678 20  21   .rodata ascii Number now is  : %d\n + +[0x004004b0]> +``` + +### Cross-reference strings + +As with functions, you can cross-reference strings to see where they are being printed from and understand the code around them: + + +``` +[0x004004b0]> ps @ 0x400678 +Number now is  : %d + +[0x004004b0]> +[0x004004b0]> axt 0x400678 +main 0x4005c6 [DATA] mov edi, str.Number_now_is__:__d +[0x004004b0]> +``` + +### Visual mode + +When your code is complicated with multiple functions called, it's easy to get lost. It can be helpful to have a graphic or visual view of which functions are called, which paths are taken based on certain conditions, etc. You can explore r2's visual mode by using the `VV` command after moving to a function of interest. For example, for the adder function: + + +``` +[0x004004b0]> s sym.adder +[0x00400596]> +[0x00400596]> VV +``` + +![Radare2 Visual mode][8] + +(Gaurav Kamathe, [CC BY-SA 4.0][9]) + +### Debugger + +So far, you have been doing static analysis—you are just looking at things in the binary without running it. Sometimes you need to execute the binary and analyze various information in memory at runtime. r2's internal debugger allows you to run a binary, put in breakpoints, analyze variables' values, or dump registers' contents. + +Start the debugger with the `-d` flag, and add the `-A` flag to do an analysis as the binary loads. You can set breakpoints at various places, like functions or memory addresses, by using the `db ` command. To view existing breakpoints, use the `dbi` command. Once you have placed your breakpoints, start running the binary using the `dc` command. You can view the stack using the `dbt` command, which shows function calls. Finally, you can dump the contents of the registers using the `drr` command: + + +``` +$ r2 -d -A ./adder +Process with PID 17453 started... += attach 17453 17453 +bin.baddr 0x00400000 +Using 0x400000 +asm.bits 64 +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. + -- git checkout hamster +[0x7f77b0a28030]> +[0x7f77b0a28030]> db main +[0x7f77b0a28030]> +[0x7f77b0a28030]> db sym.adder +[0x7f77b0a28030]> +[0x7f77b0a28030]> dbi +0 0x004005a5 E:1 T:0 +1 0x00400596 E:1 T:0 +[0x7f77b0a28030]> +[0x7f77b0a28030]> afl | grep main +0x004005a5    1 55           main +[0x7f77b0a28030]> +[0x7f77b0a28030]> afl | grep sym.adder +0x00400596    1 15           sym.adder +[0x7f77b0a28030]> +[0x7f77b0a28030]> dc +hit breakpoint at: 0x4005a5 +[0x004005a5]> +[0x004005a5]> dbt +0  0x4005a5           sp: 0x0                 0    [main]  main sym.adder+15 +1  0x7f77b0687873     sp: 0x7ffe35ff6858      0    [??]  section..gnu.build.attributes-1345820597 +2  0x7f77b0a36e0a     sp: 0x7ffe35ff68e8      144  [??]  map.usr_lib64_ld_2.28.so.r_x+65034 +[0x004005a5]> dc +hit breakpoint at: 0x400596 +[0x00400596]> dbt +0  0x400596           sp: 0x0                 0    [sym.adder]  rip entry.init0+6 +1  0x4005be           sp: 0x7ffe35ff6838      0    [main]  main+25 +2  0x7f77b0687873     sp: 0x7ffe35ff6858      32   [??]  section..gnu.build.attributes-1345820597 +3  0x7f77b0a36e0a     sp: 0x7ffe35ff68e8      144  [??]  map.usr_lib64_ld_2.28.so.r_x+65034 +[0x00400596]> +[0x00400596]> +[0x00400596]> dr +rax = 0x00000064 +rbx = 0x00000000 +rcx = 0x7f77b0a21738 +rdx = 0x7ffe35ff6948 +r8 = 0x7f77b0a22da0 +r9 = 0x7f77b0a22da0 +r10 = 0x0000000f +r11 = 0x00000002 +r12 = 0x004004b0 +r13 = 0x7ffe35ff6930 +r14 = 0x00000000 +r15 = 0x00000000 +rsi = 0x7ffe35ff6938 +rdi = 0x00000064 +rsp = 0x7ffe35ff6838 +rbp = 0x7ffe35ff6850 +rip = 0x00400596 +rflags = 0x00000202 +orax = 0xffffffffffffffff +[0x00400596]> +``` + +### Decompiler + +Being able to understand assembly is a prerequisite to binary analysis. Assembly language is always tied to the architecture the binary is built on and is supposed to run on. There is never a 1:1 mapping between a line of source code and assembly code. Often, a single line of C source code produces multiple lines of assembly. So, reading assembly code line-by-line is not optimal. + +This is where decompilers come in. They try to reconstruct the possible source code based on the assembly instructions. This is NEVER exactly the same as the source code used to create the binary; it is a close representation of the source based on assembly. Also, take into account that compiler optimizations that generate different assembly code to speed things up, reduce the size of a binary, etc., will make the decompiler's job more difficult. Also, malware authors often deliberately obfuscate code to put a malware analyst off. + +Radare2 provides decompilers through plugins. You can install any decompiler that is supported by Radare2. View current plugins with the `r2pm -l` command. Install a sample `r2dec` decompiler with the `r2pm install` command: + + +``` +$ r2pm  -l +$ +$ r2pm install r2dec +Cloning into 'r2dec'... +remote: Enumerating objects: 100, done. +remote: Counting objects: 100% (100/100), done. +remote: Compressing objects: 100% (97/97), done. +remote: Total 100 (delta 18), reused 27 (delta 1), pack-reused 0 +Receiving objects: 100% (100/100), 1.01 MiB | 1.31 MiB/s, done. +Resolving deltas: 100% (18/18), done. +Install Done For r2dec +gmake: Entering directory '/root/.local/share/radare2/r2pm/git/r2dec/p' +[CC] duktape/duktape.o +[CC] duktape/duk_console.o +[CC] core_pdd.o +[CC] core_pdd.so +gmake: Leaving directory '/root/.local/share/radare2/r2pm/git/r2dec/p' +$ +$ r2pm  -l +r2dec +$ +``` + +### Decompiler view + +To decompile a binary, load the binary in r2 and auto-analyze it. Move to the function of interest—adder in this example—using the `s sym.adder` command, then use the `pdda` command to view the assembly and decompiled source code side-by-side. Reading this decompiled source code is often easier than reading assembly line-by-line: + + +``` +$ r2 -A ./adder +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. + -- What do you want to debug today? +[0x004004b0]> +[0x004004b0]> s sym.adder +[0x00400596]> +[0x00400596]> s +0x400596 +[0x00400596]> +[0x00400596]> pdda +    ; assembly                               | /* r2dec pseudo code output */ +                                             | /* ./adder @ 0x400596 */ +                                             | #include <stdint.h> +                                             |   +    ; (fcn) sym.adder ()                     | int32_t adder (int64_t arg1) { +                                             |     int64_t var_4h; +                                             |     rdi = arg1; +    0x00400596 push rbp                      |     +    0x00400597 mov rbp, rsp                  |     +    0x0040059a mov dword [rbp - 4], edi      |     *((rbp - 4)) = edi; +    0x0040059d mov eax, dword [rbp - 4]      |     eax = *((rbp - 4)); +    0x004005a0 add eax, 1                    |     eax++; +    0x004005a3 pop rbp                       |     +    0x004005a4 ret                           |     return eax; +                                             | } +[0x00400596]> +``` + +### Configure settings + +As you get more comfortable with Radare2, you will want to change its configuration to tune it to how you work. You can view r2's default configurations using the `e` command. To set a specific configuration, add `config = value` after the `e` command: + + +``` +[0x004005a5]> e | wc -l +593 +[0x004005a5]> e | grep syntax +asm.syntax = intel +[0x004005a5]> +[0x004005a5]> e asm.syntax = att +[0x004005a5]> +[0x004005a5]> e | grep syntax +asm.syntax = att +[0x004005a5]> +``` + +To make the configuration changes permanent, place them in a startup file named `.radare2rc` that r2 reads at startup. This file is usually found in your home directory; if not, you can create one. Some sample configuration options include: + + +``` +$ cat ~/.radare2rc +e asm.syntax = att +e scr.utf8 = true +eco solarized +e cmd.stack = true +e stack.size = 256 +$ +``` + +### Explore more + +You've seen enough Radare2 features to find your way around the tool. Because Radare2 follows the Unix philosophy, even though you can do various things from its console, it uses a separate set of binaries underneath to do its tasks. + +Explore the standalone binaries listed below to see how they work. For example, the binary information seen in the console with the `iI` command can also be found using the `rabin2 ` command: + + +``` +$ cd bin/ +$ +$ ls +prefix  r2agent    r2pm  rabin2   radiff2  ragg2    rarun2   rasm2 +r2      r2-indent  r2r   radare2  rafind2  rahash2  rasign2  rax2 +$ +``` + +What do you think about Radare2? Share your feedback in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/linux-radare2 + +作者:[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/binary_code_computer_screen.png?itok=7IzHK1nn (Binary code on a computer screen) +[2]: https://opensource.com/article/20/4/linux-binary-analysis +[3]: https://opensource.com/article/19/10/gnu-binutils +[4]: https://rada.re/n/ +[5]: https://github.com/radareorg/radare2 +[6]: https://opensource.com/article/19/3/getting-started-vim +[7]: https://ghidra-sre.org/ +[8]: https://opensource.com/sites/default/files/uploads/radare2_visual-mode_0.png (Radare2 Visual mode) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ From 08e38e65eeacc50e491e7d409d647381e774f82b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Jan 2021 05:04:16 +0800 Subject: [PATCH 003/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210125=20?= =?UTF-8?q?Use=20Joplin=20to=20find=20your=20notes=20faster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210125 Use Joplin to find your notes faster.md --- ...25 Use Joplin to find your notes faster.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20210125 Use Joplin to find your notes faster.md diff --git a/sources/tech/20210125 Use Joplin to find your notes faster.md b/sources/tech/20210125 Use Joplin to find your notes faster.md new file mode 100644 index 0000000000..02a50bcbc3 --- /dev/null +++ b/sources/tech/20210125 Use Joplin to find your notes faster.md @@ -0,0 +1,65 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Joplin to find your notes faster) +[#]: via: (https://opensource.com/article/21/1/notes-joplin) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use Joplin to find your notes faster +====== +Organizing notes across multiple written and digital platforms is a +serious challenge. Here's a tip to organize your notes better and find +what you need quickly. +![Working from home at a laptop][1] + +In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 15 of 21 Days of Productivity in 2021. + +Staying productive also means (to some extent) being organized enough to find my notes and reference them on demand. This is a challenge not just for myself but for a lot of people I talk to. + +Over the years, I have used either individually or some combination of digital notes in an app, paper notes, sticky notes, digital sticky notes, word processor documents, plain text files, and a bunch of other formats I am forgetting. That makes not only finding notes difficult but knowing where to put them an even bigger challenge. + +![Stacks of paper notes on a desk][2] + +Piles of notes (Jessica Cherry, [CC BY-SA 4.0][3]) + +And then there is the most important thing about taking notes: A note has no value at all if you can't find it later. Knowing that the note with the information you need exists _somewhere_ in one of the places you keep notes isn't helpful at all. + +How did I fix that for myself? It was, as they say, a process, and I hope it is a process that works for others as well. + +I started by looking at the kinds of notes I was taking. Do different subjects need to be stored in different ways? Since I handwrite notes for my podcasts and use plain text notes for almost everything else, I needed two different ways to maintain them. For the handwritten notes, I put them all in a binder that I could reference easily. + +![Man holding a binder full of notes][4] + +Over three years of notes (Kevin Sonney, [CC BY-SA 4.0][3]) + +To store my digital notes, I needed to pull them all into one place. The tool needed to be accessible from multiple devices, have a useful search function, and be able to export or share my notes. I chose [Joplin][5] after trying many, many different options. Joplin lets me write notes in markdown, has a pretty good search function, has applications for all the OSs (including mobile), and supports several different ways to sync between devices. As a bonus, it has folders _and_ tags, so I can group my notes together in ways that make sense to me. + +![Organized Joplin notes management page][6] + +My Joplin + +It took me some time to get everything where I wanted it, but in the end, it really was worth it. Now I can find the notes I take and not have them scattered across my office, different machines, and various services. + +Learn about great open source alternatives to Evernote for notetaking and task management. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/notes-joplin + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[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/sites/default/files/day15-image1.jpg +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/day15-image2.png +[5]: https://joplinapp.org/ +[6]: https://opensource.com/sites/default/files/day15-image3.png From 36925aa590151028ee7c9d60f4d154996c04ff66 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Jan 2021 05:04:32 +0800 Subject: [PATCH 004/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210125=20?= =?UTF-8?q?7=20ways=20open=20source=20was=20essential=20to=20business=20in?= =?UTF-8?q?=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210125 7 ways open source was essential to business in 2020.md --- ...ource was essential to business in 2020.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20210125 7 ways open source was essential to business in 2020.md diff --git a/sources/tech/20210125 7 ways open source was essential to business in 2020.md b/sources/tech/20210125 7 ways open source was essential to business in 2020.md new file mode 100644 index 0000000000..57dea0448a --- /dev/null +++ b/sources/tech/20210125 7 ways open source was essential to business in 2020.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (7 ways open source was essential to business in 2020) +[#]: via: (https://opensource.com/article/21/1/open-source-business) +[#]: author: (Jessica Cherry https://opensource.com/users/cherrybomb) + +7 ways open source was essential to business in 2020 +====== +Moving work online created challenges and opportunities for innovation +in 2020. +![A chair in a field.][1] + +The COVID-19 pandemic created many new challenges for businesses in 2020 as they rapidly moved non-essential workers to remote operations. However, it also created tremendous opportunities for innovation as people searched for effective ways to work and collaborate virtually. + +Opensource.com responded to the need by publishing a variety of articles in 2020 on working better with open source. Since it appears working remotely is here to stay for the foreseeable future, make sure you're doing everything you can to adapt by reading the top seven articles about open source business from 2020. + +### Open source live streaming with Open Broadcaster Software + +If you want to start reaching your customers with live streaming, Seth Kenlon's article on [open source live streaming][2] explains how to use Open Broadcaster Software (OBS) to connect to various streaming services to share your skills or gameplay. He outlines OBS and offers a detailed walk-through of its installation and use, making your start in streaming quick and easy. Seth also explains how to connect your devices to a streaming server and shares a powerful message about the value of teaching others and broadcasting words of encouragement. + +### Manage knowledge with BlueSpice, an open source alternative to Confluence + +Most enterprises have a wiki for sharing and managing knowledge across their teams. Instead of risking vendor lock-in with proprietary software, Martin Loschwitz recommends [considering BlueSpice][3], an open source alternative to Confluence. He covers the structural differences between BlueSpice and Confluence, how to use the optional BlueSpice Farm to connect multiple wikis, and BlueSpice's amazing search capabilities that use Elasticsearch to enable narrower searches. Martin also gets into BlueSpice's compliance and security features, editor functions, extensions, and design features that match your wiki to your company's branding. + +### Choosing open source as a marketing strategy + +Lucas Galvanni and Nathalie Risbakk discuss how to use [open source in your marketing strategy][4]. They use the example of Brewdog, which opened its beer recipes to the public, a strategy that paid off by making the brand extremely popular with the homebrewing community. They also cover developing marketing strategies based on customers' needs and desires and explain how moving their company to an open source model helped it engage with the community. Finally, they get into the challenges, risks, and rewards of open source with some final notes about building success over time. + +### 7 Ways NOT to manage your remote team + +Matt Shealy says [remote teams are susceptible to miscommunication][5], but rethinking how things have always been done can help avoid disaster. His tips include continuous training on technical and emotional topics, creating standards around communications in remote chat systems, and keeping work on schedule. Matt also recommends keeping your eye on the big picture with goals and milestones, avoiding micromanagement, and promoting diversity to leverage different viewpoints and help teams shine. He also describes the benefits and barriers of teams working across different time zones and recommends keeping your eye on costs to find a middle ground to keep trust between IT and finance teams. + +### 5 humans review 5 open source video chat tools + +During the lockdowns in summer 2020, Opensource.com writers Matt Broberg, Alan Formy-Duval, Chris Hermansen, Seth Kenlon, and I joined forces to [review open source video chat tools][6]. We looked at the tools' security risks, capabilities, and performance, considering our various locations and internet quality, to discover what's out there in open source video-conferencing solutions. This review may give you new ideas on tools to improve your video chats. + +### Love or hate chat? 4 best practices for remote teams + +To help the many teams working remotely, Jen Wike Huger offers [best practices for using chat][7] in your day-to-day life. Before getting into her tips, Jen recommends asking team members about their comfort level using chat to keep in touch during the workday. Next, she offers best practices, including creating rooms and threads, setting expectations around when people are expected to respond (or not) in chat, and communicating clearly and kindly. + +### The FSF reveals the tools they use for chat, video, and more + +The Free Software Foundation's Greg Farough shares the [software the organization uses for remote communications][8]. He explains that self-reliance on some of the tools (by self-hosting or having a friend or colleague host them) can be difficult but beneficial. He concludes by saying, "This is just a small selection of the huge amount of free software out there, all ready to be used, shared, and improved by the community," and asks the community to share knowledge "to help people find ways of communicating that put user freedom as a priority." + +### 2020: The year open source remote business became essential + +These seven articles offer many suggestions for teams working remotely and which open source tools will help them do it better. In 2020, open source software proved its value for expanding and improving work across great distances. And these tools will remain key business enablers in 2021, as many of us continue working from home. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/open-source-business + +作者:[Jessica Cherry][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BIZ_WorkInPublic_4618517_1110_CS_A.png?itok=RwVrWArk (A chair in a field.) +[2]: https://opensource.com/article/20/4/open-source-live-stream +[3]: https://opensource.com/article/20/9/bluespice +[4]: https://opensource.com/article/20/7/open-source-marketing +[5]: https://opensource.com/article/20/1/ways-not-manage-remote-team +[6]: https://opensource.com/article/20/5/open-source-video-conferencing +[7]: https://opensource.com/article/20/4/chat-tools-best-practices +[8]: https://opensource.com/article/20/5/free-software-communication From b1cddb3a34ddb8e69aef463814c7a07747e89c89 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Jan 2021 05:04:47 +0800 Subject: [PATCH 005/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210125=20?= =?UTF-8?q?Why=20you=20need=20to=20drop=20ifconfig=20for=20ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210125 Why you need to drop ifconfig for ip.md --- ...25 Why you need to drop ifconfig for ip.md | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 sources/tech/20210125 Why you need to drop ifconfig for ip.md diff --git a/sources/tech/20210125 Why you need to drop ifconfig for ip.md b/sources/tech/20210125 Why you need to drop ifconfig for ip.md new file mode 100644 index 0000000000..4bbe5b2cdc --- /dev/null +++ b/sources/tech/20210125 Why you need to drop ifconfig for ip.md @@ -0,0 +1,214 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why you need to drop ifconfig for ip) +[#]: via: (https://opensource.com/article/21/1/ifconfig-ip-linux) +[#]: author: (Rajan Bhardwaj https://opensource.com/users/rajabhar) + +Why you need to drop ifconfig for ip +====== +Start using the modern method for configuring a Linux network interface. +![Tips and gears turning][1] + +For a long time, the `ifconfig` command was the default method for configuring a network interface. It served Linux users well, but networking is complex, and the commands to configure it must be robust. The `ip` command is the new default networking command for modern systems, and in this article, I'll show you how to use it. + +The `ip` command is functionally organized on two layers of the [OSI networking stack][2]: Layer 2 (data link layer) and Layer 3 (network or IP layer). It does all the work in the old `net-tools` package. + +### Installing ip + +The `ip` command is included in the `iproute2util` package. It's probably already included in your Linux distribution. If it's not, you can install it from your distro's software repository. + +### Comparing ipconfig and ip usage + +The `ip` and `ipconfic` commands can be used to configure a network interface, but they do things differently. I'll compare how to do common tasks with the old (`ipconfig`) and new (`ip`) commands. + +#### View network interface and IP address + +If you want to see the IP address of a host or view network interface information, the old `ifconfig` command, with no arguments, provides a good summary: + + +``` +$ ifconfig +                                                                                                 +eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                                                  +       ether bc:ee:7b:5e:7d:d8  txqueuelen 1000  (Ethernet)                                                        +       RX packets 0  bytes 0 (0.0 B) +       RX errors 0  dropped 0  overruns 0  frame 0 +       TX packets 0  bytes 0 (0.0 B) +       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 + +lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536 +       inet 127.0.0.1  netmask 255.0.0.0 +       inet6 ::1  prefixlen 128  scopeid 0x10<host> +       loop  txqueuelen 1000  (Local Loopback) +       RX packets 41  bytes 5551 (5.4 KiB) +       RX errors 0  dropped 0  overruns 0  frame 0 +       TX packets 41  bytes 5551 (5.4 KiB) +       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 + +wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 +       inet 10.1.1.6  netmask 255.255.255.224  broadcast 10.1.1.31 +       inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212  prefixlen 64  scopeid 0x0<global> +       inet6 fe80::8eb3:4bc0:7cbb:59e8  prefixlen 64  scopeid 0x20<link> +       ether 08:71:90:81:1e:b5  txqueuelen 1000  (Ethernet) +       RX packets 569459  bytes 779147444 (743.0 MiB) +       RX errors 0  dropped 0  overruns 0  frame 0 +       TX packets 302882  bytes 38131213 (36.3 MiB) +       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 +``` + +The new `ip` command provides similar results, but the command is `ip address show`, or just `ip a` for short: + + +``` +$ ip a + +1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 +   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +   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: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 +   link/ether bc:ee:7b:5e:7d:d8 brd ff:ff:ff:ff:ff:ff +3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 +   link/ether 08:71:90:81:1e:b5 brd ff:ff:ff:ff:ff:ff +   inet 10.1.1.6/27 brd 10.1.1.31 scope global dynamic wlan0 +      valid_lft 83490sec preferred_lft 83490sec +   inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212/64 scope global noprefixroute dynamic   +      valid_lft 6909sec preferred_lft 3309sec +   inet6 fe80::8eb3:4bc0:7cbb:59e8/64 scope link   +      valid_lft forever preferred_lft forever +``` + +#### Add IP address + +To add an IP address to an interface with `ifconfig`, the command is: + + +``` +`$ ifconfig eth0 add 192.9.203.21` +``` + +The command is similar for `ip`: + + +``` +`$ ip address add 192.9.203.21 dev eth0` +``` + +Subcommands in `ip` can be shortened, so this command is equally valid: + + +``` +`$ ip addr add 192.9.203.21 dev eth0` +``` + +You can make it even shorter: + + +``` +`$ ip a add 192.9.203.21 dev eth0` +``` + +#### Remove an IP address + +The inverse of adding an IP address is to remove one. + +With `ifconfig`, the syntax is: + + +``` +`$ ifconfig eth0 del 192.9.203.21` +``` + +The `ip` command syntax is: + + +``` +`$ ip a del 192.9.203.21 dev eth0` +``` + +#### Enable or disable multicast + +Enabling (or disabling) [multicast][3] on an interface with `ifconfig` happens with the `multicast` argument: + + +``` +`# ifconfig eth0 multicast` +``` + +With `ip`, use the `set` subcommand with the device (`dev`) and a Boolean or toggle `multicast` option: + + +``` +`# ip link set dev eth0 multicast on` +``` + +#### Enable or disable a network + +Every sysadmin is familiar with the old "turn it off and then on again" trick to fix a problem. In terms of networking interfaces, that translates to bringing a network up or down. + +The `ifconfig` command does this with the `up` or `down` keywords: + + +``` +`# ifconfig eth0 up` +``` + +Or you could use a dedicated command: + + +``` +`# ifup eth0` +``` + +The `ip` command uses the `set` subcommand to set the interface to an `up` or `down` state: + + +``` +`# ip link set eth0 up` +``` + +#### Enable or disable the Address Resolution Protocol (ARP) + +With `ifconfig`, you enable ARP by declaring it: + + +``` +`# ifconfig eth0 arp` +``` + +With `ip`, you _set_ the `arp` property as `on` or `off`: + + +``` +`# ip link set dev eth0 arp on` +``` + +### Pros and cons of ip and ipconfig + +The `ip` command is more versatile and technically more efficient than `ifconfig` because it uses `Netlink` sockets rather than `ioctl` system calls. + +The `ip` command may appear more verbose and more complex than `ifconfig`, but that's one reason it's more versatile. Once you start using it, you'll get a feel for its internal logic (for instance, using `set` instead of a seemingly arbitrary mix of declarations or settings). + +Ultimately, `ifconfig` is outdated (for instance, it lacks full support for network namespaces), and `ip` is designed for the modern network. Try it out, learn it, use it. You'll be glad you did! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/ifconfig-ip-linux + +作者:[Rajan Bhardwaj][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/rajabhar +[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://en.wikipedia.org/wiki/OSI_model +[3]: https://en.wikipedia.org/wiki/Multicast From aeb80ad6045867581b2c302b2127b52e22809116 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: Tue, 26 Jan 2021 10:41:01 +0800 Subject: [PATCH 006/213] Apply for translation File Name: 20210118 10 ways to get started with open source in 2021.md Translator: mengxinayan --- ...0210118 10 ways to get started with open source in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210118 10 ways to get started with open source in 2021.md b/sources/tech/20210118 10 ways to get started with open source in 2021.md index 09b4c89cd3..df73a60f33 100644 --- a/sources/tech/20210118 10 ways to get started with open source in 2021.md +++ b/sources/tech/20210118 10 ways to get started with open source in 2021.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -103,7 +103,7 @@ via: https://opensource.com/article/21/1/getting-started-open-source 作者:[Lauren Maffeo][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b3763c07f628a17cc8a4b83d4d36489e81984a34 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Jan 2021 10:57:50 +0800 Subject: [PATCH 007/213] PRF @wxy --- ...ing trade-offs when writing Python code.md | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/translated/tech/20191225 Making trade-offs when writing Python code.md b/translated/tech/20191225 Making trade-offs when writing Python code.md index 46c283bcd6..6051be8383 100644 --- a/translated/tech/20191225 Making trade-offs when writing Python code.md +++ b/translated/tech/20191225 Making trade-offs when writing Python code.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Making trade-offs when writing Python code) @@ -12,7 +12,7 @@ > 本文是 Python 之禅特别系列的一部分,重点此篇着眼于第七、八、九条原则:可读性、特殊情况和实用性。 -![开发人员和运营经理两个人之间的铜墙铁壁][1] +![](https://img.linux.net.cn/data/attachment/album/202101/26/105645c1looxqxns12loen.jpg) 软件开发是一门充满了取舍的学科。每一个选择,都有一个同样合理但相反的选择。将一个方法私有化?你在鼓励复制粘贴。将一个方法公开?你在过早地对一个接口做出承诺。 @@ -20,27 +20,19 @@ ### 可读性很重要Readability counts -从某种意义上说,这一中间原则确实是整个 Python 之禅的中心。这条原则与编写高效的程序无关。在大多数情况下,它甚至与编写健壮的程序无关。它讲的是编写出*别人能读懂的程序*。 +从某种意义上说,这一中间原则确实是整个 Python 之禅的中心。这条原则与编写高效的程序无关。在大多数情况下,它甚至与编写健壮的程序也无关。它讲的是编写出*别人能读懂的程序*。 阅读代码,就其本质而言,发生在代码被添加到系统中之后。通常,它会发生在很久很久以后。忽略可读性是最简单的选择,因为它对现在没有伤害。无论添加新代码的原因是什么,它都会对现在造成影响,无论是一个令人痛苦的 bug 还是一个被强烈要求的功能。 -面对巨大的压力,把可读性扔到一边,只管“解决问题”,Python 之禅提醒我们:可读性很重要。编写代码让它适合阅读,是对自己和他人的一种慈悲。 - -###特殊情况还没有特殊到违反规则的地步。 - -总有个借口。这个bug特别痛苦,我们不要担心简单。这个功能特别紧急,我们不要担心美观。这个案例所涉及的领域规则特别毛躁,我们不要担心嵌套程度。 - -一旦我们允许特殊恳求,大坝墙就会破裂,没有原则了;事情就会演变成一个疯狂的麦克斯荒诞症,每个程序员都为自己,试图找到最好的借口。 - -纪律需要承诺。只有在事情困难的时候,在强烈的诱惑下,才会考验一个软件开发人员。总有一个合理的借口来破坏规则,这就是为什么必须守规矩的原因。纪律是向例外说不的艺术。 任何解释都无法改变这一点。 +如果面对巨大的压力,把可读性扔到一边,只管“解决问题”,而 Python 之禅提醒我们:可读性很重要。编写代码让它适合阅读,无论是对自己还是他人,都是一种慈悲。 ### 特殊情况不足以违反规则Special cases aren't special enough to break the rules -总是有各种借口。这个 bug 特别麻烦,先简单处理一下吧;这个功能特别紧急,别管美观了;这种情况下所涉及的领域规则特别复杂,嵌套深点也没事。 +总是有各种借口:这个 bug 特别麻烦,先简单处理一下吧;这个功能特别紧急,别管美观了;这种情况下所涉及的领域规则特别复杂,嵌套深点也没关系。 -一旦我们允许特例的借口,大坝就会破裂,就丧失原则了;事情就会演变成一个疯狂麦克斯的荒诞症,每个程序员都会为自己试图找到最好的借口。 +一旦我们对特例的借口妥协,大坝就会破裂,就丧失了原则;事情就会演变成一个疯狂麦克斯的荒诞症,每个程序员都会为自己试图找到最好的借口。 -纪律需要承诺。只有当事情艰辛、有强烈的诱惑时,才是对一个软件开发人员的考验。总是有合理的借口来破坏规则,这就是为什么必须守规矩的原因。纪律就是向例外说不的艺术。没有任何解释可以改变这一点。 +纪律需要承诺。只有当事情艰辛、有强烈的诱惑时,才是对一个软件开发人员的考验。总是有合理的借口来破坏规则,这就是为什么必须坚守规矩的原因。纪律就是向例外说不的艺术。没有任何解释可以改变这一点。 ### 虽然,实用性胜过纯洁性Although, practicality beats purity @@ -49,7 +41,7 @@ 归根结底,软件开发是一门实用的学科。它的目标是解决真实的人所面临的实际问题。实用性比纯粹性更重要:首先,我们必须*解决问题*。如果我们只考虑可读性、简单性或美观性,我们将无法真正*解决问题*。 -正如宫本武藏所说的,每一次代码修改的首要目标应该是*解决问题°。这个问题需要我们心心念念去解决它。如果我们不以解决问题为目标,只想着 Python 之禅,我们就辜负了这些原则。这是 Python 之禅所固有的另一种矛盾。 +正如宫本武藏所说的,每一次代码修改的首要目标应该是*解决问题*。这个问题需要我们心心念念地去解决它。如果我们不以解决问题为目标,只想着 Python 之禅,我们就辜负了这些原则。这是 Python 之禅所固有的另一种矛盾。 -------------------------------------------------------------------------------- @@ -58,7 +50,7 @@ via: https://opensource.com/article/19/12/zen-python-trade-offs 作者:[Moshe Zadka][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxys) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxys) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f1ea6ff41cd40d0cb9d2793c7363b69e43feed51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Jan 2021 10:58:19 +0800 Subject: [PATCH 008/213] PUB @wxy https://linux.cn/article-13053-1.html --- .../20191225 Making trade-offs when writing Python code.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191225 Making trade-offs when writing Python code.md (98%) diff --git a/translated/tech/20191225 Making trade-offs when writing Python code.md b/published/20191225 Making trade-offs when writing Python code.md similarity index 98% rename from translated/tech/20191225 Making trade-offs when writing Python code.md rename to published/20191225 Making trade-offs when writing Python code.md index 6051be8383..1e7caf0b23 100644 --- a/translated/tech/20191225 Making trade-offs when writing Python code.md +++ b/published/20191225 Making trade-offs when writing Python code.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13053-1.html) [#]: subject: (Making trade-offs when writing Python code) [#]: via: (https://opensource.com/article/19/12/zen-python-trade-offs) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 10727e7402c8a6cafe4dcbe7c659b6da28e4e32c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Jan 2021 11:04:43 +0800 Subject: [PATCH 009/213] Rename sources/tech/20210125 7 ways open source was essential to business in 2020.md to sources/talk/20210125 7 ways open source was essential to business in 2020.md --- ...210125 7 ways open source was essential to business in 2020.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210125 7 ways open source was essential to business in 2020.md (100%) diff --git a/sources/tech/20210125 7 ways open source was essential to business in 2020.md b/sources/talk/20210125 7 ways open source was essential to business in 2020.md similarity index 100% rename from sources/tech/20210125 7 ways open source was essential to business in 2020.md rename to sources/talk/20210125 7 ways open source was essential to business in 2020.md From 2d7cc00326f1aee7f8ffb2033590c79ca041a2cf Mon Sep 17 00:00:00 2001 From: bestony Date: Tue, 26 Jan 2021 14:46:06 +0800 Subject: [PATCH 010/213] done file --- ...21 lawyer The MIT License, Line by Line.md | 296 ------------------ ...21 lawyer The MIT License, Line by Line.md | 290 +++++++++++++++++ 2 files changed, 290 insertions(+), 296 deletions(-) delete mode 100644 sources/talk/20160921 lawyer The MIT License, Line by Line.md create mode 100644 translated/talk/20160921 lawyer The MIT License, Line by Line.md diff --git a/sources/talk/20160921 lawyer The MIT License, Line by Line.md b/sources/talk/20160921 lawyer The MIT License, Line by Line.md deleted file mode 100644 index 8d4424117a..0000000000 --- a/sources/talk/20160921 lawyer The MIT License, Line by Line.md +++ /dev/null @@ -1,296 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (bestony) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (lawyer The MIT License, Line by Line) -[#]: via: (https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html) -[#]: author: (Kyle E. Mitchell https://kemitchell.com/) - -lawyer The MIT License, Line by Line -====== - -### The MIT License, Line by Line - -[The MIT License][1] is the most popular open-source software license. Here’s one read of it, line by line. - -#### Read the License - -If you’re involved in open-source software and haven’t taken the time to read the license from top to bottom—it’s only 171 words—you need to do so now. Especially if licenses aren’t your day-to-day. Make a mental note of anything that seems off or unclear, and keep trucking. I’ll repeat every word again, in chunks and in order, with context and commentary. But it’s important to have the whole in mind. - -> The MIT License (MIT) -> -> Copyright (c) -> -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -> -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -> -> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. - -The license is arranged in five paragraphs, but breaks down logically like this: - - * **Header** - * **License Title** : “The MIT License” - * **Copyright Notice** : “Copyright (c) …” - * **License Grant** : “Permission is hereby granted …” - * **Grant Scope** : “… to deal in the Software …” - * **Conditions** : “… subject to …” - * **Attribution and Notice** : “The above … shall be included …” - * **Warranty Disclaimer** : “The software is provided ‘as is’ …” - * **Limitation of Liability** : “In no event …” - - - -Here we go: - -#### Header - -##### License Title - -> The MIT License (MIT) - -“The MIT License” is a not a single license, but a family of license forms derived from language prepared for releases from the Massachusetts Institute of Technology. It has seen a lot of changes over the years, both for the original projects that used it, and also as a model for other projects. The Fedora Project maintains a [kind of cabinet of MIT license curiosities][2], with insipid variations preserved in plain text like anatomical specimens in formaldehyde, tracing a wayward kind of evolution. - -Fortunately, the [Open Source Initiative][3] and [Software Package Data eXchange][4] groups have standardized a generic MIT-style license form as “The MIT License”. OSI in turn has adopted SPDX’ standardized [string identifiers][5] for common open-source licenses, with `MIT` pointing unambiguously to the standardized form “MIT License”. If you want MIT-style terms for a new project, use [the standardized form][1]. - -Even if you include “The MIT License” or “SPDX:MIT” in a `LICENSE` file, any responsible reviewer will still run a comparison of the text against the standard form, just to be sure. While various license forms calling themselves “MIT License” vary only in minor details, the looseness of what counts as an “MIT License” has tempted some authors into adding bothersome “customizations”. The canonical horrible, no good, very bad example of this is [the JSON license][6], an MIT-family license plus “The Software shall be used for Good, not Evil.”. This kind of thing might be “very Crockford”. It is definitely a pain in the ass. Maybe the joke was supposed to be on the lawyers. But they laughed all the way to the bank. - -Moral of the story: “MIT License” alone is ambiguous. Folks probably have a good idea what you mean by it, but you’re only going to save everyone—yourself included—time by copying the text of the standard MIT License form into your project. If you use metadata, like the `license` property in package manager metadata files, to designate the `MIT` license, make sure your `LICENSE` file and any header comments use the standard form text. All of this can be [automated][7]. - -##### Copyright Notice - -> Copyright (c) - -Until the 1976 Copyright Act, United States copyright law required specific actions, called “formalities”, to secure copyright in creative works. If you didn’t follow those formalities, your rights to sue others for unauthorized use of your work were limited, often completely lost. One of those formalities was “notice”: Putting marks on your work and otherwise making it known to the market that you were claiming copyright. The © is a standard symbol for marking copyrighted works, to give notice of copyright. The ASCII character set doesn’t have the © symbol, but `Copyright (c)` gets the same point across. - -The 1976 Copyright Act, which “implemented” many requirements of the international Berne Convention, eliminated formalities for securing copyright. At least in the United States, copyright holders still need to register their copyrighted works before suing for infringement, with potentially higher damages if they register before infringement begins. In practice, however, many register copyright right before bringing suit against someone in particular. You don’t lose your copyright just by failing to put notices on it, registering, sending a copy to the Library of Congress, and so on. - -Even if copyright notices aren’t as absolutely necessary as they used to be, they are still plenty useful. Stating the year a work was authored and who the copyright belonged to give some sense of when copyright in the work might expire, bringing the work into the public domain. The identity of the author or authors is also useful: United States law calculates copyright terms differently for individual and “corporate” authors. Especially in business use, it may also behoove a company to think twice about using software from a known competitor, even if the license terms give very generous permission. If you’re hoping others will see your work and want to license it from you, copyright notices serve nicely for attribution. - -As for “copyright holder”: Not all standard form licenses have a space to write this out. More recent license forms, like [Apache 2.0][8] and [GPL 3.0][9], publish `LICENSE` texts that are meant to be copied verbatim, with header comments and separate files elsewhere to indicate who owns copyright and is giving the license. Those approaches neatly discourage changes to the “standard” texts, accidental or intentional. They also make automated license identification more reliable. - -The MIT License descends from language written for releases of code by institutions. For institutional releases, there was just one clear “copyright holder”, the institution releasing the code. Other institutions cribbed these licenses, replacing “MIT” with their own names, leading eventually to the generic forms we have now. This process repeated for other short-form institutional licenses of the era, notably the [original four-clause BSD License][10] for the University of California, Berkeley, now used in [three-clause][11] and [two-clause][12] variants, as well as [The ISC License][13] for the Internet Systems Consortium, an MIT variant. - -In each case, the institution listed itself as the copyright holder in reliance on rules of copyright ownership, called “[works made for hire][14]” rules, that give employers and clients ownership of copyright in some work their employees and contractors do on their behalf. These rules don’t usually apply to distributed collaborators submitting code voluntarily. This poses a problem for project-steward foundations, like the Apache Foundation and Eclipse Foundation, that accept contributions from a more diverse group of contributors. The usual foundation approach thus far has been to use a house license that states a single copyright holder—[Apache 2.0][8] and [EPL 1.0][15]—backed up by contributor license agreements—[Apache CLAs][16] and [Eclipse CLAs][17]—to collect rights from contributors. Collecting copyright ownership in one place is even more important under “copyleft” licenses like the GPL, which rely on copyright owners to enforce license conditions to promote software-freedom values. - -These days, loads of projects without any kind of institutional or business steward use MIT-style license terms. SPDX and OSI have helped these use cases by standardizing forms of licenses like MIT and ISC that don’t refer to a specific entity or institutional copyright holder. Armed with those forms, the prevailing practice of project authors is to fill their own name in the copyright notice of the form very early on … and maybe bump the year here and there. At least under United States copyright law, the resulting copyright notice doesn’t give a full picture. - -The original owner of a piece of software retains ownership of their work. But while MIT-style license terms give others rights to build on and change the software, creating what the law calls “derivative works”, they don’t give the original author ownership of copyright in others’ contributions. Rather, each contributor has copyright in any [even marginally creative][18] work they make using the existing code as a starting point. - -Most of these projects also balk at the idea of taking contributor license agreements, to say nothing of signed copyright assignments. That’s both naive and understandable. Despite the assumption of some newer open-source developers that sending a pull request on GitHub “automatically” licenses the contribution for distribution on the terms of the project’s existing license, United States law doesn’t recognize any such rule. Strong copyright protection, not permissive licensing, is the default. - -Update: GitHub later changed its site-wide terms of service to include an attempt to flip this default, at least on GitHub.com. I’ve written up some thoughts on that development, not all of them positive, in [another post][19]. - -To fill the gap between legally effective, well-documented grants of rights in contributions and no paper trail at all, some projects have adopted the [Developer Certificate of Origin][20], a standard statement contributors allude to using `Signed-Off-By` metadata tags in their Git commits. The Developer Certificate of Origin was developed for Linux kernel development in the wake of the infamous SCO lawsuits, which alleged that chunks of Linux’ code derived from SCO-owned Unix source. As a means of creating a paper trail showing that each line of Linux came from a contributor, the Developer Certificate of Origin functions nicely. While the Developer Certificate of Origin isn’t a license, it does provide lots of good evidence that those submitting code expected the project to distribute their code, and for others to use it under the kernel’s existing license terms. The kernel also maintains a machine-readable `CREDITS` file listing contributors with name, affiliation, contribution area, and other metadata. I’ve done [some][21] [experiments][22] adapting that approach for projects that don’t use the kernel’s development flow. - -#### License Grant - -> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), - -The meat of The MIT License is, you guessed it, a license. In general terms, a license is permission that one person or legal entity—the “licensor”—gives another—the “licensee”—to do something the law would otherwise let them sue for. The MIT License is a promise not to sue. - -The law sometimes distinguishes licenses from promises to give licenses. If someone breaks a promise to give a license, you may be able to sue them for breaking their promise, but you may not end up with a license. “Hereby” is one of those hokey, archaic-sounding words lawyers just can’t get rid of. It’s used here to show that the license text itself gives the license, and not just a promise of a license. It’s a legal [IIFE][23]. - -While many licenses give permission to a specific, named licensee, The MIT License is a “public license”. Public licenses give everybody—the public at large—permission. This is one of the three great ideas in open-source licensing. The MIT License captures this idea by giving a license “to any person obtaining a copy of … the Software”. As we’ll see later, there is also a condition to receiving this license that ensures others will learn about their permission, too. - -The parenthetical with a capitalized term in quotation marks (a “Definition”), is the standard way to give terms specific meanings in American-style legal documents. Courts will reliably look back to the terms of the definition when they see a defined, capitalized term used elsewhere in the document. - -##### Grant Scope - -> to deal in the Software without restriction, - -From the licensee’s point of view, these are the seven most important words in The MIT License. The key legal concerns are getting sued for copyright infringement and getting sued for patent infringement. Neither copyright law nor patent law uses “to deal in” as a term of art; it has no specific meaning in court. As a result, any court deciding a dispute between a licensor and a licensee would ask what the parties meant and understood by this language. What the court will see is that the language is intentionally broad and open-ended. It gives licensees a strong argument against any claim by a licensor that they didn’t give permission for the licensee to do that specific thing with the software, even if the thought clearly didn’t occur to either side when the license was given. - -> including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, - -No piece of legal writing is perfect, “fully settled in meaning”, or unmistakably clear. Beware anyone who pretends otherwise. This is the least perfect part of The MIT License. There are three main issues: - -First, “including without limitation” is a legal antipattern. It crops up in any number of flavors: - - * “including, without limitation” - * “including, without limiting the generality of the foregoing” - * “including, but not limited to” - * many, many pointless variations - - - -All of these share a common purpose, and they all fail to achieve it reliably. Fundamentally, drafters who use them try to have their cake and eat it, too. In The MIT License, that means introducing specific examples of “dealing in the Software”—“use, copy, modify” and so on—without implying that licensee action has to be something like the examples given to count as “dealing in”. The trouble is that, if you end up needing a court to review and interpret the terms of a license, the court will see its job as finding out what those fighting meant by the language. If the court needs to decide what “deal in” means, it cannot “unsee” the examples, even if you tell it to. I’d argue that “deal in the Software without restriction” alone would be better for licensees. Also shorter. - -Second, the verbs given as examples of “deal in” are a hodgepodge. Some have specific meanings under copyright or patent law, others almost do or just plain don’t: - - * use appears in [United States Code title 35, section 271(a)][24], the patent law’s list of what patent owners can sue others for doing without permission. - - * copy appears in [United States Code title 17, section 106][25], the copyright law’s list of what copyright owners can sue others for doing without permission. - - * modify doesn’t appear in either copyright or patent statute. It is probably closest to “prepare derivative works” under the copyright statute, but may also implicate improving or otherwise derivative inventions. - - * merge doesn’t appear in either copyright or patent statute. “Merger” has a specific meaning in copyright, but that’s clearly not what’s intended here. Rather, a court would probably read “merge” according to its meaning in industry, as in “to merge code”. - - * publish doesn’t appear in either copyright or patent statute. Since “the Software” is what’s being published, it probably hews closest to “distribute” under the [copyright statute][25]. That statute also covers rights to perform and display works “publicly”, but those rights apply only to specific kinds of copyrighted work, like plays, sound recordings, and motion pictures. - - * distribute appears in the [copyright statute][25]. - - * sublicense is a general term of intellectual property law. The right to sublicense means the right to give others licenses of their own, to do some or all of what you have permission to do. The MIT License’s right to sublicense is actually somewhat unusual in open-source licenses generally. The norm is what Heather Meeker calls a “direct licensing” approach, where everyone who gets a copy of the software and its license terms gets a license direct from the owner. Anyone who might get a sublicense under the MIT License will probably end up with a copy of the license telling them they have a direct license, too. - - * sell copies of is a mongrel. It is close to “offer to sell” and “sell” in the [patent statute][24], but refers to “copies”, a copyright concept. On the copyright side, it seems close to “distribute”, but the [copyright statute][25] makes no mention of sales. - - * permit persons to whom the Software is furnished to do so seems redundant of “sublicense”. It’s also unnecessary to the extent folks who get copies also get a direct license. - - - - -Lastly, as a result of this mishmash of legal, industry, general-intellectual-property, and general-use terms, it isn’t clear whether The MIT License includes a patent license. The general language “deal in” and some of the example verbs, especially “use”, point toward a patent license, albeit a very unclear one. The fact that the license comes from the copyright holder, who may or may not have patent rights in inventions in the software, as well as most of the example verbs and the definition of “the Software” itself, all point strongly toward a copyright license. More recent permissive open-source licenses, like [Apache 2.0][8], address copyright, patent, and even trademark separately and specifically. - -##### Three License Conditions - -> subject to the following conditions: - -There’s always a catch! MIT has three! - -If you don’t follow The MIT License’s conditions, you don’t get the permission the license offers. So failing to do what the conditions say at least theoretically leaves you open to a lawsuit, probably a copyright lawsuit. - -Using the value of the software to the licensee to motivate compliance with conditions, even though the licensee paid nothing for the license, is the second great idea of open-source licensing. The last, not found in The MIT License, builds off license conditions: “Copyleft” licenses like the [GNU General Public License][9] use license conditions to control how those making changes can license and distribute their changed versions. - -##### Notice Condition - -> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -If you give someone a copy of the software, you need to include the license text and any copyright notice. This serves a few critical purposes: - - 1. Gives others notice that they have permission for the software under the public license. This is a key part of the direct-licensing model, where each user gets a license direct from the copyright holder. - - 2. Makes known who’s behind the software, so they can be showered in praises, glory, and cold, hard cash donations. - - 3. Ensures the warranty disclaimer and limitation of liability (coming up next) follow the software around. Everyone who gets a copy should get a copy of those licensor protections, too. - - - - -There’s nothing to stop you charging for providing a copy, or even a copy in compiled form, without source code. But when you do, you can’t pretend that the MIT code is your own proprietary code, or provided under some other license. Those receiving get to know their rights under the “public license”. - -Frankly, compliance with this condition is breaking down. Nearly every open-source license has such an “attribution” condition. Makers of system and installed software often understand they’ll need to compile a notices file or “license information” screen, with copies of license texts for libraries and components, for each release of their own. The project-steward foundations have been instrumental in teaching those practices. But web developers, as a whole, haven’t got the memo. It can’t be explained away by a lack of tooling—there is plenty—or the highly modular nature of packages from npm and other repositories—which uniformly standardize metadata formats for license information. All the good JavaScript minifiers have command-line flags for preserving license header comments. Other tools will concatenate `LICENSE` files from package trees. There’s really no excuse. - -##### Warranty Disclaimer - -> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. - -Nearly every state in the United States has enacted a version of the Uniform Commercial Code, a model statute of laws governing commercial transactions. Article 2 of the UCC—“Division 2” in California—governs contracts for sales of goods, from used automobiles bought off the lot to large shipments of industrial chemicals to manufacturing plants. - -Some of the UCC’s rules about sales contracts are mandatory. These rules always apply, whether those buying and selling like them or not. Others are just “defaults”. Unless buyers and sellers opt out in writing, the UCC implies that they want the baseline rule found in the UCC’s text for their deal. Among the default rules are implied “warranties”, or promises by sellers to buyers about the quality and usability of the goods being sold. - -There is a big theoretical debate about whether public licenses like The MIT License are contracts—enforceable agreements between licensors and licensees—or just licenses, which go one way, but may come with strings attached, their conditions. There is less debate about whether software counts as “goods”, triggering the UCC’s rules. There is no debate among licensors on liability: They don’t want to get sued for lots of money if the software they give away for free breaks, causes problems, doesn’t work, or otherwise causes trouble. That’s exactly the opposite of what three default rules for “implied warranties” do: - - 1. The implied warranty of “merchantability” under [UCC section 2-314][26] is a promise that “the goods”—the Software—are of at least average quality, properly packaged and labeled, and fit for the ordinary purposes they are intended to serve. This warranty applies only if the one giving the software is a “merchant” with respect to the software, meaning they deal in software and hold themselves out as skilled in software. - - 2. The implied warranty of “fitness for a particular purpose” under [UCC section 2-315][27] kicks in when the seller knows the buyer is relying on them to provide goods for a particular purpose. The goods need to actually be “fit” for that purpose. - - 3. The implied warranty of “noninfringement” is not part of the UCC, but is a common feature of general contract law. This implied promise protects the buyer if it turns out the goods they received infringe somebody else’s intellectual property rights. That would be the case if the software under The MIT License didn’t actually belong to the one trying to license it, or if it fell under a patent owned by someone else. - - - - -[Section 2-316(3)][28] of the UCC requires language opting out of, or “excluding”, implied warranties of merchantability and fitness for a particular purpose to be conspicuous. “Conspicuous” in turn means written or formatted to call attention to itself, the opposite of microscopic fine print meant to slip past unwary consumers. State law may impose a similar attention-grabbing requirement for disclaimers of noninfringement. - -Lawyers have long suffered under the delusion that writing anything in `ALL-CAPS` meets the conspicuous requirement. That isn’t true. Courts have criticized the Bar for pretending as much, and most everyone agrees all-caps does more to discourage reading than compel it. All the same, most open-source-license forms set their warranty disclaimers in all-caps, in part because that’s the only obvious way to make it stand out in plain-text `LICENSE` files. I’d prefer to use asterisks or other ASCII art, but that ship sailed long, long ago. - -##### Limitation of Liability - -> In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software. - -The MIT License gives permission for software “free of charge”, but the law does not assume that folks receiving licenses free of charge give up their rights to sue when things go wrong and the licensor is to blame. “Limitations of liability”, often paired with “damages exclusions”, work a lot like licenses, as promises not to sue. But these are protections for the licensor against lawsuits by licensees. - -In general, courts read limitations of liability and damages exclusions warily, since they can shift an incredible amount of risk from one side to another. To protect the community’s vital interest in giving folks a way to redress wrongs done in court, they “strictly construe” language limiting liability, reading it against the one protected by it where possible. Limitations of liability have to be specific to stand up. Especially in “consumer” contracts and other situations where those giving up the right to sue lack sophistication or bargaining power, courts have sometimes refused to honor language that seemed buried out of sight. Partly for that reason, partly by sheer force of habit, lawyers tend to give limits of liability the all-caps treatment, too. - -Drilling down a bit, the “limitation of liability” part is a cap on the amount of money a licensee can sue for. In open-source licenses, that limit is always no money at all, $0, “not liable”. By contrast, in commercial licenses, it’s often a multiple of license fees paid in the last 12-month period, though it’s often negotiated. - -The “exclusion” part lists, specifically, kinds of legal claims—reasons to sue for damages—the licensor cannot use. Like many, many legal forms, The MIT License mentions actions “of contract”—for breaching a contract—and “of tort”. Tort rules are general rules against carelessly or maliciously harming others. If you run someone down on the road while texting, you have committed a tort. If your company sells faulty headphones that burn peoples’ ears off, your company has committed a tort. If a contract doesn’t specifically exclude tort claims, courts sometimes read exclusion language in a contract to prevent only contract claims. For good measure, The MIT License throws in “or otherwise”, just to catch the odd admiralty law or other, exotic kind of legal claim. - -The phrase “arising from, out of or in connection with” is a recurring tick symptomatic of the legal draftsman’s inherent, anxious insecurity. The point is that any lawsuit having anything to do with the software is covered by the limitation and exclusions. On the off chance something can “arise from”, but not “out of”, or “in connection with”, it feels better to have all three in the form, so pack ‘em in. Never mind that any court forced to split hairs in this part of the form will have to come up with different meanings for each, on the assumption that a professional drafter wouldn’t use different words in a row to mean the same thing. Never mind that in practice, where courts don’t feel good about a limitation that’s disfavored to begin with, they’ll be more than ready to read the scope trigger narrowly. But I digress. The same language appears in literally millions of contracts. - -#### Overall - -All these quibbles are a bit like spitting out gum on the way into church. The MIT License is a legal classic. The MIT License works. It is by no means a panacea for all software IP ills, in particular the software patent scourge, which it predates by decades. But MIT-style licenses have served admirably, fulfilling a narrow purpose—reversing troublesome default rules of copyright, sales, and contract law—with a minimal combination of discreet legal tools. In the greater context of computing, its longevity is astounding. The MIT License has outlasted and will outlast the vast majority of software licensed under it. We can only guess how many decades of faithful legal service it will have given when it finally loses favor. It’s been especially generous to those who couldn’t have afforded their own lawyer. - -We’ve seen how the The MIT License we know today is a specific, standardized set of terms, bringing order at long last to a chaos of institution-specific, haphazard variations. - -We’ve seen how its approach to attribution and copyright notice informed intellectual property management practices for academic, standards, commercial, and foundation institutions. - -We’ve seen how The MIT Licenses grants permission for software to all, for free, subject to conditions that protect licensors from warranties and liability. - -We’ve seen that despite some crusty verbiage and lawyerly affectation, one hundred and seventy one little words can get a hell of a lot of legal work done, clearing a path for open-source software through a dense underbrush of intellectual property and contract. - -I’m so grateful for all who’ve taken the time to read this rather long post, to let me know they found it useful, and to help improve it. As always, I welcome your comments via [e-mail][29], [Twitter][30], and [GitHub][31]. - -A number of folks have asked where they can read more, or find run-downs of other licenses, like the GNU General Public License or the Apache 2.0 license. No matter what your particular continuing interest may be, I heartily recommend the following books: - - * Andrew M. St. Laurent’s [Understanding Open Source & Free Software Licensing][32], from O’Reilly. - -I start with this one because, while it’s somewhat dated, its approach is also closest to the line-by-line approach used above. O’Reilly has made it [available online][33]. - - * Heather Meeker’s [Open (Source) for Business][34] - -In my opinion, by far the best writing on the GNU General Public License and copyleft more generally. This book covers the history, the licenses, their development, as well as compatibility and compliance. It’s the book I lend to clients considering or dealing with the GPL. - - * Larry Rosen’s [Open Source Licensing][35], from Prentice Hall. - -A great first book, also available for free [online][36]. This is the best introduction to open-source licensing and related law for programmers starting from scratch. This one is also a bit dated in some specific details, but Larry’s taxonomy of licenses and succinct summary of open-source business models stand the test of time. - - - - -All of these were crucial to my own education as an open-source licensing lawyer. Their authors are professional heroes of mine. Have a read! — K.E.M - -I license this article under a [Creative Commons Attribution-ShareAlike 4.0 license][37]. - - --------------------------------------------------------------------------------- - -via: https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html - -作者:[Kyle E. Mitchell][a] -选题:[lujun9972][b] -译者:[bestony](https://github.com/bestony) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://kemitchell.com/ -[b]: https://github.com/lujun9972 -[1]: http://spdx.org/licenses/MIT -[2]: https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT -[3]: https://opensource.org -[4]: https://spdx.org -[5]: http://spdx.org/licenses/ -[6]: https://spdx.org/licenses/JSON -[7]: https://www.npmjs.com/package/licensor -[8]: https://www.apache.org/licenses/LICENSE-2.0 -[9]: https://www.gnu.org/licenses/gpl-3.0.en.html -[10]: http://spdx.org/licenses/BSD-4-Clause -[11]: https://spdx.org/licenses/BSD-3-Clause -[12]: https://spdx.org/licenses/BSD-2-Clause -[13]: http://www.isc.org/downloads/software-support-policy/isc-license/ -[14]: http://worksmadeforhire.com/ -[15]: https://www.eclipse.org/legal/epl-v10.html -[16]: https://www.apache.org/licenses/#clas -[17]: https://wiki.eclipse.org/ECA -[18]: https://en.wikipedia.org/wiki/Feist_Publications,_Inc.,_v._Rural_Telephone_Service_Co. -[19]: https://writing.kemitchell.com/2017/02/16/Against-Legislating-the-Nonobvious.html -[20]: http://developercertificate.org/ -[21]: https://github.com/berneout/berneout-pledge -[22]: https://github.com/berneout/authors-certificate -[23]: https://en.wikipedia.org/wiki/Immediately-invoked_function_expression -[24]: https://www.govinfo.gov/app/details/USCODE-2017-title35/USCODE-2017-title35-partIII-chap28-sec271 -[25]: https://www.govinfo.gov/app/details/USCODE-2017-title17/USCODE-2017-title17-chap1-sec106 -[26]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2314.&lawCode=COM -[27]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2315.&lawCode=COM -[28]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2316.&lawCode=COM -[29]: mailto:kyle@kemitchell.com -[30]: https://twitter.com/kemitchell -[31]: https://github.com/kemitchell/writing/tree/master/_posts/2016-09-21-MIT-License-Line-by-Line.md -[32]: https://lccn.loc.gov/2006281092 -[33]: http://www.oreilly.com/openbook/osfreesoft/book/ -[34]: https://www.amazon.com/dp/1511617772 -[35]: https://lccn.loc.gov/2004050558 -[36]: http://www.rosenlaw.com/oslbook.htm -[37]: https://creativecommons.org/licenses/by-sa/4.0/legalcode diff --git a/translated/talk/20160921 lawyer The MIT License, Line by Line.md b/translated/talk/20160921 lawyer The MIT License, Line by Line.md new file mode 100644 index 0000000000..eb050aad1b --- /dev/null +++ b/translated/talk/20160921 lawyer The MIT License, Line by Line.md @@ -0,0 +1,290 @@ +[#]: collector: (lujun9972) +[#]: translator: (bestony) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (lawyer The MIT License, Line by Line) +[#]: via: (https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html) +[#]: author: (Kyle E. Mitchell https://kemitchell.com/) + +逐行解读 MIT 许可证 +====== + +[MIT 许可证][1] 是世界上最流行的开源软件许可证。以下是它的逐行解读。 + +#### 阅读协议 + +如果你涉及到开源软件,并且没有花时间从头到尾的阅读整个许可证(它只有 171 个单词),你现在就需要这样去做。尤其是当许可证不是你日常的工作内容时。把任何看起来不对劲或不清楚的地方记下来,然后继续阅读。我会把每一个单词再重复一遍,并按顺序分块,加入上下文和注释。但最重要的还是要牢记整体。 + +> The MIT License (MIT) +> +> Copyright (c) +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the Software. + +许可证可以分为五段,按照逻辑划分如下: + + * **头部** + * **许可证标题** : “MIT 许可证” + * **版权说明** : “Copyright (c) …” + * **许可证授权** : “特此批准 …” + * **授权范围** : “… 处理软件 …” + * **条件** : “… 服从了 …” + * **归属和通知** : “上述 … 应当被包含在内 …” + * **免责声明** : “软件按照“原状”提供 …” + * **责任限制** : “在任何情况下 …” + + +接下来详细看看 + +#### 头部 + +##### 许可证头部 + +> The MIT License (MIT) + +“MIT 许可证“不是单一的许可证,而是一系列从麻省理工学院为将要发布的语言准备的许可证衍生的许可证。多年来,无论是对于使用它的原始项目,还是作为其他项目的模型,他都经历了许多变化。Fedora 项目维护了一个纯文本的[麻省理工学院许可证其他版本]的页面,如同泡在甲醛中的解剖标本一般,平淡的追溯了无序的演变。 + +幸运的是,[OSI(开放源码倡议)][3] 和 [Software Package Data eXchange(软件数据包交换)]团体已经将一种通用的 MIT 式的许可证形式标准化为”MIT 许可证“。而 OSI 则采用了 SPDX 标准化的[字符串标志符][5],并将其中的 ”MIT“ 明确的指向标准化形式的”MIT 许可证“ + +即使你在 “LICENSE” 文件中包含 “MIT 许可证”或 “SPDX:MIT“ ,任何负责的审查员仍会将文本与标准格式进行比较,以确保安全。尽管自称为“MIT 许可证”的各种许可证形式只在细微的细节上有所不同,但“MIT 许可证”的松散性吸引了一些作者加入麻烦的“定制”。典型的糟糕、不好的例子是[JSON 许可证][6],一个 MIT 家族的许可证被加上了“这个软件应该被应用于好的,而不是恶的”。这件事情可能是“非常克罗克福特”的(译者注,JSON 格式和 JSON.org 的作者)。这绝对是一件麻烦事,也许这个笑话应该只是在律师身上,但它一直延伸到银行业。 + +这个故事的寓意是:“MIT 许可证”本身就是模棱两可的。大家可能很清楚你的意思,但你只需要把标准的 MIT 许可证文本复制到你的项目中,就可以节省每个人的时间。如果使用元数据(如包管理器中的元数据文件)来制定 “MIT 许可证”,请确保 “LICENSE” 文件和任何头部的注释都适用标准的许可证文本。所有的这些都可以[自动化完成][7]。 + + +##### 版权说明 + +> Copyright (c) + + +在 1976 年《版权法》颁布之前,美国的版权法要求采取具体的行动,即所谓的“手续”来确保创意作品的版权。如果你不遵守这些手续,你起诉他人未经授权使用你的作品的权力就会受到限制,往往完全丧失权力,其中一项手续就是 "通知"。在你的作品上打上记号,以其他方式让市场知道你拥有版权 ©是一个标准符号,用于标记受版权保护的作品,以发出版权通知。ASCII 字符集没有©符号,但`Copyright (c)`可以表达同样的意思。 + +1976 年的版权法“执行”了国际《伯尔尼公约》的许多要求, 取消了确保版权的手续。至少在美国,著作权人在起诉侵权之前,仍然需要对自己的版权作品进行登记,如果在侵权行为开始之前进行登记,可能会获得更高的赔偿。但在实践中,很多人在对某个人提起诉讼之前,都会先注册版权。你并不会因为没有在上面贴上告示、注册、向国会图书馆寄送副本等而失去版权。 + +即使版权声明不像过去那样绝对必要,但它们仍然有很多用处。说明作品的创作年份和版权属于谁,可以让人知道作品的版权何时到期,从而使作品进入公共领域。作者或作者们的身份也很有用。美国法律对个人作者和"公司"作者的版权条款的计算方式不同。特别是在商业用途中,公司在使用已知竞争对手的软件时,可能也要三思而行,即使许可条款给予了非常慷慨的许可。如果你希望别人看到你的作品并想从你这里获得许可,版权声明可以很好地起到归属作用。 + +至于"版权持有人"。并非所有标准形式的许可证都有写明这一点的空间。最新的许可证形式,如[Apache 2.0][8]和[GPL 3.0][9],公布了 "LICENSE" 文本,这些文本是要逐字复制的,并在其他地方加上标题注释和单独的文件,以表明谁拥有版权和给予许可证。这些办法巧妙地阻止了对 "标准"文本的意外或故意的修改。这还使自动许可证识别更加可靠。 + +麻省理工学院的许可证是从为机构发布代码而写的语言演变而来。对于机构发布的代码,只有一个明确的 "版权持有人",即发布代码的机构。其他机构则抄袭了这些许可证,用他们自己的名字代替 "MIT",最终形成了我们现在的通用形式。这一过程同样适用于该时代的其他简短机构许可证,特别是加州大学伯克利分校的[最初的四条款 BSD 许可证][10],现在用于[三条款][11]和[两条款][12]变体,以及麻省理工学院的变体 — 互联网系统联盟的[ISC 许可证][13]。 + +在每一种情况下,该机构都根据版权所有权规则将自己列为版权持有人,这些规则称为“[雇佣作品][14]”规则,这些规则赋予雇主和客户对其雇员和承包商代表其从事的某些工作的版权所有权。这些规则通常不适用于自愿提交代码的分布式协作者。这给项目统筹型基金会(如 Apache 基金会和 Eclipse 基金会)带来了一个问题,它们接受来自更多不同贡献者的贡献。到目前为止,通常的基础方法是使用一个房产型许可证,它规定了一个版权持有者,如[Apache 2.0][8] 和 [EPL 1.0][15] — 并由贡献者许可协议 [Apache CLAs][16] 以及 [Eclipse CLAs][17] 支持,以从贡献者中收集权利。在像 GPL 这样的 "copyleft" 许可证下,将版权所有权收集在一个地方就更加重要了,因为 GPL 依靠版权所有者来执行许可证条件,以促进软件自由的价值。 + +如今,没有任何机构或业务统筹的大量项目都使用 MIT 风格的许可条款。 SPDX 和 OSI 通过标准化不涉及特定实体或机构版权持有人的 MIT 和 ISC 之类的许可证形式,为这些用例提供了帮助。有了这些许可证,项目作者的普遍做法是在许可证的版权声明中很早就填上自己的名字...也许还会在这里和那里填上年份。至少根据美国的版权法,由此产生的版权通知并不能说明全部情况。 + +某个软件的原始所有者保留其工作的所有权。但是,尽管 MIT 风格的许可条款赋予了他人开发和更改软件的权利,创造了法律所谓的“衍生作品”,但它们并没有赋予原始作者他人的贡献的所有权。相反,每个贡献者都以他们使用现有代码为起点进行的任何[甚至是少量创造][18]的作品来拥有版权。 + +这些项目中的大多数也对获得贡献者许可协议的想法犹豫不决,更不用说签署的版权转让了。这既幼稚又可以理解。尽管一些较新的开源开发人员假设在 GitHub 上发送 Pull Request “自动”根据项目现有许可证的条款授权分发贡献,但美国法律不承认任何此类规则。默认而强大的版本保护是不允许许可的。 + +更新:GitHub 后来修改了全站的服务条款,包括试图改变这一默认值,至少在 GitHub.com 上是这样。我在[另一篇][19]中写了一些对这一发展的并非都是正面的看法。 + +为了填补法律上有效的、有据可查的贡献权利授予与完全没有文件线索之间的差距,一些项目采用了[开发者原创证书][20],这是贡献者在 Git 提交中使用 "Signed-Off-By" 元数据标签暗示的标准声明。 开发人员原创证书是在臭名昭著的 SCO 诉讼之后,为 Linux 内核开发而开发的,该诉讼称 Linux 的大部分代码源自 SCO 拥有的 Unix 作为来源。作为创建显示 Linux 的每一行都来自贡献者的书面记录的一种方法,开发人员原创证书功能很好。尽管开发人员原产地证书不是许可证,但它确实提供了许多充分的证据,表明提交代码的人希望项目分发其代码,并让其他人根据内核现有的许可证条款使用该代码。内核还维护着一个机器可读的 “CREDITS” 文件,列出了具有名称,隶属关系,贡献区域和其他元数据的贡献者。我已经做了[一些][21][实验][22]针对不使用内核开发流程的项目进行了调整。 + +#### 许可证授权 + +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), + +MIT 许可证的实质是许可证(你猜对了)。一般来说,许可证是一个人或法律实体"许可人"给予另一个人"被许可人"做一些法律允许他们起诉的事情的许可。MIT 许可证是一种不起诉的承诺。 + +法律有时将许可证与给予许可证的承诺区分开来。如果有人违背了提供许可证的承诺,你可以起诉他们违背了承诺,但你最终可能得不到许可证。“特此”是律师们永远摆脱不了的一个老生常谈的词。这里使用它来显示许可证文本本身提供了许可证,而不仅仅是许可证的承诺。这是合法的[IIFE][23]。 + +尽管许多许可证都授予特定的命名许可证持有人许可,但 MIT 许可证是“公共许可证”。 公共许可证授予所有人(包括整个公众)许可。 这是开源许可中的三大创意之一。 MIT 许可证通过“向任何获得……软件副本的人”授予许可证来体现这一思想。 稍后我们将看到,获得此许可证还有一个条件,即确保其他人也可以了解他们的许可。 + +在美国式法律文件中,带引号大写的附加语(定义)是赋予术语特定含义的标准方式。当法院看到文件中其他地方使用了一个已定义的大写术语时,法院将可靠地回顾定义中的术语。 + +##### 授权范围 + +> to deal in the Software without restriction, + +从被许可人的角度来看,这是 MIT 许可证中最重要的七个字。关键的法律问题是被起诉侵犯版权和被起诉侵犯专利。无论是版权法还是专利法都没有将 "to deal in" 作为一个术语,它在法庭上没有特定的含义。因此,任何法院在裁决许可人和被许可人之间的纠纷时,都会问双方对这种语言的含义和理解。法院将看到的是,该措辞有意宽泛和开放。它使被许可人强烈反对许可人的任何主张,即他们没有许可被许可人使用该软件做特定的事情,即使在授予许可时双方都没有明显想到。 + +> including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, + +任何一篇法律文章都不是完美的,“意义上完全确定”或明确无误的。小心那些装作不一样的人。这是 MIT 许可证中最不完美的部分。主要有三个问题: + +首先,“包括但不限于”是一种法律反模式。它有多种衍生: + + * 包括但不限于 + + * 包括但不限于前述条文的一般性 + + * 包括但不限于 + + * 很多,很多毫无意义的变化 + +所有这些都有一个共同的目标,但都未能可靠地实现。从根本上说,使用它们的起草者也会尽量试探着去做。在MIT许可证中,这意味着引入“软件交易”的具体例子 — “使用、复制、修改”等等,但不意味着被许可方的行为必须与给出的例子类似,才能算作“交易”。问题是,如果你最终需要法庭来审查和解释许可证的条款,法庭将把它的工作看作是找出这些语言的含义。如果法院需要决定“交易”的含义,它不能“看不到”这些例子,即使你告诉它。我认为“不受限制的软件交易”本身对被许可方更好,也更短。 + +其次,作为 “deal in” 例子的动词是一个大杂烩。有些在版权法或专利法下有特定的含义,有些几乎有或根本没有: + + + * 使用出现在 [美国法典第 35 篇, 第 271(a)节][24], 专利法列出了专利权人可以在未经许可的情况下起诉他人的行为。 + + * 拷贝出现在 [美国法典第 17 篇, 第 106 节][25], 版权法列出了版权所有人可以在未经许可的情况下起诉他人的行为。 + + * 修改既不出现在版权法中,也不出现在专利法中。它可能最接近版权法下的“准备衍生作品”,但也可能涉及改进或其他衍生发明。 + + * 无论是在版权法还是专利法中,合并都没有出现。“合并”在版权方面有特定的含义,但这显然不是本文的意图。相反,法院可能会根据其在行业中的含义来解读“合并”,如“合并法典”。 + + * 无论是在版权法还是专利法中,都没有公布。由于“软件”是正在出版的东西,根据[版权法][25],它可能最接近于“发行”。该法令还包括“公开”表演和展示作品的权利,但这些权利只适用于特定类型的受版权保护的作品,如戏剧、录音和电影。 + + * 分发出现在[版权法][25]中。 + + * 分许可是知识产权法的总称。再许可权是指授予他人自己的许可,进行您所许可的部分或全部活动的权利。实际上,MIT 许可证的分许可证权利实际上在开放源代码许可证中并不常见。希瑟·米克(Heather Meeker)所说的规范是“直接许可”方法,在这种方法中,每个获得该软件及其许可条款副本的人都直接从所有者那里获得许可。任何可能根据 MIT 许可证获得分许可证的人都可能会得到一份许可证副本,告诉他们他们也有直接许可证。 + + + * 卖书是个混血儿。它接近于[专利法][24]中的“要约出售”和“出售”,但指的是“复制品”,一种版权概念。在版权方面,它似乎接近于“分发”,但[版权法][25]没有提到销售。 + + * 允许向其提供软件的人员这样做似乎是多余的“分许可”。这也是不必要的,因为获得拷贝的人也可以直接获得许可证。 + +最后,由于这种法律、行业、一般知识产权和一般使用条款的混杂,并不清楚《麻省理工学院许可证》是否包括专利许可。一般性语言 "交易 "和一些例子动词,尤其是 "使用",都指向了尽管是一个非常不明确的许可的专利许可。许可证来自于版权人,而版权人可能对软件中的发明拥有或不拥有专利权,以及大多数的例子动词和 "软件" 本身的定义,都强烈地指向版权许可证。诸如[Apache 2.0][8]之类的较新的开放源代码许可分别特别地处理了版权,专利甚至商标。 + +##### 三个许可条件 + +> subject to the following conditions: + +总有一个陷阱!麻省理工有三个! + +如果你不遵守麻省理工学院许可证的条件,你就得不到许可证提供的许可。因此,如果不按照条件所说的去做,至少在理论上会让你面临一场诉讼,很可能是一场版权诉讼。 + +开源软件的第二个好主意是,利用软件对被许可人的价值来激发对条件的遵守,即使被许可人不为许可支付任何费用。 最后一个想法,在《麻省理工学院许可证》中没有,它建立在许可证条件之上。像[GNU 通用公共许可证][9]这样的 "Copyleft "许可证,使用许可证条件来控制那些进行修改的人如何对其修改后的版本进行许可和发布。 + +##### 通知条件 + +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +如果你给别人一份软件的副本,你需要包括许可证文本和任何版权声明。这有几个关键目的。 + + 1. 给别人一个通知,说明他们在公共许可证下对软件有许可。这是直接授权模式的一个关键部分,在这种模式下,每个用户都能直接从版权持有人那里获得授权。 + + 2. 让人们知道谁是软件的幕后推手,这样他们就可以得到赞美、荣耀和冷冰冰的现金捐赠。 + + 3. 确保保修免责声明和责任限制(下一步)跟在软件后面。每一个得到副本的人也应该得到一份这些许可人保护的副本。 + + +没有任何东西可以阻止你为提供一个没有源代码的副本,甚至是编译形式的副本而收费。但是当你这么做的时候,你不能假装 MIT 代码是你自己的专有代码,或者是在其他许可下提供的。获得“公共许可证”的人可以了解他们在“公共许可证”下的权利。 + +坦率地说,遵守这个条件是崩溃的。几乎所有的开源许可证都有这样的"归属"条件。系统和装机软件的制作者往往明白,他们需要为自己的每一个发行版本编制一个通知文件或 "许可证信息 "屏幕,并附上库和组件的许可证文本副本。项目统筹基金会在教授这些做法方面起到了重要作用。但是网络开发者作为一个整体,还没有得到备忘录。这不能用缺乏工具来解释,工具有很多,也不能用 npm 和其他资源库中的包的高度模块化来解释,它们统一了许可证信息的元数据格式。所有好的 JavaScript minifiers 都有命令行标志来保存许可证头注释。其他工具会从包树中连接`LICENSE`文件。这实在是无可厚非。 + +##### 免责声明 + +> The Software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. + +美国几乎每个州都颁布了统一商业法典的版本,该法典是规范商业交易的法律范本。 UCC 的第2条(加利福尼亚州的“第2分部”)规定了商品销售合同,从批量购买的二手车到大批工业化学品再到制造厂。 + +UCC 关于销售合同的某些规则是强制性的。 这些规则始终适用,无论买卖双方是否喜欢。 其他只是“默认值”。 除非买卖双方以书面形式选择退出,否则 UCC 表示他们希望在 UCC 文本中找到交易的基准规则。 默认规则中包括隐含的“保证”,或卖方对买方关于所售商品的质量和可用性的承诺。 + +关于诸如 MIT 许可证之类的公共许可证是合同(许可方和被许可方之间的可执行协议)还是仅仅是许可,这在理论上存在很大争议,这是一种方式,但可能附带条件。 关于软件是否被视为“商品”,从而触发了 UCC 的规则,争论较少。 许可人之间没有就赔偿责任进行辩论:如果他们免费提供的软件可以免费休息,造成问题,无法正常工作或以其他方式引起麻烦,那么他们就不会被起诉要求巨额赔偿。 这与“默示保证”的三个默认规则完全相反: + + 1. [UCC 第2-314节][26]所隐含的“可商购性”保证是对“商品”(即软件)的质量至少为平均水平,并经过适当包装和标记,并符合其常规用途, 意在服务。 仅当提供该软件的人是该软件的“商人”时,此保证才适用,这意味着他们从事软件交易并表现出对软件的熟练程度。 + + 2. 当卖方知道买方依靠他们提供用于特定目的的货物时,[UCC第 2-315节][27]中的“针对特定目的的适用性”的隐含担保即刻生效。 为此,商品实际上需要“适合”。 + + 3. 隐含的“非侵权”保证不是 UCC 的一部分,而是一般合同法的共同特征。 如果事实证明买方收到的商品侵犯了他人的知识产权,则该隐含的承诺将保护买方。 如果根据MIT许可获得的软件实际上并不属于尝试许可该软件的软件,或者属于他人拥有的专利,那就属于这种情况。 + + +UCC 的[第2-316(3)节][28]要求,出于明显的目的,选择退出或“排除”隐含的适销性和适用性的默示保证。 反过来,“显眼”是指书写或格式化以引起人们的注意,这与微观精细印刷的反义词相反,意在溜过粗心的消费者。 州法律可能会对不侵权免责声明施加类似的引人注目的要求。 + +长期以来,律师们都有一种错觉,认为用 "全大写 "写任何东西都符合明显的要求。这是不正确的。法院曾批评律师协会自以为是,而且大多数人都认为,全大写更多的是阻止阅读,而不是强制阅读。同样的,大多数开源许可表格都将其担保免责声明设置为全大写,部分原因是这是在纯文本的 `LICENSE` 文件中唯一明显的方式。我更喜欢使用星号或其他 ASCII 艺术,但那是很久很久以前的事了。 + +##### 责任限制 + +> In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software. + +麻省理工学院许可证允许 "免费 "使用软件,但法律并不认为接受免费许可证的人在出错时放弃了起诉的权利,而要责怪许可人。"责任限制",通常与 "损害赔偿排除条款 "搭配使用,其作用与许可证很像,是不起诉的承诺。但这些都是保护许可人免受被许可人起诉的保护措施。 + +一般来说,法院对责任限制和损害赔偿排除条款的解读非常谨慎,因为这些条款可以将大量的风险从一方转移到另一方。为了保护社会的重大利益,让人们有办法在法庭上纠正错误,他们 "严格解释 "限制责任的语言,在可能的情况下对受其保护的一方进行解读。责任限制必须具体才能成立。特别是在 "消费者 "合同和其他放弃起诉权的人缺乏复杂性或讨价还价能力的情况下,法院有时会拒绝尊重那些似乎被埋没在视线之外的语言。部分是出于这个原因,部分是出于习惯,律师们往往也会给责任限制以全称处理。 + +再往下看,"责任限制 "部分是对被许可人可以起诉的金额的上限。在开源许可证中,这个上限总是没有钱,0元,"不负责任"。相比之下,在商业许可证中,它通常是过去 12 个月内支付的许可证费用的倍数,尽管它通常是经过谈判的。 + +“排除”部分具体列出了各种法律主张,即请求赔偿的理由,许可人无法使用。 像许多其他法律形式一样,MIT 许可证 提到了“违反合同”的行为(即违反合同)和“侵权”的行为。 侵权规则是防止粗心或恶意伤害他人的一般规则。 如果您在发短信时在路上撞人,则表示您犯了侵权行为。 如果您的公司销售的有问题的耳机会烧伤人们的耳朵,则说明您的公司已经侵权。 如果合同没有明确排除侵权索赔,那么法院有时会在合同中使用排除语言,以仅阻止合同索赔。 出于很好的考虑, MIT 许可证抛出“或其他”字样,只是为了抓住奇怪的海事法或其他奇特的法律主张。 + +“产生于、来自或与之相关”这句话是法律起草人固有的、焦虑的不安全感的反复出现的症状。关键是,任何与软件有关的诉讼都包含在限制和排除范围内。在偶然的情况下,有些东西可以“产生”,但不能“产生”,或者“与之相关”,把这三者都放在形式上感觉更好,所以把它们打包。更不用说,任何法院被迫在表格的这一部分分头讨论的问题,都必须对每一个问题给出不同的含义,前提是专业的起草者不会在一行中使用不同的词来表示同一件事。更不用说,在实践中,如果法院对一开始不受欢迎的限制感觉不好,那么他们将更愿意狭隘地解读范围触发器。但我离题了。同样的语言出现在数以百万计的合同中。 + +#### 总结 + +所有这些诡辩都有点像在进教堂的路上吐口香糖。MIT 许可证是一个法律经典且有效。 它绝不是所有软件 IP 弊病的灵丹妙药,尤其是它早在几十年前就已经出现的软件专利灾难。但麻省理工学院风格的许可证发挥了令人钦佩的作用,实现了一个狭隘的目的,用最少的谨慎的法律工具组合扭转了版权、销售和合同法等棘手的默认规则。在计算的大背景下,它的寿命是惊人的。麻省理工学院的许可证已经和将要超过绝大多数的软件许可证。我们只能猜测,当它最终失宠时,它将提供多少年忠实的法律服务。对于那些付不起自己律师的人来说,这是特别慷慨的。 + +我们已经看到,我们今天所知道的麻省理工学院的许可证是一套具体的、标准化的条款,最终将秩序带入了一个混乱的机构特定的、随意的变化。 + +我们已经看到了它的方法,归因和版权通知通知知识产权管理的做法,学术,标准,商业和基础机构。 + +我们已经看到了麻省理工学院的许可证是如何免费授予所有人软件许可的,但前提是要保护许可人不受担保和责任的影响。 + +我们已经看到,尽管有一些刻薄的措辞和律师的矫揉造作,但一百七十一个小词可以完成大量的法律工作,通过密集的知识产权和合同丛林为开源软件扫清了一条道路。 +我非常感谢所有花时间阅读这篇相当长的文章的人,让我知道他们发现它很有用,并帮助改进它。一如既往,我欢迎您通过[e-mail][29]、[Twitter][30]和[GitHub][31]发表评论。 + + +有很多人问,他们在哪里可以读到更多的东西,或者找到其他许可证,比如 GNU 通用公共许可证或 Apache 2.0 许可证。无论你的兴趣是什么,我都会向你推荐以下书籍: + + * Andrew M. St. Laurent 的 [Understanding Open Source & Free Software Licensing][32], 来自 O’Reilly. + +我先说这本,因为虽然它有些过时,但它的方法也最接近上面使用的逐行方法。O'Reilly 已经把它[放在网上][33]。 + + * Heather Meeker’s [Open (Source) for Business][34] + +在我看来,这是迄今为止关于 GN U通用公共许可证和更广泛的 copyleft 的最佳著作。这本书涵盖了历史、许可证、它们的发展,以及兼容性和合规性。这本书是我给那些考虑或处理 GPL 的客户的书。 + + * Larry Rosen’s [Open Source Licensing][35], from Prentice Hall. + +一本很棒的第一本书,也可以免费[在线阅读][36]。对于从零开始的程序员来说,这是开源许可和相关法律的最好介绍。这本在一些具体细节上也有点过时了,但 Larry 的许可证分类法和对开源商业模式的简洁总结经得起时间的考验。 + + + +所有这些都对我作为一个开源许可律师的教育至关重要。它们的作者都是我的职业英雄。请读一读吧 — K.E.M + +我将此文章基于 [Creative Commons Attribution-ShareAlike 4.0 license][37] 授权 + + +-------------------------------------------------------------------------------- + +via: https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html + +作者:[Kyle E. Mitchell][a] +选题:[lujun9972][b] +译者:[bestony](https://github.com/bestony) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://kemitchell.com/ +[b]: https://github.com/lujun9972 +[1]: http://spdx.org/licenses/MIT +[2]: https://fedoraproject.org/wiki/Licensing:MIT?rd=Licensing/MIT +[3]: https://opensource.org +[4]: https://spdx.org +[5]: http://spdx.org/licenses/ +[6]: https://spdx.org/licenses/JSON +[7]: https://www.npmjs.com/package/licensor +[8]: https://www.apache.org/licenses/LICENSE-2.0 +[9]: https://www.gnu.org/licenses/gpl-3.0.en.html +[10]: http://spdx.org/licenses/BSD-4-Clause +[11]: https://spdx.org/licenses/BSD-3-Clause +[12]: https://spdx.org/licenses/BSD-2-Clause +[13]: http://www.isc.org/downloads/software-support-policy/isc-license/ +[14]: http://worksmadeforhire.com/ +[15]: https://www.eclipse.org/legal/epl-v10.html +[16]: https://www.apache.org/licenses/#clas +[17]: https://wiki.eclipse.org/ECA +[18]: https://en.wikipedia.org/wiki/Feist_Publications,_Inc.,_v._Rural_Telephone_Service_Co. +[19]: https://writing.kemitchell.com/2017/02/16/Against-Legislating-the-Nonobvious.html +[20]: http://developercertificate.org/ +[21]: https://github.com/berneout/berneout-pledge +[22]: https://github.com/berneout/authors-certificate +[23]: https://en.wikipedia.org/wiki/Immediately-invoked_function_expression +[24]: https://www.govinfo.gov/app/details/USCODE-2017-title35/USCODE-2017-title35-partIII-chap28-sec271 +[25]: https://www.govinfo.gov/app/details/USCODE-2017-title17/USCODE-2017-title17-chap1-sec106 +[26]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2314.&lawCode=COM +[27]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2315.&lawCode=COM +[28]: https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?sectionNum=2316.&lawCode=COM +[29]: mailto:kyle@kemitchell.com +[30]: https://twitter.com/kemitchell +[31]: https://github.com/kemitchell/writing/tree/master/_posts/2016-09-21-MIT-License-Line-by-Line.md +[32]: https://lccn.loc.gov/2006281092 +[33]: http://www.oreilly.com/openbook/osfreesoft/book/ +[34]: https://www.amazon.com/dp/1511617772 +[35]: https://lccn.loc.gov/2004050558 +[36]: http://www.rosenlaw.com/oslbook.htm +[37]: https://creativecommons.org/licenses/by-sa/4.0/legalcode \ No newline at end of file From 9e75686cb66639c02cc119fc40a67cfdaa5a9bc2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Jan 2021 20:54:45 +0800 Subject: [PATCH 011/213] APL --- sources/tech/20191226 How the Zen of Python handles errors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191226 How the Zen of Python handles errors.md b/sources/tech/20191226 How the Zen of Python handles errors.md index 030c889db3..1e7dc218eb 100644 --- a/sources/tech/20191226 How the Zen of Python handles errors.md +++ b/sources/tech/20191226 How the Zen of Python handles errors.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From acafb1de5f8b29579573bf71fc4740e1500251fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Jan 2021 22:50:58 +0800 Subject: [PATCH 012/213] TSL --- ...26 How the Zen of Python handles errors.md | 56 ------------------ ...26 How the Zen of Python handles errors.md | 57 +++++++++++++++++++ 2 files changed, 57 insertions(+), 56 deletions(-) delete mode 100644 sources/tech/20191226 How the Zen of Python handles errors.md create mode 100644 translated/tech/20191226 How the Zen of Python handles errors.md diff --git a/sources/tech/20191226 How the Zen of Python handles errors.md b/sources/tech/20191226 How the Zen of Python handles errors.md deleted file mode 100644 index 1e7dc218eb..0000000000 --- a/sources/tech/20191226 How the Zen of Python handles errors.md +++ /dev/null @@ -1,56 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How the Zen of Python handles errors) -[#]: via: (https://opensource.com/article/19/12/zen-python-errors) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -How the Zen of Python handles errors -====== -This is part of a special series about the Zen of Python focusing on the -10th and 11th principles: on the silence (or not) of errors. -![a checklist for a team][1] - -Handling "exceptional conditions" is one of the most debated issues in programming. That could be because the stakes are high: mishandled error values can bring down even the largest systems. Since "exception conditions," by nature, are the least tested but occur with unpleasant frequency, correctly handling them can often distinguish a system that horror stories are told about to a system that "just works." - -From Java's **checked** exceptions through Erlang's fault isolation to Haskell's **Maybe**, different languages have remarkably different attitudes to error handling. - -The [Zen][2] offers Python's meditation on the topic. - -### Errors should never pass silently… - -Before the Zen of Python was a twinkle in Tim Peters' eye, before Wikipedia became informally known as "wiki," the first WikiWiki site, [C2][3], existed as a trove of programming guidelines. These are principles that mostly came out of a [Smalltalk][4] programming community. Smalltalk's ideas influenced many object-oriented languages, Python included. - -The C2 wiki defines the Samurai Principle: "return victorious, or not at all." In Pythonic terms, it encourages eschewing sentinel values, such as returning **None** or **-1** to indicate an inability to complete the task, in favor of raising exceptions. A **None** is silent: it looks like a value and can be put in a variable and passed around. Sometimes, it is even a _valid_ return value. - -The principle here is that if a function cannot accomplish its contract, it should "fail loudly": raise an exception. The raised exception will never look like a possible value. It will skip past the **returned_value = call_to_function(parameter)** line and go up the stack, potentially crashing the program. - -A crash is straightforward to debug: there is a stack trace indicating the problem as well as the call stack. The failure might mean that a necessary condition for the program was not met, and human intervention is needed. It might mean that the program's logic is faulty. In either case, the loud failure is better than a hidden, "missing" value, infecting the program's valid data with **None**, until it is used somewhere and an error message says "**None does not have method split**," which you probably already knew. - -### Unless explicitly silenced. - -Exceptions sometimes need to be explicitly caught. We might anticipate some of the lines in a file are misformatted and want to handle those in a special way, maybe by putting them in a "lines to be looked at by a human" file, instead of crashing the entire program. - -Python allows us to catch exceptions with **except**. This means errors can be _explicitly_ silenced. This explicitness means that the **except** line is visible in code reviews. It makes sense to question why this is the right place to silence, and potentially recover from, the exception. It makes sense to ask if we are catching too many exceptions or too few. - -Because this is all explicit, it is possible for someone to read the code and understand which exceptional conditions are recoverable. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-errors - -作者:[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/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) -[2]: https://www.python.org/dev/peps/pep-0020/ -[3]: https://wiki.c2.com/ -[4]: https://en.wikipedia.org/wiki/Smalltalk diff --git a/translated/tech/20191226 How the Zen of Python handles errors.md b/translated/tech/20191226 How the Zen of Python handles errors.md new file mode 100644 index 0000000000..4bb8fcbeb1 --- /dev/null +++ b/translated/tech/20191226 How the Zen of Python handles errors.md @@ -0,0 +1,57 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How the Zen of Python handles errors) +[#]: via: (https://opensource.com/article/19/12/zen-python-errors) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Python 处理错误的原则 +====== + +> 这是 Python 之禅特别系列的一部分,重点是第十和第十一条原则:沉默的错误(或不沉默)。 + +![一个团队的检查表][1] + +处理“异常情况”是编程中争论最多的问题之一。这可能是因为风险很大:处理不当的错误值甚至可以使庞大的系统瘫痪。由于“异常情况”从本质上来说,是测试不足的,但发生的频率却令人不快,因此,是否正确处理它们往往可以将一个噩梦般的系统与一个“可以工作”的系统区分开来。 + +从 Java 的 **受检查的** 异常,到 Erlang 的故障隔离,再到 Haskell 的 **也许**,不同的语言对错误处理的态度截然不同。 + +这两条 [Python 之禅][2]是 Python 对这个话题的冥思。 + +### 错误绝不该悄悄传递...Errors should never pass silently… + +在 Python 之禅在 Tim Peters 眼里闪烁而出之前,在维基百科被俗称为“维基”之前,第一个维基网站 [C2][3] 就已经存在了,它是一个编程指南的宝库。这些原则大多来自于 [Smalltalk][4] 编程社区。Smalltalk 的思想影响了许多面向对象的语言,包括 Python。 + +C2 维基定义了武士原则Samurai Principle:“胜利归来,或者不归。”用 Python 人的术语来说,它鼓励摒弃哨兵值,比如返回 `None` 或 `-1` 来表示无法完成任务,而是采用引发异常。一个 `None` 是无声的:它看起来像一个值,可以放在一个变量中,然后到处传递。有时,它甚至是一个*有效*的返回值。 + +这里的原则是,如果一个函数不能完成它的契约,它应该“高调失败”:引发一个异常。引发的异常永远不会看起来像是一个可能的值。它将跳过 `returned_value = call_to_function(parameter)` 行,并上升到调用栈中,可能使程序崩溃。 + +崩溃的调试是很直接的:有一个堆栈跟踪指示问题以及调用堆栈。崩溃可能意味着程序的必要条件没有满足,需要人为干预。它可能意味着程序的逻辑有问题。无论是哪种情况,高调失败都比一个隐藏的、“缺失”的值要好。用 `None` 来感染程序的有效数据,直到它被用在某个地方,就如你可能已经知道的,错误信息会说 “**None 没有方法进行拆分**”。 + +### 除非显式消除Unless explicitly silenced + +有时需要显式地捕获异常。我们可能会预见到文件中的某些行格式错误,并希望以特殊的方式来处理它们,也许可以把它们放在一个“需要人来看看的行”的文件中,而不是让整个程序崩溃。 + +Python 允许我们用 `except` 来捕获异常。这意味着错误可以被*显式*静音。这种明确性意味着 `except` 行在代码审查中是可见的。质疑为什么应该在这里显式消除异常并从异常中恢复,是有意义的。自问我们是否捕获了太多或太少的异常也是有意义的。 + +因为这些全都是明确的,所以有人可以阅读代码并了解哪些异常是可以恢复的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-errors + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://www.python.org/dev/peps/pep-0020/ +[3]: https://wiki.c2.com/ +[4]: https://en.wikipedia.org/wiki/Smalltalk From 73ca7b8326b46859a74d965f8bb4386d4730b44e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 00:05:49 +0800 Subject: [PATCH 013/213] PRF @stevenzdg988 --- ...mating basic community management tasks.md | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/translated/tech/20200323 5 Python scripts for automating basic community management tasks.md b/translated/tech/20200323 5 Python scripts for automating basic community management tasks.md index 5eaaf9ad75..c83738c8e7 100644 --- a/translated/tech/20200323 5 Python scripts for automating basic community management tasks.md +++ b/translated/tech/20200323 5 Python scripts for automating basic community management tasks.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (5 Python scripts for automating basic community management tasks) @@ -10,21 +10,23 @@ 用于基本社区管理任务自动化的 5 个 Python 脚本 ====== -如果某些事情不得不重复做三遍,尝试使其自动化。 +> 如果某些事情不得不重复做三遍,尝试使其自动化。 ![人形符号][1] -我 [之前写过关于社区管理员的工作][2],如果你问 10 位社区管理员,你会得到 12 个不同的答案。你在任何给定的时刻都要做社区需要你做的事情。并且大多数可以重复。 +我 [之前写过关于社区管理员的工作][2],如果你问 10 位社区管理员,你会得到 12 个不同的答案。不过,大多数情况下,你做的是社区需要你在任何特定时刻做的事情。而且很多事情可能是重复的。 -当我成为系统管理员时,我遵循一个规则:如果某些事必须做三遍,我会尝试使其自动化。当然,如今,使用诸如 Ansible 这样的强大工具,这是一门完整的科学。 +当我还是系统管理员时,我遵循一个规则:如果某些事必须做三遍,我会尝试使其自动化。当然,如今,使用诸如 Ansible 这样的强大工具,就有了一整套科学的方法。 -我每天或每周要做的一些事情涉及在一些地方查找内容,然后生成摘要或该信息的报告发布到别处。这样的任务是自动化的理想选择。这些并不是 [难事][3],当我与同事共享其中一些脚本时,总是至少有一个能证明这是有用的。 +我每天或每周要做的一些事情涉及在一些地方查找内容,然后生成信息的摘要或报告,然后发布到别处。这样的任务是自动化的理想选择。这些并不是什么 [难事][3],当我与同事共享其中一些脚本时,总是至少有一个能证明这是有用的。 -[在 GitHub][4] 上,我有几个每周都要使用的脚本。他们都不是很复杂的,但每次都为我节省几分钟。其中一些是用 Perl 写的是因为我快 50 岁了。其中一些就在几年前是用 Python 写的,我决定需要学习 Python。概述如下: +[在 GitHub][4] 上,我有几个每周都要使用的脚本。它们都不是很复杂,但每次都为我节省几分钟。其中一些是用 Perl 写的,因为我快 50 岁了(这些是我早些年写的)。有些是用 Python 写的,因为几年前,我决定要学习 Python。 -### **[tshirts.py][5]** +以下是概述: -这个简单的脚本将为你定制一定数量的活动 T恤,告诉你尺寸分布是什么。将它们分布在一条正常的曲线(也称为 “钟形曲线”)上,以我的经验,这和一个正常的会议观众的实际需求非常吻合。如果在美国使用,则可能需要将脚本(中的值)调整的稍大一些;如果在欧洲使用,则可能需要将脚本(中的值)稍稍缩小一些。 YMMV。 +### tshirts.py + +这个简单的 [tshirts.py 脚本][5]会根据你要定制的活动 T 恤的数量,然后告诉你尺寸分布是什么。它将这些尺寸分布在一条正态曲线(也称为 “钟形曲线”)上,以我的经验,这和一个正常的会议观众的实际需求非常吻合。如果在美国使用,则可能需要将脚本中的值调整的稍大一些;如果在欧洲使用,则可能需要将脚本中的值稍稍缩小一些。你的情况也许不同。 用法: @@ -40,13 +42,13 @@ For a total of 300 shirts, order: 30.0 2xl ``` -### **[followers.py][6]** +### followers.py -该脚本为我提供了我关心的 Twitter 账号的关注者数量。 +[followers.py 脚本][6]为我提供了我关心的 Twitter 账号的关注者数量。 -该脚本只有 14 行,并不令人兴奋,但是它可能节省我十分钟的加载网页和查找数字的时间。 +该脚本只有 14 行,没什么复杂的,但是它可能节省我十分钟的加载网页和查找数字的时间。 -您需要编辑 `feed` 数组以添加您关心的帐户: +你需要编辑 `feed` 数组以添加你关心的帐户: ``` feeds = [ @@ -55,7 +57,7 @@ feeds = [         ]; ``` -注意:如果你在英语国家以外(的地区)运行它,则可能无法正常工作,因为它只是一个简单的屏幕抓取脚本,可读取 HTML 并查找其中包含的特定信息。因此,当输出使用其他语言时,正则表达式将不匹配。 +注意:如果你在英语国家以外的地方运行它,则可能无法正常工作,因为它只是一个简单的屏幕抓取脚本,它读取 HTML 并查找其中包含的特定信息。因此,当输出使用其他语言时,正则表达式可能不匹配。 用法: @@ -65,25 +67,27 @@ centosproject: 11,479 Followers centos: 18,155 Followers ``` -### **[get_meetups][7]** +### get_meetups -该脚本纳入另一种类别的脚本——API脚本。这个特定的脚本使用 [meetup.com][8](网站)API 寻找在特定区域和时间范围内有关特定主题的聚会,以便我可以向社区报告。您所依赖的许多服务都提供了 API,因此您的脚本可以查找信息,而无需手动浏览网页。学习如何使用这些 API 既令人沮丧又耗时,但是最终将获得可以节省大量时间的技能。 +[get_meetups 脚本][7]S 另一种类别的脚本 —— API脚本。这个特定的脚本使用 [meetup.com][8] 网站的 API 来寻找在特定区域和时间范围内特定主题的聚会,以便我可以将它报告给我的社区。你所依赖的许多服务都提供了 API,因此你的脚本可以查找信息,而无需手动查找网页。学习如何使用这些 API 既令人沮丧又耗时,但是最终将获得可以节省大量时间的技能。 -_免责声明:[meetup.com][8] 已于2019年8月更改了他们的 API,目前为止已经不能为新的 API 更新此脚本了,因此它实际上暂时不起作用。在接下来的几周内关注此版本的修复版本。_ +_免责声明:[meetup.com][8] 已于 2019 年 8 月更改了他们的 API,我还没有将这个脚本更新到新的API,所以它现在实际上并没有工作。在接下来的几周内请关注此版本的修复版本。_ -### **[centos-announcements.pl][9]** +### centos-announcements.pl -该脚本在我所使用的实例中是相当复杂的和非常明确的,但你可能有类似的情况。在本例中该脚本查看邮件列表存档(`centos-announce` 邮件列表),并查找具有特定格式的邮件,然后生成这些邮件的报告。报告有两种不同的格式——一种用于我的每月新闻通讯,另一种用于安排 Twitter 信息(借助于 Hootsuite)。 +[centos-announcements.pl 脚本][9]要复杂得多,而且对我的用例来说非常特殊,但你可能有类似的情况。在本例中该脚本查看邮件列表存档(`centos-announce` 邮件列表),并查找具有特定格式的邮件,然后生成这些邮件的报告。报告有两种不同的格式:一种用于我的每月新闻通讯,另一种用于安排 Twitter 信息(借助于 Hootsuite)。 -我使用 `Hootsuite` 为 Twitter 安排内容,它们具有便捷的 CSV(逗号分隔值)格式,你可以一次批量安排整整一周的推文。从不同数据源(比如:邮件列表,博客,其他网页)自动生成 CSV 格式可以节省大量时间。但是请注意,这可能仅应用于初稿,然后您可以对其进行检查和编辑,以便最终不会自动发布你不想要内容的推文。 -### **[reporting.pl][10]** +我使用 Hootsuite 为 Twitter 安排内容,它们具有便捷的 CSV(逗号分隔值)格式,你可以一次批量安排整整一周的推文。从各种数据源(比如:邮件列表、博客、其他网页)自动生成 CSV 格式可以节省大量时间。但是请注意,这可能只应该用于初稿,然后你可以对其进行检查和编辑,以便最终不会自动发布你不想要内容的推文。 -该脚本也非常符合我的特定需求,但是概念本身是通用的。我每月向 [CentOS SIG][11](特殊兴趣小组)发送邮件,这些邮件计划在给定的月份报告。该脚本只是告诉我本月有哪些 SIG,并记录需要发送给他们的电子邮件。 +### reporting.pl + +[reporting.pl 脚本][10]也是相当特定的,以满足我的特殊需求,但是这个概念本身是通用的。我每月向 [CentOS SIG][11](特殊兴趣小组)发送邮件,这些邮件计划在给定的月份报告。该脚本只是告诉我本月有哪些 SIG,并记录需要发送给他们的电子邮件。 但是,因以下两个原因,实际上并未发送该电子邮件。第一,我希望在消息发送之前对其进行编辑。第二,虽然发送电子邮件的脚本在过去很有效,但如今,很可能被当做垃圾邮件而被过滤。 -### 综上所述(总结) -该存储库中还有一些其他脚本或多或少是针对我的特定需求的,但是我希望其中至少有一个脚本对你有用,并且激发你使自己的某些需要自动化。我也希望看到你方便的自动化脚本存储库;在评论中链接他们! +### 总结 + +在这个存储库中还有一些其他脚本,这些脚本或多或少是针对我的特定需求的,但是我希望其中至少有一个脚本对你有用,并且希望这些脚本的多样性能激励你去自动化一些你自己的东西。我也希望看到你的自动化脚本存储库;在评论中链接他们! -------------------------------------------------------------------------------- @@ -92,7 +96,7 @@ via: https://opensource.com/article/20/3/automating-community-management-python 作者:[Rich Bowen][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 4fb308977f96334e5353c11bd0b3c7695bce911f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 00:06:58 +0800 Subject: [PATCH 014/213] PUB @stevenzdg988 https://linux.cn/article-13055-1.html --- ...ripts for automating basic community management tasks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20200323 5 Python scripts for automating basic community management tasks.md (97%) diff --git a/translated/tech/20200323 5 Python scripts for automating basic community management tasks.md b/published/20200323 5 Python scripts for automating basic community management tasks.md similarity index 97% rename from translated/tech/20200323 5 Python scripts for automating basic community management tasks.md rename to published/20200323 5 Python scripts for automating basic community management tasks.md index c83738c8e7..6c785a9020 100644 --- a/translated/tech/20200323 5 Python scripts for automating basic community management tasks.md +++ b/published/20200323 5 Python scripts for automating basic community management tasks.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (stevenzdg988) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13055-1.html) [#]: subject: (5 Python scripts for automating basic community management tasks) [#]: via: (https://opensource.com/article/20/3/automating-community-management-python) [#]: author: (Rich Bowen https://opensource.com/users/rbowen) @@ -12,7 +12,7 @@ > 如果某些事情不得不重复做三遍,尝试使其自动化。 -![人形符号][1] +![](https://img.linux.net.cn/data/attachment/album/202101/27/000544aakdc4mnmn6tzj8y.jpg) 我 [之前写过关于社区管理员的工作][2],如果你问 10 位社区管理员,你会得到 12 个不同的答案。不过,大多数情况下,你做的是社区需要你在任何特定时刻做的事情。而且很多事情可能是重复的。 From b05c5c4be2b3b198aadb1fdb20d7c7dd65773437 Mon Sep 17 00:00:00 2001 From: bestony Date: Wed, 27 Jan 2021 00:28:26 +0800 Subject: [PATCH 015/213] =?UTF-8?q?=E8=AE=A4=E9=A2=86=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/talk/20170928 The Lineage of Man.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20170928 The Lineage of Man.md b/sources/talk/20170928 The Lineage of Man.md index de2cc7515e..b51d67f4f9 100644 --- a/sources/talk/20170928 The Lineage of Man.md +++ b/sources/talk/20170928 The Lineage of Man.md @@ -92,7 +92,7 @@ via: https://twobithistory.org/2017/09/28/the-lineage-of-man.html 作者:[Two-Bit History][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[bestony](https://github.com/bestony) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 199876cc24f88ffbb6d734c1a00b4f5390d5a448 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Jan 2021 05:04:07 +0800 Subject: [PATCH 016/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210126=20?= =?UTF-8?q?Use=20your=20Raspberry=20Pi=20as=20a=20productivity=20powerhous?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md --- ...spberry Pi as a productivity powerhouse.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md diff --git a/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md b/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md new file mode 100644 index 0000000000..cb0535cba7 --- /dev/null +++ b/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use your Raspberry Pi as a productivity powerhouse) +[#]: via: (https://opensource.com/article/21/1/raspberry-pi-productivity) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Use your Raspberry Pi as a productivity powerhouse +====== +The Raspberry Pi has come a long way from being primarily for hacking +and hobbyists to a solid choice for a small productive workstation. +![Team checklist and to dos][1] + +In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 16 of 21 Days of Productivity in 2021. + +The [Raspberry Pi][2] is a pretty amazing little computer—small, surprisingly powerful, and very easy to set up and use. I have used them for home automation projects, dashboards, and a dedicated media player. But can it be a productivity powerhouse as well? + +The answer is, quite simply, yes. + +![Geary and Calendar apps on the Raspberry Pi][3] + +Geary and Calendar (Kevin Sonney, [CC BY-SA 4.0][4]) + +The base [Raspbian][5] install includes [Claws Mail][6], which is a lightweight mail client. The UI is a little dated, and it is very bare-bones. If you are a [Mutt user][7], this will probably meet your needs just fine. + +I prefer to install [Geary][8] since it is also lightweight and has a modern interface. Also, unlike Claws, Geary has support for rich-text (HTML) email by default. I dislike rich-text email, but it has become necessary, so having good support for it is critical. + +The default Raspbian installation does not include a calendar, so I added [GNOME Calendar][9] since it can talk to remote services (since almost all of my calendars are on cloud providers). + +![GTG and GNote open on Raspberry Pi][10] + +GTG and GNote (Kevin Sonney, [CC BY-SA 4.0][4]) + +What about notes and to-do lists? There are a lot of options out there, but I'm a fan of [GNote][11] for notes and [Getting-Things-GNOME!][12] for to-do lists. Both are reasonably lightweight and can sync to each other, as well as to other services. + +You'll note that I'm using quite a few GNOME applications here. Why not just install the full GNOME Desktop? On the Raspberry Pi 4 with 4Gb (or 8Gb) of memory, GNOME works exceptionally well. You will need to take some extra steps to disable the default wifi setup on Raspbian and replace it with Network Manager, but that is well documented on the internet and really easy. + +Included with GNOME is [Evolution][13], which combines mail, calendars, notes, to-do lists, and contact management into a single app. It is a little heavy compared to Geary and GNOME Calendar, but it is rock solid on the Raspberry Pi 4. This was surprising to me since I'm used to Evolution being kind of a resource hog, but the Raspberry Pi 4 runs it as well as my brand-name laptops with resources to spare. + +![Evolution on Raspbian][14] + +Evolution on Raspbian (Kevin Sonney, [CC BY-SA 4.0][4]) + +The Raspberry Pi has come a long way in the last few years and has gone from being primarily for hacking and hobbyists to a solid choice for a small productive workstation. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/raspberry-pi-productivity + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://www.raspberrypi.org/ +[3]: https://opensource.com/sites/default/files/day16-image1.png +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.raspbian.org/ +[6]: https://www.claws-mail.org/ +[7]: http://www.mutt.org/ +[8]: https://wiki.gnome.org/Apps/Geary +[9]: https://wiki.gnome.org/Apps/Calendar +[10]: https://opensource.com/sites/default/files/day16-image2.png +[11]: https://wiki.gnome.org/Apps/Gnote +[12]: https://wiki.gnome.org/Apps/GTG +[13]: https://opensource.com/business/18/1/desktop-email-clients +[14]: https://opensource.com/sites/default/files/day16-image3.png From 00deee80a17c58e0e01cda7d584705bdf6bd4e05 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Jan 2021 05:04:25 +0800 Subject: [PATCH 017/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210126=20?= =?UTF-8?q?Automate=20setup=20and=20delivery=20for=20virtual=20machines=20?= =?UTF-8?q?in=20the=20cloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md --- ...ivery for virtual machines in the cloud.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md diff --git a/sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md b/sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md new file mode 100644 index 0000000000..65f7fe07e8 --- /dev/null +++ b/sources/tech/20210126 Automate setup and delivery for virtual machines in the cloud.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Automate setup and delivery for virtual machines in the cloud) +[#]: via: (https://opensource.com/article/21/1/testcloud-virtual-machines) +[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro) + +Automate setup and delivery for virtual machines in the cloud +====== +Get a cloud image ready in minutes by using Testcloud to automate the +setup process and deliver a VM ready to run. +![Looking at a map][1] + +If you're a developer or hobbyist using a Fedora [qcow2 image][2] for the cloud, you always have to do a bunch of initial configuration before an image is ready to use. I know this all too well, and I was eager to find a way to make the setup process simpler. As it happens, the entire Fedora quality assurance team feels the same way, so we developed [Testcloud][3]. + +Testcloud is a tool that makes it easy to get a cloud image ready for testing in minutes. It automates the setup process and delivers a virtual machine (VM) ready to run on the cloud with just a few commands.  + +Testcloud: + + 1. Downloads the qcow2 image + 2. Creates the instance with the name of your choice + 3. Creates a user named `fedora` with the password of `passw0rd` + 4. Assigns an IP, which you can later use to secure shell (SSH) into the cloud + 5. Starts, stops, removes, and lists an instance + + + +### Install Testcloud + +To start your journey, you first must install the Testcloud package. You can install it from a terminal or through the software application. In both cases, the package name is `testcloud`. Install with: + + +``` +`$ sudo dnf install testcloud -y` +``` + +Once the installation is complete, add your desired user to the `testcloud` group, which helps Testcloud automate the rest of the process. Execute these two commands to add your user to the `testcloud` group and restart the session with the updated group privileges: + + +``` +$ sudo usermod -a -G testcloud $USER +$ su - $USER +``` + +![Add user to testcloud group][4] + +(Sumantro Mukherjee, [CC BY-SA 4.0][5]) + +### Spin cloud images like a pro + +Once your user has the required group permissions, create an instance: + + +``` +`$ testcloud instance create -u ` +``` + +Alternatively, you can use `fedora:latest/fedora:XX` (where `XX` is your Fedora release) instead of the full URL: + + +``` +`$ testcloud instance create -u fedora:latest` +``` + +This returns the IP address of your VM: + + +``` +$ testcloud instance create testcloud272593 -u   +[...] +INFO:Successfully booted instance testcloud272593 +The IP of vm testcloud272593:  192.168.122.202 +\------------------------------------------------------------ +To connect to the VM, use the following command (password is 'passw0rd'): +ssh fedora@192.168.122.202 +\------------------------------------------------------------ +``` + +You can log in as the default user `fedora` with the password `passw0rd` (note the zero). You can get to the VM with `ssh`, `virt-manager`, or any other method that supports connecting to libvirt machines. + +Another simple way to create a Fedora cloud is: + + +``` +$ testcloud instance create testcloud193 -u fedora:33 +  +WARNING:Not proceeding with backingstore cleanup because there are some testcloud instances running. +You can fix this by following command(s): +testcloud instance stop testcloud272593 + +DEBUG:Local downloads will be stored in /var/lib/testcloud/backingstores. +DEBUG:successfully changed SELinux context for image /var/lib/testcloud/backingstores/Fedora-Cloud-Base-33-1.2.x86_64.qcow2 +DEBUG:Creating instance directories +DEBUG:creating seed image /var/lib/testcloud/instances/testcloud193/testcloud193-seed.img +INFO:Seed image generated successfully +INFO:Successfully booted instance testcloud193 +The IP of vm testcloud193:  192.168.122.225 +\------------------------------------------------------------ +To connect to the VM, use the following command (password is 'passw0rd'): +ssh fedora@192.168.122.225 +\------------------------------------------------------------ +``` + +### Play with instances + +Testcloud can be used to administer instances. This includes activities such as listing images or stopping and starting an instance. + +To list instances, use the `list` subcommand: + + +``` +$ testcloud instance list                 +Name                            IP                      State     +\------------------------------------------------------------ +testcloud272593                 192.168.122.202         running     +testcloud193                    192.168.122.225         running     +testcloud252793                 192.168.122.146         shutoff     +testcloud93                             192.168.122.152         shutoff +``` + +To stop a running instance: + + +``` +$ testcloud instance stop testcloud193   +DEBUG:stop instance: testcloud193 +DEBUG:stopping instance testcloud193. +``` + +To remove an instance: + + +``` +$ testcloud instance destroy testcloud193   +DEBUG:remove instance: testcloud193 +DEBUG:removing instance testcloud193 from libvirt. +DEBUG:Unregistering instance from libvirt. +DEBUG:removing instance /var/lib/testcloud/instances/testcloud193 from disk +``` + +To reboot a running instance: + + +``` +$ testcloud instance reboot testcloud93                                                                                         +DEBUG:stop instance: testcloud93 +[...] +INFO:Successfully booted instance testcloud93 +The IP of vm testcloud93:  192.168.122.152 +usage: testcloud [-h] {instance,image} ... +``` + +Give Testcloud a try and let me know what you think in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/testcloud-virtual-machines + +作者:[Sumantro Mukherjee][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/sumantro +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://en.wikipedia.org/wiki/Qcow +[3]: https://pagure.io/testcloud +[4]: https://opensource.com/sites/default/files/uploads/adduser.png (Add user to testcloud group) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ From 15cc4b6070f40faa89ac45693fcc6f26cc403a0f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Jan 2021 05:04:43 +0800 Subject: [PATCH 018/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210126=20?= =?UTF-8?q?Write=20GIMP=20scripts=20to=20make=20image=20processing=20faste?= =?UTF-8?q?r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210126 Write GIMP scripts to make image processing faster.md --- ...scripts to make image processing faster.md | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 sources/tech/20210126 Write GIMP scripts to make image processing faster.md diff --git a/sources/tech/20210126 Write GIMP scripts to make image processing faster.md b/sources/tech/20210126 Write GIMP scripts to make image processing faster.md new file mode 100644 index 0000000000..a4b5adc523 --- /dev/null +++ b/sources/tech/20210126 Write GIMP scripts to make image processing faster.md @@ -0,0 +1,271 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Write GIMP scripts to make image processing faster) +[#]: via: (https://opensource.com/article/21/1/gimp-scripting) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Write GIMP scripts to make image processing faster +====== +Learn GIMP's scripting language Script-Fu by adding an effect to a batch +of images. +![Painting art on a computer screen][1] + +Some time ago, I wanted to give a blackboard-style look to a typeset equation. I started playing around with the [GNU Image Manipulation Program (GIMP)][2] and was satisfied with the result. The problem was that I had to perform several actions on the image, I wanted to use this style again, and I did not want to repeat the steps for all the images. Besides, I was sure that I would forget them in no time. + +![Fourier transform equations][3] + +Fourier transform equations (Cristiano Fontana, [CC BY-SA 4.0][4]) + +GIMP is a great open source image editor. Although I have been using it for years, I had never investigated its batch-processing abilities nor its [Script-Fu menu][5]. This was the perfect chance to explore them. + +### What is Script-Fu? + +[Script-Fu][6] is the scripting language built into GIMP. It is an implementation of the [Scheme][7] programming language. If you have never used Scheme, give it a try, as it can be very useful. I think Script-Fu is a great way to start because it has an immediate effect on image processing, so you can feel productive very quickly. You can also write scripts in [Python][8], but Script-Fu is the default option. + +To help you get acquainted with Scheme, GIMP's documentation offers an [in-depth tutorial][9]. Scheme is a [Lisp][10]-like language, so a major characteristic is that it uses a [prefix notation][11] and a [lot of parentheses][12]. Functions and operators are applied to a list of operands by prefixing them: + + +``` +(function-name operand operand ...) + +(+ 2 3) +↳ Returns 5 + +(list 1 2 3 5) +↳ Returns a list containing 1, 2, 3, and 5 +``` + +It took me a while to find the documentation for the full list of GIMP's functions, but it was actually straightforward. In the **Help** menu, there is a **Procedure Browser** with very extensive and detailed documentation about all the possible functions. + +![GIMP Procedure Browser][13] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +### Accessing GIMP's batch mode + +You can run GIMP with batch mode enabled by using the `-b` option. The `-b` option's argument can be the script you want to run or a dash (`-`) that makes GIMP launch in an interactive mode instead of the command line. Normally when you start GIMP, it loads its graphical user interface (GUI), but you can disable that with the `-i` option. + +### Writing your first script + +Create a file called `chalk.scm` and save it to the `scripts` folder found in the **Preferences** window under **Folders → Scripts**. In my case, it is at `$HOME/.config/GIMP/2.10/scripts`. + +Inside the `chalk.scm` file, write your first script with: + + +``` +(define (chalk filename grow-pixels spread-amount percentage) +   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) +          (drawable (car (gimp-image-get-active-layer image))) +          (new-filename (string-append "modified_" filename))) +     (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) +     (gimp-selection-grow image grow-pixels) +     (gimp-context-set-foreground '(0 0 0)) +     (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) +     (gimp-selection-none image) +     (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) +     (gimp-drawable-invert drawable TRUE) +     (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) +     (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) +     (gimp-image-delete image))) +``` + +### Defining the script variables + +In the script, the `(define (chalk filename grow-pixels spread-amound percentage) ...)` function defines a new function called `chalk` that accepts the parameters: `filename`, `grow-pixels`, `spread-amound`, and `percentage`. Everything else inside the `define` function is the body of the `chalk` function. You might have noticed that variables with long names are spelled with dashes between the words; this is the idiomatic style of Lisp-like languages. + +The `(let* ...)` function is a special procedure that allows you to define some temporary variables that are valid only inside the body. In this case, the variables are `image`, `drawable`, and `new-filename`. It loads the image with `gimp-file-load`, which returns a list that includes the image, then it selects the first entry with the `car` function. Then, it selects the first active layer and stores its reference in the `drawable` variable. Finally, it defines the string containing the new filename of the resulting image. + +To help you better understand the procedure, I'll break it down. First, start GIMP with the GUI enabled and the Script-Fu console, which is found in **Filters → Script-Fu → Console**. In this case, you cannot use `let*` because the variables must be persistent. Define the `image` variable using the `define` function, and give it the proper path to find the image: + + +``` +`(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png")))` +``` + +It appears that nothing has happened in the GUI, but the image is loaded. You need to enable the image display with: + + +``` +`(gimp-display-new image)` +``` + +![GUI with the displayed image][14] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Now, get the active layer and store it in the `drawable` variable: + + +``` +`(define drawable (car (gimp-image-get-active-layer image)))` +``` + +Finally, define the image's new filename: + + +``` +`(define new-filename "modified_Fourier.png")` +``` + +Here is what you should see in the Script-Fu console after running these commands: + +![Script-Fu console][15] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Before acting on the image, you need to define the variables that would be defined as the function arguments in the script: + + +``` +(define grow-pixels 2) +(define spread-amount 4) +(define percentage 3) +``` + +### Acting on the image + +Now that all the relevant variables are defined, you can act on the image. The script's actions can be executed directly on the console. The first step is to select the color black on the active layer. The color is written as a list of three numbers—either as `(list 0 0 0)` or `'(0 0 0)`: + + +``` +`(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0))` +``` + +![Image with the selected color][16] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Grow the selection by two pixels: + + +``` +`(gimp-selection-grow image grow-pixels)` +``` + +![Image with the selected color][17] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Set the foreground color to black, and fill the selection with it: + + +``` +(gimp-context-set-foreground '(0 0 0)) +(gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) +``` + +![Image with the selection filled with black][18] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Delete the selection: + + +``` +`(gimp-selection-none image)` +``` + +![Image with no selection][19] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Move the pixels around randomly: + + +``` +`(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount)` +``` + +![Image with pixels moved around][20] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Invert the image colors: + + +``` +`(gimp-drawable-invert drawable TRUE)` +``` + +![Image with pixels moved around][21] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Randomize the pixels: + + +``` +`(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0)` +``` + +![Image with pixels moved around][22] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +Save the image to a new file: + + +``` +`(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename)` +``` + +![Equations of the Fourier transform and its inverse][23] + +Fourier transform equations (Cristiano Fontana, [CC BY-SA 4.0][4]) + +### Running the script in batch mode + +Now that you know what the script does, you can run it in batch mode: + + +``` +`gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)'` +``` + +After the `chalk` function runs, it calls a second function with the `-b` option to tell GIMP to quit: `gimp-quit`. + +### Learn more + +This tutorial showed you how to get started with GIMP's built-in scripting features and introduced Script-Fu, GIMP's Scheme implementation. If you want to move forward, I suggest you look at the official documentation and its [tutorial][9]. If you are not familiar with Scheme or Lisp, the syntax could be a little intimidating at first, but I suggest you give it a try anyway. It might be a nice surprise. + +Professional design software like Photoshop is terrific, but it’s also expensive. What do you do... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/gimp-scripting + +作者:[Cristiano L. Fontana][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) +[2]: https://www.gimp.org/ +[3]: https://opensource.com/sites/default/files/uploads/fourier.png (Fourier transform equations) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://docs.gimp.org/en/gimp-filters-script-fu.html +[6]: https://docs.gimp.org/en/gimp-concepts-script-fu.html +[7]: https://en.wikipedia.org/wiki/Scheme_(programming_language) +[8]: https://docs.gimp.org/en/gimp-filters-python-fu.html +[9]: https://docs.gimp.org/en/gimp-using-script-fu-tutorial.html +[10]: https://en.wikipedia.org/wiki/Lisp_%28programming_language%29 +[11]: https://en.wikipedia.org/wiki/Polish_notation +[12]: https://xkcd.com/297/ +[13]: https://opensource.com/sites/default/files/uploads/procedure_browser.png (GIMP Procedure Browser) +[14]: https://opensource.com/sites/default/files/uploads/gui01_image.png (GUI with the displayed image) +[15]: https://opensource.com/sites/default/files/uploads/console01_variables.png (Script-Fu console) +[16]: https://opensource.com/sites/default/files/uploads/gui02_selected.png (Image with the selected color) +[17]: https://opensource.com/sites/default/files/uploads/gui03_grow.png (Image with the selected color) +[18]: https://opensource.com/sites/default/files/uploads/gui04_fill.png (Image with the selection filled with black) +[19]: https://opensource.com/sites/default/files/uploads/gui05_no_selection.png (Image with no selection) +[20]: https://opensource.com/sites/default/files/uploads/gui06_spread.png (Image with pixels moved around) +[21]: https://opensource.com/sites/default/files/uploads/gui07_invert.png (Image with pixels moved around) +[22]: https://opensource.com/sites/default/files/uploads/gui08_hurl.png (Image with pixels moved around) +[23]: https://opensource.com/sites/default/files/uploads/modified_fourier.png (Equations of the Fourier transform and its inverse) From 29be19cf27aaf6279d611fcede77c9d6f9204fa9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Jan 2021 08:52:53 +0800 Subject: [PATCH 019/213] translated --- ... tips for automating your email filters.md | 61 ------------------- ... tips for automating your email filters.md | 60 ++++++++++++++++++ 2 files changed, 60 insertions(+), 61 deletions(-) delete mode 100644 sources/tech/20210122 3 tips for automating your email filters.md create mode 100644 translated/tech/20210122 3 tips for automating your email filters.md diff --git a/sources/tech/20210122 3 tips for automating your email filters.md b/sources/tech/20210122 3 tips for automating your email filters.md deleted file mode 100644 index 0d65a87577..0000000000 --- a/sources/tech/20210122 3 tips for automating your email filters.md +++ /dev/null @@ -1,61 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 tips for automating your email filters) -[#]: via: (https://opensource.com/article/21/1/email-filter) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -3 tips for automating your email filters -====== -Trim down that email and make your life easier with these simple -suggestions. -![gears and lightbulb to represent innovation][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 12 of 21 Days of Productivity in 2021. - -If there is one thing I love, it is automation. I will automate away small tasks whenever I can. Get up early to open the doors to our chicken coops? I bought a door that opens and closes at sunrise and sunset. Stream the chickens live every day from dawn to dusk? A little time with Node-RED and [OBS-Websockets][2], and it takes care of itself. - -And then we have email. A few days ago, I wrote about processing email, and also about labels and folders. With a little up-front work, you can automate away a LOT of the overhead of managing email as it comes in. - -![Author has 480 filters][3] - -Yes, I really do have that many filters.  (Kevin Sonney, [CC BY-SA 4.0)][4] - -There are two main ways to filter your email: On the server or on the client. I prefer to do it on the server since I am constantly trying new and different email clients (no, really, I think I've used five different clients this week alone. I might have a problem). - -Either way, there are several things I like to do with my email rules to make my email easier to navigate and to keep my inbox uncluttered. - - 1. Move the messages that are not urgent to a "Read Later" folder. In my case, this includes notifications from social networks, newsletters, and mailing lists. - 2. Tag or label messages by list or subject. I belong to a couple of organizations, and while they often end up in the "Read Later" folder, I will add a second or third tag or label to say what the source or project is about to help find related things when searching. - 3. Don't overcomplicate the rules. This idea is one I have a difficult time with. I want to add all the possible situations that should send something to a folder into one rule. Having one big rule just makes it harder to fix if something goes wrong or if something needs to be added or removed. - - - -![Unsubscribe from email][5] - -Click it, click it good! (Kevin Sonney, [CC BY-SA 4.0][4]) - -With all that being said, there is one other thing I have been doing that has helped reduce my time spent on email: Unsubscribing from things. That mailing list I was interested in two years ago isn't interesting anymore, so out it goes. That product update newsletter for the item I stopped using last year? No more! It has been positively liberating. I try to evaluate if the email messages from lists are (still) useful or not a few times a year. - -Filters and rules can be very powerful tools for keeping your email focused and reducing the time spent on them. And clicking the unsubscribe button is liberating. Try it and see! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/email-filter - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) -[2]: https://opensource.com/article/20/6/obs-websockets-streaming -[3]: https://opensource.com/sites/default/files/day12-image1_0.png -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/day12-image2_0.png diff --git a/translated/tech/20210122 3 tips for automating your email filters.md b/translated/tech/20210122 3 tips for automating your email filters.md new file mode 100644 index 0000000000..cbd6589161 --- /dev/null +++ b/translated/tech/20210122 3 tips for automating your email filters.md @@ -0,0 +1,60 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 tips for automating your email filters) +[#]: via: (https://opensource.com/article/21/1/email-filter) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +3 个自动化电子邮件过滤器的技巧 +====== +通过这些简单的建议,减少你的电子邮件并让你的生活更轻松。 +![gears and lightbulb to represent innovation][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十二天。 + +如果有一件事是我喜欢的,那就是自动化。只要有机会,我就会把小任务自动化掉。早起打开鸡舍的门?我买了一扇门,可以在日出和日落时开门和关门。每天从早到晚实时监控鸡群?用 Node-RED 和 [OBS-Websockets][2] 稍微花点时间,就能搞定。 + +我们还有电子邮件。几天前,我写过关于处理邮件的文章,也写过关于标签和文件夹的文章。只要做一点前期的工作,你就可以在邮件进来的时候,你就可以自动摆脱掉大量管理邮件的开销。 + +![Author has 480 filters][3] + +是的,我有很多过滤器。(Kevin Sonney, [CC BY-SA 4.0][4]) + +有两种主要方式来过滤你的电子邮件:在服务端或者客户端上。我更喜欢在服务端上做,因为我不断地在尝试新的和不同的电子邮件客户端。(不,真的,我光这个星期就已经使用了五个不同的客户端。我可能有问题。) + +无论哪种方式,我都喜欢用电子邮件规则做几件事,以使我的电子邮件更容易浏览,并保持我的收件箱不混乱。 + + 1. 将不紧急的邮件移到”稍后阅读“文件夹中。对我而言,这包括来自社交网络、新闻简报和邮件列表的通知。 + 2. 按列表或主题给消息贴上标签。我属于几个组织,虽然它们经常会被放在”稍后阅读“文件夹中,但我会添加第二个或第三个标签,以说明该源或项目的内容,以帮助搜索时找到相关的东西。 + 3. 不要把规则搞得太复杂。这个想法让我有一段困难的时间。我想把邮件发送到某个文件夹的所有可能情况都加到一个规则里。如果有什么问题或需要添加或删除的东西,有一个大规则只是让它更难修复。 + + + +![Unsubscribe from email][5] + +点击它,点击它就行!(Kevin Sonney, [CC BY-SA 4.0][4]) + +说了这么多,还有一件事我一直在做,它有助于减少我花在电子邮件上的时间:退订邮件。两年前我感兴趣的那个邮件列表已经不感兴趣了,所以就不订阅了。产品更新通讯是我去年停止使用的商品?退订!这一直在积极解放。我每年都会试着评估几次列表中的邮件信息是否(仍然)有用。 + +过滤器和规则可以是非常强大的工具,让你的电子邮件保持集中,减少花在它们身上的时间。而点击取消订阅按钮是一种解放。试试就知道了! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/email-filter + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: https://opensource.com/article/20/6/obs-websockets-streaming +[3]: https://opensource.com/sites/default/files/day12-image1_0.png +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/day12-image2_0.png From 244ce91a9eb36fc8b025358939cbd05d30dfdb80 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Jan 2021 09:00:36 +0800 Subject: [PATCH 020/213] translating --- sources/tech/20210125 Use Joplin to find your notes faster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210125 Use Joplin to find your notes faster.md b/sources/tech/20210125 Use Joplin to find your notes faster.md index 02a50bcbc3..4d8e367129 100644 --- a/sources/tech/20210125 Use Joplin to find your notes faster.md +++ b/sources/tech/20210125 Use Joplin to find your notes faster.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 990e45508a66f5869ccc813feb6e38b3d2057ca9 Mon Sep 17 00:00:00 2001 From: AnyISalIn Date: Wed, 27 Jan 2021 13:01:36 +0800 Subject: [PATCH 021/213] Translated --- ...122 How to implement a DevOps toolchain.md | 96 ------------------- ...122 How to implement a DevOps toolchain.md | 95 ++++++++++++++++++ 2 files changed, 95 insertions(+), 96 deletions(-) delete mode 100644 sources/tech/20210122 How to implement a DevOps toolchain.md create mode 100644 translated/tech/20210122 How to implement a DevOps toolchain.md diff --git a/sources/tech/20210122 How to implement a DevOps toolchain.md b/sources/tech/20210122 How to implement a DevOps toolchain.md deleted file mode 100644 index 9ed74d5e23..0000000000 --- a/sources/tech/20210122 How to implement a DevOps toolchain.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to implement a DevOps toolchain) -[#]: via: (https://opensource.com/article/21/1/devops-tool-chain) -[#]: author: (Tereza Denkova https://opensource.com/users/tereza-denkova) - -How to implement a DevOps toolchain -====== -A fully enabled DevOps toolchain propels your innovation initiatives -with prompt deployment and cost savings. -![Wratchet set tools][1] - -Organizations from all industries and of all sizes strive to deliver quality software solutions faster. This guarantees not only their survival but also success in the global marketplace. DevOps can help them chart an optimal course. - -DevOps is a system where different processes are supported by tools that work in a connected chain to deliver projects on time and at a lower cost. - -At the IT services company [Accedia][2], where I work, we support our clients in implementing a fully-enabled DevOps toolchain that enables them to meet and often surpass their business objectives. In this article, I share with you the key things I have learned from our DevOps projects so far.  - -### What is a DevOps toolchain? - -A good DevOps toolchain is a progression of different DevOps tools used to address a specific business challenge. Connected in a chain, they guarantee a profitable cycle between the front-end and back-end developers, quality analyzers, and customers. The goal is to automate development and deployment processes to ensure the rapid, reliable, and budget-friendly delivery of innovative solutions. - -We found out that building a successful DevOps toolchain is not a simple undertaking. It takes experimentation and nonstop refinement to guarantee that essential processes are fully automated. - -### Why you need a DevOps toolchain - -A DevOps toolchain automates all of the technical elements in your workflow. It also gets different teams on the same page so that you can focus on a business strategy to drive your organization into the future. - -We have come to identify five all the more valid benefits in support of the DevOps toolchain implementation. You can use them to convince your management that it is worth the time and resources which will be invested in developing it:  - - 1. **Faster and more efficient product deployments:** DevOps tools automate most of the software development process. This results in the agile delivery of innovative products and solutions that leave the business far ahead of the competition. - 2. **Budget and time optimization:** Automating manual tasks ensures that your organization saves time and resources. Once there are no additional costs incurred from natural human errors or insufficient time management, the budget is naturally optimized. - 3. **Efficient development:** A DevOps toolchain makes the development process more efficient by removing unnecessary delays between the different aspects of development work. The work of front-end and back-end developers and quality testers is synchronized, so no one waits for the other team members to deliver their part so they can take over. - 4. **Faster deployment means higher quality:** A DevOps toolchain guarantees that defects are resolved quickly and skillfully to achieve the best quality with a faster deployment process. How? It enables the generation of targeted alerts that notify your team of major incidents. This allows you to proactively stop potential problems from escalating and damaging your customer service. - 5. **Timely incident management:** A DevOps toolchain helps refine your incident management record. It does this by identifying IT incidents and escalating them specifically towards the right team members, then following through until the issues are resolved. This means messages are received and acted upon quickly because they're correctly targeted. - - - -### A DevOps toolchain in action - -My team isn't new to DevOps. We've been agile for a long time, and we've always been keen to explore optimal workflows. In our experience, increasing application complexity increases the need for automation. - -Here's a toolchain we set up for a client. The project included developing a mobile factoring solution that links all participants in a financial transaction—seller, buyer, and bank. The client wanted to make the whole experience user-friendly by dynamically responding to user feedback and reducing downtime to a minimum. My team designed a toolchain to automate app maintenance and deployment of new features. - -![Accedia's DevOps toolchain][3] - -(Accedia, [CC BY-NC-SA 4.0][4]) - - 1. First, the team wrote automated tests that immediately identified changes to the application's initial version (the **source control/version control DevOps** phase). - 2. Once the new version was ready, the code was committed to GitLab. - 3. Through GitLab, the commit automatically started a Jenkins build. - 4. In **continuous integration**, the new code version was tested with [Chai][5] and [Mocha][6] to check whether it operated correctly. - 5. When the tests passed successfully, the **continuous delivery phase** automatically started and created a ready-to-use Docker image in Sonatype's [Nexus][7]. (This is available both as a free and open source tool and as a paid service from Sonatype.) - 6. Finally, the new version of the application was downloaded from Nexus and deployed to a live environment, e.g., [Docker][8] containers (the **continuous deployment phase**). - - - -In short, every time someone makes a new commit in the repository where the team uploads any new code versions, functions, upgrades, bug fixes, etc., the app package is automatically updated and delivered to clients. - -This system has proficient incident control to ensure rapid deployment but not at the expense of quality. It's dynamic in responding to user feedback, meaning that new functions and updates of old ones are released in half the time, while downtime is reduced to a minimum. - -### To wrap it up - -A fully enabled and properly implemented DevOps toolchain propels your innovation initiatives from start to end and ensures prompt deployment. - -Your toolchain will look different than this, depending on your requirements, but I hope seeing our workflow gives you a sense of how to approach automation as a solution. - -* * * - -_This was written in collaboration with Vladimir Vladimirov, senior software consultant at Accedia, who has extensive experience in CI/CD, DevOps processes, and automating software delivery. It is also based on [5 good reasons why you need a DevOps toolchain][9] from Accedia's blog and is reused under a [CC BY-NC-SA 4.0][4] license._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/devops-tool-chain - -作者:[Tereza Denkova][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/tereza-denkova -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4 (Wratchet set tools) -[2]: https://accedia.com/services/operations/devops/ -[3]: https://opensource.com/sites/default/files/uploads/devopstoolchain.png (Accedia's DevOps toolchain) -[4]: https://creativecommons.org/licenses/by-nc-sa/4.0/ -[5]: https://www.chaijs.com/ -[6]: https://mochajs.org/ -[7]: https://www.sonatype.com/nexus/repository-oss -[8]: https://opensource.com/resources/what-docker -[9]: https://accedia.com/blog/5-good-reasons-why-you-need-a-devops-toolchain/ diff --git a/translated/tech/20210122 How to implement a DevOps toolchain.md b/translated/tech/20210122 How to implement a DevOps toolchain.md new file mode 100644 index 0000000000..22f1430e3c --- /dev/null +++ b/translated/tech/20210122 How to implement a DevOps toolchain.md @@ -0,0 +1,95 @@ +[#]: collector: (lujun9972) +[#]: translator: (AnyISalIn) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to implement a DevOps toolchain) +[#]: via: (https://opensource.com/article/21/1/devops-tool-chain) +[#]: author: (Tereza Denkova https://opensource.com/users/tereza-denkova) + +如何实现 DevOps 工具链 +====== +一套完整的 DevOps 工具链有助于推动业务创新 +快速部署并且节省成本 +![Wratchet set tools][1] + +不同规模和不同行业组织都致力于为提高软件交付的速度和质量提供解决方案。这不仅保证了他们的生存还令他们在全球市场取得了成功。DevOps 可以帮助他们规划最佳路线。 + +DevOps 是一个系统,通过引入不同的工具链连接不同工作流程,以便及时交付项目并降低所需的开销。 + +在我工作的 IT 服务公司 [Accedia][2],我们会帮助客户落地一套完整的 DevOps 工具链,这套工具链能帮助他们达到甚至超越他们的业务目标。在这篇文章,我会分享目前为止从 DevOps 项目中汲取的经验。 + +### DevOps 工具链是什么? +一套完善的 DevOps 工具链可以在不同阶段中使用不同的 DevOps 工具来解决特定的业务带来的挑战。一条工具链能保证前端和后端开发者,QA 人员,客户都能够从中获得收益。构建工具链的目的是为了自动化开发和部署过程,以确保快速,可靠,预算友好地交付与创新。 + +我们发现成功构建一套 DevOps 工具链不是一个简单的事情。它需要实验和不断的完善,保证必要的流程是完全自动化的。 + +### Why you need a DevOps toolchain +### 为什么你需要 DevOps 工具链 + +DevOps 工具链自动化了工作流中的所有技术元素。它能让不同团队在一个平台上进行工作,因此可以使你专注于业务战略以推动组织走向未来。 + +我们总结了五个实现 DevOps 工具链所带来的好处。你可以让管理层相信,是值得为 DevOps 工具链的开发投入资源和时间的。 + + 1. **更快更高效的生产部署** DevOps 工具自动化了大部分软件开发进程。这会使产品开发专注于创新,交付更加敏捷,更领先于竞争对手。 + 2. **预算和时间优化** 将手动的任务转变为自动化会使你的组织节省时间和资源。当没有人为错误和时间管理不足带来的额外支出,预算自然会得到优化。 + 3. **高效开发** DevOps 工具链会减少开发工作中不必要的延时,提高开发效率。前端、后端、质量测试人员的工作是一致的,所以没有人需要协调不同团队之间人员的交付。 + 4. **更快的部署意味着更高的质量** DevOps 工具链保证了缺陷能够很快被解决,并且迅速的完成高质量的部署进程。怎么样?它可以生产有针对性的告警,并将重要的事件通知给你的团队。这会让你主动地发现并解决潜在的问题,从而规避故障的不断的升级从而导致的客户服务不可用。 + 5. **及时事件管理** DevOps 工具链有助于优化事件管理记录。它能够识别 IT 事件并且逐渐升级事件级别,通知给指定团队的成员,直到问题被解决。这意味着消息的接受和处理会更加的迅速,因为它们发送给了正确的目标。 + +### DevOps 工具链的实践 + +对我的团队来说,DevOps 并不新鲜。我们已经敏捷开发很长时间了,并且我们总是热衷于探索最优的工作流。在我们的实践中,往往都是应用复杂性增加从而带来了自动化的需求。 + +这是我们为客户配置的工具链。这个项目包含了移动运营方案,连接了金融交易的所有参与者 (卖方,买方,银行)。这个客户需要动态响应用户反馈并且将故障时间缩短到最小从而来提高用户体验。我的团队设计了一套工具链用于自动化应用的维护和部署新功能。 + +![Accedia's DevOps toolchain][3] + +(Accedia, [CC BY-NC-SA 4.0][4]) + + 1. 首先,我们团队编写了自动化测试,可以立即识别应用程序的变更。 + 2. 当新版本已经准备就绪的时候,代码将被提交到 Gitlab 中。 + 3. 通过 Gitlab,提交会自动触发 Jenkins 构建。 + 4. 在 **持续集成中**,新的代码版本通过 [Chai][5] 和 [Mocha][6] 进行了测试,以检测是否运行正常。 + 5. 当测试通过,**持续部署阶段** 将会开始并创建一个可用的 Docker 镜像并上传到 Sonatype's [Nexus][7]. (这是 Sonatype 公司的的一个开源工具) + 6. 最后,新版本应用会通过 Nexus 下载并且部署到线上环境中,例如 [Docker][8] 容器 (**持续部署阶段**) + + + +简而言之,每当有人在仓库中创建一个新的提交,又或者团队上传新的代码版本、功能、升级、缺陷修复等,应用程序包都会自动更新并且交付给客户。 + +这套系统拥有良好的事故控制能力以保证快速部署,但不以牺牲质量为代价。它对于用户的反馈是动态的,意味着新功能和旧功能的和更新只需要之前一半的时间,同时将故障时间降低到最低。 + + +### 把它封装起来 + +一套完整并且正确实施的 DevOps 工具链可以从始至终推动你的创新计划并且加速部署。 + +根据你的需求,你的工具链可能看起来和这些不一样,但是我希望我们的工作流能够让你了解如何将自动化作为一种解决方案。 + +* * * + +_This was written in collaboration with Vladimir Vladimirov, senior software consultant at Accedia, who has extensive experience in CI/CD, DevOps processes, and automating software delivery. It is also based on [5 good reasons why you need a DevOps toolchain][9] from Accedia's blog and is reused under a [CC BY-NC-SA 4.0][4] license._ + +--------------------------------------------------- ----------------------------- + +via: https://opensource.com/article/21/1/devops-tool-chain + +作者:[Tereza Denkova][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/AnyISalIn) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tereza-denkova +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4 (Wratchet set tools) +[2]: https://accedia.com/services/operations/devops/ +[3]: https://opensource.com/sites/default/files/uploads/devopstoolchain.png (Accedia's DevOps toolchain) +[4]: https://creativecommons.org/licenses/by-nc-sa/4.0/ +[5]: https://www.chaijs.com/ +[6]: https://mochajs.org/ +[7]: https://www.sonatype.com/nexus/repository-oss +[8]: https://opensource.com/resources/what-docker +[9]: https://accedia.com/blog/5-good-reasons-why-you-need-a-devops-toolchain/ From 35a792b9c90007b448fac916625d2dada0c51643 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 15:35:17 +0800 Subject: [PATCH 022/213] PRF @geekpi --- ...20210115 3 plain text note-taking tools.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210115 3 plain text note-taking tools.md b/translated/tech/20210115 3 plain text note-taking tools.md index 7295039f0e..41a744723f 100644 --- a/translated/tech/20210115 3 plain text note-taking tools.md +++ b/translated/tech/20210115 3 plain text note-taking tools.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 plain text note-taking tools) @@ -9,24 +9,26 @@ 3 个纯文本记事工具 ====== -记笔记很重要,而纯文本是一种简单、中性的方式。这里有三个工具,你可以在不失去纯文本的简易和便携性的前提下,给你的笔记加点东西。 -![Typewriter with hands][1] + +> 记笔记很重要,而纯文本是一种简单、中性的方式。这里有三个工具,你可以在不失去纯文本的简易和便携性的前提下,给你的笔记加点东西。 + +![](https://img.linux.net.cn/data/attachment/album/202101/27/153329o0waw16448hq0avf.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第五天。 -纯文本是最具弹性的文档格式。纯文本文档体积小,可以在机器之间快速传输,并且可以在_任意_设备上阅读。因此,在纯文本文档中做笔记是很有意义的。 +纯文本是最具弹性的文档格式。纯文本文档体积小,可以在机器之间快速传输,并且可以在*任意*设备上阅读。因此,在纯文本文档中做笔记是很有意义的。 -然而,纯文本也仅是纯文本。我们生活在一个富文本世界中,我们仍然需要标题、列表以及区分一个部分和另一个部分的方法。幸运的是,我们有几种方法可以添加这些元素,而不需要在纯文本文档中添加复杂的标记。 +然而,纯文本也仅是纯文本。我们生活在一个富文本世界中,我们仍然需要标题、列表以及区分一个章节和另一个章节的方法。幸运的是,我们有几种方法可以添加这些元素,而不需要在纯文本文档中添加复杂的标记。 ### Markdown ![Markdown][2] -Markdown (Kevin Sonney, [CC BY-SA 4.0][3]) +*Markdown (Kevin Sonney, [CC BY-SA 4.0][3])* 由 Aaron Schwartz 和 John Gruber 创建的 [Markdown][4],是我如今每天使用最多的格式。从读写 README 文件、文档、记笔记,甚至源代码注释,Markdown 让我可以在不牺牲轻松阅读文档的能力的情况下添加格式。 -此外,Markdown 还有几个”扩展版本“,以允许那些不属于原始设计的项目。特别是,[GitHub 风格的 Markdown][5] 由于其在同名的源码控制网站中的使用而异常流行。 +此外,Markdown 还有几个“扩展版本”,以允许那些不属于原始设计的项目。特别是,[GitHub 风格的 Markdown][5] 由于其在同名的源码控制网站中的使用而异常流行。 许多文件编辑器都支持 Markdown 高亮显示,不需要额外的附加组件或工作。 @@ -34,21 +36,21 @@ Markdown (Kevin Sonney, [CC BY-SA 4.0][3]) ![AsciiDoc][6] -AsciiDoc (Kevin Sonney, [CC BY-SA 4.0][3]) +*AsciiDoc (Kevin Sonney, [CC BY-SA 4.0][3])* -由 Stuart Rackham 创建的 [AsciiDoc][7] 是向纯文本文档添加富文本元素的另一种方式。AsciiDoc 有许多生成文档、书籍和论文的功能。然而,这并不意味着它不能被用来做笔记。有很多环境(特别是在教育和研究领域),能够快速将笔记转换为更”正式“的格式是很有帮助的。 +由 Stuart Rackham 创建的 [AsciiDoc][7] 是向纯文本文档添加富文本元素的另一种方式。AsciiDoc 有许多生成文档、书籍和论文的功能。然而,这并不意味着它不能被用来做笔记。有很多环境(特别是在教育和研究领域),能够快速将笔记转换为更“正式”的格式是很有帮助的。 AsciiDoc 也有很多工具可以将文本转换为其他格式进行协作。还有一些附加组件可以从不同的源导入数据,并将其放入最终的文档中,或者处理特殊的格式,如 MathML 或 LaTeX。 -### Org Mode +### Org 模式 ![ORG-Mode][8] -ORG-Mode (Kevin Sonney, [CC BY-SA 4.0][3]) +*ORG-Mode (Kevin Sonney, [CC BY-SA 4.0][3])* -说到文本格式,我不能不提 [Org][9]。Org Mode 最初是为 [GNU Emacs][10] 设计的,现在已经成为笔记、待办事项、文档等常用的纯文本格式之一。Org 可以在包括 [Vim][11] 在内的众多文本编辑器中编写和使用。Org 简单、易学,是我最喜欢的笔记文本格式之一。 +说到文本格式,我不能不提 [Org 模式][9]。它最初是为 [GNU Emacs][10] 设计的,现在已经成为笔记、待办事项、文档等常用的纯文本格式之一。Org 模式可以在包括 [Vim][11] 在内的众多文本编辑器中编写和使用。Org 模式简单、易学,是我最喜欢的笔记文本格式之一。 -最后,选择 Markdown、AsciiDoc 或 Org 作为纯文本笔记,是确保它们可以在任何地方被阅读和更新的一种方式。如果你和我一样,你会发现自己在做纸质笔记的时候,也会使用同样的语法! +最后,选择 Markdown、AsciiDoc 或 Org 模式作为纯文本笔记,是确保它们可以在任何地方被阅读和更新的一种方式。如果你和我一样,你会发现自己在做纸质笔记的时候,也会使用同样的语法! -------------------------------------------------------------------------------- @@ -57,7 +59,7 @@ via: https://opensource.com/article/21/1/plain-text 作者:[Kevin Sonney][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 68c5e33381c6bdc4a34295bfb8dba23ac7181f61 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 15:36:24 +0800 Subject: [PATCH 023/213] PUB @geekpi https://linux.cn/article-13056-1.html --- .../20210115 3 plain text note-taking tools.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210115 3 plain text note-taking tools.md (98%) diff --git a/translated/tech/20210115 3 plain text note-taking tools.md b/published/20210115 3 plain text note-taking tools.md similarity index 98% rename from translated/tech/20210115 3 plain text note-taking tools.md rename to published/20210115 3 plain text note-taking tools.md index 41a744723f..c5b839a849 100644 --- a/translated/tech/20210115 3 plain text note-taking tools.md +++ b/published/20210115 3 plain text note-taking tools.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13056-1.html) [#]: subject: (3 plain text note-taking tools) [#]: via: (https://opensource.com/article/21/1/plain-text) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From eb2809e7306d7e24a0667662d4fe4b1a76a4b654 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 22:33:28 +0800 Subject: [PATCH 024/213] PRF @wxy --- ...26 How the Zen of Python handles errors.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20191226 How the Zen of Python handles errors.md b/translated/tech/20191226 How the Zen of Python handles errors.md index 4bb8fcbeb1..95e8bfb680 100644 --- a/translated/tech/20191226 How the Zen of Python handles errors.md +++ b/translated/tech/20191226 How the Zen of Python handles errors.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How the Zen of Python handles errors) @@ -12,29 +12,29 @@ Python 处理错误的原则 > 这是 Python 之禅特别系列的一部分,重点是第十和第十一条原则:沉默的错误(或不沉默)。 -![一个团队的检查表][1] +![](https://img.linux.net.cn/data/attachment/album/202101/27/223251q261j2ndoccajc16.jpg) 处理“异常情况”是编程中争论最多的问题之一。这可能是因为风险很大:处理不当的错误值甚至可以使庞大的系统瘫痪。由于“异常情况”从本质上来说,是测试不足的,但发生的频率却令人不快,因此,是否正确处理它们往往可以将一个噩梦般的系统与一个“可以工作”的系统区分开来。 -从 Java 的 **受检查的** 异常,到 Erlang 的故障隔离,再到 Haskell 的 **也许**,不同的语言对错误处理的态度截然不同。 +从 Java 的 `checked` 异常,到 Erlang 的故障隔离,再到 Haskell 的 `Maybe`,不同的语言对错误处理的态度截然不同。 这两条 [Python 之禅][2]是 Python 对这个话题的冥思。 -### 错误绝不该悄悄传递...Errors should never pass silently… +### 错误绝不应该悄悄传递...Errors should never pass silently… -在 Python 之禅在 Tim Peters 眼里闪烁而出之前,在维基百科被俗称为“维基”之前,第一个维基网站 [C2][3] 就已经存在了,它是一个编程指南的宝库。这些原则大多来自于 [Smalltalk][4] 编程社区。Smalltalk 的思想影响了许多面向对象的语言,包括 Python。 +当 Python 之禅在 Tim Peters 眼里闪烁而出之前,在维基百科被俗称为“维基”之前,第一个维基网站 [C2][3] 就已经存在了,它是一个编程指南的宝库。这些原则大多来自于 [Smalltalk][4] 编程社区。Smalltalk 的思想影响了许多面向对象的语言,包括 Python。 -C2 维基定义了武士原则Samurai Principle:“胜利归来,或者不归。”用 Python 人的术语来说,它鼓励摒弃哨兵值,比如返回 `None` 或 `-1` 来表示无法完成任务,而是采用引发异常。一个 `None` 是无声的:它看起来像一个值,可以放在一个变量中,然后到处传递。有时,它甚至是一个*有效*的返回值。 +C2 维基定义了武士原则Samurai Principle:“胜利归来,要么不归。”用 Python 人的术语来说,它鼓励摒弃哨兵值sentinel value,比如用返回 `None` 或 `-1` 来表示无法完成任务,而是采用引发异常的方式。一个 `None` 是无声的:它看起来像一个值,可以放在一个变量中,然后到处传递。有时,它甚至是一个*有效*的返回值。 -这里的原则是,如果一个函数不能完成它的契约,它应该“高调失败”:引发一个异常。引发的异常永远不会看起来像是一个可能的值。它将跳过 `returned_value = call_to_function(parameter)` 行,并上升到调用栈中,可能使程序崩溃。 +这里的原则是,如果一个函数不能完成它的契约,它应该“高调失败”:引发一个异常。所引发的异常永远不会看起来像是一个可能的值。它将跳过 `returned_value = call_to_function(parameter)` 行,并上升到调用栈中,可能使程序崩溃。 -崩溃的调试是很直接的:有一个堆栈跟踪指示问题以及调用堆栈。崩溃可能意味着程序的必要条件没有满足,需要人为干预。它可能意味着程序的逻辑有问题。无论是哪种情况,高调失败都比一个隐藏的、“缺失”的值要好。用 `None` 来感染程序的有效数据,直到它被用在某个地方,就如你可能已经知道的,错误信息会说 “**None 没有方法进行拆分**”。 +崩溃的调试是很直接的:有一个堆栈跟踪来指示问题以及调用堆栈。崩溃可能意味着程序的必要条件没有满足,需要人为干预。它可能意味着程序的逻辑有问题。无论是哪种情况,高调失败都比一个隐藏的、“缺失”的值要好。用 `None` 来感染程序的有效数据,直到它被用在某个地方,就如你可能已经知道的,错误信息会说 “**None 没有方法进行拆分**”。 ### 除非显式消除Unless explicitly silenced 有时需要显式地捕获异常。我们可能会预见到文件中的某些行格式错误,并希望以特殊的方式来处理它们,也许可以把它们放在一个“需要人来看看的行”的文件中,而不是让整个程序崩溃。 -Python 允许我们用 `except` 来捕获异常。这意味着错误可以被*显式*静音。这种明确性意味着 `except` 行在代码审查中是可见的。质疑为什么应该在这里显式消除异常并从异常中恢复,是有意义的。自问我们是否捕获了太多或太少的异常也是有意义的。 +Python 允许我们用 `except` 来捕获异常。这意味着错误可以被*显式*消除。这种明确性意味着 `except` 行在代码审查中是可见的。质疑为什么应该在这里显式消除异常并从异常中恢复,是有意义的。自问一下我们是否捕获了太多或太少的异常也是有意义的。 因为这些全都是明确的,所以有人可以阅读代码并了解哪些异常是可以恢复的。 @@ -45,7 +45,7 @@ via: https://opensource.com/article/19/12/zen-python-errors 作者:[Moshe Zadka][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 991a23ee49241b8ee211ddb0fe46255e2e574212 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 22:34:00 +0800 Subject: [PATCH 025/213] PUB @wxy https://linux.cn/article-13058-1.html --- .../20191226 How the Zen of Python handles errors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191226 How the Zen of Python handles errors.md (98%) diff --git a/translated/tech/20191226 How the Zen of Python handles errors.md b/published/20191226 How the Zen of Python handles errors.md similarity index 98% rename from translated/tech/20191226 How the Zen of Python handles errors.md rename to published/20191226 How the Zen of Python handles errors.md index 95e8bfb680..46ca0861c8 100644 --- a/translated/tech/20191226 How the Zen of Python handles errors.md +++ b/published/20191226 How the Zen of Python handles errors.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13058-1.html) [#]: subject: (How the Zen of Python handles errors) [#]: via: (https://opensource.com/article/19/12/zen-python-errors) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) From 074f2088b39c8dbab8818094fecf9b7670f0006d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 22:48:42 +0800 Subject: [PATCH 026/213] APL --- ...r Cool Open Source To-Do List App with GitHub Integration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md b/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md index d805a3afbb..7d7a5a9c40 100644 --- a/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md +++ b/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4995234ab9b0bc96064c458d42fea637355d74e2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Jan 2021 23:58:39 +0800 Subject: [PATCH 027/213] TSL&PRF --- ... To-Do List App with GitHub Integration.md | 106 ------------------ ... To-Do List App with GitHub Integration.md | 104 +++++++++++++++++ 2 files changed, 104 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md create mode 100644 translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md diff --git a/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md b/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md deleted file mode 100644 index 7d7a5a9c40..0000000000 --- a/sources/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Super Productivity: A Super Cool Open Source To-Do List App with GitHub Integration) -[#]: via: (https://itsfoss.com/super-productivity/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -Super Productivity: A Super Cool Open Source To-Do List App with GitHub Integration -====== - -_**Brief: Super Productivity is an awesome open-source to-do app that helps you manage tasks, track tickets, and manage time.**_ - -No matter what you do, improving productivity is a common goal for most of the people. Usually, you would end up trying various [to-do list apps][1] or a [note-taking app][2] to help yourself organize and remind things to efficiently keep up with your work. - -Sure, you can check out those lists and try them as you like. Here, I’ve come across something unique that you also may want to try if you wanted a desktop to-do application with a solid user interface, GitHub/GitLab integration, and a list of essential features. - -Super Productivity seems to be an impressive to-do list app with some unique features to offer. In this article, I’ll let you know all about it briefly. - -### Super Productivity: A Simple & Attractive Open-Source To-do App - -![][3] - -Super Productivity is an open-source app, and it is actively maintained by [Johannes Millan][4] on GitHub. - -To me, the user experience matters the most, and I’m completely impressed with the UI offered by Super Productivity. - -It also offers a bunch of essential features along with some interesting options. Let’s take a look at them. - -### Features of Super Productivity - -![][5] - - * Add to-do tasks, description - * Track time spent on tasks and break - * Project management (with JIRA, GitHub, and GitLab integration) - * Ability to schedule tasks - * Language selection option - * Sync option to Dropbox, Google Drive, or any other WebDAV storage location - * Import/Export functionality - * Auto-backup functionality - * Ability to tweak the behavior of timers and counters - * Dark Mode them available - * Add attachment to tasks - * Ability to repeat tasks completely for free - * Cross-platform support - - - -In addition to the features I mentioned, you will find more detailed settings and tweaks to configure. - -Especially, the integration with [JIRA][6], [GitHub][7] and [GitL][8][ab][8]. You can automatically assign tasks to work on without needing to check your email for the recent updates to issue trackers or tickets. - -Compared to many premium to-do web services that I’ve used so far, you will be surprised to find many useful features completely for free. You can also take a look at the video below to get some idea: - -### Installing Super Productivity on Linux - -![][9] - -You get a variety of options to install. I downloaded the AppImage file to test. But, you can also get the deb package for Debian-based distros. - -It is also available as a [snap][10]. You can find all the packages in the [GitHub releases section][11]. - -If you’re curious, you can check out its [GitHub page][12] to know more about it. - -Download Super Productivity - -### Concluding Thoughts - -I found the user experience fantastic with Super Productivity. The features offered are incredibly useful and considering that you get some premium functionalities (that you’d get normally with to-do web services) it could be a perfect replacement for most of the users. - -You can simply sync the data using Google Drive, Dropbox, or any other WebDAV storage location. - -It could also replace a service like [ActivityWatch][13] to help you track the time you work on your tasks and remain idle. So, it could be your all-in-one solution for improving productivity! - -Sounds exciting, right? - -What do you think about Super Productivity? Let me know your thoughts in the comments section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/super-productivity/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/to-do-list-apps-linux/ -[2]: https://itsfoss.com/note-taking-apps-linux/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/super-productivity.jpg?resize=800%2C569&ssl=1 -[4]: https://github.com/johannesjo -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/super-productivity-2.jpg?resize=800%2C575&ssl=1 -[6]: https://www.atlassian.com/software/jira -[7]: https://github.com/ -[8]: https://about.gitlab.com -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/super-productivity-1.jpg?resize=800%2C574&ssl=1 -[10]: https://snapcraft.io/superproductivity -[11]: https://github.com/johannesjo/super-productivity/releases -[12]: https://github.com/johannesjo/super-productivity -[13]: https://itsfoss.com/activitywatch/ diff --git a/translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md b/translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md new file mode 100644 index 0000000000..32a78bec52 --- /dev/null +++ b/translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Super Productivity: A Super Cool Open Source To-Do List App with GitHub Integration) +[#]: via: (https://itsfoss.com/super-productivity/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +超级生产力:一款集成了 GitHub 的超酷开源待办事项列表应用 +====== + +> “超级生产力”是一款很棒的开源待办事项应用,可以帮助你管理任务、跟踪事务和管理时间。 + +无论你做什么,提高工作效率是大多数人的共同目标。通常,你总会尝试各种[待办事项列表应用][1]或者[记事应用][2]来帮助自己组织和提醒事情,从而高效地跟上工作进度。 + +当然,你可以看看那些清单,根据自己的喜好去尝试其中的一些。在这里,我遇到了一些独特的东西,如果你想要一个具有可靠的用户界面、GitHub/GitLab 集成以及一系列基本功能的桌面待办事项应用,你也许可以尝试一下。 + +超级生产力Super Productivity看起来是一个令人印象深刻的待办事项列表应用,并提供一些独特的功能。在本文中,我将让你简单了解它的一切。 + +### 超级生产力:一个简单的而有吸引力的开源待办事项应用程序 + +![][3] + +“超级生产力”是一款开源应用,它由 [Johannes Millan][4] 在 GitHub 上积极维护。 + +对我来说,用户体验是最重要的,“超级生产力”提供的用户界面给我留下了十分深刻的印象。 + +它还提供了一堆基本功能以及一些有趣的选项。让我们来看看它们。 + +### “超级生产力”的特点 + +![][5] + + * 添加待办事项、说明 + * 追踪花费在任务和休息上的时间 + * 项目管理(与 JIRA、GitHub 和 GitLab 整合) + * 安排任务的能力 + * 语言选择选项 + * 同步到 Dropbox、Google Drive 或任何其他 WebDAV 存储位置 + * 导入/导出功能 + * 自动备份功能 + * 能够调整定时器和计数器的行为 + * 黑暗模式 + * 在任务中添加附件 + * 完全免费的重复任务 + * 跨平台支持 + +除了我提到的功能外,你还会发现更多详细的设置和调整配置。 + +尤其是与 [JIRA][6]、[GitHub][7] 和 [GitLab][8] 的整合。你可以自动分配要进行的工作任务,而不需要检查你的电子邮件以了解问题跟踪器或议题的最近更新。 + +与我目前使用过的许多收费版的待办事项 Web 服务相比,你会惊讶地发现许多有用的功能完全免费。 + +### 在 Linux 上安装“超级生产力” + +![][9] + +它有各种安装方式。我下载了 AppImage 文件测试了一下。但是,你也可以得到基于 Debian 的发行版的 deb 包。 + +它也可以作为一个 [snap][10] 来安装。你可以在 [GitHub 的发布部分][11]中找到所有的包。 + +如果你感兴趣,可以查看它的 [GitHub 页面][12]来了解它的更多信息。 + +- [下载超级生产力](https://github.com/johannesjo/super-productivity/releases) + +### 总结 + +我发现“超级生产力”的用户体验非常棒。所提供的功能非常有用,考虑到你可以获得一些你通常从收费版的待办事项 Web 服务中才能获得的高级功能,它可以成为大多数用户的完美替代品。 + +你可以简单地使用 Google Drive、Dropbox 或任何其他 WebDAV 存储位置同步数据。 + +它也可以取代像 [ActivityWatch][13] 这样的服务,帮助你追踪你工作任务和保持闲置的时间。所以,它可以成为你提高生产力的一体化解决方案! + +听起来很不错,对吧? + +你对“超级生产力”有什么看法?请在下面的评论区告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/super-productivity/ + +作者:[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://itsfoss.com/to-do-list-apps-linux/ +[2]: https://itsfoss.com/note-taking-apps-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/super-productivity.jpg?resize=800%2C569&ssl=1 +[4]: https://github.com/johannesjo +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/super-productivity-2.jpg?resize=800%2C575&ssl=1 +[6]: https://www.atlassian.com/software/jira +[7]: https://github.com/ +[8]: https://about.gitlab.com +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/super-productivity-1.jpg?resize=800%2C574&ssl=1 +[10]: https://snapcraft.io/superproductivity +[11]: https://github.com/johannesjo/super-productivity/releases +[12]: https://github.com/johannesjo/super-productivity +[13]: https://itsfoss.com/activitywatch/ From 6685d10e1d12c52bcf42cb81988ab43840d48f80 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Jan 2021 05:03:15 +0800 Subject: [PATCH 028/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210127=20?= =?UTF-8?q?Introduction=20to=20Thunderbird=20mail=20filters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210127 Introduction to Thunderbird mail filters.md --- ...ntroduction to Thunderbird mail filters.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20210127 Introduction to Thunderbird mail filters.md diff --git a/sources/tech/20210127 Introduction to Thunderbird mail filters.md b/sources/tech/20210127 Introduction to Thunderbird mail filters.md new file mode 100644 index 0000000000..423d48f86d --- /dev/null +++ b/sources/tech/20210127 Introduction to Thunderbird mail filters.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Introduction to Thunderbird mail filters) +[#]: via: (https://fedoramagazine.org/introduction-to-thunderbird-mail-filters/) +[#]: author: (Richard England https://fedoramagazine.org/author/rlengland/) + +Introduction to Thunderbird mail filters +====== + +![][1] + +Everyone eventually runs into an inbox loaded with messages that they need to sort through. If you are like a lot of people, this is not a fast process. However, use of mail filters can make the task a little less tedious by letting Thunderbird pre-sort the messages into categories that reflect their source, priority, or usefulness. This article is an introduction to the creation of filters in Thunderbird. + +Filters may be created for each email account you have created in Thunderbird. These are the accounts you see in the main Thunderbird folder pane shown at the left of the “Classic Layout”. + +![Classic Layout][2] + +There are two methods that can be used to create mail filters for your accounts. The first is based on the currently selected account and the second on the currently selected message. Both are discussed here. + +### Message destination folder + +Before filtering messages there has to be a destination for them. Create the destination by selecting a location to create a new folder. In this example the destination will be **Local Folders** shown in the accounts pane. Right click on **Local Folders** and select _New Folder…_ from the menu. + +![Creating a new folder][3] + +Enter the name of the new folder in the menu and select _Create Folder._ The mail to filter is coming from the New York Times so that is the name entered. + +![Folder creation][4] + +### Filter creation based on the selected account + +Select the _Inbox_ for the account you wish to filter and select the toolbar menu item at _Tools > Message_Filters_. + +![Message_Filters menu location][5] + +The _Message Filters_ menu appears and is set to your pre-selected account as indicated at the top in the selection menu labelled _Filters for:_. + +![Message Filters menu][6] + +Previously created filters, if any, are listed beneath the account name in the “_Filter Name”_ column. To the right of this list are controls that let you modify the filters selected. These controls are activated when you select a filter. More on this later. + +Start creating your filter as follows: + + 1. Verify the correct account has been pre-selected. It may be changed if necessary. + 2. Select _New…_ from the menu list at the right. + + + +When you select _New_ you will see the _Filter Rules_ menu where you define your filter. Note that when using _New…_ you have the option to copy an existing filter to use as a template or to simply duplicate the settings. + +Filter rules are made up of three things, the “property” to be tested, the “test”, and the “value” to be tested against. Once the condition is met, the “action” is performed. + +![Message Filters menu][7] + +Complete this filter as follows: + + 1. Enter an appropriate name in the textbox labelled _Filter name:_ + 2. Select the property _From_ in the left drop down menu, if not set. + 3. Leave the test set to _contains_. + 4. Enter the value, in this case the email address of the sender. + + + +Under the _Perform these actions:_ section at the bottom, create an action rule to move the message and choose the destination. + + 1. Select _Move Messages to_ from the left end of the action line. + 2. Select _Choose Folder…_ and select _Local Folders > New York Times_. + 3. Select _OK_. + + + +By default the **Apply filter when:** is set to _Manually Run_ and _Getting New Mail:_. This means that when new mail appears in the Inbox for this account the filter will be applied and you may run it manually at any time, if necessary. There are other options available but they are too numerous to be discussed in this introduction. They are, however, for the most part self explanatory. + +If more than one rule or action is to be created during the same session, the “+” to the right of each entry provides that option. Additional property, test, and value entries can be added. If more than one rule is created, make certain that the appropriate option for _Match all of the following_ and _Match any of the following_ is selected. In this example the choice does not matter since we are only setting one filter. + +After selecting _OK,_ the _Message Filters_ menu is displayed again showing your newly created filter. Note that the menu items on the right side of the menu are now active for _Edit…_ and _Delete._ + +![First filter in the Message Filters menu][8] + +Also notice the message _“Enabled filters are run automatically in the order shown below”_. If there are multiple filters the order is changed by selecting the one to be moved and using the _Move to Top, Move Up, Move Down,_ or _Move to Bottom_ buttons. The order can change the destination of your messages so consider the tests used in each filter carefully when deciding the order. + +Since you have just created this filter you may wish to use the _Run Now_ button to run your newly created filter on the Inbox shown to the left of the button. + +### Filter creation based on a message + +An alternative creation technique is to select a message from the message pane and use the _Create Filter From Message…_ option from the menu bar. + +In this example the filter will use two rules to select the messages: the email address and a text string in the Subject line of the email. Start as follows: + + 1. Select a message in the message page. + 2. Select the filter options on the toolbar at _Message > Create Filter From Message…_. + + + +![Create new filters from Messages][9] + +The pre-selected message, highlighted in grey in the message pane above, determines the account used and _Create Filter From Message…_ takes you directly to the _Filter Rules_ menu. + +![][10] + +The property (_From_), test (_is_), and value (email) are pre-set for you as shown in the image above. Complete this filter as follows: + + 1. Enter an appropriate name in the textbox labelled _Filter name:_. _COVID_ is the name in this case. + 2. Check that the property is _From_. + 3. Verify the test is set to _is_. + 4. Confirm that the value for the email address is from the correct sender. + 5. Select the “+” to the right of the _From_ rule to create a new filter rule. + 6. In the new rule, change the default property entry _From_ to _Subject_ using the pulldown menu. + 7. Set the test to _contains_. + 8. Enter the value text to be matched in the Email “Subject” line. In this case _COVID_. + + + +Since we left the _Match all of the following_ item checked, each message will be from the address chosen AND will have the text _COVID_ in the email subject line. + +Now use the action rule to choose the destination for the messages under the _Perform these actions:_ section at the bottom: + + 1. Select _Move Messages to_ from the left menu. + 2. Select _Choose Folder…_ and select _Local Folders > COVID in Scotland_. (This destination was created before this example was started. There was no magic here.) + 3. Select _OK_. + + + +_OK_ will cause the _Message Filters_ menu to appear, again, verifying that the new filter has been created. + +### The Message Filters menu + +All the message filters you create will appear in the _Message Filters_ menu. Recall that the _Message Filters_ is available in the menu bar at _Tools > Message Filters_. + +Once you have created filters there are several options to manage them. To change a filter, select the filter in question and click on the _Edit_ button. This will take you back to the _Filter Rules_ menu for that filter. As mentioned earlier, you can change the order in which the rules are apply here using the _Move_ buttons. Disable a filter by clicking on the check mark in the _Enabled_ column. + +![][11] + +The _Run Now_ button will execute the selected filter immediately. You may also run your filter from the menu bar using _Tools > Run Filters on Folder_ or _Tools > Run Filters on Message_. + +### Next step + +This article hasn’t covered every feature available for message filtering but hopefully it provides enough information for you to get started. Places for further investigation are the “property”, “test”, and “actions” in the _Filter menu_ as well as the settings there for when your filter is to be run, _Archiving, After Sending,_ and _Periodically_. + +### References + +Mozilla: [Organize][12] [Your Messages][12] [by Using Filters][12] + +MozillaZine: [Message][13] [Filters][13] + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/introduction-to-thunderbird-mail-filters/ + +作者:[Richard England][a] +选题:[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/rlengland/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/01/Tbird_mail_filters-1-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2021/01/Image_001-1024x613.png +[3]: https://fedoramagazine.org/wp-content/uploads/2021/01/Image_New_Folder.png +[4]: https://fedoramagazine.org/wp-content/uploads/2021/01/Folder_name-1.png +[5]: https://fedoramagazine.org/wp-content/uploads/2021/01/Image_002-2-1024x672.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/01/Image_Message_Filters-1.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/01/Filter_rules_1-1.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/01/Messsage_Filters_1st_entry.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/01/Create_by_messasge.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Filter_rules_2-1.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/01/Message_Filters_2nd_entry.png +[12]: https://support.mozilla.org/en-US/kb/organize-your-messages-using-filters +[13]: http://kb.mozillazine.org/Filters_%28Thunderbird%29 From b9dd777fc937ad54ced7d7939c492c018be95f5e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Jan 2021 05:04:17 +0800 Subject: [PATCH 029/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210128=20?= =?UTF-8?q?How=20to=20Run=20a=20Shell=20Script=20in=20Linux=20[Essentials?= =?UTF-8?q?=20Explained=20for=20Beginners]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md --- ...nux -Essentials Explained for Beginners.md | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md diff --git a/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md new file mode 100644 index 0000000000..1fdd219fa9 --- /dev/null +++ b/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -0,0 +1,174 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to Run a Shell Script in Linux [Essentials Explained for Beginners]) +[#]: via: (https://itsfoss.com/run-shell-script-linux/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +How to Run a Shell Script in Linux [Essentials Explained for Beginners] +====== + +There are two ways to run a shell script in Linux. You can use: + +``` +bash script.sh +``` + +Or you can execute the shell script like this: + +``` +./script.sh +``` + +That maybe simple, but it doesn’t explain a lot. Don’t worry, I’ll do the necessary explaining with examples so that you understand why a particular syntax is used in the given format while running a shell script. + +I am going to use this one line shell script to make things as uncomplicated as possible: + +``` +[email protected]:~/Scripts$ cat hello.sh + +echo "Hello World!" +``` + +### Method 1: Running a shell script by passing the file as argument to shell + +The first method involves passing the script file name as an argument to the shell. + +Considering that bash is the default shell, you can run a script like this: + +``` +bash hello.sh +``` + +Do you know the advantage of this approach? **Your script doesn’t need to have the execute permission**. Pretty handy for quick and simple tasks. + +![Running a Shell Script Linux][1] + +If you are not familiar already, I advise you to [read my detailed guide on file permission in Linux][2]. + +Keep in mind that it needs to be a shell script that you pass as argument. A shell script is composed of commands. If you use a normal text file, it will complain about incorrect commands. + +![Running a Text File As Script][3] + +In this approach, **you explicitly specified that you want to use bash as the interpreter** for the script. + +Shell is just a program and bash is an implementation of that. There are other such shells program like ksh, [zsh][4], etc. If you have other shells installed, you can use that as well instead of bash. + +For example, I installed zsh and used it to run the same script: + +![Execute Shell Script With Zsh][5] + +**Recommended Read:** + +![][6] + +#### [How to Run Multiple Linux Commands at Once in Linux Terminal [Essential Beginners Tip]][7] + +### Method 2: Execute shell script by specifying its path + +The other method to run a shell script is by providing its path. But for that to be possible, your file must be executable. Otherwise, you’ll have “permission denied” error when you try to execute the script. + +So first you need to make sure that your script has the execute permission. You can [use the chmod command][8] to give yourself this permission like this: + +``` +chmod u+x script.sh +``` + +Once your script is executable, all you need to do is to type the file name along with its absolute or relative path. Most often you are in the same directory so you just use it like this: + +``` +./script.sh +``` + +If you are not in the same directory as your script, you can specify it the absolute or relative path to the script: + +![Running Shell Script In Other Directory][9] + +#### That ./ before the script is important (when you are in the same directory as the script) + +![][10] + +Why can you not use the script name when you are in the same directory? That is because your Linux systems looks for the executables to run in a few selected directories that are specified in the PATH variable. + +Here’s the value of PATH variable for my system: + +``` +[email protected]:~$ echo $PATH +/home/abhishek/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin +``` + +This means that any file with execute permissions in one of the following directories can be executed from anywhere in the system: + + * /home/abhishek/.local/bin + * /usr/local/sbin + * /usr/local/bin + * /usr/sbin + * /usr/bin + * /sbin + * /bin + * /usr/games + * /usr/local/games + * /snap/bin + + + +The binaries or executable files for Linux commands like ls, cat etc are located in one of those directories. This is why you are able to run these commands from anywhere on your system just by using their names. See, the ls command is located in /usr/bin directory. + +![][11] + +When you specify the script WITHOUT the absolute or relative path, it cannot find it in the directories mentioned in the PATH variable. + +#### Why most shell scripts contain #! /bin/bash at the beginning of the shell scripts? + +Remember how I mentioned that shell is just a program and there are different implementations of shells. + +When you use the #! /bin/bash, you are specifying that the script is to run with bash as interpreter. If you don’t do that and run a script in ./script.sh manner, it is usually run with whatever shell you are running. + +Does it matter? It could. See, most of the shell syntax is common in all kind of shell but some might differ. + +For example, the array behavior is different in bash and zsh shells. In zsh, the array index starts at 1 instead of 0. + +![Bash Vs Zsh][12] + +Using #! /bin/bash indicates that the script is bash shell script and should be run with bash as interpreter irrespective of the shell which is being used on the system. If you are using zsh specific syntax, you can indicate that it is zsh script by adding #! /bin/zsh as the first line of the script. + +The space between #! /bin/bash doesn’t matter. You can also use #!/bin/bash. + +### Was it helpful? + +I hope this article added to your Linux knowledge. If you still have questions or suggestions, please leave a comment. + +Expert users can still nitpick this article about things I missed out. But the problem with such beginner topics is that it is not easy to find the right balance of information and avoid having too much or too few details. + +If you are interested in learning bash script, we have an [entire Bash Beginner Series][13] on our sysadmin focused website [Linux Handbook][14]. If you want, you may also [purchase the ebook with additional exercises to support Linux Handbook][15]. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-shell-script-linux/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/run-a-shell-script-linux.png?resize=741%2C329&ssl=1 +[2]: https://linuxhandbook.com/linux-file-permissions/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/running-text-file-as-script.png?resize=741%2C329&ssl=1 +[4]: https://www.zsh.org +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/execute-shell-script-with-zsh.png?resize=741%2C253&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/run-multiple-commands-in-linux.png?fit=800%2C450&ssl=1 +[7]: https://itsfoss.com/run-multiple-commands-linux/ +[8]: https://linuxhandbook.com/chmod-command/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/running-shell-script-in-other-directory.png?resize=795%2C272&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/executing-shell-scripts-linux.png?resize=800%2C450&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/locating-command-linux.png?resize=795%2C272&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/bash-vs-zsh.png?resize=795%2C386&ssl=1 +[13]: https://linuxhandbook.com/tag/bash-beginner/ +[14]: https://linuxhandbook.com +[15]: https://www.buymeacoffee.com/linuxhandbook From 5121ef55cb1c0f2927e1adf38232c1d21cb21ab4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Jan 2021 05:04:35 +0800 Subject: [PATCH 030/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210127=20?= =?UTF-8?q?Build=20a=20programmable=20light=20display=20on=20Raspberry=20P?= =?UTF-8?q?i?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210127 Build a programmable light display on Raspberry Pi.md --- ...grammable light display on Raspberry Pi.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20210127 Build a programmable light display on Raspberry Pi.md diff --git a/sources/tech/20210127 Build a programmable light display on Raspberry Pi.md b/sources/tech/20210127 Build a programmable light display on Raspberry Pi.md new file mode 100644 index 0000000000..b7b0ee31b5 --- /dev/null +++ b/sources/tech/20210127 Build a programmable light display on Raspberry Pi.md @@ -0,0 +1,218 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Build a programmable light display on Raspberry Pi) +[#]: via: (https://opensource.com/article/21/1/light-display-raspberry-pi) +[#]: author: (Darin London https://opensource.com/users/dmlond) + +Build a programmable light display on Raspberry Pi +====== +Celebrate the holidays or any special occasion with a DIY light display +using a Raspberry Pi, Python, and programmable LED lights. +![Lightbulb][1] + +This past holiday season, I decided to add some extra joy to our house by setting up a DIY light display. I used a Raspberry Pi, a programmable light string, and Python. + + + +You can set up your own light display for any occasion, thanks to the flexibility of the WS12911/2 (or NeoPixel) system, by following these directions. + +### Prerequisites + +You will need: + + * 1 – Raspberry Pi with headers and an Ethernet or WiFi connection. I used a Raspberry Pi Zero W with headers. + * 1 – WS12811/2 light string. I used the [Alitove WS2811 Addressable LED Pixel Light 50][2], but many other types are available. Adafruit brands these as [NeoPixel][3]. + * 1 – [5v/10A AC-DC power supply for WS12811][4] if you use the Alitove. Other lights may come with a power supply. + * 1 – Breadboard + * 2 – Breadboard-to-Pi-header jumper wires. I used blue for the Pi GPIO pin 18 and black for the Pi ground. + * 1 – 74AHCT125 level converter chip to safely transmit Pi GPIO wire signals to 5v/10A power without feeding back to the Pi. + * 8 – Breadboard-to-breadboard jumper wires or solid-core 24 AWG wires. I used red/orange for 5v power, black for ground, and yellow for data. + * 1 – SD card with Raspberry Pi OS installed. I used [Raspberry Pi OS Lite][5] and set it up in a headless mode with SSH enabled. + + + +### What are WS2811/2 programmable LEDs? + +The [WS2811/2 class of programmable lights][6] integrates red, green, and blue LED lights with a driver chip into a tiny surface-mounted package controlled through a single wire. + +![Programmable LED light][7] + +(Darin London, [CC BY-SA 4.0][8]) + +Each light can be individually programmed using an RGB set of integers or hex equivalents. These lights can be packaged together into matrices, strings, and other form factors, and they can be programmatically accessed using a data structure that makes sense for the form factor. The light strings I use are addressed using a standard Python list. Adafruit has a great [tutorial on wiring and controlling your lights][9]. + +### Control NeoPixel LEDs with Python + +Adafruit has created a full suite of Python libraries for most of the parts it sells. These are designed to work with [CircuitPython][10], Adafruit's port of Python designed for low-cost microcontroller boards. You do not need to install CircuitPython on the Raspberry Pi OS because the preinstalled Python 2 and Python 3 are compatible. + +You will need to `pip3` to install libraries for Python 3. Install it with: + + +``` +`sudo apt-get install python3-pip` +``` + +Then install the following libraries: + + * [rpi_ws281x][11] + * [Adafruit-circuitpython-neopixel][12] + * [Adafruit-blinka][13] + + + +Once these libraries and their dependencies are installed, you can write code like the following to program one or more lights wired to your Raspberry Pi using `sudo python3` (sudo is required): + + +``` +import board +import neopixel +num_lights = 50 +# program 50 lights with the default brightness 1.0, and autoWrite true +pixels = neopixel.NeoPixel(board.D18, num_lights) +# light 20 bright green +pixels[19] = (0,255,0) +# light all pixels red +pixels.fill((255.0,0)) +# turn off neopixels +pixels.fill((0,0,0)) +``` + +### Set up your lighting system + + 1. Install the SD card into the Raspberry Pi and secure it, the breadboard, and lights [where they need to be][14] (velcro works for the Pi and breadboard). + + 2. Install the 74AHCT125 level converter chip, light, power supply, and Pi according to this schematic: + +![Wiring schematic][15] + +([Kattni Rembor][16], [CC BY-SA 4.0][8]) + + 3. String additional lights to the first light using their connectors. Note the total number of lights. + + 4. Plug the power supply into the wall. + + 5. Plug the Raspberry Pi power supply into the wall, and wait for it to boot. + + + + +  + +![Lighting hardware wiring][17] + +(Darin London, [CC BY-SA 4.0][8]) + +![Lighting hardware wiring][18] + +(Darin London, [CC BY-SA 4.0][8]) + +![Lighting hardware wiring][19] + +(Darin London, [CC BY-SA 4.0][8]) + +### Install the light controller and Flask web application + +I wrote a Python application and library to interact with the lights and a Flask web application that runs on the Pi. See my [Raspberry Pi Neopixel Controller][20] GitHub repository for more information about the code. + +#### The lib.neopixc library + +The [`lib.neopixc` library][21] extends the `neopixel.NeoPixC` class to work with two 50-light Alitove light strands connected in serial, using a programmable list of RGB colors lists. It adds the following functions:  + + * `set_color`: Takes a new list of lists of RGB colors + * `walk`: Walks through each light and sets them to the colors in order + * `rotate`: Pushes the last color in the list of lists to the beginning of the list of lists for blinking the lights + + + +If you have a different number of lights, you will need to edit this library to change the `self._num_lights` value. Also, some lights require a different argument in the order constructor attribute. The Alitove is compatible with the default order attribute `neopixel.GRBW`. + +#### The run_lights.py script + +The [`run_lights.py` script][22] uses `lib.neopixc` to support a colors file and a state file to dynamically set how the lights behave at any time. The colors file is a JSON array of arrays of RGB (or RGBW) integers that is fed as the colors to the `lib.neopixc` object using its `set_colors` method. The state file can hold one of three words: + + * `static`: Does not rotate the lights with each iteration of the while loop + * `blink`: Rotates the lights with each iteration of the main while loop + * `down`: Turns all the lights off + + + +If the state file does not exist, the default state is `static`. + +The script also has HUP and INT signal handlers, which will turn off the lights when those signals are received. + +Note: Because the GPIO 18 pin requires sudo on the Raspberry Pi to work, the `run_lights.py` script must be run with sudo. + +#### The neopixel_controller application + +The `neopixel_controller` Flask application, in the neopix_controller directory of the github repository (see below), offers a front-end browser graphical user interface (GUI) to control the lights. My raspberry pi connects to my wifi, and is accessible at raspberrypi.local. To access the GUI in a browser, go to . Alternatively, you can use ping to find the IP address of raspberrypi.local, and use it as the hostname, which is useful if you have multiple raspberry pi devices connected to your wifi. + +![Flask app UI][23] + +(Darin London, [CC BY-SA 4.0][8]) + +The current state and three front-end buttons use JavaScript to interact with a set of REST API endpoints presented by the Flask application: + + * `/api/v1/state`: Returns the current state of the shared state file, which defaults to `static` if the state file does not exist + * `/api/v1/blink`: Sets the state file to blink + * `/api/v1/static`: Sets the state file to static + * `/api/v1/down`: Sets the state file to down + + + +I wrote two scripts and corresponding JSON definition files that launch `run_lights.py` and the Flask application: + + * `launch_christmas.sh` + * `launch_new_years.sh` + + + +These can be launched from a command-line session (terminal or SSH) on the Pi after it is set up (they do not require sudo, but use sudo internally): + + +``` +`./launch_christmas.sh` +``` + +You can turn off the lights and stop `run_lights.sh` and the Flask application by using `lights_down.sh`. + +The code for the library and the flask application are in the [Raspberry Pi Neopixel Controller][20] GitHub repository. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/light-display-raspberry-pi + +作者:[Darin London][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dmlond +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lightbulb-idea-think-yearbook-lead.png?itok=5ZpCm0Jh (Lightbulb) +[2]: https://www.amazon.com/gp/product/B06XD72LYM +[3]: https://www.adafruit.com/category/168 +[4]: https://www.amazon.com/gp/product/B01M0KLECZ +[5]: https://opensource.com/article/20/6/custom-raspberry-pi +[6]: https://learn.adafruit.com/adafruit-neopixel-uberguide +[7]: https://opensource.com/sites/default/files/uploads/led_1.jpg (Programmable LED light) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://learn.adafruit.com/neopixels-on-raspberry-pi +[10]: https://circuitpython.org/ +[11]: https://pypi.org/project/rpi-ws281x/ +[12]: https://circuitpython.readthedocs.io/projects/neopixel/en/latest/api.html +[13]: https://pypi.org/project/Adafruit-Blinka/ +[14]: https://gpiozero.readthedocs.io/en/stable/recipes.html#pin-numbering +[15]: https://opensource.com/sites/default/files/uploads/schematic.png (Wiring schematic) +[16]: https://learn.adafruit.com/assets/64121 +[17]: https://opensource.com/sites/default/files/uploads/wiring.jpg (Lighting hardware wiring) +[18]: https://opensource.com/sites/default/files/uploads/wiring2.jpg (Lighting hardware wiring) +[19]: https://opensource.com/sites/default/files/uploads/wiring3.jpg (Lighting hardware wiring) +[20]: https://github.com/dmlond/raspberry_pi_neopixel +[21]: https://github.com/dmlond/raspberry_pi_neopixel/blob/main/lib/neopixc.py +[22]: https://github.com/dmlond/raspberry_pi_neopixel/blob/main/run_lights.py +[23]: https://opensource.com/sites/default/files/uploads/neopixelui.png (Flask app UI) From e41384ff7003758fede5d0a92756b90e3d64b538 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Jan 2021 05:04:51 +0800 Subject: [PATCH 031/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210127=20?= =?UTF-8?q?Why=20I=20use=20the=20D=20programming=20language=20for=20script?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210127 Why I use the D programming language for scripting.md --- ...he D programming language for scripting.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 sources/tech/20210127 Why I use the D programming language for scripting.md diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md new file mode 100644 index 0000000000..ab63de404e --- /dev/null +++ b/sources/tech/20210127 Why I use the D programming language for scripting.md @@ -0,0 +1,184 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why I use the D programming language for scripting) +[#]: via: (https://opensource.com/article/21/1/d-scripting) +[#]: author: (Lawrence Aberba https://opensource.com/users/aberba) + +Why I use the D programming language for scripting +====== +The D programming language is best known as a system programming +language, but it's also a great option for scripting. +![Business woman on laptop sitting in front of window][1] + +The D programming language is often advertised as a system programming language due to its static typing and metaprogramming capabilities. However, it's also a very productive scripting language. + +Python is commonly chosen for scripting due to its flexibility for automating tasks and quickly prototyping ideas. This makes Python very appealing to sysadmins, [managers][2], and developers in general for automating recurring tasks that they might otherwise have to do manually. + +It is reasonable to expect any other script-writing language to have these Python traits and capabilities. Here are two reasons why I believe D is a good option. + +### 1\. D is easy to read and write + +As a C-like language, D should be familiar to most programmers. Anyone who uses JavaScript, Java, PHP, or Python will know their way around D. + +If you don't already have D installed, [install a D compiler][3] so that you can [run the D code][4] in this article. You may also use the [online D editor][5]. + +Here is an example of D code that reads words from a file named `words.txt` and prints them on the command line: + + +``` +open +source +is +cool +``` + +Write the script in D: + + +``` +// file print_words.d + +#!/usr/bin/env rdmd + +// import the D standard library +import std; + +void main(){ +    // open the file +     File("./words.txt") + +         //iterate by line +        .byLine + +        // print each number +        .each!writeln; +} +``` + +This code is prefixed with a [shebang][6] that will run the code using [rdmd][7], a tool that comes with the D compiler to compile and run code. Assuming you are running Unix or Linux, before you can run this script, you must make it executable by using the `chmod` command: + + +``` +`chmod u+x print_words.d` +``` + +Now that the script is executable, you can run it: + + +``` +`./print_words.d` +``` + +This should print the following on your command line: + + +``` +open +source +is +cool +``` + +Congratulations! You've written your first D script. You can see how D enables you to chain functions in sequence to make reading the code feel natural, similar to how you think about problems in your mind. This [feature makes D my favorite programming language][8]. + +Try writing another script: A nonprofit manager has a text file of donations with each amount on separate lines. The manager wants to sum the first 10 donations and print the amounts: + + +``` +// file sum_donations.d + +#!/usr/bin/env rdmd + +import std; + +void main() +{ +    double total = 0; + +    // open the file +    File("monies.txt") + +         // iterate by line +        .byLine + +         // pick first 10 lines +        .take(10) + +        // remove new line characters (\n) +        .map!(strip) + +         // convert each to double +        .map!(to!double) + +        // add element to total +        .tee!((x) { total += x; }) + +        // print each number +        .each!writeln; + +    // print total +    writeln("total: ", total); +} +``` + +The `!` operator used with `each` is the syntax of a [template argument][9]. + +### 2\. D is great for quick prototyping + +D is flexible for hammering code together really quickly and making it work. Its standard library is rich with utility functions for performing common tasks, such as manipulating data (JSON, CSV, text, etc.). It also comes with a rich set of generic algorithms for iterating, searching, comparing, and mutating data. These cleverly crafted algorithms are oriented towards processing sequences by defining generic [range-based interfaces][10]. + +The script above shows how chaining functions in D provides a gist of sequential processing and manipulating data. Another appeal of D is its growing ecosystem of third-party packages for performing common tasks. An example is how easy it is to build a simple web server using the [Vibe.d][11] web framework. Here's an example: + + +``` +#!/usr/bin/env dub +/+ dub.sdl: +dependency "vibe-d" version="~>0.8.0" ++/ +void main() +{ +    import vibe.d; +    listenHTTP(":8080", (req, res) { +        res.writeBody("Hello, World: " ~ req.path); +    }); +    runApplication(); +} +``` + +This uses the official D package manager, [Dub][12], to fetch the vibe.d web framework from the [D package repository][13]. Dub takes care of downloading the Vibe.d package, then compiling and spinning up a web server on localhost port 8080. + +### Give D a try + +These are only a couple of reasons why you might want to use D for writing scripts. + +D is a great language for development. It's easy to install from the D download page, so download the compiler, take a look at the examples, and experience D for yourself. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/d-scripting + +作者:[Lawrence Aberba][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/aberba +[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/20/3/automating-community-management-python +[3]: https://tour.dlang.org/tour/en/welcome/install-d-locally +[4]: https://tour.dlang.org/tour/en/welcome/run-d-program-locally +[5]: https://run.dlang.io/ +[6]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[7]: https://dlang.org/rdmd.html +[8]: https://opensource.com/article/20/7/d-programming +[9]: http://ddili.org/ders/d.en/templates.html +[10]: http://ddili.org/ders/d.en/ranges.html +[11]: https://vibed.org +[12]: https://dub.pm/getting_started +[13]: https://code.dlang.org From 0ca1e9bd4c54811e05715d7d47e6dbc93c2caf05 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Jan 2021 05:05:06 +0800 Subject: [PATCH 032/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210127=20?= =?UTF-8?q?3=20email=20mistakes=20and=20how=20to=20avoid=20them?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210127 3 email mistakes and how to avoid them.md --- ... 3 email mistakes and how to avoid them.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20210127 3 email mistakes and how to avoid them.md diff --git a/sources/tech/20210127 3 email mistakes and how to avoid them.md b/sources/tech/20210127 3 email mistakes and how to avoid them.md new file mode 100644 index 0000000000..a9ade4721d --- /dev/null +++ b/sources/tech/20210127 3 email mistakes and how to avoid them.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 email mistakes and how to avoid them) +[#]: via: (https://opensource.com/article/21/1/email-mistakes) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +3 email mistakes and how to avoid them +====== +Automation is wonderful, except when it's not. Be sure your email +auto-responds and CCs are properly configured so you don't waste +everyone else's time. +![Computer screen with files or windows open][1] + +In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 17 of 21 Days of Productivity in 2021. + +OK, so we've talked about some things we should do with our email - [Stop treating it as an instant messenger][2], [Prioritize things][3], [trying to reach Inbox Zero][4], and [filtering it effectively][5]. But what things SHOULDN'T we do? + +  + +![Automated email reply][6] + +Lucky you (Kevin Sonney, [CC BY-SA 4.0][7]) + +### 1\. Please do not Auto-respond to _everything_ + +There is always that one person on any mailing list. They have gone on vacation and set up an "I'm on vacation" auto-reply message. However, they didn't set it up correctly, so it responds to every email on the list with "I'm on vacation" until an admin mutes or unsubscribes them. + +We have all felt this pain, and I'll admit that at least once in the past, I was that person. + +Learn from my mistakes, and make sure that your auto-responders or vacation messages have limits on who they will respond to and how often. + +![An actual email with lots of CC'd recipients][8] + +This is a real email (Kevin Sonney, [CC BY-SA 4.0][7]) + +### 2\. Please do not CC everyone and the world + +We've all done it at least once. There is that big list of people we need to send an email to, so we just carbon copy (CC) _all_ of them. Sometimes this is warranted, but most of the time, it isn't. Sure, it's nice that you invited everyone to have birthday cake in the atrium, or that your cousin twice removed is getting married, or that the company just got a big account. Please, use a mailing list if you have one, or blind carbon copy (BCC) everyone if you don't. Seriously, BCC is your friend. + +### 3\. Reply All is NOT your friend + +![Reply options in Kmail][9] + +This one goes hand-in-hand with the previous item. I do not know how many times I have seen someone send a message to a list (or just a big group of people) that was meant to go a single person. I have seen the relatively benign emails that have been sent that way and resulting disciplinary action emails that followed. + +Seriously, do not use "Reply All" button unless you have to. And even then, make sure you _really_ have to. + +Some email applications manage this better than others. Kmail, the email component of [KDE Kontact][10], has several different reply options available in a sub-menu of the **Reply** toolbar button. You can choose to just reply to whatever entity is in the **From** field (usually a person, but sometimes a mailing list), or to the author (dropping anyone in CC or BCC), just to a mailing list, or to _all_ (don't do this). Seeing the options listed explicitly can really help you understand who's going to get a copy of an email you're about to send, which is sometimes more thought-provoking than you might expect. I've caught myself changing the recipient of an email to just the author instead of to an entire list upon realizing that a comment doesn't necessarily add to the end goal of a complex discussion. + +(Also, if you write an email that could get you in trouble with HR or your company, think about it for a long time before hitting Send.) + +Hopefully, these are things you are already _not_ doing with email. And if someone you know is? Feel free to share this with them. + +Ditch Outlook and check out six of the best open source desktop email applications. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/email-mistakes + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[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://opensource.com/article/21/1/email-rules +[3]: https://opensource.com/article/21/1/prioritize-tasks +[4]: https://opensource.com/article/21/1/inbox-zero +[5]: https://opensource.com/article/21/1/email-filter +[6]: https://opensource.com/sites/default/files/day17-image1.png +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/day17-image2.png +[9]: https://opensource.com/sites/default/files/kmail-replies.jpg (Reply options in Kmail) +[10]: https://opensource.com/article/21/1/kde-kontact From 56cf3d1e4badc221629468a2ce984d9555c8a2e3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Jan 2021 08:55:06 +0800 Subject: [PATCH 033/213] translated --- ...ultimate open source productivity suite.md | 69 ------------------- ...ultimate open source productivity suite.md | 68 ++++++++++++++++++ 2 files changed, 68 insertions(+), 69 deletions(-) delete mode 100644 sources/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md create mode 100644 translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md diff --git a/sources/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md b/sources/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md deleted file mode 100644 index 936901907e..0000000000 --- a/sources/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md +++ /dev/null @@ -1,69 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How Nextcloud is the ultimate open source productivity suite) -[#]: via: (https://opensource.com/article/21/1/nextcloud-productivity) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -How Nextcloud is the ultimate open source productivity suite -====== -Nextcloud can replace many of the online apps you use for collaboration, -organization, and task management. -![Working on a team, busy worklife][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 11 of 21 Days of Productivity in 2021. - -Web-based services allow for access to your data almost anywhere and they support millions of users hourly. For some of us, though, running our own service is preferable to using a big company's service for various reasons. Maybe we work on things that are subject to regulation or have explicit security requirements. Perhaps we have privacy concerns, or just like being able to build, run, and fix things ourselves. Whatever the case may be, [Nextcloud][2] can provide most of the services you need, but on your own hardware. - -![NextCloud Dashboard displaying service options][3] - -The Nextcloud Dashboard (Kevin Sonney, [CC BY-SA 4.0][4]) - -Most of the time, when we think of Nextcloud, we think of file sharing and syncing, similar to commercial products like Dropbox, OneDrive, and Google Drive. However, these days, it is a full-on productivity suite, with an email client, calendaring, tasks, and notebooks. - -There are several ways to set up and run Nextcloud. You can install it to a bare metal server, run it in Docker containers, or as a virtual machine. There are also hosted services that will run Nextcloud for you, should you choose. Finally, there are apps for every major OS, including mobile apps for access on-the-go. - -![Nextcloud virtual machine][5] - -The Nextcloud VM (Kevin Sonney, [CC BY-SA 4.0][4]) - -By default, Nextcloud comes with file sharing and a few other related apps (or add-ons) installed. You can find the Apps page in the Admin interface, which allows you to install individual add-ons and some pre-defined bundles of related apps. For my install, I chose the _Groupware Bundle_, which includes mail, calendars, contacts, and Deck. Deck is a lightweight Kanban Board for handling tasks. I installed the _Notes_ and _Tasks_ apps as well. - -The Nextcloud Mail app is a very straight-forward IMAP email client. While Nextcloud does not include an IMAP or SMTP server as part of the packages, you can easily add one to the OS or use a remote service. The Calendar application is pretty standard and also allows you to subscribe to remote calendars. One drawback is that remote calendars (say, from a large cloud provider) are read-only, so you can view but not modify them. - -![NextCoud App Interface][6] - -The Nextcloud App interface (Kevin Sonney, [CC BY-SA 4.0][4]) - -Notes is a simple text notepad, allowing you to create and update short notes, journals, and related things. Tasks is a to-do list application with support for multiple lists, task priorities, percent complete, and several other standard features that users expect. If you installed Deck, its task cards are listed as well. Each Board will show up as its own list, so you can use Deck or Tasks to track what is complete. - -Deck itself is a Kanban Board app, presenting tasks as cards to move through a process. If you like the Kanban flow, it is an excellent application for tracking progress. - -![Taking notes][7] - -Taking notes (Kevin Sonney, [CC BY-SA 4.0][4]) - -All the applications in Nextcloud natively support sharing via standard protocols. Unlike some similar solutions, this sharing does not feel like it was added on to check a features box. Sharing is one of the primary reasons Nextcloud exists, and so it is very simple to use. You can also add the ability to share links to social media, via email, and so on. You can use Nextcloud to replace several online services in a single interface, accessible from anywhere, with a collaboration-first mindset. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/nextcloud-productivity - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) -[2]: https://nextcloud.com/ -[3]: https://opensource.com/sites/default/files/day11-image1_0.png -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/sites/default/files/pictures/nextcloud-vm.png (Nextcloud virtual machine) -[6]: https://opensource.com/sites/default/files/pictures/nextcloud-app-interface.png (NextCoud App Interface) -[7]: https://opensource.com/sites/default/files/day11-image3.png (Taking notes in Nextcloud) diff --git a/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md b/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md new file mode 100644 index 0000000000..8bb5a49cc0 --- /dev/null +++ b/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md @@ -0,0 +1,68 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How Nextcloud is the ultimate open source productivity suite) +[#]: via: (https://opensource.com/article/21/1/nextcloud-productivity) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +Nextcloud 是如何成为终极开源生产力套件的 +====== +Nextcloud 可以取代你用于协作、组织和任务管理的许多在线应用。 +![Working on a team, busy worklife][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十一天。 + +基于网络的服务几乎可以在任何地方访问你的数据,它们每小时支持数百万用户。不过对于我们中的一些人来说,由于各种原因,运行自己的服务比使用大公司的服务更可取。也许我们的工作是受监管或有明确安全要求。也许我们有隐私方面的考虑,或者只是喜欢能够自己构建、运行和修复事物。不管是什么情况,[Nextcloud][2] 都可以提供你所需要的大部分服务,但是是在你自己的硬件上。 + +![NextCloud Dashboard displaying service options][3] + +Nextcloud 控制面板(Kevin Sonney, [CC BY-SA 4.0][4]) + +大多数时候,当我们想到 Nextcloud 时,我们会想到文件共享和同步,类似于 Dropbox、OneDrive 和 Google Drive 等商业产品。然而,如今,它是一个完整的生产力套件,拥有电子邮件客户端、日历、任务和笔记本。 + +有几种方法可以安装和运行 Nextcloud。你可以把它安装到裸机服务器上、在 Docker 容器中运行,或者作为虚拟机运行。如果你选择的话,还有一些托管服务将为你运行 Nextcloud。最后,有适用于所有主流操作系统的应用,包括移动应用,以便随时访问。 + +![Nextcloud virtual machine][5] + +Nextcloud 虚拟机(Kevin Sonney, [CC BY-SA 4.0][4]) + +默认情况下,Nextcloud 会安装文件共享和其他一些相关应用(或附加组件)。你可以在管理界面中找到”应用“页面,这里允许你安装单个附加组件和一些预定义的相关应用捆绑。对我而言,我选择了 _Groupware Bundle_,其中包括邮件、日历、联系人和 Deck。Deck 是一个轻量级的看板,用于处理任务。我也安装了 _Notes_ 和 _Tasks_ 应用。 + +Nextcloud Mail 是一个非常直接的 IMAP 邮件客户端。虽然 Nextcloud 没有将 IMAP 或 SMTP 服务器作为软件包的一部分,但你可以很容易地在操作系统中添加一个或使用远程服务。日历应用是相当标准的,也允许你订阅远程日历。有一个缺点是,远程日历(例如,来自大型云提供商)是只读的,所以你可以查看但不能修改它们。 + +![NextCoud App Interface][6] + +Nextcloud 应用界面 (Kevin Sonney, [CC BY-SA 4.0][4]) + +Notes 是一个简单的文本记事本,允许你创建和更新简短的笔记、日记和相关的东西。Tasks 是一款待办事项应用,支持多个列表、任务优先级、完成百分比以及其他一些用户期待的标准功能。如果你安装了 Deck,它的任务卡也会被列出来。每个看板都会显示自己的列表,所以你可以使用 Deck 或 Tasks 来跟踪完成的内容。 + +Deck 本身就是一个看板应用,将任务以卡片的形式呈现在流程中。如果你喜欢看板流程,它是一个追踪进度的优秀应用。 + +![Taking notes][7] + +做笔记 (Kevin Sonney, [CC BY-SA 4.0][4]) + +Nextcloud 中所有的应用都原生支持通过标准协议进行共享。与一些类似的解决方案不同,它的分享并不是为了完成功能列表中的一项而加上去的。分享是 Nextcloud 存在的主要原因之一,所以使用起来非常简单。你还可以将链接分享到社交媒体、通过电子邮件分享等。你可以用一个 Nextcloud 取代多个在线服务,它在任何地方都可以访问,以协作为先。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/nextcloud-productivity + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) +[2]: https://nextcloud.com/ +[3]: https://opensource.com/sites/default/files/day11-image1_0.png +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/pictures/nextcloud-vm.png (Nextcloud virtual machine) +[6]: https://opensource.com/sites/default/files/pictures/nextcloud-app-interface.png (NextCoud App Interface) +[7]: https://opensource.com/sites/default/files/day11-image3.png (Taking notes in Nextcloud) From a4bbddec55600eceab05110768e287df84334baa Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Jan 2021 09:01:17 +0800 Subject: [PATCH 034/213] translating --- ...210126 Use your Raspberry Pi as a productivity powerhouse.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md b/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md index cb0535cba7..f731211028 100644 --- a/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md +++ b/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1099b3b9ff206566742e3c5c1ef451adea0b451d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 28 Jan 2021 10:25:05 +0800 Subject: [PATCH 035/213] PRF @geekpi --- ...o use KDE-s productivity suite, Kontact.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md b/translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md index 6905ecf4ac..db238ecd57 100644 --- a/translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md +++ b/translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to use KDE's productivity suite, Kontact) @@ -9,46 +9,46 @@ 如何使用 KDE 的生产力套件 Kontact ====== -KDE 是很棒的,但当你使用统一个人信息管理器 Kontact 时,它才真正发挥了作用。 -![Working on a team, busy worklife][1] + +> KDE 很棒,但当你使用这个统一个人信息管理器 Kontact 时,它才真正发挥了作用。 + +![](https://img.linux.net.cn/data/attachment/album/202101/28/094146fyx79l7zwbwej7ym.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第六天。 -在很久很久以前,当编译内核是获取 wifi 驱动的唯一途径时,图形环境主要是用来运行网页浏览器和打开大量终端窗口。其外观和感觉是程序作者选择使用的任何工具箱的大杂烩。然后,在 1996 年 [Matthias Ettrich][2] 提出并随后发布了第一个版本的 [KDE][3]。它是基于当时专有的 [Qt][4]工具箱(后来成为免费和开源的)。这个版本引发了 Linux 上的桌面革命,同时还有使用当时的 FOSS GTK 工具包创建的 [GNOME 桌面][5] 。在 KDE 和 GNOME 之间,Linux 从一个_只有电脑操作人员使用的 Linux_ 操作系统变成了一个人人都能使用的强大桌面环境。 +在很久很久以前,当编译内核还是获取 WiFi 驱动的唯一途径时,图形环境主要是用来运行网页浏览器和打开大量终端窗口。其外观和感觉是由程序作者选择使用的各种工具箱组成的大杂烩。然后,在 1996 年 [Matthias Ettrich][2] 提出并随后发布了第一个版本的 [KDE][3]。它是基于当时专有的 [Qt][4] 工具箱(后来成为自由而开源的)。这个版本引发了 Linux 上的桌面革命,同一时期出现的还有使用当时的自由开源软件 GTK 工具包所创建的 [GNOME 桌面][5] 。不管是 KDE 还是 GNOME,Linux 从一个*只有电脑操作人员使用的 Linux 操作系统*变成了一个人人都能使用的强大桌面环境。 ![Fedora KDE Spin Default Desktop][6] -Fedora KDE Spin 默认桌面 (Kevin Sonney, [CC BY-SA 4.0][7]) +*Fedora KDE 版的默认桌面 (Kevin Sonney, [CC BY-SA 4.0][7])* -KDE Plasma 5 是最新的 KDE 化身,它的功能非常丰富,可以提高你的工作效率。包括 Konqueror 网页浏览器、Dolphin 文件管理器和 Konsole 终端模拟器。所有这些都为桌面环境提供了一个很好的坚实基础,但是 KDE 真正提高生产力的方法是统一的个人信息管理器 [Kontact][8]。 +KDE Plasma 5 是最新的 KDE 版本,它的功能非常丰富,可以提高你的工作效率。它包括了 Konqueror 网页浏览器、Dolphin 文件管理器和 Konsole 终端模拟器,所有这些都为这个桌面环境提供了一个很好的坚实基础,但是 KDE 真正提高生产力的方法是这个统一个人信息管理器:[Kontact][8]。 -Kontact 为其他几个 KDE 程序提供了一个单一的界面,包括:KMail (电子邮件)、KOrganizer (日历、待办事项和日记)、KAddressBook、KNotes、Akregator (RSS/ATOM 订阅阅读器)等。第一次启动时,Kontact 会引导你完成电子邮件提供商的设置,它支持本地和远程邮件配置。然后,Kontact 进入一个仪表板,默认情况下,仪表板会显示最近的电子邮件、日历事件、计划任务和最近的笔记。 +Kontact 为其他几个 KDE 程序提供了一个单一的界面,包括:KMail(电子邮件)、KOrganizer(日历、待办事项和日记)、KAddressBook(地址簿)、KNotes(笔记)、Akregator(RSS/ATOM 订阅阅读器)等。第一次启动时,Kontact 会引导你完成电子邮件提供商的设置,它支持本地和远程邮件配置。然后,Kontact 会进入一个仪表板,默认情况下,该仪表板会显示最近的电子邮件、日历事件、计划任务和最近的笔记。 ![Kontact Summary screen][9] -Kontact 概览页面 (Kevin Sonney, [CC BY-SA 4.0][7]) +*Kontact 概览页面 (Kevin Sonney, [CC BY-SA 4.0][7])* -设置“流程”看起来有点奇怪,因为在内置的本地账户之外没有配置统一的单一账户。在 Kontact(通过 KMail)引导你完成邮件设置后,你可以进入日历页面添加你的日历,这里也配置了待办事项和日记应用(对于某些提供商,还可以配置通讯录)。 +设置“流程”看起来有点奇怪,因为在内置的本地账户之外没有配置统一的单一账户。在 Kontact(通过 KMail)引导你完成邮件设置后,你就可以进入日历页面添加你的日历,这里也配置了待办事项和日记应用(对于某些提供商,还可以配置通讯录)。 -邮件和日历组件非常简单,可以如你期望地正常工作。待办事项页面和日记是与日历绑定的,这对于一些不完全支持所有日历类型的日历提供商来说可能是个问题(Google。我是说 Google)。如果你使用的是这些提供商中的一个,你将需要为日记和待办事项创建一个特定的本地日历。 +邮件和日历组件非常简单明了,可以如你期望地正常工作。待办事项页面和日记是与日历绑定的,这对于一些不完全支持所有日历类型的日历提供商来说可能是个问题(Google,我说的是你)。如果你使用的是这些提供商中的一个,你将需要为日记和待办事项创建一个特定的本地日历。 ![Kontact Calendar][10] -Kontact Calendar (Kevin Sonney, [CC BY-SA 4.0][7]) +*Kontact Calendar (Kevin Sonney, [CC BY-SA 4.0][7])* 待办事项列表有很多功能。虽然它可以作为一个简单的任务清单与提醒,它也支持一些轻量级的项目管理功能。它有一个完成百分比的滑块,可以从主列表视图中更新,这样你就可以跟踪进度。它能够附加文件和分配 1-10 的优先级。最后,它可以像其他日历约会一样将用户添加到任务中。 -创建一个日记条目本质上是在日历上给自己创建一个笔记。它是一个自由形式的文本,就像在特定的一天写在笔记本或计划书上那样。如果你要记录工作,保持每天的日记,或只是需要个地方记录会议记录,这个功能是非常_方便_的(后面有更多关于这个系列)。 +创建一个日记条目本质上是在日历上给自己创建一个笔记。它是一段形式自由的文本,就像写在实体笔记本和计划手册的某一天上那样。如果你要记录工作,写下每天的日记,或只是需要个地方记录会议记录,这个功能是非常*方便*的(本系列后面有更多关于这个的内容)。 ![Kontact Journal][11] -Kontact Journal (Kevin Sonney, [CC BY-SA 4.0][7]) +*Kontact Journal (Kevin Sonney, [CC BY-SA 4.0][7])* -构成 Kontact 的程序非常强大,如果你愿意的话,可以作为单独的应用运行。Kontact 通过给你提供一个集中的地方和应用来找到你所有的信息,从而提升了它们的实用性。 +构成 Kontact 的这些程序非常强大,如果你愿意的话,也可以作为单独的应用运行。Kontact 通过给你提供一个集中的地方,在一个应用内找到你所有的信息,从而提升了它们的实用性。 -大多数发行版都允许你在没有 KDE 的情况下安装 Kontact 和它所使用的组件,但当它作为 KDE 桌面的一部分使用时,它才会真正发挥其作用。KDE 在 Fedora KDE Spin、KUbuntu、KDE Neon(基于 Ubuntu LTS)和其他几个发行版中都可以作为默认桌面。 - -KDE 最初代表 Kool Desktop Environment,但现在被许多人称为 K Desktop。。。 +大多数发行版都允许你在没有 KDE 的情况下安装 Kontact 和它所使用的组件,但当它作为 KDE 桌面的一部分使用时,它才会真正发挥其作用。KDE 在 Fedora KDE 版、KUbuntu、KDE Neon(基于 Ubuntu LTS)和其他几个发行版中都是默认桌面。 -------------------------------------------------------------------------------- @@ -57,7 +57,7 @@ via: https://opensource.com/article/21/1/kde-kontact 作者:[Kevin Sonney][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 9d4f2f0dab50eff55d0150899d61b8d35d4bde00 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 28 Jan 2021 10:25:37 +0800 Subject: [PATCH 036/213] PUB @geekpi https://linux.cn/article-13059-1.html --- .../20210116 How to use KDE-s productivity suite, Kontact.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210116 How to use KDE-s productivity suite, Kontact.md (98%) diff --git a/translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md b/published/20210116 How to use KDE-s productivity suite, Kontact.md similarity index 98% rename from translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md rename to published/20210116 How to use KDE-s productivity suite, Kontact.md index db238ecd57..617d48c640 100644 --- a/translated/tech/20210116 How to use KDE-s productivity suite, Kontact.md +++ b/published/20210116 How to use KDE-s productivity suite, Kontact.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13059-1.html) [#]: subject: (How to use KDE's productivity suite, Kontact) [#]: via: (https://opensource.com/article/21/1/kde-kontact) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 64f2e2e440637be47f6c4f036be83231887bb2fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 29 Jan 2021 05:03:36 +0800 Subject: [PATCH 037/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210128=20?= =?UTF-8?q?Interview=20with=20Shuah=20Khan,=20Kernel=20Maintainer=20&=20Li?= =?UTF-8?q?nux=20Fellow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md --- ... Khan, Kernel Maintainer - Linux Fellow.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md diff --git a/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md b/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md new file mode 100644 index 0000000000..1d22b6f0fb --- /dev/null +++ b/sources/tech/20210128 Interview with Shuah Khan, Kernel Maintainer - Linux Fellow.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Interview with Shuah Khan, Kernel Maintainer & Linux Fellow) +[#]: via: (https://www.linux.com/news/interview-with-shuah-khan-kernel-maintainer-linux-fellow/) +[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/interview-with-shuah-khan-kernel-maintainer-linux-fellow/) + +Interview with Shuah Khan, Kernel Maintainer & Linux Fellow +====== + +![][1] + +_Jason Perlow, Director of Project Insights and Editorial Content at the Linux Foundation, had an opportunity to speak with Shuah Khan about her experiences as a woman in the technology industry. She discusses how mentorship can improve the overall diversity and makeup of open source projects, why software maintainers are important for the health of open source projects such as the Linux kernel, and how language inclusivity and codes of conduct can improve relationships and communication between software maintainers and individual contributors._ + +**JP:** So, Shuah, I know you wear many different hats at the Linux Foundation. What do you call yourself around here these days? + +**SK:** <laughs> Well, I primarily call myself a Kernel Maintainer & Linux Fellow. In addition to that, I focus on two areas that are important to the continued health and sustainability of the open source projects in the Linux ecosystem. The first one is bringing more women into the Kernel community, and additionally, I am leading the mentorship program efforts overall at the Linux Foundation. And in that role, in addition to the Linux Kernel Mentorship, we are looking at how the Linux Foundation mentorship program is working overall, how it is scaling. I make sure the [LFX Mentorship][2] platform scales and serves diverse mentees and mentors’ needs in this role. + +The LF mentorships program includes several projects in the Linux kernel, LFN, HyperLedger, Open MainFrame, OpenHPC, and other technologies. [The Linux Foundation’s Mentorship Programs][3] are designed to help developers with the necessary skills–many of whom are first-time open source contributors–experiment, learn, and contribute effectively to open source communities. + +The mentorship program has been successful in its mission to train new developers and make these talented pools of prospective employees trained by experts to employers. Several graduated mentees have found jobs. New developers have improved the quality and security of various open source projects, including the Linux kernel. Several Linux kernel bugs were fixed, a new subsystem mentor was added, and a new driver maintainer is now part of the Linux kernel community. My sincere thanks to all our mentors for volunteering to share their expertise. + +**JP:** How long have you been working on the Kernel? + +**SK:** Since 2010, or 2011, I got involved in the [Android Mainlining project][4]. My [first patch removed the Android pmem driver][5]. + +**JP:** Wow! Is there any particular subsystem that you specialize in? + +**SK:** I am a self described generalist. I maintain the [kernel self-test][6] subsystem, the [USB over IP driver][7], [usbip tool][8], and the [cpupower][9] tool. I contributed to the media subsystem working on [Media Controller Device Allocator API][10] to resolve shared device resource management problems across device drivers from different subsystems. + +**JP:** Hey, I’ve [actually used the USB over IP driver][11] when I worked at Microsoft on Azure. And also, when I’ve used AWS and Google Compute. + +**SK:** It’s a small niche driver used in cloud computing. Docker and other containers use that driver heavily. That’s how they provide remote access to USB devices on the server to export devices to be imported by other systems for use. + +**JP:** I initially used it for IoT kinds of stuff in the embedded systems space. Were you the original lead developer on it, or was it one of those things you fell into because nobody else was maintaining it? + +**SK:** Well, twofold. I was looking at USB over IP because I like that technology. it just so happened the driver was brought from the staging tree into the Mainline kernel, I volunteered at the time to maintain it. Over the last few years, we discovered some security issues with it, because it handles a lot of userspace data, so I had a lot of fun fixing all of those. <laugh>. + +**JP:** What drew you into the Linux operating system, and what drew you into the kernel development community in the first place? + +**SK:** Well, I have been doing kernel development for a very long time. I worked on the [LynxOS RTOS][12], a while back, and then HP/UX, when I was working at HP, after which I transitioned into  doing open source development — the [OpenHPI][13] project, to support HP’s rack server hardware, and that allowed me to work much more closely with Linux on the back end. And at some point, I decided I wanted to work with the kernel and become part of the Linux kernel community. I started as an independent contributor. + +**JP:** Maybe it just displays my own ignorance, but you are the first female, hardcore Linux kernel developer I have ever met. I mean, I had met female core OS developers before — such as when I was at Microsoft and IBM — but not for Linux. Why do you suppose we lack women and diversity in general when participating in open source and the technology industry overall? + +**SK:** So I’ll answer this question from my perspective, from what I have seen and experienced, over the years. You are right; you probably don’t come across that many hardcore women Kernel developers. I’ve been working professionally in this industry since the early 1990s, and on every project I have been involved with, I am usually the only woman sitting at the table. Some of it, I think, is culture and society. There are some roles that we are told are acceptable to women — even me, when I was thinking about going into engineering as a profession. Some of it has to do with where we are guided, as a natural path. + +There’s a natural resistance to choosing certain professions that you have to overcome first within yourself and externally. This process is different for everybody based on their personality and their origin story. And once you go through the hurdle of getting your engineering degree and figuring out which industry you want to work in, there is a level of establishing credibility in those work environments you have to endure and persevere. Sometimes when I would walk into a room, I felt like people were looking at me and thinking, “why is she here?” You aren’t accepted right away, and you have to overcome that as well. You have to go in there and say, “I am here because I want to be here, and therefore, I belong here.” You have to have that mindset. Society sends you signals that “this profession is not for me” — and you have to be aware of that and resist it. I consider myself an engineer that happens to be a woman as opposed to a woman engineer. + +**JP:** Are you from India, originally? + +**SK:** Yes. + +**JP:** It’s funny; my wife really likes this [Netflix show about matchmaking in India][14]. Are you familiar with it? + +**SK:** <laughs> Yes I enjoyed the series, and [A Suitable Girl][15] documentary film that follows three women as they navigate making decisions about their careers and family obligations. + +**JP:** For many Americans, this is our first introduction to what home life is like for Indian people. But many of the women featured on this show are professionals, such as doctors, lawyers, and engineers. And they are very ambitious, but of course, the family tries to set them up in a marriage to find a husband for them that is compatible. As a result, you get to learn about the traditional values and roles they still want women to play there — while at the same time, many women are coming out of higher learning institutions in that country that are seeking technical careers. + +**SK:** India is a very fascinatingly complex place. But generally speaking, in a global sense, having an environment at home where your parents tell you that you may choose any profession you want to choose is very encouraging. I was extremely fortunate to have parents like that. They never said to me that there was a role or a mold that I needed to fit into. They have always told me, “do what you want to do.” Which is different; I don’t find that even here, in the US. Having that support system, beginning in the home to tell you, “you are open to whatever profession you want to choose,” is essential. That’s where a lot of the change has to come from. + +**JP:** Women in technical and STEM professions are becoming much more prominent in other countries, such as China, Japan, and Korea. For some reason, in the US, I tend to see more women enter the medical profession than hard technology — and it might be a level of effort and perceived reward thing. You can spend eight years becoming a medical doctor or eight years becoming a scientist or an engineer, and it can be equally difficult, but the compensation at the end may not be the same. It’s expensive to get an education, and it takes a long time and hard work, regardless of the professional discipline. + +**SK:** I have also heard that women also like to enter professions where they can make a difference in the world — a human touch, if you will. So that may translate to them choosing careers where they can make a larger impact on people — and they may view careers in technology as not having those same attributes. Maybe when we think about attracting women to technology fields, we might have to promote technology aspects that make a difference. That may be changing now, such as the [LF Public Health][16] (LFPH) project we kicked off last year. And with [LF AI & Data Foundation][17], we are also making a difference in people’s lives, such as [detecting earthquakes][18] or [analyzing climate change][19]. If we were to promote projects such as these, we might draw more women in. + +**JP:** So clearly, one of the areas of technology where you can make a difference is in open source, as the LF is hosting some very high-concept and existential types of projects such as [LF Energy][20], for example — I had no idea what was involved in it and what its goals were until I spoke to [Shuli Goodman][21] in-depth about it. With the mentorship program, I assume we need this to attract fresh talent — because as folks like us get older and retire, and they exit the field, we need new people to replace them. So I assume mentorship, for the Linux Foundation, is an investment in our own technologies, correct? + +**SK:** Correct. Bringing in new developers into the fold is the primary purpose, of course — and at the same time, I view the LF as taking on mentorship provides that neutral, level playing field across the industry for all open source projects. Secondly, we offer a self-service platform, [LFX Mentorship][22], where anyone can come in and start their project. So when the COVID-19 pandemic began, we [expanded this program to help displaced people][3] — students, et cetera, and less visible projects. Not all projects typically get as much funding or attention as others do — such as a Kubernetes or  Linux kernel — among the COVID mentorship program projects we are funding. I am particularly proud of supporting a climate change-related project, [Using Machine Learning to Predict Deforestation][23]. + +The self-service approach allows us to fund and add new developers to projects where they are needed. The LF mentorships are remote work opportunities that are accessible to developers around the globe. We see people sign up for mentorship projects from places we haven’t seen before, such as Africa, and so on, thus creating a level playing field. + +The other thing that we are trying to increase focus on is how do you get maintainers? Getting new developers is a starting point, but how do we get them to continue working on the projects they are mentored on? As you said, someday, you and I and others working on these things are going to retire, maybe five or ten years from now. This is a harder problem to solve than training and adding new developers to the project itself. + +**JP:** And that is core to our [software supply chain security mission][24]. It’s one thing to have this new, flashy project, and then all these developers say, “oh wow, this is cool, I want to join that,” but then, you have to have a certain number of people maintaining it for it to have long-term viability. As we learned in our [FOSS study with Harvard][25], there are components in the Linux operating system that are like this. Perhaps even modules within the kernel itself, I assume that maybe you might have only one or two people actively maintaining it for many years. And what happens if that person dies or can no longer work? What happens to that code? And if someone isn’t familiar with that code, it might become abandoned. That’s a serious problem in open source right now, isn’t it? + +**SK:** Right. We have seen that with SSH and other security-critical areas. What if you don’t have the bandwidth to fix it? Or the money to fix it? I ended up volunteering to maintain a tool for a similar reason when the maintainer could no longer contribute regularly. It is true; we have many drivers where maintainer bandwidth is an issue in the kernel. So the question is, how do we grow that talent pool? + +**JP:** Do we need a job board or something? We need X number of maintainers. So should we say, “Hey, we know you want to join the kernel project as a contributor, and we have other people working on this thing, but we really need your help working on something else, and if you do a good job, we know tons of companies willing to hire developers just like you?” + +**SK:** With the kernel, we are talking about organic growth; it is just like any other open source project. It’s not a traditional hire and talent placement scenario. Organically they have to have credibility, and they have to acquire it through experience and relationships with people on those projects. We just talked about it at the previous [Linux Plumbers Conference][26], we do have areas where we really need maintainers, and the [MAINTAINERS][27] file does show areas where they need help. + +To answer your question, it’s not one of those things where we can seek people to fill that role, like LinkedIn or one of the other job sites. It has to be an organic fulfillment of that role, so the mentorship program is essential in creating those relationships. It is the double-edged sword of open source; it is both the strength and weakness. People need to have an interest in becoming a maintainer and also a commitment to being one, long term. + +**JP:** So, what do you see as the future of your mentorship and diversity efforts at the Linux Foundation? What are you particularly excited about that is forthcoming that you are working on? + +**SK:** I view the Linux Foundation mentoring as a three-pronged approach to provide unstructured webinars, training courses, and structured mentoring programs. All of these efforts combine to advance a diverse, healthy, and vibrant open source community. So over the past several months, we have been morphing our speed mentorship style format into an expanded webinar format — the [LF Live Mentorship series][28]. This will have the function of growing our next level of expertise. As a complement to our traditional mentorship programs, these are webinars and courses that are an hour and a half long that we hold a few times a month that tackle specific technical areas in software development. So it might cover how to write great commit logs, for example, for your patches to be accepted, or how to find bugs in C code. Commit logs are one of those things that are important to code maintenance, so promoting good documentation is a beneficial thing. Webinars provide a way for experts short on time to share their knowledge with a few hours of time commitment and offer a self-paced learning opportunity to new developers. + +Additionally, I have started the [Linux Kernel Mentorship forum][29] for developers and their mentors to connect and interact with others participating in the Linux Kernel Mentorship program and graduated mentees to mentor new developers. We kicked off [Linux Kernel mentorship Spring 2021][30] and are planning for Summer and Fall. + +A big challenge is we are short on mentors to be able to scale the structured program. Solving the problem requires help from LF member companies and others to encourage their employees to mentor, “it takes a village,” they say. + +**JP:** So this webinar series and the expanded mentorship program will help developers cultivate both hard and soft skills, then. + +**SK:** Correct. The thing about doing webinars is that if we are talking about this from a diversity perspective, they might not have time for a full-length mentorship, typically like a three-month or six-month commitment. This might help them expand their resources for self-study. When we ask for developers’ feedback about what else they need to learn new skill sets, we hear that they don’t have resources, don’t have time to do self-study, and learn to become open source developers and software maintainers. This webinar series covers general open source software topics such as the Linux kernel and legal issues. It could also cover topics specific to other LF projects such as CNCF, Hyperledger, LF Networking, etc. + +**JP:** Anything else we should know about the mentorship program in 2021? + +**SK:** In my view,  attracting diversity and new people is two-fold. One of the things we are working on is inclusive language. Now, we’re not talking about curbing harsh words, although that is a component of what we are looking at. The English you and I use in North America isn’t the same English used elsewhere. As an example, when we use North American-centric terms in our email communications, such as when a maintainer is communicating on a list with people from South Korea, something like “where the rubber meets the road” may not make sense to them at all. So we have to be aware of that. + +**JP:** I know that you are serving on the [Linux kernel Code of Conduct Committee][31] and actively developing the handbook. When I first joined the Linux Foundation, I learned what the Community Managers do and our governance model. I didn’t realize that we even needed to have codes of conduct for open source projects. I have been covering open source for 25 years, but I come out of the corporate world, such as IBM and Microsoft. Codes of Conduct are typically things that the Human Resources officer shows you during your initial onboarding, as part of reviewing your employee manual. You are expected to follow those rules as a condition of employment. + +So why do we need Codes of Conduct in an open source project? Is it because these are people who are coming from all sorts of different backgrounds, companies, and ways of life, and may not have interacted in this form of organized and distributed project before? Or is it about personalities, people interacting with each other over long distance, and email, which creates situations that may arise due to that separation? + +**SK:** Yes, I come out of the corporate world as well, and of course, we had to practice those codes of conduct in that setting. But conduct situations arise that you have to deal with in the corporate world. There are always interpersonal scenarios that can be difficult or challenging to work with — the corporate world isn’t better than the open source world in that respect. It is just that all of that happens behind a closed setting. + +But there is no accountability in the open source world because everyone participates out of their own free will. So on a small, traditional closed project, inside the corporate world, where you might have 20 people involved, you might get one or two people that could be difficult to work with. The same thing happens and is multiplied many times in the open source community, where you have hundreds of thousands of developers working across many different open source projects. + +The biggest problem with these types of projects when you encounter situations such as this is dealing with participation in public forums. In the corporate world, this can be addressed in private. But on a public mailing list, if you are being put down or talked down to, it can be extremely humiliating. + +These interactions are not always extreme cases; they could be simple as a maintainer or a lead developer providing negative feedback — so how do you give it? It has to be done constructively. And that is true for all of us. + +**JP:** Anything else? + +**SK:** In addition to bringing our learnings and applying this to the kernel project, I am also doing this on the [ELISA][32] project, where I chair the Technical Steering Committee, where I am bridging communication between experts from the kernel and the safety communities. To make sure we can use the kernel the best ways in safety-critical applications, in the automotive and medical industry, and so on. Many lessons can be learned in terms of connecting the dots, defining clearly what is essential to make Linux run effectively in these environments, in terms of dependability. How can we think more proactively instead of being engaged in fire-fighting in terms of security or kernel bugs? As a result of this, I am also working on any necessary kernel changes needed to support these safety-critical usage scenarios. + +**JP:** Before we go, what are you passionate about besides all this software stuff? If you have any free time left, what else do you enjoy doing? + +**SK:** I read a lot. COVID quarantine has given me plenty of opportunities to read. I like to go hiking, snowshoeing, and other outdoor activities. Living in Colorado gives me ample opportunities to be in nature. I also like backpacking — while I wasn’t able to do it last year because of COVID — I like to take backpacking trips with my son. I also love to go to conferences and travel, so I am looking forward to doing that again as soon as we are able. + +Talking about backpacking reminded me of the two-day, 22-mile backpacking trip during the summer of 2019 with my son. You can see me in the picture above at the end of the road, carrying a bearbox, sleeping bag, and hammock. It was worth injuring my foot and hurting in places I didn’t even know I had. + +**JP:** Awesome. I enjoyed talking to you today. So happy I finally got to meet you virtually. + +The post [Interview with Shuah Khan, Kernel Maintainer & Linux Fellow][33] appeared first on [Linux Foundation][34]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/interview-with-shuah-khan-kernel-maintainer-linux-fellow/ + +作者:[The Linux Foundation][a] +选题:[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.linuxfoundation.org/en/blog/interview-with-shuah-khan-kernel-maintainer-linux-fellow/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2021/01/3E9C3E02-5F59-4A99-AD4A-814C7B8737A9_1_105_c.jpeg +[2]: https://lfx.linuxfoundation.org/tools/mentorship/ +[3]: https://linuxfoundation.org/about/diversity-inclusivity/mentorship/ +[4]: https://elinux.org/Android_Mainlining_Project +[5]: https://lkml.org/lkml/2012/1/26/368 +[6]: https://www.kernel.org/doc/html/v4.15/dev-tools/kselftest.html +[7]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/usbip +[8]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/usb/usbip +[9]: https://www.systutorials.com/docs/linux/man/1-cpupower/ +[10]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/media/mc/mc-dev-allocator.c +[11]: https://www.linux-magazine.com/Issues/2018/208/Tutorial-USB-IP +[12]: https://en.wikipedia.org/wiki/LynxOS +[13]: http://www.openhpi.org/Developers +[14]: https://www.netflix.com/title/80244565 +[15]: https://en.wikipedia.org/wiki/A_Suitable_Girl_(film) +[16]: https://www.lfph.io/ +[17]: https://lfaidata.foundation/ +[18]: https://openeew.com/ +[19]: https://www.os-climate.org/ +[20]: https://www.lfenergy.org/ +[21]: mailto:sgoodman@contractor.linuxfoundation.org +[22]: https://mentorship.lfx.linuxfoundation.org/ +[23]: https://mentorship.lfx.linuxfoundation.org/project/926665ac-9b96-45aa-bb11-5d99096be870 +[24]: https://www.linuxfoundation.org/en/blog/preventing-supply-chain-attacks-like-solarwinds/ +[25]: https://www.linuxfoundation.org/en/press-release/new-open-source-contributor-report-from-linux-foundation-and-harvard-identifies-motivations-and-opportunities-for-improving-software-security/ +[26]: https://www.linuxplumbersconf.org/ +[27]: https://www.kernel.org/doc/linux/MAINTAINERS +[28]: https://events.linuxfoundation.org/lf-live-mentorship-series/ +[29]: https://forum.linuxfoundation.org/categories/lfx-mentorship-linux-kernel +[30]: https://forum.linuxfoundation.org/discussion/858202/linux-kernel-mentorship-spring-projects-are-now-accepting-applications#latest +[31]: https://www.kernel.org/code-of-conduct.html +[32]: https://elisa.tech/ +[33]: https://www.linuxfoundation.org/en/blog/interview-with-shuah-khan-kernel-maintainer-linux-fellow/ +[34]: https://www.linuxfoundation.org/ From 25f631baf4fbe5df3b5e3da093b6f9336ab6e16c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 29 Jan 2021 05:04:00 +0800 Subject: [PATCH 038/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210128=20?= =?UTF-8?q?Open=20Source=20Security=20Foundation=20(OpenSSF):=20Reflection?= =?UTF-8?q?=20and=20Future?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md --- ...dation (OpenSSF)- Reflection and Future.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md diff --git a/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md b/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md new file mode 100644 index 0000000000..493b72b562 --- /dev/null +++ b/sources/tech/20210128 Open Source Security Foundation (OpenSSF)- Reflection and Future.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Open Source Security Foundation (OpenSSF): Reflection and Future) +[#]: via: (https://www.linux.com/news/open-source-security-foundation-openssf-reflection-and-future/) +[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/) + +Open Source Security Foundation (OpenSSF): Reflection and Future +====== + +The [Open Source Software Foundation (OpenSSF)][1] officially [launched on August 3, 2020][2]. In this article, we’ll look at why the OpenSSF was formed, what it’s accomplished in its first six months, and its plans for the future. + +The world depends on open source software (OSS), so OSS security is vital. Various efforts have been created to help improve OSS security. These efforts include the Core Infrastructure Initiative (CII) in the Linux Foundation, the Open Source Security Coalition (OSSC) founded by the GitHub Security Lab, and the Joint Open Source Software Initiative (JOSSI) founded by Google and others. + +It became apparent that progress would be easier if these efforts merged into a single effort. The OpenSSF was created in 2020 as a merging of these three groups into “a cross-industry collaboration that brings together leaders to improve the security of open source software (OSS).” + +The OpenSSF has certainly gained that “cross-industry collaboration”; its dozens of members include (alphabetically) Canonical, GitHub, Google, IBM, Intel, Microsoft, and Red Hat. Its governing board also includes a Security Community Individual Representative to represent those not represented in other ways specifically. It’s also created some structures to help people work together: it’s established active working groups, identified (and posted) its values, and agreed on its technical vision. + +But none of that matters unless they actually _produce_ results. It’s still early, but they already have several accomplishments. They have released: + + * [Secure Software Development Fundamentals courses][3]. This set of 3 freely-available courses on the edX platform is for software developers to learn to develop secure software. It focuses on practical steps that any software developer can easily take, not theory or actions requiring unlimited resources.  Developers can also pay a fee to take tests to attempt to earn certificates to prove they understand the material. + * [Security Scorecards][4]. This auto-generates a “security score” for open source projects to help users as they decide the trust, risk, and security posture for their use case. + * [Criticality Score][5]. This project auto-generates a criticality score for open source projects based on a number of parameters. The goal is to better understand the most critical open source projects the world depends on. + * [Security metrics dashboard][6]. This early-release work provides a dashboard of security and sustainment information about OSS projects by combining the Security ScoreCards, CII Best Practices, and other data sources. + * [OpenSSF CVE Benchmark][7]. This benchmark consists of vulnerable code and metadata for over 200 historical JavaScript/TypeScript vulnerabilities (CVEs). This will help security teams evaluate different security tools on the market by enabling teams to determine false positive and false negative rates with real codebases instead of synthetic test code. + * [OWASP Security Knowledge Framework (SKF)][8]. In collaboration with OWASP, this work is a knowledge base that includes projects with checklists and best practice code examples in multiple programming languages. It includes training materials for developers on how to write secure code in specific languages and security labs for hands-on work. + * [Report on the 2020 FOSS Contributor Survey][9], The OpenSSF and the Laboratory for Innovation Science at Harvard (LISH) released a report that details the findings of a contributor survey to study and identify ways to improve OSS security and sustainability. There were nearly 1,200 respondents. + + + +The existing [CII Best Practices badge][10] project has also been folded into the OpenSSF and continues to be improved. The project now has more Chinese translators, a new ongoing Swahili translation, and various small refinements that clarify the badging requirements. + +The [November 2020 OpenSSF Town Hall][11] discussed the OpenSSF’s ongoing work. The OpenSSF currently has the following working groups: + + * Vulnerability Disclosures + * Security Tooling + * Security Best Practices + * Identifying Security Threats to Open Source Projects (focusing on a metrics dashboard) + * Securing Critical Projects + * Digital Identity Attestation + + + +Future potential work, other than continuously improving work already released, includes: + + * Identifying overlapping and related security requirements in various specifications to reduce duplicate effort. This is to be developed in collaboration with OWASP as lead and is termed the [Common Requirements Enumeration (CRE)][12]. The CRE is to “link sections of standard[s] and guidelines to each other, using a mutual topic identifier, enabling standard and scheme makers to work efficiently, enabling standard users to find the information they need, and attaining a shared understanding in the industry of what cyber security is.” [Source: “Common Requirements Enumeration”] + * Establishing a website for no-install access to a security metrics OSS dashboard. Again, this will provide a single view of data from multiple data sources, including the Security Scorecards and CII Best Practices. + * Developing improved identification of critical OSS projects. Harvard and the LF have previously worked to identify critical OSS projects. In the coming year, they will refine their approaches and add new data sources to identify critical OSS projects better. + * Funding specific critical OSS projects to improve their security. The expectation is that this will focus on critical OSS projects that are not otherwise being adequately funded and will work to improve their overall sustainability. + * Identifying and implementing improved, simplified techniques for digitally signing commits and verifying those identity attestations. + + + +As with all Linux Foundation projects, the work by the OpenSSF is decided by its participants. If you are interested in the security of the OSS we all depend on, check out the OpenSSF and participate in some way. The best way to get involved is to attend the working group meetings — they are usually every other week and very casual. By working together we can make a difference. For more information, see [https://openssf.org][1] + +_[**David A. Wheeler,**][13]_* Director of Open Source Supply Chain Security at the Linux Foundation*** + +The post [Open Source Security Foundation (OpenSSF): Reflection and Future][14] appeared first on [Linux Foundation][15]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/open-source-security-foundation-openssf-reflection-and-future/ + +作者:[The Linux Foundation][a] +选题:[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.linuxfoundation.org/en/blog/openssf-reflection-and-future/ +[b]: https://github.com/lujun9972 +[1]: https://openssf.org/ +[2]: https://www.linuxfoundation.org/en/press-release/technology-and-enterprise-leaders-combine-efforts-to-improve-open-source-security/ +[3]: https://openssf.org/blog/2020/10/29/announcing-secure-software-development-edx-course-sign-up-today/ +[4]: https://openssf.org/blog/2020/11/06/security-scorecards-for-open-source-projects/ +[5]: https://github.com/ossf/criticality_score +[6]: https://github.com/ossf/Project-Security-Metrics +[7]: https://openssf.org/blog/2020/12/09/introducing-the-openssf-cve-benchmark/ +[8]: https://owasp.org/www-project-security-knowledge-framework/ +[9]: https://www.linuxfoundation.org/en/press-release/new-open-source-contributor-report-from-linux-foundation-and-harvard-identifies-motivations-and-opportunities-for-improving-software-security/ +[10]: https://bestpractices.coreinfrastructure.org/ +[11]: https://openssf.org/blog/2020/11/23/openssf-town-hall-recording-now-available/ +[12]: https://owasp.org/www-project-integration-standards/ +[13]: mailto:dwheeler@linuxfoundation.org +[14]: https://www.linuxfoundation.org/en/blog/openssf-reflection-and-future/ +[15]: https://www.linuxfoundation.org/ From 095f762ae54d4ad4210e5618272c1691a3198831 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 29 Jan 2021 05:05:15 +0800 Subject: [PATCH 039/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210128=20?= =?UTF-8?q?Start=20programming=20in=20Racket=20by=20writing=20a=20"guess?= =?UTF-8?q?=20the=20number"=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md --- ...et by writing a -guess the number- game.md | 156 ++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md diff --git a/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md b/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md new file mode 100644 index 0000000000..4f0bb194a6 --- /dev/null +++ b/sources/tech/20210128 Start programming in Racket by writing a -guess the number- game.md @@ -0,0 +1,156 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Start programming in Racket by writing a "guess the number" game) +[#]: via: (https://opensource.com/article/21/1/racket-guess-number) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Start programming in Racket by writing a "guess the number" game +====== +Racket is a great way to learn a language from the Scheme and Lisp +families. +![Person using a laptop][1] + +I am a big advocate of learning multiple programming languages. That's mostly because I tend to get bored with the languages I use the most. It also teaches me new and interesting ways to approach programming. + +Writing the same program in multiple languages is a good way to learn their differences and similarities. Previously, I wrote articles showing the same sample data plotting program written in [C & C++][2], JavaScript with [Node.js][3], and [Python and Octave][4]. + +This article is part of another series about writing a "guess the number" game in different programming languages. In this game, the computer picks a number between one and 100 and asks you to guess it. The program loops until you make a correct guess. + +### Learning a new language + +Venturing into a new language always feels awkward—I feel like I am losing time since it would be much quicker to use the tools I know and use all the time. Luckily, at the start, I am also very enthusiastic about learning something new, and this helps me overcome the initial pain. And once I learn a new perspective or a solution that I would never have thought of, things become interesting! Learning new languages also helps me backport new techniques to my old and tested tools. + +When I start learning a new language, I usually look for a tutorial that introduces me to its [syntax][5]. Once I have a feeling for the syntax, I start working on a program I am familiar with and look for examples that will adapt to my needs. + +### What is Racket? + +[Racket][6] is a programming language in the [Scheme family][7], which is a dialect of [Lisp][8]. Lisp is also a family of languages, which can make it hard to decide which "dialect" to start with when you want to learn Lisp. All of the implementations have various degrees of compatibility, and this plethora of options might turn away newbies. I think that is a pity because these languages are really fun and stimulating! + +Starting with Racket makes sense because it is very mature and versatile, and the community is very active. Since Racket is a Lisp-like language, a major characteristic is that it uses the [prefix notation][9] and a [lot of parentheses][10]. Functions and operators are applied to a list of operands by prefixing them: + + +``` +(function-name operand operand ...) + +(+ 2 3) +↳ Returns 5 + +(list 1 2 3 5) +↳ Returns a list containing 1, 2, 3, and 5 + +(define x 1) +↳ Defines a variable called x with value of 1 + +(define (f x y) (* x x)) +↳ Defines a function called f with two parameters called x and y that returns their product. +``` + +This is basically all there is to know about Racket syntax; the rest is learning the functions from the [documentation][11], which is very thorough. There are other aspects of the syntax, like [keyword arguments][12] and [quoting][13], but you do not need them for this example. + +Mastering Racket might be difficult, and its syntax might look weird (especially if you are used to languages like Python), but I find it very fun to use. A big bonus is Racket's programming environment, [DrRacket][14], which is very supportive, especially when you are getting started with the language. + +The major Linux distributions offer packaged versions of Racket, so [installation][15] should be easy. + +### Guess the number game in Racket + +Here is a version of the "guess the number" program written in Racket: + + +``` +#lang racket + +(define (inquire-user number) +  (display "Insert a number: ") +  (define guess (string->number (read-line))) +  (cond [(> number guess) (displayln "Too low") (inquire-user number)] +        [(< number guess) (displayln "Too high") (inquire-user number)] +        [else (displayln "Correct!")])) + +(displayln "Guess a number between 1 and 100") +(inquire-user (random 1 101)) +``` + +Save this listing to a file called `guess.rkt` and run it: + + +``` +`$ racket guess.rkt` +``` + +Here is some example output: + + +``` +Guess a number between 1 and 100 +Insert a number: 90 +Too high +Insert a number: 50 +Too high +Insert a number: 20 +Too high +Insert a number: 10 +Too low +Insert a number: 12 +Too low +Insert a number: 13 +Too low +Insert a number: 14 +Too low +Insert a number: 15 +Correct! +``` + +### Understanding the program + +I'll go through the program line by line. The first line declares the language the listing is written into: `#lang racket`. This might seem strange, but Racket is very good at [writing interpreters][16] for new [domain-specific languages][17]. Do not panic, though! You can use Racket as it is because it is very rich in tools. + +Now for the next line. `(define ...)` is used to declare new variables or functions. Here, it defines a new function called `inquire-user` that accepts the parameter `number`. The `number` parameter is the random number that the user will have to guess. The rest of the code inside the parentheses of the `define` procedure is the body of the `inquire-user` function. Notice that the function name contains a dash; this is Racket's idiomatic style for writing a long variable name. + +This function recursively calls itself to repeat the question until the user guesses the right number. Note that I am not using loops; I feel that Racket programmers do not like loops and only use recursive functions. This approach is idiomatic to Racket, but if you prefer, [loops are an option][18]. + +The first step of the `inquire-user` function asks the user to insert a number by writing that string to the console. Then it defines a variable called `guess` that contains whatever the user entered. The [`read-line` function][19] returns the user input as a string. The string is then converted to a number with the [`string->number` function][20]. After the variable definition, the [`cond` function][21] accepts a series of conditions. If a condition is satisfied, it executes the code inside that condition. These conditions, `(> number guess)` and `(< number guess)`, are followed by two functions: a `displayln` that gives clues to the user and a `inquire-user` call. The function calls itself again when the user does not guess the right number. The `else` clause executes when the two conditions are not met, i.e., the user enters the correct number. The program's guts are this `inquire-user` function. + +However, the function still needs to be called! First, the program asks the user to guess a number between 1 and 100, and then it calls the `inquire-user` function with a random number. The random number is generated with the [`random` function][22]. You need to inform the function that you want to generate a number between 1 and 100, but the `random` function generates integer numbers up to `max-1`, so I used 101. + +### Try Racket + +Learning new languages is fun! I am a big advocate of programming languages polyglotism because it brings new, interesting approaches and insights to programming. Racket is a great opportunity to start learning how to program with a Lisp-like language. I suggest you give it a try. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/racket-guess-number + +作者:[Cristiano L. Fontana][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cristianofontana +[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://opensource.com/article/20/2/c-data-science +[3]: https://opensource.com/article/20/6/data-science-nodejs +[4]: https://opensource.com/article/20/2/python-gnu-octave-data-science +[5]: https://en.wikipedia.org/wiki/Syntax_(programming_languages) +[6]: https://racket-lang.org/ +[7]: https://en.wikipedia.org/wiki/Scheme_(programming_language) +[8]: https://en.wikipedia.org/wiki/Lisp_(programming_language) +[9]: https://en.wikipedia.org/wiki/Polish_notation +[10]: https://xkcd.com/297/ +[11]: https://docs.racket-lang.org/ +[12]: https://rosettacode.org/wiki/Named_parameters#Racket +[13]: https://docs.racket-lang.org/guide/quote.html +[14]: https://docs.racket-lang.org/drracket/ +[15]: https://download.racket-lang.org/ +[16]: https://docs.racket-lang.org/guide/hash-languages.html +[17]: https://en.wikipedia.org/wiki/Domain-specific_language +[18]: https://docs.racket-lang.org/heresy/conditionals.html +[19]: https://docs.racket-lang.org/reference/Byte_and_String_Input.html?q=read-line#%28def._%28%28quote._~23~25kernel%29._read-line%29%29 +[20]: https://docs.racket-lang.org/reference/generic-numbers.html?q=string-%3Enumber#%28def._%28%28quote._~23~25kernel%29._string-~3enumber%29%29 +[21]: https://docs.racket-lang.org/reference/if.html?q=cond#%28form._%28%28lib._racket%2Fprivate%2Fletstx-scheme..rkt%29._cond%29%29 +[22]: https://docs.racket-lang.org/reference/generic-numbers.html?q=random#%28def._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._random%29%29 From 2ba2ee543f9a0a14d45cdf1f966eef1b394e9d75 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 29 Jan 2021 05:05:40 +0800 Subject: [PATCH 040/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210128=20?= =?UTF-8?q?4=20tips=20for=20preventing=20notification=20fatigue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210128 4 tips for preventing notification fatigue.md --- ...ips for preventing notification fatigue.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210128 4 tips for preventing notification fatigue.md diff --git a/sources/tech/20210128 4 tips for preventing notification fatigue.md b/sources/tech/20210128 4 tips for preventing notification fatigue.md new file mode 100644 index 0000000000..96e2e66660 --- /dev/null +++ b/sources/tech/20210128 4 tips for preventing notification fatigue.md @@ -0,0 +1,80 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 tips for preventing notification fatigue) +[#]: via: (https://opensource.com/article/21/1/alert-fatigue) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +4 tips for preventing notification fatigue +====== +Don't overwhelm yourself with alerts—set the ones that matter and let +the others go. You'll feel better and be more productive. +![Working on a team, busy worklife][1] + +In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 18 of 21 Days of Productivity in 2021. + +One thing I notice when I talk to people about productivity is that almost everyone is doing it to keep a clearer head. Instead of keeping all our appointments in our heads, we put them on a digital calendar that alerts us before the event. We have digital or physical notes so that we don't have to remember every little detail of something. We have to-do lists to remind us to do the things we need to do. + +![Text box offering to send notifications][2] + +NOPE (Kevin Sonney, [CC BY-SA 4.0][3]) + +So many applications, websites, and services want to alert us about every little thing that it is easy just to tune them all out. And if we don't do that, we start to suffer from *alert fatigue—*where we are on edge, just waiting for that next alert, and living in dread of it. + +Alert fatigue is very common among people who are on-call for their jobs. It also happens to people who have *FOMO—*the Fear Of Missing Out—and so set alerts on every keyword, hashtag, or mention on social media of a thing they are interested in. + +Setting up alerts that will get our attention but won't be ignored is tricky with all this going on. However, I do have some helpful hints, so that maybe the important alerts get past our own mental filters in this hectic world. + +![Alert for a task][4] + +I can ignore this, right? (Kevin Sonney, [CC BY-SA 4.0][3]) + + 1. Figure out what works better for you: Visual alerts or audible alerts. I use a combination of visual pop-ups and noises, but that is what works for me. Some people need tactile alerts—things like phone or watch vibrations. Find the one that works for you. + 2. Assign unique tones or visuals to important alerts. I have a friend who has the loudest, most obnoxious ring tone for work pages. It is _designed_ to get his attention and make him look at the alert. I have a light on my monitor that blinks red when I get an alert for work when I am on-call, as well as notifications sent to my phone. + 3. Turn off the alerts that don't actually matter. Social networks, websites, and apps want your attention. They don't care if you miss a meeting, are late to an appointment, or stay up until 4 am doom-scrolling. Turn off the ones that aren't important so the ones that are can be seen. + 4. Change things up every so often. What worked last month may not work next month. We adapt, we get used to things, and then we tune them out. If something isn't working, try something different! It can't hurt, and even if it doesn't work out, maybe you'll learn something new. + + + +![Blue alert indicators light][5] + +Blue is good. Red is bad. (Kevin Sonney, [CC BY-SA 4.0][3]) + +### Open source and choice + +A good application provides lots of choices for notifications. One of my favorites is the Etar calendar app for Android. [Etar is available from the open source F-droid repository][6]. + +Etar, like many open source applications, provides you with all the options, especially for notification settings. + +![Etar][7] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +With Etar, you can activate or deactivate pop-up notifications, set snooze times, snooze delay, whether to remind you about declined events, and so on. Combined with an intentional scheduling strategy, you can change the course of your day by taking control of how often your digital assistance nudges you about things you need to do. + +Reminders and alerts can be really useful, as long as we receive the ones that matter and pay attention to them. It can take some experimentation, but in the end, less noise is good, and it is easier to notice the alerts that truly need our attention. + +Need to keep your schedule straight? Learn how to do it using open source with these free... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/alert-fatigue + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) +[2]: https://opensource.com/sites/default/files/day18-image1.png +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/day18-image2.png +[5]: https://opensource.com/sites/default/files/day18-image3.png +[6]: https://f-droid.org/en/packages/ws.xsoh.etar/ +[7]: https://opensource.com/sites/default/files/etar.jpg (Etar) From e536e09f18927659198ec79d7afae6363843ef4d Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Jan 2021 08:45:28 +0800 Subject: [PATCH 041/213] translated --- ...25 Use Joplin to find your notes faster.md | 65 ------------------- ...25 Use Joplin to find your notes faster.md | 61 +++++++++++++++++ 2 files changed, 61 insertions(+), 65 deletions(-) delete mode 100644 sources/tech/20210125 Use Joplin to find your notes faster.md create mode 100644 translated/tech/20210125 Use Joplin to find your notes faster.md diff --git a/sources/tech/20210125 Use Joplin to find your notes faster.md b/sources/tech/20210125 Use Joplin to find your notes faster.md deleted file mode 100644 index 4d8e367129..0000000000 --- a/sources/tech/20210125 Use Joplin to find your notes faster.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use Joplin to find your notes faster) -[#]: via: (https://opensource.com/article/21/1/notes-joplin) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use Joplin to find your notes faster -====== -Organizing notes across multiple written and digital platforms is a -serious challenge. Here's a tip to organize your notes better and find -what you need quickly. -![Working from home at a laptop][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 15 of 21 Days of Productivity in 2021. - -Staying productive also means (to some extent) being organized enough to find my notes and reference them on demand. This is a challenge not just for myself but for a lot of people I talk to. - -Over the years, I have used either individually or some combination of digital notes in an app, paper notes, sticky notes, digital sticky notes, word processor documents, plain text files, and a bunch of other formats I am forgetting. That makes not only finding notes difficult but knowing where to put them an even bigger challenge. - -![Stacks of paper notes on a desk][2] - -Piles of notes (Jessica Cherry, [CC BY-SA 4.0][3]) - -And then there is the most important thing about taking notes: A note has no value at all if you can't find it later. Knowing that the note with the information you need exists _somewhere_ in one of the places you keep notes isn't helpful at all. - -How did I fix that for myself? It was, as they say, a process, and I hope it is a process that works for others as well. - -I started by looking at the kinds of notes I was taking. Do different subjects need to be stored in different ways? Since I handwrite notes for my podcasts and use plain text notes for almost everything else, I needed two different ways to maintain them. For the handwritten notes, I put them all in a binder that I could reference easily. - -![Man holding a binder full of notes][4] - -Over three years of notes (Kevin Sonney, [CC BY-SA 4.0][3]) - -To store my digital notes, I needed to pull them all into one place. The tool needed to be accessible from multiple devices, have a useful search function, and be able to export or share my notes. I chose [Joplin][5] after trying many, many different options. Joplin lets me write notes in markdown, has a pretty good search function, has applications for all the OSs (including mobile), and supports several different ways to sync between devices. As a bonus, it has folders _and_ tags, so I can group my notes together in ways that make sense to me. - -![Organized Joplin notes management page][6] - -My Joplin - -It took me some time to get everything where I wanted it, but in the end, it really was worth it. Now I can find the notes I take and not have them scattered across my office, different machines, and various services. - -Learn about great open source alternatives to Evernote for notetaking and task management. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/notes-joplin - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[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/sites/default/files/day15-image1.jpg -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/day15-image2.png -[5]: https://joplinapp.org/ -[6]: https://opensource.com/sites/default/files/day15-image3.png diff --git a/translated/tech/20210125 Use Joplin to find your notes faster.md b/translated/tech/20210125 Use Joplin to find your notes faster.md new file mode 100644 index 0000000000..212025a919 --- /dev/null +++ b/translated/tech/20210125 Use Joplin to find your notes faster.md @@ -0,0 +1,61 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Joplin to find your notes faster) +[#]: via: (https://opensource.com/article/21/1/notes-joplin) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +使用 Joplin 更快地找到你的笔记 +====== +在多个手写和数字平台上整理笔记是一个严峻的挑战。这里有一个小技巧,可以更好地组织你的笔记,并快速找到你需要的东西。 +![Working from home at a laptop][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十五天。 + +保持生产力也意味着(在某种程度上)要有足够的组织能力,以便找到笔记并在需要时参考它们。这不仅是对我自己的挑战,也是我交谈的很多人的挑战。 + +多年来,我在应用中单独或使用数字笔记、纸质笔记、便签、数字便签、word 文档、纯文本文件以及一堆我忘记的其他格式的组合。这不仅让寻找笔记变得困难,而且知道把它们放在哪里是一个更大的挑战。 + +![Stacks of paper notes on a desk][2] + +一堆笔记 (Jessica Cherry, [CC BY-SA 4.0][3]) + +还有就是做笔记最重要的一点:如果你以后找不到它,笔记就没有任何价值。知道含有你所需信息的笔记存在于你保存笔记的_某处_,根本没有任何帮助。 + +我是如何为自己解决这个问题的呢?正如他们所说,这是一个过程,我希望这也是一个对其他人有效的过程。 + +我首先看了看自己所做的笔记种类。不同的主题需要用不同的方式保存吗?由于我为我的播客手写笔记,而几乎所有其他的东西都使用纯文本笔记,我需要两种不同的方式来维护它们。对于手写的笔记,我把它们都放在一个文件夹里,方便我参考。 + +![Man holding a binder full of notes][4] + +三年多的笔记 (Kevin Sonney, [CC BY-SA 4.0][3]) + +为了保存我的数字笔记,我需要将它们全部集中到一个地方。这个工具需要能够从多种设备上访问,具有有用的搜索功能,并且能够导出或共享我的笔记。在尝试了很多很多不同的选项之后,我选择了 [Joplin][5]。Joplin 可以让我用 markdown 写笔记,有一个相当不错的搜索功能,有适用于所有操作系统(包括手机)的应用,并支持几种不同的设备同步方式。另外,它还有文件夹_和_标签,因此我可以按照对我有意义的方式将笔记分组。 + +![Organized Joplin notes management page][6] + +我的 Joplin + +我花了一些时间才把所有的东西都放在我想要的地方,但最后,这真的是值得的。现在,我可以找到我所做的笔记,而不是让它们散落在我的办公室、不同的机器和各种服务中。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/notes-joplin + +作者:[Kevin Sonney][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/ksonney +[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/sites/default/files/day15-image1.jpg +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/day15-image2.png +[5]: https://joplinapp.org/ +[6]: https://opensource.com/sites/default/files/day15-image3.png From efd370c77f81fa60564a789721fc8d3669533dfb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 29 Jan 2021 08:54:23 +0800 Subject: [PATCH 042/213] translating --- sources/tech/20210127 3 email mistakes and how to avoid them.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210127 3 email mistakes and how to avoid them.md b/sources/tech/20210127 3 email mistakes and how to avoid them.md index a9ade4721d..61ab55cc07 100644 --- a/sources/tech/20210127 3 email mistakes and how to avoid them.md +++ b/sources/tech/20210127 3 email mistakes and how to avoid them.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From b2e44259baa3bc8c05f86ef94fe80c977a15dab1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 29 Jan 2021 15:02:52 +0800 Subject: [PATCH 043/213] PRF @geekpi --- ...19 Organize your task list using labels.md | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/translated/tech/20210119 Organize your task list using labels.md b/translated/tech/20210119 Organize your task list using labels.md index 7808c542ef..cd798c169d 100644 --- a/translated/tech/20210119 Organize your task list using labels.md +++ b/translated/tech/20210119 Organize your task list using labels.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Organize your task list using labels) @@ -9,42 +9,42 @@ 使用标签组织你的任务列表 ====== -文件夹的用途是存储信息和任务。使用标签来帮助你更好地组织这些文件夹中的内容。 -![Kanban-style organization action][1] -在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第九天。 +> 文件夹的用途是存储信息和任务。使用标签来帮助你更好地组织这些文件夹中的内容。 -我用电子邮件、待办列表和笔记来做这件事,有一天我决定我要把这些“组织起来”,重新安排我保存东西的方式和位置。有时我发现了一个新的程序,我必须(再次)从头开始配置。有时,当前的方法已经花了很多时间,与我使用系统的时间相比,我花了更多的时间在保持存储顺序最新。我去年测试一些待办列表软件时,最后一个软件让我有了一个非常重要的认识。 +![](https://img.linux.net.cn/data/attachment/album/202101/29/150011k9sz3n0q99mmkems.jpg) + +在前几年,这个年度系列报道了诸如 Notmuch 和 Syncthing 之类的开源的组织应用程序。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第九天。 + +我用我的电子邮件、待办列表和笔记来做这件事,有一天我决定我要把这些“组织起来”,重新安排我保存东西的方式和位置。有时我发现了一个新的程序,我必须(再次)从头开始配置。有时,当前的方法已经花了很多时间,与我使用系统的时间相比,我花了更多的时间在保持存储顺序最新。我去年测试一些待办列表软件时,最后一个软件让我有了一个非常重要的认识。 ![List of labels][4] -所有事情都有存放的地方(Kevin Sonney, [CC BY-SA 4.0][5]) +*所有事情都有存放的地方(Kevin Sonney, [CC BY-SA 4.0][5])* -让我先打个比方。一个任务(或电子邮件或笔记)就像你在一次活动中收到的那件很酷的 T 恤。它是黑色的,有一个很棒的图案,后面有一个标签,上面写着尺寸,领口有一个标签,上面写着洗涤说明。到了该收起来的时候,它该放在哪里呢?是和黑色的 T 恤放在一起吗?是和类似主题的衬衫放在一起吗?是按尺码放吗?是按需要洗涤的方式?还是按材质? +让我打个比方。一个任务(或电子邮件或笔记)就像你在一次活动中收到的那件很酷的 T 恤。它是黑色的,有一个很棒的图案,后面有一个标签,上面写着尺寸,领口有一个标签,上面写着洗涤说明。到了该收起来的时候,它该放在哪里呢?是和黑色的 T 恤放在一起吗?是和类似主题的衬衫放在一起吗?是按尺码放吗?是按需要洗涤的方式?还是按材质? -一件 T 恤只能放在_一_个地方,即使它可以有多种特质。我们需要以同样的方式对待任务、电子邮件和笔记。一个非常大的[电子邮件提供商][6]已经允许我们把一个标签当作一个文件夹。一封邮件(或一个文档或一个任务)可以同时在两个文件夹中!或者三个!甚至 11 个! +一件 T 恤只能放在*一*个地方,即使它可以有多种特质。我们需要以同样的方式对待任务、电子邮件和笔记。大型[电子邮件提供商][6]已经允许我们把一个标签当作一个文件夹。一封邮件(或一个文档或一个任务)可以同时在两个文件夹中!或者三个!甚至 11 个! ![Guitar volume 11][7] -它高达 11 个(Seth Kenlon, [CC BY-SA 4.0][5]) +*它高达 11 个(Seth Kenlon, [CC BY-SA 4.0][5])* -我必须明智地决定不再这样做。文件夹不是标签,标签也不是文件夹。这让我找到了我目前整理待办事项清单(和笔记,以及电子邮件)的规则。 +我必须明智地决定不再这样做。文件夹不是标签,标签也不是文件夹。这让我找到了我目前整理待办事项清单(和笔记,以及电子邮件)的规则: - 1. 一个任务只应该在一个文件夹里。文件夹是以“大的事情”命名的,比如一个地方或组织。我目前有三个文件夹来存放任务。“工作”、“家庭”和 “爱好”。当我专注于其中一个领域时,我知道我在看什么任务。 + 1. 一个任务只应该在一个文件夹里。文件夹是以“大事”来命名的,比如一个地方或组织。我目前有三个文件夹来存放任务。“工作”、“家庭”和 “爱好”。当我专注于其中一个领域时,我知道我在看什么任务。 2. 一个任务可以有任意个我需要的标签。我尽量保持在三个左右或更少。 3. 一个任务应该有一个明确的意义。也许是你要写的程序的名字。也许是一些通用的东西,比如“要读的书”或“账单”。但如果你记不起 “4rg8sn5” 就是“要支付的账单”,这就对你没有帮助。 +利用这些规则,如果我有一个“写第 9 天文章”的任务,它就会进入”爱好“文件夹,我给它打上 “OSDC”、“文章”、“2021” 的标签。如果我想在我的 [Elementary Planner][8] 中看到我所有的 2021 年的任务,我可以搜索这个标签。任务最终会出现在 “OSDC” 的搜索中,其中可能还包括一个对文章发表评论的待办事项,一个开始规划 2022 年系列的待办事项,还有一个跟进我认为有好文章想法的人。 - -利用这些规则,如果我有一个“写第 9 天文章”的任务,它就会进入”爱好“文件夹,我给它打上 ”OSDC“、”文章“、”2021“ 的标签。如果我想在我的 [Elementary Planner][8] 中看到我所有的 2021 年的任务,我可以搜索这个标签。任务最终会出现在 ”OSDC“ 的搜索中,其中可能还包括一个对文章发表评论的待办事项,一个开始规划 2022 年系列的待办事项,还有一个跟进我认为有好文章想法的人。 - -我的”工作“文件夹里的东西通常是按项目标记的。”完成管理 CLI 文档“可能会被分为 “github”、“prod” 和 “admin”。“docs” 标签包含了“工作”和”爱好“文件夹中的项目,因为写文档是这两个文件夹都需要做的事情。 +我的“工作”文件夹里的东西通常是按项目标记的。“完成管理 CLI 文档”可能会被分为 “github”、“prod” 和 “admin”。“docs” 标签包含了“工作”和”爱好“文件夹中的项目,因为写文档是这两个文件夹都需要做的事情。 ![Linux Elementary planner][9] -文件夹和标签(Kevin Sonney, [CC BY-SA 4.0][5]) +*文件夹和标签(Kevin Sonney, [CC BY-SA 4.0][5])* -将”标签“和”文件夹“进行心理分离,帮助我将任务进行分组和分类,而不至于过度。这也意味着我可以更快地找到事情,花更少的时间去维护我的待办事项清单,而花更多的时间去做清单上的事情。 +将“标签”和“文件夹”进行心理分离,帮助我将任务进行分组和分类,而不至于过度。这也意味着我可以更快地找到事情,花更少的时间去维护我的待办事项清单,而花更多的时间去做清单上的事情。 -------------------------------------------------------------------------------- @@ -53,7 +53,7 @@ via: https://opensource.com/article/21/1/labels 作者:[Kevin Sonney][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 f578a51f8a30137cb0d026cb79802a9559d929aa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 29 Jan 2021 15:03:37 +0800 Subject: [PATCH 044/213] PUB @geekpi https://linux.cn/article-13062-1.html --- .../20210119 Organize your task list using labels.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210119 Organize your task list using labels.md (98%) diff --git a/translated/tech/20210119 Organize your task list using labels.md b/published/20210119 Organize your task list using labels.md similarity index 98% rename from translated/tech/20210119 Organize your task list using labels.md rename to published/20210119 Organize your task list using labels.md index cd798c169d..9fc27d6cb7 100644 --- a/translated/tech/20210119 Organize your task list using labels.md +++ b/published/20210119 Organize your task list using labels.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13062-1.html) [#]: subject: (Organize your task list using labels) [#]: via: (https://opensource.com/article/21/1/labels) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From dec5a09d33b0a18f8bf17791620b28ae071f0e45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 29 Jan 2021 15:40:52 +0800 Subject: [PATCH 045/213] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @AnyISalIn 感谢你!完成了第一篇翻译贡献! --- ...122 How to implement a DevOps toolchain.md | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210122 How to implement a DevOps toolchain.md b/translated/tech/20210122 How to implement a DevOps toolchain.md index 22f1430e3c..7b35958fc3 100644 --- a/translated/tech/20210122 How to implement a DevOps toolchain.md +++ b/translated/tech/20210122 How to implement a DevOps toolchain.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (AnyISalIn) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to implement a DevOps toolchain) @@ -9,76 +9,70 @@ 如何实现 DevOps 工具链 ====== -一套完整的 DevOps 工具链有助于推动业务创新 -快速部署并且节省成本 -![Wratchet set tools][1] -不同规模和不同行业组织都致力于为提高软件交付的速度和质量提供解决方案。这不仅保证了他们的生存还令他们在全球市场取得了成功。DevOps 可以帮助他们规划最佳路线。 +> 一套完整启用的 DevOps 工具链可推动你的创新计划,实现快速部署并节约成本。 + +![](https://img.linux.net.cn/data/attachment/album/202101/29/153905o35h8u9zy5k58bll.jpg) + +不同规模和不同行业组织都致力于为提高软件交付的速度和质量提供解决方案。这不仅保证了他们的生存,还令他们在全球市场取得了成功。DevOps 可以帮助他们规划出一条最佳路线。 DevOps 是一个系统,通过引入不同的工具链连接不同工作流程,以便及时交付项目并降低所需的开销。 在我工作的 IT 服务公司 [Accedia][2],我们会帮助客户落地一套完整的 DevOps 工具链,这套工具链能帮助他们达到甚至超越他们的业务目标。在这篇文章,我会分享目前为止从 DevOps 项目中汲取的经验。 ### DevOps 工具链是什么? -一套完善的 DevOps 工具链可以在不同阶段中使用不同的 DevOps 工具来解决特定的业务带来的挑战。一条工具链能保证前端和后端开发者,QA 人员,客户都能够从中获得收益。构建工具链的目的是为了自动化开发和部署过程,以确保快速,可靠,预算友好地交付与创新。 + +一套完善的 DevOps 工具链可以在不同阶段中使用不同的 DevOps 工具来解决特定的业务带来的挑战。一条工具链能保证前端和后端开发者、质量测试人员、客户都能够从中获得收益。构建工具链的目的是为了自动化开发和部署过程,以确保快速、可靠、预算友好地交付与创新。 我们发现成功构建一套 DevOps 工具链不是一个简单的事情。它需要实验和不断的完善,保证必要的流程是完全自动化的。 -### Why you need a DevOps toolchain ### 为什么你需要 DevOps 工具链 DevOps 工具链自动化了工作流中的所有技术元素。它能让不同团队在一个平台上进行工作,因此可以使你专注于业务战略以推动组织走向未来。 我们总结了五个实现 DevOps 工具链所带来的好处。你可以让管理层相信,是值得为 DevOps 工具链的开发投入资源和时间的。 - 1. **更快更高效的生产部署** DevOps 工具自动化了大部分软件开发进程。这会使产品开发专注于创新,交付更加敏捷,更领先于竞争对手。 - 2. **预算和时间优化** 将手动的任务转变为自动化会使你的组织节省时间和资源。当没有人为错误和时间管理不足带来的额外支出,预算自然会得到优化。 - 3. **高效开发** DevOps 工具链会减少开发工作中不必要的延时,提高开发效率。前端、后端、质量测试人员的工作是一致的,所以没有人需要协调不同团队之间人员的交付。 - 4. **更快的部署意味着更高的质量** DevOps 工具链保证了缺陷能够很快被解决,并且迅速的完成高质量的部署进程。怎么样?它可以生产有针对性的告警,并将重要的事件通知给你的团队。这会让你主动地发现并解决潜在的问题,从而规避故障的不断的升级从而导致的客户服务不可用。 - 5. **及时事件管理** DevOps 工具链有助于优化事件管理记录。它能够识别 IT 事件并且逐渐升级事件级别,通知给指定团队的成员,直到问题被解决。这意味着消息的接受和处理会更加的迅速,因为它们发送给了正确的目标。 + 1. **更快、更高效的生产部署**:DevOps 工具自动化了大部分软件开发进程。这会使产品开发专注于创新,交付更加敏捷,更领先于竞争对手。 + 2. **预算和时间优化**:将手动的任务转变为自动化会使你的组织节省时间和资源。当没有人为的错误和时间管理不足带来的额外支出,预算自然会得到优化。 + 3. **高效的开发**:DevOps 工具链会减少开发工作中不必要的延时,提高开发效率。前端、后端、质量测试人员的工作是一致的,所以没有人需要协调不同团队之间人员的交付。 + 4. **更快的部署意味着更高的质量**:DevOps 工具链保证了缺陷能够很快被解决,并且迅速完成高质量的部署进程。怎么样?它可以生成有针对性的告警,并将重要的事件通知给你的团队。这会让你主动地发现并解决潜在的问题,从而规避故障的不断的升级从而导致的客户服务不可用。 + 5. **及时事件管理**:DevOps 工具链有助于优化事件管理记录。它能够识别 IT 事件并且逐渐升级事件级别,通知给指定团队的成员,直到问题被解决。这意味着消息的接受和处理会更加的迅速,因为它们发送给了正确的目标。 ### DevOps 工具链的实践 对我的团队来说,DevOps 并不新鲜。我们已经敏捷开发很长时间了,并且我们总是热衷于探索最优的工作流。在我们的实践中,往往都是应用复杂性增加从而带来了自动化的需求。 -这是我们为客户配置的工具链。这个项目包含了移动运营方案,连接了金融交易的所有参与者 (卖方,买方,银行)。这个客户需要动态响应用户反馈并且将故障时间缩短到最小从而来提高用户体验。我的团队设计了一套工具链用于自动化应用的维护和部署新功能。 +这是我们为一个客户配置的工具链。这个项目包含了移动运营方案,连接了金融交易的所有参与者 (卖方、买方、银行)。这个客户需要动态响应用户反馈并且将故障时间缩短到最小,从而来提高用户体验。我的团队设计了一套工具链用于自动化应用的维护和部署新功能。 ![Accedia's DevOps toolchain][3] -(Accedia, [CC BY-NC-SA 4.0][4]) +*(Accedia, [CC BY-NC-SA 4.0][4])* 1. 首先,我们团队编写了自动化测试,可以立即识别应用程序的变更。 2. 当新版本已经准备就绪的时候,代码将被提交到 Gitlab 中。 3. 通过 Gitlab,提交会自动触发 Jenkins 构建。 4. 在 **持续集成中**,新的代码版本通过 [Chai][5] 和 [Mocha][6] 进行了测试,以检测是否运行正常。 - 5. 当测试通过,**持续部署阶段** 将会开始并创建一个可用的 Docker 镜像并上传到 Sonatype's [Nexus][7]. (这是 Sonatype 公司的的一个开源工具) - 6. 最后,新版本应用会通过 Nexus 下载并且部署到线上环境中,例如 [Docker][8] 容器 (**持续部署阶段**) - - + 5. 当测试通过,**持续部署阶段** 将会开始并创建一个可用的 Docker 镜像并上传到 Sonatype 的 [Nexus][7]。(这是 Sonatype 公司的的一个开源工具) + 6. 最后,新版本应用会通过 Nexus 下载并且部署到线上环境中,例如 [Docker][8] 容器 (**持续部署阶段**) 简而言之,每当有人在仓库中创建一个新的提交,又或者团队上传新的代码版本、功能、升级、缺陷修复等,应用程序包都会自动更新并且交付给客户。 这套系统拥有良好的事故控制能力以保证快速部署,但不以牺牲质量为代价。它对于用户的反馈是动态的,意味着新功能和旧功能的和更新只需要之前一半的时间,同时将故障时间降低到最低。 - ### 把它封装起来 一套完整并且正确实施的 DevOps 工具链可以从始至终推动你的创新计划并且加速部署。 根据你的需求,你的工具链可能看起来和这些不一样,但是我希望我们的工作流能够让你了解如何将自动化作为一种解决方案。 -* * * - -_This was written in collaboration with Vladimir Vladimirov, senior software consultant at Accedia, who has extensive experience in CI/CD, DevOps processes, and automating software delivery. It is also based on [5 good reasons why you need a DevOps toolchain][9] from Accedia's blog and is reused under a [CC BY-NC-SA 4.0][4] license._ - ---------------------------------------------------- ----------------------------- +-------------------------------------------------- ----------------------------- via: https://opensource.com/article/21/1/devops-tool-chain 作者:[Tereza Denkova][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/AnyISalIn) -校对:[校对者ID](https://github.com/校对者ID) +译者:[AnyISalIn](https://github.com/AnyISalIn) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5338a1a86f6b0e462775c5b65bec0206fe3e5cce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 29 Jan 2021 15:43:28 +0800 Subject: [PATCH 046/213] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @AnyISalIn 本文首发地址:https://linux.cn/article-13063-1.html 你的 LCTT 专页:https://linux.cn/lctt/AnyISalIn --- .../20210122 How to implement a DevOps toolchain.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210122 How to implement a DevOps toolchain.md (98%) diff --git a/translated/tech/20210122 How to implement a DevOps toolchain.md b/published/20210122 How to implement a DevOps toolchain.md similarity index 98% rename from translated/tech/20210122 How to implement a DevOps toolchain.md rename to published/20210122 How to implement a DevOps toolchain.md index 7b35958fc3..49af4bf425 100644 --- a/translated/tech/20210122 How to implement a DevOps toolchain.md +++ b/published/20210122 How to implement a DevOps toolchain.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (AnyISalIn) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13063-1.html) [#]: subject: (How to implement a DevOps toolchain) [#]: via: (https://opensource.com/article/21/1/devops-tool-chain) [#]: author: (Tereza Denkova https://opensource.com/users/tereza-denkova) From 54a71d60615b26f44ac7b8f450b131709912b1c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Fri, 29 Jan 2021 19:22:36 +0800 Subject: [PATCH 047/213] translating --- ...Shell Script in Linux -Essentials Explained for Beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index 1fdd219fa9..6acc9e50e2 100644 --- a/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/sources/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (robsean) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ec44c4e365c56c5afed67a89e412c477d3ca4704 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 30 Jan 2021 03:50:35 +0800 Subject: [PATCH 048/213] Revert "translating" This reverts commit 8b7bc433ab4039b4ef019c2d7a3f09b081b655db. --- sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md index ea454aa0b6..ac60a02d17 100644 --- a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zhangxiangping) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -241,7 +241,7 @@ via: https://fedoramagazine.org/latex-typesetting-part-1/ 作者:[Earl Ramirez][a] 选题:[lujun9972][b] -译者:[zhangxiangping](https://github.com/zxp93) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe026fe52a4520748a6c123bc6fa2069aca54968 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 30 Jan 2021 05:03:58 +0800 Subject: [PATCH 049/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210129=20?= =?UTF-8?q?Manage=20containers=20with=20Podman=20Compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210129 Manage containers with Podman Compose.md --- ...9 Manage containers with Podman Compose.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20210129 Manage containers with Podman Compose.md diff --git a/sources/tech/20210129 Manage containers with Podman Compose.md b/sources/tech/20210129 Manage containers with Podman Compose.md new file mode 100644 index 0000000000..ff652c2c2d --- /dev/null +++ b/sources/tech/20210129 Manage containers with Podman Compose.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage containers with Podman Compose) +[#]: via: (https://fedoramagazine.org/manage-containers-with-podman-compose/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) + +Manage containers with Podman Compose +====== + +![][1] + +Containers are awesome, allowing you to package your application along with its dependencies and run it anywhere. Starting with Docker in 2013, containers have been making the lives of software developers much easier. + +One of the downsides of Docker is it has a central daemon that runs as the root user, and this has security implications. But this is where Podman comes in handy. Podman is a [daemonless container engine][2] for developing, managing, and running OCI Containers on your Linux system in root or rootless mode. + +There are other articles on Fedora Magazine you can use to learn more about Podman. Two examples follow: + + * [Using Pods with Podman on Fedora][3] + * [Podman with Capabilities on Fedora][4] + + + +If you have worked with Docker, chances are you also know about Docker Compose, which is a tool for orchestrating several containers that might be interdependent. To learn more about Docker Compose see its [documentation][5]. + +### What is Podman Compose? + +[Podman Compose][6] is a project whose goal is to be used as an alternative to Docker Compose without needing any changes to be made in the docker-compose.yaml file. Since Podman Compose works using pods, it’s good to check a refresher definition of a pod. + +> A _Pod_ (as in a pod of whales or pea pod) is a group of one or more [containers][7], with shared storage/network resources, and a specification for how to run the containers. +> +> [Pods – Kubernetes Documentation][8] + +The basic idea behind Podman Compose is that it picks the services defined inside the _docker-compose.yaml_ file and creates a container for each service. A major difference between Docker Compose and Podman Compose is that Podman Compose adds the containers to a single pod for the whole project, and all the containers share the same network. It even names the containers the same way Docker Compose does, using the _‐‐add-host_ flag when creating the containers, as you will see in the example. + +### Installation + +Complete install instructions for Podman Compose are found on its [project page][6], and there are several ways to do it. To install the latest development version, use the following command: + +``` +pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz +``` + +Make sure you also have [Podman installed][9] since you’ll need it as well. On Fedora, to install Podman use the following command: + +``` +sudo dnf install podman +``` + +### Example: launching a WordPress site with Podman Compose + +Imagine your _docker-compose.yaml_ file is in a folder called _wpsite_. A typical _docker-compose.yaml_ (or _docker-compose.yml_) for a WordPress site looks like this: + +``` +version: "3.8" +services: + web: + image: wordpress + restart: always + volumes: + - wordpress:/var/www/html + ports: + - 8080:80 + environment: + WORDPRESS_DB_HOST: db + WORDPRESS_DB_USER: magazine + WORDPRESS_DB_NAME: magazine + WORDPRESS_DB_PASSWORD: 1maGazine! + WORDPRESS_TABLE_PREFIX: cz + WORDPRESS_DEBUG: 0 + depends_on: + - db + networks: + - wpnet + db: + image: mariadb:10.5 + restart: always + ports: + - 6603:3306 + + volumes: + - wpdbvol:/var/lib/mysql + + environment: + MYSQL_DATABASE: magazine + MYSQL_USER: magazine + MYSQL_PASSWORD: 1maGazine! + MYSQL_ROOT_PASSWORD: 1maGazine! + networks: + - wpnet +volumes: + wordpress: {} + wpdbvol: {} + +networks: + wpnet: {} +``` + +If you come from a Docker background, you know you can launch these services by running _docker-compose up_. Docker Compose will create two containers named _wpsite_web_1_ and _wpsite_db_1_, and attaches them to a network called _wpsite_wpnet_. + +Now, see what happens when you run _podman-compose up_ in the project directory. First, a pod is created named after the directory in which the command was issued. Next, it looks for any named volumes defined in the YAML file and creates the volumes if they do not exist. Then, one container is created per every service listed in the _services_ section of the YAML file and added to the pod. + +Naming of the containers is done similar to Docker Compose. For example, for your web service, a container named _wpsite_web_1_ is created. Podman Compose also adds localhost aliases to each named container. Then, containers can still resolve each other by name, although they are not on a bridge network as in Docker. To do this, use the option _–add-host_. For example, _–add-host web:localhost_. + +Note that _docker-compose.yaml_ includes a port forwarding from host port 8080 to container port 80 for the web service. You should now be able to access your fresh WordPress instance from the browser using the address __. + +![WordPress Dashboard][10] + +### Controlling the pod and containers + +To see your running containers, use _podman ps_, which shows the web and database containers along with the infra container in your pod. +``` + +``` + +CONTAINER ID  IMAGE                               COMMAND               CREATED      STATUS          PORTS                                         NAMES +a364a8d7cec7  docker.io/library/wordpress:latest  apache2-foregroun...  2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_web_1 +c447024aa104  docker.io/library/mariadb:10.5      mysqld                2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_db_1 +12b1e3418e3e  k8s.gcr.io/pause:3.2 +``` + +``` + +You can also verify that a pod has been created by Podman for this project, named after the folder in which you issued the command. +``` + +``` + +POD ID        NAME             STATUS    CREATED      INFRA ID      # OF CONTAINERS +8a08a3a7773e  wpsite           Degraded  2 hours ago  12b1e3418e3e  3 +``` + +``` + +To stop the containers, enter the following command in another command window: + +``` +podman-compose down +``` + +You can also do that by stopping and removing the pod. This essentially stops and removes all the containers and then the containing pod. So, the same thing can be achieved with these commands: + +``` +podman pod stop podname +podman pod rm podname +``` + +Note that this does not remove the volumes you defined in _docker-compose.yaml_. So, the state of your WordPress site is saved, and you can get it back by running this command: + +``` +podman-compose up +``` + +In conclusion, if you’re a Podman fan and do your container jobs with Podman, you can use Podman Compose to manage your containers in development and production. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-containers-with-podman-compose/ + +作者:[Mehdi Haghgoo][a] +选题:[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/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/01/podman-compose-1-816x345.jpg +[2]: https://podman.io +[3]: https://fedoramagazine.org/podman-pods-fedora-containers/ +[4]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ +[5]: https://docs.docker.com/compose/ +[6]: https://github.com/containers/podman-compose +[7]: https://kubernetes.io/docs/concepts/containers/ +[8]: https://kubernetes.io/docs/concepts/workloads/pods/ +[9]: https://podman.io/getting-started/installation +[10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Screenshot-from-2021-01-08-06-27-29-1024x767.png From de89390d0062c99c811a9801c2392ecf43829d9e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 30 Jan 2021 05:04:26 +0800 Subject: [PATCH 050/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210129=20?= =?UTF-8?q?Machine=20learning=20made=20easy=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210129 Machine learning made easy with Python.md --- ... Machine learning made easy with Python.md | 218 ++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 sources/tech/20210129 Machine learning made easy with Python.md diff --git a/sources/tech/20210129 Machine learning made easy with Python.md b/sources/tech/20210129 Machine learning made easy with Python.md new file mode 100644 index 0000000000..da6e7f078f --- /dev/null +++ b/sources/tech/20210129 Machine learning made easy with Python.md @@ -0,0 +1,218 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Machine learning made easy with Python) +[#]: via: (https://opensource.com/article/21/1/machine-learning-python) +[#]: author: (Girish Managoli https://opensource.com/users/gammay) + +Machine learning made easy with Python +====== +Solve real-world machine learning problems with Naïve Bayes classifiers. +![arrows cycle symbol for failing faster][1] + +Naïve Bayes is a classification technique that serves as the basis for implementing several classifier modeling algorithms. Naïve Bayes-based classifiers are considered some of the simplest, fastest, and easiest-to-use machine learning techniques, yet are still effective for real-world applications. + +Naïve Bayes is based on [Bayes' theorem][2], formulated by 18th-century statistician [Thomas Bayes][3]. This theorem assesses the probability that an event will occur based on conditions related to the event. For example, an individual with [Parkinson's disease][4] typically has voice variations; hence such symptoms are considered related to the prediction of a Parkinson's diagnosis. The original Bayes' theorem provides a method to determine the probability of a target event, and the Naïve variant extends and simplifies this method. + +### Solving a real-world problem + +This article demonstrates a Naïve Bayes classifier's capabilities to solve a real-world problem (as opposed to a complete business-grade application). I'll assume you have basic familiarity with machine learning (ML), so some of the steps that are not primarily related to ML prediction, such as data shuffling and splitting, are not covered here. If you are an ML beginner or need a refresher, see _[An introduction to machine learning today][5]_ and _[Getting started with open source machine learning][6]_. + +The Naïve Bayes classifier is [supervised][7], [generative][8], non-linear, [parametric][9], and [probabilistic][10]. + +In this article, I'll demonstrate using Naïve Bayes with the example of predicting a Parkinson's diagnosis. The dataset for this example comes from this [UCI Machine Learning Repository][11]. This data includes several speech signal variations to assess the likelihood of the medical condition; this example will use the first eight of them: + + * **MDVP:Fo(Hz):** Average vocal fundamental frequency + * **MDVP:Fhi(Hz):** Maximum vocal fundamental frequency + * **MDVP:Flo(Hz):** Minimum vocal fundamental frequency + * **MDVP:Jitter(%)**, **MDVP:Jitter(Abs)**, **MDVP:RAP**, **MDVP:PPQ**, and **Jitter:DDP:** Five measures of variation in fundamental frequency + + + +The dataset used in this example, shuffled and split for use, is available in my [GitHub repository][12]. + +### ML with Python + +I'll use Python to implement the solution. The software I used for this application is: + + * Python 3.8.2 + * Pandas 1.1.1 + * scikit-learn 0.22.2.post1 + + + +There are several open source Naïve Bayes classifier implementations available in Python, including: + + * **NLTK Naïve Bayes:** Based on the standard Naïve Bayes algorithm for text classification + * **NLTK Positive Naïve Bayes:** A variant of NLTK Naïve Bayes that performs binary classification with partially labeled training sets + * **Scikit-learn Gaussian Naïve Bayes:** Provides partial fit to support a data stream or very large dataset + * **Scikit-learn Multinomial Naïve Bayes:** Optimized for discrete data features, example counts, or frequency + * **Scikit-learn Bernoulli Naïve Bayes:** Designed for binary/Boolean features + + + +I will use [sklearn Gaussian Naive Bayes][13] for this example. + +Here is my Python implementation of `naive_bayes_parkinsons.py`: + + +``` +import pandas as pd + +# Feature columns we use +x_rows=['MDVP:Fo(Hz)','MDVP:Fhi(Hz)','MDVP:Flo(Hz)', +        'MDVP:Jitter(%)','MDVP:Jitter(Abs)','MDVP:RAP','MDVP:PPQ','Jitter:DDP'] +y_rows=['status'] + +# Train + +# Read train data +train_data = pd.read_csv('parkinsons/Data_Parkinsons_TRAIN.csv') +train_x = train_data[x_rows] +train_y = train_data[y_rows] +print("train_x:\n", train_x) +print("train_y:\n", train_y) + +# Load sklearn Gaussian Naive Bayes and fit +from sklearn.naive_bayes import GaussianNB + +gnb = GaussianNB() +gnb.fit(train_x, train_y) + +# Prediction on train data +predict_train = gnb.predict(train_x) +print('Prediction on train data:', predict_train) + +# Accuray score on train data +from sklearn.metrics import accuracy_score +accuracy_train = accuracy_score(train_y, predict_train) +print('Accuray score on train data:', accuracy_train) + +# Test + +# Read test data +test_data = pd.read_csv('parkinsons/Data_Parkinsons_TEST.csv') +test_x = test_data[x_rows] +test_y = test_data[y_rows] + +# Prediction on test data +predict_test = gnb.predict(test_x) +print('Prediction on test data:', predict_test) + +# Accuracy Score on test data +accuracy_test = accuracy_score(test_y, predict_test) +print('Accuray score on test data:', accuracy_train) +``` + +Run the Python application: + + +``` +$ python naive_bayes_parkinsons.py + +train_x: +      MDVP:Fo(Hz)  MDVP:Fhi(Hz) ...  MDVP:RAP  MDVP:PPQ  Jitter:DDP +0        152.125       161.469  ...   0.00191   0.00226     0.00574 +1        120.080       139.710  ...   0.00180   0.00220     0.00540 +2        122.400       148.650  ...   0.00465   0.00696     0.01394 +3        237.323       243.709  ...   0.00173   0.00159     0.00519 +..           ...           ...           ...  ...       ...       ...         +155      138.190       203.522  ...   0.00406   0.00398     0.01218 + +[156 rows x 8 columns] + +train_y: +      status +0         1 +1         1 +2         1 +3         0 +..      ... +155       1 + +[156 rows x 1 columns] + +Prediction on train data: [1 1 1 0 ... 1] +Accuracy score on train data: 0.6666666666666666 + +Prediction on test data: [1 1 1 1 ... 1 + 1 1] +Accuracy score on test data: 0.6666666666666666 +``` + +The accuracy scores on the train and test sets are 67% in this example; its performance can be optimized. Do you want to give it a try? If so, share your approach in the comments below. + +### Under the hood + +The Naïve Bayes classifier is based on Bayes' rule or theorem, which computes conditional probability, or the likelihood for an event to occur when another related event has occurred. Stated in simple terms, it answers the question: _If we know the probability that event x occurred before event y, then what is the probability that y will occur when x occurs again?_ The rule uses a prior-prediction value that is refined gradually to arrive at a final [posterior][14] value. A fundamental assumption of Bayes is that all parameters are of equal importance. + +At a high level, the steps involved in Bayes' computation are: + + 1. Compute overall posterior probabilities ("Has Parkinson's" and "Doesn't have Parkinson's") + 2. Compute probabilities of posteriors across all values and each possible value of the event + 3. Compute final posterior probability by multiplying the results of #1 and #2 for desired events + + + +Step 2 can be computationally quite arduous. Naïve Bayes simplifies it: + + 1. Compute overall posterior probabilities ("Has Parkinson's" and "Doesn't have Parkinson's") + 2. Compute probabilities of posteriors for desired event values + 3. Compute final posterior probability by multiplying the results of #1 and #2 for desired events + + + +This is a very basic explanation, and several other factors must be considered, such as data types, sparse data, missing data, and more. + +### Hyperparameters + +Naïve Bayes, being a simple and direct algorithm, does not need hyperparameters. However, specific implementations may provide advanced features. For example, [GaussianNB][13] has two: + + * **priors:** Prior probabilities can be specified instead of the algorithm taking the priors from data. + * **var_smoothing:** This provides the ability to consider data-curve variations, which is helpful when the data does not follow a typical Gaussian distribution. + + + +### Loss functions + +Maintaining its philosophy of simplicity, Naïve Bayes uses a [0-1 loss function][15]. If the prediction correctly matches the expected outcome, the loss is 0, and it's 1 otherwise. + +### Pros and cons + +**Pro:** Naïve Bayes is one of the easiest and fastest algorithms. +**Pro:** Naïve Bayes gives reasonable predictions even with less data. +**Con:** Naïve Bayes predictions are estimates, not precise. It favors speed over accuracy. +**Con:** A fundamental Naïve Bayes assumption is the independence of all features, but this may not always be true. + +In essence, Naïve Bayes is an extension of Bayes' theorem. It is one of the simplest and fastest machine learning algorithms, intended for easy and quick training and prediction. Naïve Bayes provides good-enough, reasonably accurate predictions. One of its fundamental assumptions is the independence of prediction features. Several open source implementations are available with traits over and above what are available in the Bayes algorithm. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/machine-learning-python + +作者:[Girish Managoli][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gammay +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/fail_progress_cycle_momentum_arrow.png?itok=q-ZFa_Eh (arrows cycle symbol for failing faster) +[2]: https://en.wikipedia.org/wiki/Bayes%27_theorem +[3]: https://en.wikipedia.org/wiki/Thomas_Bayes +[4]: https://en.wikipedia.org/wiki/Parkinson%27s_disease +[5]: https://opensource.com/article/17/9/introduction-machine-learning +[6]: https://opensource.com/business/15/9/getting-started-open-source-machine-learning +[7]: https://en.wikipedia.org/wiki/Supervised_learning +[8]: https://en.wikipedia.org/wiki/Generative_model +[9]: https://en.wikipedia.org/wiki/Parametric_model +[10]: https://en.wikipedia.org/wiki/Probabilistic_classification +[11]: https://archive.ics.uci.edu/ml/datasets/parkinsons +[12]: https://github.com/gammay/Machine-learning-made-easy-Naive-Bayes/tree/main/parkinsons +[13]: https://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html +[14]: https://en.wikipedia.org/wiki/Posterior_probability +[15]: https://en.wikipedia.org/wiki/Loss_function#0-1_loss_function From 15a9aa000ccee77189d17f01f23845418ddbafea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 30 Jan 2021 12:07:17 +0800 Subject: [PATCH 051/213] PUB @wxy https://linux.cn/article-13067-1.html --- ...ol Open Source To-Do List App with GitHub Integration.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md (97%) diff --git a/translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md b/published/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md similarity index 97% rename from translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md rename to published/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md index 32a78bec52..603476e224 100644 --- a/translated/tech/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md +++ b/published/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13067-1.html) [#]: subject: (Super Productivity: A Super Cool Open Source To-Do List App with GitHub Integration) [#]: via: (https://itsfoss.com/super-productivity/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) @@ -28,7 +28,7 @@ 它还提供了一堆基本功能以及一些有趣的选项。让我们来看看它们。 -### “超级生产力”的特点 +### “超级生产力”的功能 ![][5] From f19901f79b1f7b0a116b72be2c473c723467308e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 30 Jan 2021 17:05:23 +0800 Subject: [PATCH 052/213] PRF @mengxinayan --- ...ual address support in the Arm64 kernel.md | 98 ++++++++++--------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md b/translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md index e2acf4c5cd..3942ba32ce 100644 --- a/translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md +++ b/translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md @@ -1,43 +1,45 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Understanding 52-bit virtual address support in the Arm64 kernel) [#]: via: (https://opensource.com/article/20/12/52-bit-arm64-kernel) [#]: author: (Bhupesh Sharma https://opensource.com/users/bhsharma) -理解 ARM64 内核中对 52 比特虚拟地址的支持 +理解 ARM64 内核中对 52 位虚拟地址的支持 ====== -随着 64 比特硬件的普及,增加了处理更大地址空间的需求。 -![拼图碎片聚在一起形成计算机屏幕][1] -当 64 比特硬件变得可用之后,处理更大地址空间(大于232字节)的需求变得显而易见。现如今一些公司已经提供 64TiB 或更大内存的服务器,x86_64 架构和 arm64 架构现在允许寻址的地址空间大于 248 字节(可以使用默认的 48 比特地址支持)。 +> 随着 64 位硬件的引入,增加了处理更大地址空间的需求。 -x86_64 架构通过让硬件和软件支持五级页表以支持这些用例。它允许寻址的地址空间等于 257 字节(详情见 [x86:在 4.12 内核中启用 5 级页表][2])。它突破了过去虚拟地址空间 128PiB 和 物理地址空间 4PiB 的上限。 +![](https://img.linux.net.cn/data/attachment/album/202101/30/170448rynbm9b6nmb90403.jpg) -arm64 架构通过引入两个新的体系结构拓展来实现相同的功能—ARMv8.2 LVA(更大的虚拟寻址) 和 ARMv8.2 LPA(更大的物理地址寻址)。这允许使用 4PiB 的虚拟地址空间和 4PiB 的物理地址空间(即分别为 252 比特)。 +当 64 位硬件变得可用之后,处理更大地址空间(大于 232 字节)的需求变得显而易见。现如今一些公司已经提供 64TiB 或更大内存的服务器,x86_64 架构和 arm64 架构现在允许寻址的地址空间大于 248 字节(可以使用默认的 48 位地址支持)。 -在新的 arm64 CPU 中已经支持了 ARMv8.2 体系结构拓展,同时现在开源软件也支持了这两种新的硬件拓展。 +x86_64 架构通过让硬件和软件启用五级页表以支持这些用例。它允许寻址的地址空间等于 257 字节(详情见 [x86:在 4.12 内核中启用 5 级页表][2])。它突破了过去虚拟地址空间 128PiB 和物理地址空间 4PiB 的上限。 -从 5.4 内核开始, arm64 架构中的52 比特(大)虚拟地址(VA)和物理地址(PA)得到支持。尽管[内核文档][3]描述了这些特性和新的内核运行时对旧的 CPU(硬件层面不支持 52 比特虚拟地址拓展)和新的 CPU(硬件层面支持 52 比特虚拟地址拓展)的影响,但对普通用户而言理解这些并且如何“选择使用”52比特的地址空间可能会很复杂。 +arm64 架构通过引入两个新的体系结构 —— ARMv8.2 LVA(更大的虚拟寻址) 和 ARMv8.2 LPA(更大的物理地址寻址) —— 拓展来实现相同的功能。这允许使用 4PiB 的虚拟地址空间和 4PiB 的物理地址空间(即分别为 252 位)。 + +随着新的 arm64 CPU 中支持了 ARMv8.2 体系结构拓展,同时现在开源软件也支持了这两种新的硬件拓展。 + +从 Linux 5.4 内核开始, arm64 架构中的 52 位(大)虚拟地址(VA)和物理地址(PA)得到支持。尽管[内核文档][3]描述了这些特性和新的内核运行时对旧的 CPU(硬件层面不支持 52 位虚拟地址拓展)和新的 CPU(硬件层面支持 52 位虚拟地址拓展)的影响,但对普通用户而言,理解这些并且如何 “选择使用” 52 位的地址空间可能会很复杂。 因此,我会在本文中介绍下面这些比较新的概念: 1. 在增加了对这些功能的支持后,内核的内存布局如何“翻转”到 Arm64 架构 - 2. 对用户态应用的影响,尤其是对提供调试支持的程序(例如:kexec-tools, makedumpfile 和 crash-utility) - 3. 如何通过指定大于 48 比特的 mmap 参数,使用户态应用“选择”接收 52 比特地址? + 2. 对用户态应用的影响,尤其是对提供调试支持的程序(例如:kexec-tools、 makedumpfile 和 crash-utility) + 3. 如何通过指定大于 48 位的 mmap 参数,使用户态应用“选择”从 52 位地址空间接受 VA? ### ARMv8.2 架构的 LVA 和 LPA 拓展 -ARMv8.2 架构提供两种重要的拓展:更大的虚拟地址(LVA)和更大的物理地址(LPA)。 +ARMv8.2 架构提供两种重要的拓展:大虚拟寻址(LVA)和大物理寻址(LPA)。 -当使用 64 KB 转换粒度时,ARMv8.2-LVA 为每个基地址寄存器提供了一个更大的 52 比特虚拟地址空间。 +当使用 64 KB 转换粒度时,ARMv8.2-LVA 为每个翻译表基地址寄存器提供了一个更大的 52 位虚拟地址空间。 -在 ARMv8.2-LVA 中包含: +在 ARMv8.2-LVA 中允许: - * 当使用 64 KB 转换粒度时,中间物理地址(IPA)和物理地址空间拓展为 52 比特。 - * 如果使用 64 KB 转换粒度来实现对 52 比特物理地址的支持,那么一级块将会覆盖 4TB 的地址空间。 + * 当使用 64 KB 转换粒度时,中间物理地址(IPA)和物理地址空间拓展为 52 位。 + * 如果使用 64 KB 转换粒度来实现对 52 位物理地址的支持,那么一级块将会覆盖 4TB 的地址空间。 _需要注意的是这些特性仅在 AArch64 架构中支持。_ @@ -49,13 +51,13 @@ _需要注意的是这些特性仅在 AArch64 架构中支持。_ 更多细节请参考 [Armv8 架构参考手册][4]。 -### Arm64 中的内核内存布局 +### Arm64 的内核内存布局 -伴随着 ARMv8.2 拓展增加了对 LVA 地址的支持(仅当页大小为 64 KB 是可用),在第一级翻译中,描述符的数量会增加。 +伴随着 ARMv8.2 拓展增加了对 LVA 地址的支持(仅当以页大小为 64 KB 运行时可用),在第一级转换中,描述符的数量会增加。 -用户地址将 63-48 比特位置为 0,然而内核地址将这些比特位置为 1。TTBRx 选择由虚拟地址的 63 比特位决定。`swapper_pg_dir` 仅包含内核全局映射,然而 `pgd` 仅包含用户(非全局)的映射。`swapper_pg_dir` 地址会写入 TTBR1 且永远不会写入 TTBR0。 +用户地址将 63-48 位位置为 0,然而内核地址将这些位设置为 1。TTBRx 的选择由虚拟地址的 63 位决定。`swapper_pg_dir` 仅包含内核(全局)映射,然而 `pgd` 仅包含用户(非全局)的映射。`swapper_pg_dir` 地址会写入 TTBR1,且永远不会写入 TTBR0。 -**页面大小为 64 KB 和三个级别的(具有 52 比特硬件支持)的 AArch64 架构下 Linux 内存布局如下:** +**页面大小为 64 KB 和三个级别的(具有 52 位硬件支持)的 AArch64 架构下 Linux 内存布局如下:** ``` 开始 结束 大小 用途 @@ -85,11 +87,11 @@ _需要注意的是这些特性仅在 AArch64 架构中支持。_    |                 |         |         |         |         |    |                 |         |         |         |         v | | | | | [11:0] 页内偏移量 - | | | | +-> [20:12] L3 索引 - | | | +-----------> [29:21] L2 索引 -   |                 |         +---------------------> [38:30] L1 索引 -   |                 +-------------------------------> [47:39] L0 索引 -   +-------------------------------------------------> [63] TTBR0/1 + | | | | +-> [20:12] L3 索引 + | | | +-----------> [29:21] L2 索引 +   |                 |         +---------------------> [38:30] L1 索引 +   |                 +-------------------------------> [47:39] L0 索引 +   +-------------------------------------------------> [63] TTBR0/1 ``` **64 KB 页面的转换查询表如下:** @@ -101,18 +103,18 @@ _需要注意的是这些特性仅在 AArch64 架构中支持。_    |                 |    |               |              |    |                 |    |               |              v    |                 |    |               |            [15:0]  页内偏移量 -   |                 |    |               +----------> [28:16] L3 索引 -   |                 |    +--------------------------> [41:29] L2 索引 - | +-------------------------------> [47:42] L1 索引 (48 比特) - | [51:42] L1 索引 (52 比特) -   +-------------------------------------------------> [63] TTBR0/1 +   |                 |    |               +----------> [28:16] L3 索引 +   |                 |    +--------------------------> [41:29] L2 索引 + | +-------------------------------> [47:42] L1 索引 (48 位) + | [51:42] L1 索引 (52 位) +   +-------------------------------------------------> [63] TTBR0/1 ``` ![][5] -### 内核对 52 比特虚拟地址的支持 +### 内核对 52 位虚拟地址的支持 -因为支持 LVA 的较新的内核应在旧的CPU(硬件不支持 LVA 拓展)和新的CPU(硬件支持 LVA 拓展)上都可以正常运行,因此采用的设计方法是使用单个二进制文件来支持 52 比特(如果硬件不支持该特性,则必须在刚开始启动时能回到 48 比特)。也就是说,为了满足 52 比特的虚拟地址以及固定大小的 `PAGE_OFFSET`,VMEMMAP 必须设置得足够大。 +因为支持 LVA 的较新的内核应该可以在旧的 CPU(硬件不支持 LVA 拓展)和新的 CPU(硬件支持 LVA 拓展)上都正常运行,因此采用的设计方法是使用单个二进制文件来支持 52 位(如果硬件不支持该特性,则必须在刚开始启动时能回退到 48 位)。也就是说,为了满足 52 位的虚拟地址以及固定大小的 `PAGE_OFFSET`,`VMEMMAP` 必须设置得足够大。 这样的设计方式要求内核为了新的虚拟地址空间而支持下面的变量: @@ -122,13 +124,13 @@ VA_BITS 常量 *最大的* 虚拟地址空间大小 vabits_actual 变量 *实际的* 虚拟地址空间大小 ``` -因此,尽管 `VA_BITS` 设置了最大的虚拟地址空间大小,但实际上支持的虚拟地址空间大小由 `vabits_actual` 确定(具体取决于启动时的切换) +因此,尽管 `VA_BITS` 设置了最大的虚拟地址空间大小,但实际上支持的虚拟地址空间大小由 `vabits_actual` 确定(具体取决于启动时的切换)。 #### 翻转内核内存布局 -保持一个单内核二进制文件的设计方法要求内核的 .text 文件位于高位地址中,因此它们对于 48/52 比特虚拟地址都不变。因为内核地址检测器(KASAN)区域仅占整个内核虚拟地址空间的一小部分,因此对于 48 比特或 52 比特的虚拟地址空间,KASAN 区域的末尾也必须在内核虚拟地址空间的上半部分。(从 48 比特切换到 52 比特,KASAN 区域的末尾是不变的且依赖于 `~0UL`,而起始地址将“增长”到低位地址) +保持一个单一内核二进制文件的设计方法要求内核的 `.text` 位于高位地址中,因此它们对于 48/52 位虚拟地址是不变的。因为内核地址检测器(KASAN)区域仅占整个内核虚拟地址空间的一小部分,因此对于 48 位或 52 位的虚拟地址空间,KASAN 区域的末尾也必须在内核虚拟地址空间的上半部分。(从 48 位切换到 52 位,KASAN 区域的末尾是不变的,且依赖于 `~0UL`,而起始地址将“增长”到低位地址) -为了优化 `phys_to_virt()` 和 `virt_to_phys()`,页偏移量将被保持在 `0xFFF0000000000000` (对应于 52 比特),这消除了读取额外变量的需求。在早期启动时将会计算 `physvirt` 和 `vmemmap` 偏移量以启用这个逻辑。 +为了优化 `phys_to_virt()` 和 `virt_to_phys()`,页偏移量将被保持在 `0xFFF0000000000000` (对应于 52 位),这消除了读取额外变量的需求。在早期启动时将会计算 `physvirt` 和 `vmemmap` 偏移量以启用这个逻辑。 考虑下面的物理和虚拟 RAM 地址空间的转换: @@ -139,8 +141,8 @@ vabits_actual 变量 *实际的* 虚拟地址空间大小 */ #define virt_to_phys(addr) ({ \ - if (!(((u64)addr) & BIT(vabits_actual - 1))) \ - (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET) + if (!(((u64)addr) & BIT(vabits_actual - 1))) \ + (((addr) & ~PAGE_OFFSET) + PHYS_OFFSET) }) #define phys_to_virt(addr) ((unsigned long)((addr) - PHYS_OFFSET) | PAGE_OFFSET) @@ -152,11 +154,11 @@ vabits_actual 变量 *实际的* 虚拟地址空间大小 ### 对用于调试内核的用户态程序的影响 -一些用户空间应用程序用于调试正在运行的/活动中的内核或者分析系统崩溃时的 vmcore 转储(例如确定内核奔溃的根本原因):kexec-tools, makedumpfile, 和 crash-utility。 +有几个用户空间应用程序可以用于调试正在运行的/活动中的内核或者分析系统崩溃时的 vmcore 转储(例如确定内核奔溃的根本原因):kexec-tools、makedumpfile 和 crash-utility。 当用它们来调试 Arm64 内核时,因为 Arm64 内核内存映射被“翻转”,因此也会对它们产生影响。这些应用程序还需要遍历转换表以确定与虚拟地址相应的物理地址(类似于内核中的完成方式)。 -相应地,在将“翻转”引入内核内存映射之后,由于上游中断了用户态应用程序,因此必须对其进行修改。 +相应地,在将“翻转”引入内核内存映射之后,由于上游破坏了用户态应用程序,因此必须对其进行修改。 我已经提议了对三个受影响的用户态应用程序的修复;有一些已经被上游接受,但其他仍在等待中: @@ -166,25 +168,25 @@ vabits_actual 变量 *实际的* 虚拟地址空间大小 除非在用户空间应用程序进行了这些修改,否则它们将仍然无法调试运行/活动中的内核或分析系统崩溃时的 vmcore 转储。 -### 52 比特用户态虚拟地址 +### 52 位用户态虚拟地址 -为了保持与依赖 ARMv8.0 虚拟地址空间的最大为 48 比特的用户空间应用程序的兼容性,在默认情况下内核会将虚拟地址从 48 比特范围返回给用户空间。 +为了保持与依赖 ARMv8.0 虚拟地址空间的最大为 48 位的用户空间应用程序的兼容性,在默认情况下内核会将虚拟地址从 48 位范围返回给用户空间。 -通过指定大于48位的mmap提示参数,用户态程序可以“选择”从 52 比特空间接收虚拟地址。 +通过指定大于 48 位的 mmap 提示参数,用户态程序可以“选择”从 52 位空间接收虚拟地址。 例如: ``` .mmap_high_addr.c -\---- +----    maybe_high_address = mmap(~0UL, size, prot, flags,...); ``` -通过启用以下的内核配置选项,还可以构建一个从 52 比特空间返回地址的调试内核: +通过启用以下的内核配置选项,还可以构建一个从 52 位空间返回地址的调试内核: ``` -`   CONFIG_EXPERT=y && CONFIG_ARM64_FORCE_52BIT=y` +   CONFIG_EXPERT=y && CONFIG_ARM64_FORCE_52BIT=y ``` _请注意此选项仅用于调试应用程序,不应在实际生产中使用。_ @@ -193,9 +195,9 @@ _请注意此选项仅用于调试应用程序,不应在实际生产中使用 总结一下: -1. 内核版本从 5.14 开始,新的 Armv8.2 硬件拓展 LVA 和 LPA 在内核中得到很好的拓展。 +1. 内核版本从 5.14 开始,新的 Armv8.2 硬件拓展 LVA 和 LPA 在内核中得到良好支持。 2. 像 kexec-tools 和 makedumpfile 被用来调试内核的用户态应用程序现在无法支持新拓展,仍在等待上游接受修补。 -3. 过去的用户态应用程序依赖于 Arm64 内核提供的 48 比特虚拟地址将继续原样工作,而较新的用户态应用程序通构指定超过 48 比特更大的 mmap 提示参数来 “选择加入”已接受来自 52 比特的虚拟地址。 +3. 过去的用户态应用程序依赖于 Arm64 内核提供的 48 位虚拟地址将继续原样工作,而较新的用户态应用程序通构指定超过 48 位更大的 mmap 提示参数来 “选择加入”已接受来自 52 位的虚拟地址。 * * * @@ -208,7 +210,7 @@ via: https://opensource.com/article/20/12/52-bit-arm64-kernel 作者:[Bhupesh Sharma][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b078c0130aa19fe7085498f6cc40829549e388c8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 30 Jan 2021 17:06:14 +0800 Subject: [PATCH 053/213] PUB @mengxinayan https://linux.cn/article-13069-1.html --- ...ding 52-bit virtual address support in the Arm64 kernel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md (99%) diff --git a/translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md b/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md similarity index 99% rename from translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md rename to published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md index 3942ba32ce..e6a6aa0669 100644 --- a/translated/tech/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md +++ b/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13069-1.html) [#]: subject: (Understanding 52-bit virtual address support in the Arm64 kernel) [#]: via: (https://opensource.com/article/20/12/52-bit-arm64-kernel) [#]: author: (Bhupesh Sharma https://opensource.com/users/bhsharma) From a5124f3dc8183d15045e2e2b98b8ef8870e478a9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 30 Jan 2021 20:56:32 +0800 Subject: [PATCH 054/213] APL --- ...0125 Explore binaries using this full-featured Linux tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md b/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md index 1126cfe3ab..e08beab3db 100644 --- a/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md +++ b/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bff083d503472e06e1c9bc670a1294890dc19623 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 30 Jan 2021 22:51:06 +0800 Subject: [PATCH 055/213] TSL --- ...ies using this full-featured Linux tool.md | 656 ------------------ ...ies using this full-featured Linux tool.md | 639 +++++++++++++++++ 2 files changed, 639 insertions(+), 656 deletions(-) delete mode 100644 sources/tech/20210125 Explore binaries using this full-featured Linux tool.md create mode 100644 translated/tech/20210125 Explore binaries using this full-featured Linux tool.md diff --git a/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md b/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md deleted file mode 100644 index e08beab3db..0000000000 --- a/sources/tech/20210125 Explore binaries using this full-featured Linux tool.md +++ /dev/null @@ -1,656 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Explore binaries using this full-featured Linux tool) -[#]: via: (https://opensource.com/article/21/1/linux-radare2) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) - -Explore binaries using this full-featured Linux tool -====== -Radare2 is an open source tool custom-made for binary analysis. -![Binary code on a computer screen][1] - -In [_10 ways to analyze binary files on Linux_][2], I explained how to use Linux's rich set of native tools to analyze binaries. But if you want to explore your binary further, you need a tool that is custom-made for binary analysis. If you are new to binary analysis and have mostly worked with scripting languages, [_9 essential GNU binutils tools_][3] will help you get started learning the compilation process and what constitutes a binary. - -### Why do I need another tool? - -It's natural to ask why you need yet another tool if existing Linux-native tools do similar things. Well, it's for the same reasons you use your cellphone as your alarm clock, to take notes, as a camera, to listen to music, to surf the internet, and occasionally to make and receive calls. Previously, separate devices and tools handled these functions — like a physical camera for taking pictures, a small notepad for taking notes, a bedside alarm clock to wake up, and so on. Having one device to do multiple (but related) things is _convenient_ for the user. Also, the killer feature is _interoperability_ between the separate functions. - -Similarly, even though many Linux tools have a specific purpose, having similar (and better) functionality bundled into a single tool is very helpful. This is why I think [Radare2][4] should be your go-to tool whenever you need to work with binaries. - -Radare2 (also known as r2) is a "Unix-like reverse engineering framework and command-line toolset," according to its [GitHub profile][5]. The "2" in its name is because this version was rewritten from scratch to make it more modular. - -### Why Radare2? - -There are tons of (non-native) Linux tools out there that are used for binary analysis, so why should you choose Radare2? My reasons are simple. - -First, it's an open source project with an active and healthy community. If you are looking for slick, new features or availability of bug fixes, this matters a lot. - -Second, Radare2 can be used on the command line, and it has a rich graphical user interface (GUI) environment called Cutter for those who are more comfortable with GUIs. Being a long-time Linux user, I feed more comfortable on the shell. While there is a slight learning curve to getting familiar with Radare2's commands, I would compare it to [learning Vim][6]. You learn basic things first, and once you master them, you move on to more advanced stuff. In no time, it becomes second nature. - -Third, Radare2 has good support for external tools via plugins. For example, the recently open sourced [Ghidra][7] binary analysis and reversing tool is popular for its decompiler feature, which is a critical element of reversing software. You can install and use the Ghidra decompiler right from the Radare2 console, which is amazing and gives you the best of both worlds. - -### Get started with Radare2 - -To install Radare2, simply clone the repo and run the `user.sh` script. You might need to install some prerequisite packages if they aren't already on your system. Once the installation is complete, run the `r2 -v` command to see if Radare2 was installed properly: - - -``` -$ git clone -$ cd radare2 -$ sys/user.sh - -# version - -$ r2 -v -radare2 4.6.0-git 25266 @ linux-x86-64 git.4.4.0-930-g48047b317 -commit: 48047b3171e6ed0480a71a04c3693a0650d03543 build: 2020-11-17__09:31:03 -$ -``` - -#### Get a sample test binary - -Now that r2 is installed, you need a sample binary to try it out. You could use any system binary (`ls`, `bash`, and so on), but to keep things simple for this tutorial, compile the following C program: - - -``` -$ cat adder.c -#include <stdio.h> - -int adder(int num) { -        return num + 1; -} - -int main() { -        int res, num1 = 100; -        res = adder(num1); -        printf("Number now is  : %d\n", res); -        return 0; -} -$ -$ -$ gcc adder.c -o adder -$ -$ file adder -adder: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=9d4366f7160e1ffb46b14466e8e0d70f10de2240, not stripped -$ -$ ./adder -Number now is  : 101 -$ -``` - -#### Load the binary - -To analyze the binary, you have to load it in Radare2. Load it by providing the file as a command line argument to the `r2` command. You're dropped into a separate Radare2 console different from your shell. To exit the console, you can type **Quit** or **Exit** or hit **Ctrl**+**D**: - - -``` -$ r2 ./adder - -- Learn pancake as if you were radare! -[0x004004b0]> quit -$ -``` - -#### Analyze the binary - -Before you can explore the binary, you have to ask r2 to analyze it for you. You can do that by running the `aaa` command in the r2 console; - - -``` -$ r2 ./adder - -- Sorry, radare2 has experienced an internal error. -[0x004004b0]> -[0x004004b0]> -[0x004004b0]> aaa -[x] Analyze all flags starting with sym. and entry0 (aa) -[x] Analyze function calls (aac) -[x] Analyze len bytes of instructions for references (aar) -[x] Check for vtables -[x] Type matching analysis for all functions (aaft) -[x] Propagate noreturn information -[x] Use -AA or aaaa to perform additional experimental analysis. -[0x004004b0]> -``` - -This means that each time you pick a binary for analysis, you have to type an additional command to `aaa` after loading the binary. You can bypass this by calling r2 with `-A` followed by the binary name; this tells r2 to auto-analyze the binary for you: - - -``` -$ r2 -A ./adder -[x] Analyze all flags starting with sym. and entry0 (aa) -[x] Analyze function calls (aac) -[x] Analyze len bytes of instructions for references (aar) -[x] Check for vtables -[x] Type matching analysis for all functions (aaft) -[x] Propagate noreturn information -[x] Use -AA or aaaa to perform additional experimental analysis. - -- Already up-to-date. -[0x004004b0]> -``` - -#### Get some basic information about the binary - -Before you begin analyzing a binary, you need a starting point. In many cases, this can be the binary's file format (ELF, PE, and so on), the architecture the binary was built for (x86, AMD, ARM, and so on), and whether the binary is 32 bit or 64 bit. R2's handy `iI` command can provide the required information: - - -``` -[0x004004b0]> iI -arch     x86 -baddr    0x400000 -binsz    14724 -bintype  elf -bits     64 -canary   false -class    ELF64 -compiler GCC: (GNU) 8.3.1 20190507 (Red Hat 8.3.1-4) -crypto   false -endian   little -havecode true -intrp    /lib64/ld-linux-x86-64.so.2 -laddr    0x0 -lang     c -linenum  true -lsyms    true -machine  AMD x86-64 architecture -maxopsz  16 -minopsz  1 -nx       true -os       linux -pcalign  0 -pic      false -relocs   true -relro    partial -rpath    NONE -sanitiz  false -static   false -stripped false -subsys   linux -va       true - -[0x004004b0]> -[0x004004b0]> -``` - -### Imports and exports - -Often, once you know what kind of file you are dealing with, you want to know what kind of standard library functions the binary uses or learn the program's potential functionalities. In the sample C program in this tutorial, the only library function is `printf` to print a message. You can see this by running the `ii` command, which shows all of the binary's imports: - - -``` -[0x004004b0]> ii -[Imports] -nth vaddr      bind   type   lib name -――――――――――――――――――――――――――――――――――――― -1   0x00000000 WEAK   NOTYPE     _ITM_deregisterTMCloneTable -2   0x004004a0 GLOBAL FUNC       printf -3   0x00000000 GLOBAL FUNC       __libc_start_main -4   0x00000000 WEAK   NOTYPE     __gmon_start__ -5   0x00000000 WEAK   NOTYPE     _ITM_registerTMCloneTable -``` - -The binary can also have its own symbols, functions, or data. These functions are usually shown under `Exports`. The test binary has two functions—main and adder—that are exported. The rest of the functions are added during the compilation phase when the binary is being built. The loader needs these to load the binary (don't worry too much about them for now): - - -``` -[0x004004b0]> -[0x004004b0]> iE -[Exports] - -nth paddr       vaddr      bind   type   size lib name -―――――――――――――――――――――――――――――――――――――――――――――――――――――― -82   0x00000650 0x00400650 GLOBAL FUNC   5        __libc_csu_fini -85   ---------- 0x00601024 GLOBAL NOTYPE 0        _edata -86   0x00000658 0x00400658 GLOBAL FUNC   0        _fini -89   0x00001020 0x00601020 GLOBAL NOTYPE 0        __data_start -90   0x00000596 0x00400596 GLOBAL FUNC   15       adder -92   0x00000670 0x00400670 GLOBAL OBJ    0        __dso_handle -93   0x00000668 0x00400668 GLOBAL OBJ    4        _IO_stdin_used -94   0x000005e0 0x004005e0 GLOBAL FUNC   101      __libc_csu_init -95   ---------- 0x00601028 GLOBAL NOTYPE 0        _end -96   0x000004e0 0x004004e0 GLOBAL FUNC   5        _dl_relocate_static_pie -97   0x000004b0 0x004004b0 GLOBAL FUNC   47       _start -98   ---------- 0x00601024 GLOBAL NOTYPE 0        __bss_start -99   0x000005a5 0x004005a5 GLOBAL FUNC   55       main -100  ---------- 0x00601028 GLOBAL OBJ    0        __TMC_END__ -102  0x00000468 0x00400468 GLOBAL FUNC   0        _init - -[0x004004b0]> -``` - -### Hash info - -How do you know if two binaries are similar? You can't exactly open a binary and view the source code inside it. In most cases, a binary's hash—md5sum, sha1, sha256—is used to uniquely identify it. You can find the binary hash using the `it` command: - - -``` -[0x004004b0]> it -md5 7e6732f2b11dec4a0c7612852cede670 -sha1 d5fa848c4b53021f6570dd9b18d115595a2290ae -sha256 13dd5a492219dac1443a816ef5f91db8d149e8edbf26f24539c220861769e1c2 -[0x004004b0]> -``` - -### Functions - -Code is grouped into functions; to list which functions are present within a binary, run the `afl` command. The following list shows the main and adder functions. Usually, functions that start with `sym.imp` are imported from the standard library (glibc in this case): - - -``` -[0x004004b0]> afl -0x004004b0    1 46           entry0 -0x004004f0    4 41   -> 34   sym.deregister_tm_clones -0x00400520    4 57   -> 51   sym.register_tm_clones -0x00400560    3 33   -> 32   sym.__do_global_dtors_aux -0x00400590    1 6            entry.init0 -0x00400650    1 5            sym.__libc_csu_fini -0x00400658    1 13           sym._fini -0x00400596    1 15           sym.adder -0x004005e0    4 101          loc..annobin_elf_init.c -0x004004e0    1 5            loc..annobin_static_reloc.c -0x004005a5    1 55           main -0x004004a0    1 6            sym.imp.printf -0x00400468    3 27           sym._init -[0x004004b0]> -``` - -### Cross-references - -In C, the main function is where a program starts its execution. Ideally, other functions are called from main and, upon exiting a program, the main function returns an exit status to the operating system. This is evident in the source code; however, what about a binary? How can you tell where the adder function is called? - -You can use the `axt` command followed by the function name to see where the adder function is called; as you can see below, it is called from the main function. This is known as cross-referencing. But what calls the main function itself? The `axt main` function below shows that it is called by `entry0` (I'll leave learning about `entry0` as an exercise for the reader): - - -``` -[0x004004b0]> axt sym.adder -main 0x4005b9 [CALL] call sym.adder -[0x004004b0]> -[0x004004b0]> axt main -entry0 0x4004d1 [DATA] mov rdi, main -[0x004004b0]> -``` - -### Seek locations - -When working with text files, you often move within a file by referencing a line number followed by a row or a column number; in a binary, you use addresses. These are hexadecimal numbers starting with `0x` followed by an address. To find where you are in a binary, run the `s` command. To move to a different location, use the `s` command followed by the address. - -Function names are like labels, which are represented by addresses internally. If the function name is in the binary (not stripped), you can use the `s` command followed by the function name to jump to a specific function address. Similarly, if you want to jump to the start of the binary, type `s 0`: - - -``` -[0x004004b0]> s -0x4004b0 -[0x004004b0]> -[0x004004b0]> s main -[0x004005a5]> -[0x004005a5]> s -0x4005a5 -[0x004005a5]> -[0x004005a5]> s sym.adder -[0x00400596]> -[0x00400596]> s -0x400596 -[0x00400596]> -[0x00400596]> s 0 -[0x00000000]> -[0x00000000]> s -0x0 -[0x00000000]> -``` - -### Hexadecimal view - -Oftentimes, the raw binary doesn't make sense. It can help to view the binary in hexadecimal mode alongside its equivalent ASCII representation: - - -``` -[0x004004b0]> s main -[0x004005a5]> -[0x004005a5]> px -\- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF -0x004005a5  5548 89e5 4883 ec10 c745 fc64 0000 008b  UH..H....E.d.... -0x004005b5  45fc 89c7 e8d8 ffff ff89 45f8 8b45 f889  E.........E..E.. -0x004005c5  c6bf 7806 4000 b800 0000 00e8 cbfe ffff  ..x.@........... -0x004005d5  b800 0000 00c9 c30f 1f40 00f3 0f1e fa41  .........@.....A -0x004005e5  5749 89d7 4156 4989 f641 5541 89fd 4154  WI..AVI..AUA..AT -0x004005f5  4c8d 2504 0820 0055 488d 2d04 0820 0053  L.%.. .UH.-.. .S -0x00400605  4c29 e548 83ec 08e8 57fe ffff 48c1 fd03  L).H....W...H... -0x00400615  741f 31db 0f1f 8000 0000 004c 89fa 4c89  t.1........L..L. -0x00400625  f644 89ef 41ff 14dc 4883 c301 4839 dd75  .D..A...H...H9.u -0x00400635  ea48 83c4 085b 5d41 5c41 5d41 5e41 5fc3  .H...[]A\A]A^A_. -0x00400645  9066 2e0f 1f84 0000 0000 00f3 0f1e fac3  .f.............. -0x00400655  0000 00f3 0f1e fa48 83ec 0848 83c4 08c3  .......H...H.... -0x00400665  0000 0001 0002 0000 0000 0000 0000 0000  ................ -0x00400675  0000 004e 756d 6265 7220 6e6f 7720 6973  ...Number now is -0x00400685  2020 3a20 2564 0a00 0000 0001 1b03 3b44    : %d........;D -0x00400695  0000 0007 0000 0000 feff ff88 0000 0020  ............... -[0x004005a5]> -``` - -### Disassembly - -If you are working with compiled binaries, there is no source code you can view. The compiler translates the source code into machine language instructions that the CPU can understand and execute; the result is the binary or executable. However, you can view assembly instructions (mnemonics) to make sense of what the program is doing. For example, if you want to see what the main function is doing, you can seek the address of the main function using `s main` and then run the `pdf` command to view the disassembly instructions. - -To understand the assembly instructions, you need to refer to the architecture manual (x86 in this case), its application binary interface (its ABI, or calling conventions), and have a basic understanding of how the stack works: - - -``` -[0x004004b0]> s main -[0x004005a5]> -[0x004005a5]> s -0x4005a5 -[0x004005a5]> -[0x004005a5]> pdf -            ; DATA XREF from entry0 @ 0x4004d1 -┌ 55: int main (int argc, char **argv, char **envp); -│           ; var int64_t var_8h @ rbp-0x8 -│           ; var int64_t var_4h @ rbp-0x4 -│           0x004005a5      55             push rbp -│           0x004005a6      4889e5         mov rbp, rsp -│           0x004005a9      4883ec10       sub rsp, 0x10 -│           0x004005ad      c745fc640000.  mov dword [var_4h], 0x64    ; 'd' ; 100 -│           0x004005b4      8b45fc         mov eax, dword [var_4h] -│           0x004005b7      89c7           mov edi, eax -│           0x004005b9      e8d8ffffff     call sym.adder -│           0x004005be      8945f8         mov dword [var_8h], eax -│           0x004005c1      8b45f8         mov eax, dword [var_8h] -│           0x004005c4      89c6           mov esi, eax -│           0x004005c6      bf78064000     mov edi, str.Number_now_is__:__d ; 0x400678 ; "Number now is  : %d\n" ; const char *format -│           0x004005cb      b800000000     mov eax, 0 -│           0x004005d0      e8cbfeffff     call sym.imp.printf         ; int printf(const char *format) -│           0x004005d5      b800000000     mov eax, 0 -│           0x004005da      c9             leave -└           0x004005db      c3             ret -[0x004005a5]> -``` - -Here is the disassembly for the adder function: - - -``` -[0x004005a5]> s sym.adder -[0x00400596]> -[0x00400596]> s -0x400596 -[0x00400596]> -[0x00400596]> pdf -            ; CALL XREF from main @ 0x4005b9 -┌ 15: sym.adder (int64_t arg1); -│           ; var int64_t var_4h @ rbp-0x4 -│           ; arg int64_t arg1 @ rdi -│           0x00400596      55             push rbp -│           0x00400597      4889e5         mov rbp, rsp -│           0x0040059a      897dfc         mov dword [var_4h], edi     ; arg1 -│           0x0040059d      8b45fc         mov eax, dword [var_4h] -│           0x004005a0      83c001         add eax, 1 -│           0x004005a3      5d             pop rbp -└           0x004005a4      c3             ret -[0x00400596]> -``` - -### Strings - -Seeing which strings are present within the binary can be a starting point to binary analysis. Strings are hardcoded into a binary and often provide important hints to shift your focus to analyze certain areas. Run the `iz` command within the binary to list all the strings. The test binary has only one string hardcoded in the binary: - - -``` -[0x004004b0]> iz -[Strings] -nth paddr      vaddr      len size section type  string -――――――――――――――――――――――――――――――――――――――――――――――――――――――― -0   0x00000678 0x00400678 20  21   .rodata ascii Number now is  : %d\n - -[0x004004b0]> -``` - -### Cross-reference strings - -As with functions, you can cross-reference strings to see where they are being printed from and understand the code around them: - - -``` -[0x004004b0]> ps @ 0x400678 -Number now is  : %d - -[0x004004b0]> -[0x004004b0]> axt 0x400678 -main 0x4005c6 [DATA] mov edi, str.Number_now_is__:__d -[0x004004b0]> -``` - -### Visual mode - -When your code is complicated with multiple functions called, it's easy to get lost. It can be helpful to have a graphic or visual view of which functions are called, which paths are taken based on certain conditions, etc. You can explore r2's visual mode by using the `VV` command after moving to a function of interest. For example, for the adder function: - - -``` -[0x004004b0]> s sym.adder -[0x00400596]> -[0x00400596]> VV -``` - -![Radare2 Visual mode][8] - -(Gaurav Kamathe, [CC BY-SA 4.0][9]) - -### Debugger - -So far, you have been doing static analysis—you are just looking at things in the binary without running it. Sometimes you need to execute the binary and analyze various information in memory at runtime. r2's internal debugger allows you to run a binary, put in breakpoints, analyze variables' values, or dump registers' contents. - -Start the debugger with the `-d` flag, and add the `-A` flag to do an analysis as the binary loads. You can set breakpoints at various places, like functions or memory addresses, by using the `db ` command. To view existing breakpoints, use the `dbi` command. Once you have placed your breakpoints, start running the binary using the `dc` command. You can view the stack using the `dbt` command, which shows function calls. Finally, you can dump the contents of the registers using the `drr` command: - - -``` -$ r2 -d -A ./adder -Process with PID 17453 started... -= attach 17453 17453 -bin.baddr 0x00400000 -Using 0x400000 -asm.bits 64 -[x] Analyze all flags starting with sym. and entry0 (aa) -[x] Analyze function calls (aac) -[x] Analyze len bytes of instructions for references (aar) -[x] Check for vtables -[x] Type matching analysis for all functions (aaft) -[x] Propagate noreturn information -[x] Use -AA or aaaa to perform additional experimental analysis. - -- git checkout hamster -[0x7f77b0a28030]> -[0x7f77b0a28030]> db main -[0x7f77b0a28030]> -[0x7f77b0a28030]> db sym.adder -[0x7f77b0a28030]> -[0x7f77b0a28030]> dbi -0 0x004005a5 E:1 T:0 -1 0x00400596 E:1 T:0 -[0x7f77b0a28030]> -[0x7f77b0a28030]> afl | grep main -0x004005a5    1 55           main -[0x7f77b0a28030]> -[0x7f77b0a28030]> afl | grep sym.adder -0x00400596    1 15           sym.adder -[0x7f77b0a28030]> -[0x7f77b0a28030]> dc -hit breakpoint at: 0x4005a5 -[0x004005a5]> -[0x004005a5]> dbt -0  0x4005a5           sp: 0x0                 0    [main]  main sym.adder+15 -1  0x7f77b0687873     sp: 0x7ffe35ff6858      0    [??]  section..gnu.build.attributes-1345820597 -2  0x7f77b0a36e0a     sp: 0x7ffe35ff68e8      144  [??]  map.usr_lib64_ld_2.28.so.r_x+65034 -[0x004005a5]> dc -hit breakpoint at: 0x400596 -[0x00400596]> dbt -0  0x400596           sp: 0x0                 0    [sym.adder]  rip entry.init0+6 -1  0x4005be           sp: 0x7ffe35ff6838      0    [main]  main+25 -2  0x7f77b0687873     sp: 0x7ffe35ff6858      32   [??]  section..gnu.build.attributes-1345820597 -3  0x7f77b0a36e0a     sp: 0x7ffe35ff68e8      144  [??]  map.usr_lib64_ld_2.28.so.r_x+65034 -[0x00400596]> -[0x00400596]> -[0x00400596]> dr -rax = 0x00000064 -rbx = 0x00000000 -rcx = 0x7f77b0a21738 -rdx = 0x7ffe35ff6948 -r8 = 0x7f77b0a22da0 -r9 = 0x7f77b0a22da0 -r10 = 0x0000000f -r11 = 0x00000002 -r12 = 0x004004b0 -r13 = 0x7ffe35ff6930 -r14 = 0x00000000 -r15 = 0x00000000 -rsi = 0x7ffe35ff6938 -rdi = 0x00000064 -rsp = 0x7ffe35ff6838 -rbp = 0x7ffe35ff6850 -rip = 0x00400596 -rflags = 0x00000202 -orax = 0xffffffffffffffff -[0x00400596]> -``` - -### Decompiler - -Being able to understand assembly is a prerequisite to binary analysis. Assembly language is always tied to the architecture the binary is built on and is supposed to run on. There is never a 1:1 mapping between a line of source code and assembly code. Often, a single line of C source code produces multiple lines of assembly. So, reading assembly code line-by-line is not optimal. - -This is where decompilers come in. They try to reconstruct the possible source code based on the assembly instructions. This is NEVER exactly the same as the source code used to create the binary; it is a close representation of the source based on assembly. Also, take into account that compiler optimizations that generate different assembly code to speed things up, reduce the size of a binary, etc., will make the decompiler's job more difficult. Also, malware authors often deliberately obfuscate code to put a malware analyst off. - -Radare2 provides decompilers through plugins. You can install any decompiler that is supported by Radare2. View current plugins with the `r2pm -l` command. Install a sample `r2dec` decompiler with the `r2pm install` command: - - -``` -$ r2pm  -l -$ -$ r2pm install r2dec -Cloning into 'r2dec'... -remote: Enumerating objects: 100, done. -remote: Counting objects: 100% (100/100), done. -remote: Compressing objects: 100% (97/97), done. -remote: Total 100 (delta 18), reused 27 (delta 1), pack-reused 0 -Receiving objects: 100% (100/100), 1.01 MiB | 1.31 MiB/s, done. -Resolving deltas: 100% (18/18), done. -Install Done For r2dec -gmake: Entering directory '/root/.local/share/radare2/r2pm/git/r2dec/p' -[CC] duktape/duktape.o -[CC] duktape/duk_console.o -[CC] core_pdd.o -[CC] core_pdd.so -gmake: Leaving directory '/root/.local/share/radare2/r2pm/git/r2dec/p' -$ -$ r2pm  -l -r2dec -$ -``` - -### Decompiler view - -To decompile a binary, load the binary in r2 and auto-analyze it. Move to the function of interest—adder in this example—using the `s sym.adder` command, then use the `pdda` command to view the assembly and decompiled source code side-by-side. Reading this decompiled source code is often easier than reading assembly line-by-line: - - -``` -$ r2 -A ./adder -[x] Analyze all flags starting with sym. and entry0 (aa) -[x] Analyze function calls (aac) -[x] Analyze len bytes of instructions for references (aar) -[x] Check for vtables -[x] Type matching analysis for all functions (aaft) -[x] Propagate noreturn information -[x] Use -AA or aaaa to perform additional experimental analysis. - -- What do you want to debug today? -[0x004004b0]> -[0x004004b0]> s sym.adder -[0x00400596]> -[0x00400596]> s -0x400596 -[0x00400596]> -[0x00400596]> pdda -    ; assembly                               | /* r2dec pseudo code output */ -                                             | /* ./adder @ 0x400596 */ -                                             | #include <stdint.h> -                                             |   -    ; (fcn) sym.adder ()                     | int32_t adder (int64_t arg1) { -                                             |     int64_t var_4h; -                                             |     rdi = arg1; -    0x00400596 push rbp                      |     -    0x00400597 mov rbp, rsp                  |     -    0x0040059a mov dword [rbp - 4], edi      |     *((rbp - 4)) = edi; -    0x0040059d mov eax, dword [rbp - 4]      |     eax = *((rbp - 4)); -    0x004005a0 add eax, 1                    |     eax++; -    0x004005a3 pop rbp                       |     -    0x004005a4 ret                           |     return eax; -                                             | } -[0x00400596]> -``` - -### Configure settings - -As you get more comfortable with Radare2, you will want to change its configuration to tune it to how you work. You can view r2's default configurations using the `e` command. To set a specific configuration, add `config = value` after the `e` command: - - -``` -[0x004005a5]> e | wc -l -593 -[0x004005a5]> e | grep syntax -asm.syntax = intel -[0x004005a5]> -[0x004005a5]> e asm.syntax = att -[0x004005a5]> -[0x004005a5]> e | grep syntax -asm.syntax = att -[0x004005a5]> -``` - -To make the configuration changes permanent, place them in a startup file named `.radare2rc` that r2 reads at startup. This file is usually found in your home directory; if not, you can create one. Some sample configuration options include: - - -``` -$ cat ~/.radare2rc -e asm.syntax = att -e scr.utf8 = true -eco solarized -e cmd.stack = true -e stack.size = 256 -$ -``` - -### Explore more - -You've seen enough Radare2 features to find your way around the tool. Because Radare2 follows the Unix philosophy, even though you can do various things from its console, it uses a separate set of binaries underneath to do its tasks. - -Explore the standalone binaries listed below to see how they work. For example, the binary information seen in the console with the `iI` command can also be found using the `rabin2 ` command: - - -``` -$ cd bin/ -$ -$ ls -prefix  r2agent    r2pm  rabin2   radiff2  ragg2    rarun2   rasm2 -r2      r2-indent  r2r   radare2  rafind2  rahash2  rasign2  rax2 -$ -``` - -What do you think about Radare2? Share your feedback in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/linux-radare2 - -作者:[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/binary_code_computer_screen.png?itok=7IzHK1nn (Binary code on a computer screen) -[2]: https://opensource.com/article/20/4/linux-binary-analysis -[3]: https://opensource.com/article/19/10/gnu-binutils -[4]: https://rada.re/n/ -[5]: https://github.com/radareorg/radare2 -[6]: https://opensource.com/article/19/3/getting-started-vim -[7]: https://ghidra-sre.org/ -[8]: https://opensource.com/sites/default/files/uploads/radare2_visual-mode_0.png (Radare2 Visual mode) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ diff --git a/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md b/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md new file mode 100644 index 0000000000..1f728df0be --- /dev/null +++ b/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md @@ -0,0 +1,639 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Explore binaries using this full-featured Linux tool) +[#]: via: (https://opensource.com/article/21/1/linux-radare2) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) + +全功能的二进制文件分析工具 Radare2 指南 +====== + +> Radare2 是一个为二进制分析定制的开源工具。 + +![电脑屏幕上的二进制代码][1] + +在《[Linux 上分析二进制文件的 10 种方法][2]》中,我解释了如何使用 Linux 上丰富的原生工具集来分析二进制文件。但如果你想进一步探索你的二进制文件,你需要一个为二进制分析定制的工具。如果你是二进制分析的新手,并且大多使用的是脚本语言,《[GNU binutils 里的九种武器][3]》将帮助你开始学习编译过程和什么是二进制。 + +### 为什么我需要另一个工具? + +如果现有的 Linux 原生工具也能做类似的事情,那么自然会问为什么你需要另一个工具。嗯,这和你用手机做闹钟、做笔记、做相机、听音乐、上网、偶尔打电话和接电话的原因是一样的。以前,使用单独的设备和工具处理这些功能 —— 比如拍照的实体相机,记笔记的小记事本,起床的床头闹钟等等。对用户来说,有一个设备来做多件(但相关的)事情是*方便的*。另外,杀手锏就是独立功能之间的*互操作性*。 + +同样,即使许多 Linux 工具都有特定的用途,但在一个工具中捆绑类似(和更好)的功能是非常有用的。这就是为什么我认为 [Radare2][4] 应该是你需要处理二进制文件时的首选工具。 + +根据其 [GitHub 简介][5],Radare2(也称为 r2)是一个“类 Unix 系统上的逆向工程框架和命令行工具集”。它名字中的 “2” 是因为这个版本从头开始重写的,使其更加模块化。 + +### 为什么选择 Radare2? + +有大量(非原生的)Linux 工具可用于二进制分析,为什么你要选择 Radare2?我的理由很简单。 + +首先,它是一个开源项目,有一个活跃而健康的社区。如果你正在寻找新颖的功能或有着 bug 修复的工具,这很重要。 + +其次,Radare2 可以在命令行上使用,而且它有一个功能丰富的图形用户界面(GUI)环境,叫做 Cutter,适合那些对 GUI 比较熟悉的人。作为一个长期使用 Linux 的用户,我对在 shell 上输入感到更舒服。虽然熟悉 Radare2 的命令稍微有一点学习曲线,但我会把它比作 [学习 Vim][6]。你先学习基本的东西,一旦你掌握了它们,你就可以继续学习更高级的东西。很快,它就变成了肌肉记忆。 + +第三,Radare2 通过插件可以很好的支持外部工具。例如,最近开源的 [Ghidra][7] 二进制分析和逆向工具reversing tool很受欢迎,因为它的反编译器功能是逆向软件的关键要素。你可以直接从 Radare2 控制台安装 Ghidra 反编译器并使用,这很神奇,让你两全其美。 + +### 开始使用 Radare2 + +要安装 Radare2,只需克隆其存储库并运行 `user.sh` 脚本。如果你的系统上还没有一些预备软件包,你可能需要安装它们。一旦安装完成,运行 `r2 -v` 命令来查看 Radare2 是否被正确安装: + +``` +$ git clone https://github.com/radareorg/radare2.git +$ cd radare2 +$ ./sys/user.sh + +# version + +$ r2 -v +radare2 4.6.0-git 25266 @ linux-x86-64 git.4.4.0-930-g48047b317 +commit: 48047b3171e6ed0480a71a04c3693a0650d03543 build: 2020-11-17__09:31:03 +$ +``` + +#### 获取二进制测试样本 + +现在 `r2` 已经安装好了,你需要一个样本二进制程序来试用它。你可以使用任何系统二进制文件(`ls`、`bash` 等),但为了使本教程的内容简单,请编译以下 C 程序: + +``` +$ cat adder.c +``` + +``` +#include + +int adder(int num) { + return num + 1; +} + +int main() { + int res, num1 = 100; + res = adder(num1); + printf("Number now is : %d\n", res); + return 0; +} +``` + +``` +$ gcc adder.c -o adder +``` + +``` +$ file adder +adder: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=9d4366f7160e1ffb46b14466e8e0d70f10de2240, not stripped +$ ./adder +Number now is : 101 +``` + +#### 加载二进制文件 + +要分析二进制文件,你必须在 Radare2 中加载它。通过提供文件作为 `r2` 命令的一个命令行参数来加载它。你会进入一个独立的 Radare2 控制台,与你的 shell 不同。要退出控制台,你可以输入 `Quit` 或 `Exit` 或按 `Ctrl+D`: + +``` +$ r2 ./adder + -- Learn pancake as if you were radare! +[0x004004b0]> quit +$ +``` + +#### 分析二进制 + +在你探索二进制之前,你必须让 `r2` 为你分析它。你可以通过在 `r2` 控制台中运行 `aaa` 命令来实现: + +``` +$ r2 ./adder + -- Sorry, radare2 has experienced an internal error. +[0x004004b0]> +[0x004004b0]> +[0x004004b0]> aaa +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. +[0x004004b0]> +``` + +这意味着每次你选择一个二进制文件进行分析时,你必须在加载二进制文件后输入一个额外的命令 `aaa`。你可以绕过这一点,在命令后面跟上 `-A` 来调用 `r2`;这将告诉 `r2` 为你自动分析二进制: + +``` +$ r2 -A ./adder +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. + -- Already up-to-date. +[0x004004b0]> +``` + +#### 获取一些关于二进制的基本信息 + +在开始分析一个二进制文件之前,你需要一些背景信息。在许多情况下,这可以是二进制文件的格式(ELF、PE 等),二进制的架构(x86、AMD、ARM 等),以及二进制是 32 位还是 64 位。方便的 `r2` 的 `iI` 命令可以提供所需的信息: + +``` +[0x004004b0]> iI +arch x86 +baddr 0x400000 +binsz 14724 +bintype elf +bits 64 +canary false +class ELF64 +compiler GCC: (GNU) 8.3.1 20190507 (Red Hat 8.3.1-4) +crypto false +endian little +havecode true +intrp /lib64/ld-linux-x86-64.so.2 +laddr 0x0 +lang c +linenum true +lsyms true +machine AMD x86-64 architecture +maxopsz 16 +minopsz 1 +nx true +os linux +pcalign 0 +pic false +relocs true +relro partial +rpath NONE +sanitiz false +static false +stripped false +subsys linux +va true + +[0x004004b0]> +[0x004004b0]> +``` + +### 导入和导出 + +通常情况下,当你知道你要处理的是什么样的文件后,你就想知道二进制程序使用了什么样的标准库函数,或者了解程序的潜在功能。在本教程中的示例 C 程序中,唯一的库函数是 `printf` 来打印信息。你可以通过运行 `ii` 命令看到这一点,它显示了二进制的所有导入的库: + +``` +[0x004004b0]> ii +[Imports] +nth vaddr bind type lib name +――――――――――――――――――――――――――――――――――――― +1 0x00000000 WEAK NOTYPE _ITM_deregisterTMCloneTable +2 0x004004a0 GLOBAL FUNC printf +3 0x00000000 GLOBAL FUNC __libc_start_main +4 0x00000000 WEAK NOTYPE __gmon_start__ +5 0x00000000 WEAK NOTYPE _ITM_registerTMCloneTable +``` + +二进制也可以有自己的符号、函数或数据。这些函数通常显示在 `Exports` 下。这个测试的二进制导出了两个函数:`main` 和 `adder`。其余的函数是在编译阶段,当二进制文件被构建时添加的。加载器需要这些函数来加载二进制文件(现在不用太关心它们): + +``` +[0x004004b0]> +[0x004004b0]> iE +[Exports] + +nth paddr vaddr bind type size lib name +―――――――――――――――――――――――――――――――――――――――――――――――――――――― +82 0x00000650 0x00400650 GLOBAL FUNC 5 __libc_csu_fini +85 ---------- 0x00601024 GLOBAL NOTYPE 0 _edata +86 0x00000658 0x00400658 GLOBAL FUNC 0 _fini +89 0x00001020 0x00601020 GLOBAL NOTYPE 0 __data_start +90 0x00000596 0x00400596 GLOBAL FUNC 15 adder +92 0x00000670 0x00400670 GLOBAL OBJ 0 __dso_handle +93 0x00000668 0x00400668 GLOBAL OBJ 4 _IO_stdin_used +94 0x000005e0 0x004005e0 GLOBAL FUNC 101 __libc_csu_init +95 ---------- 0x00601028 GLOBAL NOTYPE 0 _end +96 0x000004e0 0x004004e0 GLOBAL FUNC 5 _dl_relocate_static_pie +97 0x000004b0 0x004004b0 GLOBAL FUNC 47 _start +98 ---------- 0x00601024 GLOBAL NOTYPE 0 __bss_start +99 0x000005a5 0x004005a5 GLOBAL FUNC 55 main +100 ---------- 0x00601028 GLOBAL OBJ 0 __TMC_END__ +102 0x00000468 0x00400468 GLOBAL FUNC 0 _init + +[0x004004b0]> +``` + +### 哈希信息 + +如何知道两个二进制文件是否相似?你不能只是打开一个二进制文件并查看里面的源代码。在大多数情况下,二进制文件的哈希值(md5sum、sha1、sha256)是用来唯一识别它的。你可以使用 `it` 命令找到二进制的哈希值: + +``` +[0x004004b0]> it +md5 7e6732f2b11dec4a0c7612852cede670 +sha1 d5fa848c4b53021f6570dd9b18d115595a2290ae +sha256 13dd5a492219dac1443a816ef5f91db8d149e8edbf26f24539c220861769e1c2 +[0x004004b0]> +``` + +### 函数 + +代码按函数分组;要列出二进制中存在的函数,请运行 `afl` 命令。下面的列表显示了 `main` 函数和 `adder` 函数。通常,以 `sym.imp` 开头的函数是从标准库(这里是 glibc)中导入的: + +``` +[0x004004b0]> afl +0x004004b0    1 46           entry0 +0x004004f0    4 41   -> 34   sym.deregister_tm_clones +0x00400520    4 57   -> 51   sym.register_tm_clones +0x00400560    3 33   -> 32   sym.__do_global_dtors_aux +0x00400590    1 6            entry.init0 +0x00400650    1 5            sym.__libc_csu_fini +0x00400658    1 13           sym._fini +0x00400596    1 15           sym.adder +0x004005e0    4 101          loc..annobin_elf_init.c +0x004004e0    1 5            loc..annobin_static_reloc.c +0x004005a5    1 55           main +0x004004a0    1 6            sym.imp.printf +0x00400468    3 27           sym._init +[0x004004b0]> +``` + +### 交叉引用 + +在 C 语言中,`main` 函数是一个程序开始执行的地方。理想情况下,其他函数都是从 `main` 函数调用的,在退出程序时,`main` 函数会向操作系统返回一个退出状态。这在源代码中是很明显的,然而,二进制程序呢?如何判断 `adder` 函数的调用位置呢? + +你可以使用 `axt` 命令,后面加上函数名,看看 `adder` 函数是在哪里调用的;如下图所示,它是从 `main` 函数中调用的。这就是所谓的交叉引用cross-referencing。但什么调用 `main` 函数本身呢?从下面的 `axt main` 可以看出,它是由 `entry0` 调用的(关于 `entry0` 的学习我就不说了,留待读者练习)。 + +``` +[0x004004b0]> axt sym.adder +main 0x4005b9 [CALL] call sym.adder +[0x004004b0]> +[0x004004b0]> axt main +entry0 0x4004d1 [DATA] mov rdi, main +[0x004004b0]> +``` + +### 寻找定位 + +在处理文本文件时,你经常通过引用行号和行或列号在文件内移动;在二进制文件中,你需要使用地址。这些是以 `0x` 开头的十六进制数字,后面跟着一个地址。要找到你在二进制中的位置,运行 `s` 命令。要移动到不同的位置,使用 `s` 命令,后面跟上地址。 + +函数名就像标签一样,内部用地址表示。如果函数名在二进制中(未剥离的),可以使用函数名后面的 `s` 命令跳转到一个特定的函数地址。同样,如果你想跳转到二进制的开始,输入 `s 0`: + +``` +[0x004004b0]> s +0x4004b0 +[0x004004b0]> +[0x004004b0]> s main +[0x004005a5]> +[0x004005a5]> s +0x4005a5 +[0x004005a5]> +[0x004005a5]> s sym.adder +[0x00400596]> +[0x00400596]> s +0x400596 +[0x00400596]> +[0x00400596]> s 0 +[0x00000000]> +[0x00000000]> s +0x0 +[0x00000000]> +``` + +### 十六进制视图 + +通常情况下,原始二进制没有意义。在十六进制模式下查看二进制及其等效的 ASCII 表示法会有帮助: + +``` +[0x004004b0]> s main +[0x004005a5]> +[0x004005a5]> px +- offset -   0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF +0x004005a5  5548 89e5 4883 ec10 c745 fc64 0000 008b  UH..H....E.d.... +0x004005b5  45fc 89c7 e8d8 ffff ff89 45f8 8b45 f889  E.........E..E.. +0x004005c5  c6bf 7806 4000 b800 0000 00e8 cbfe ffff  ..x.@........... +0x004005d5  b800 0000 00c9 c30f 1f40 00f3 0f1e fa41  .........@.....A +0x004005e5  5749 89d7 4156 4989 f641 5541 89fd 4154  WI..AVI..AUA..AT +0x004005f5  4c8d 2504 0820 0055 488d 2d04 0820 0053  L.%.. .UH.-.. .S +0x00400605  4c29 e548 83ec 08e8 57fe ffff 48c1 fd03  L).H....W...H... +0x00400615  741f 31db 0f1f 8000 0000 004c 89fa 4c89  t.1........L..L. +0x00400625  f644 89ef 41ff 14dc 4883 c301 4839 dd75  .D..A...H...H9.u +0x00400635  ea48 83c4 085b 5d41 5c41 5d41 5e41 5fc3  .H...[]A\A]A^A_. +0x00400645  9066 2e0f 1f84 0000 0000 00f3 0f1e fac3  .f.............. +0x00400655  0000 00f3 0f1e fa48 83ec 0848 83c4 08c3  .......H...H.... +0x00400665  0000 0001 0002 0000 0000 0000 0000 0000  ................ +0x00400675  0000 004e 756d 6265 7220 6e6f 7720 6973  ...Number now is +0x00400685  2020 3a20 2564 0a00 0000 0001 1b03 3b44    : %d........;D +0x00400695  0000 0007 0000 0000 feff ff88 0000 0020  ............... +[0x004005a5]> +``` + +### 反汇编 + +如果你使用的是编译后的二进制文件,则无法查看源代码。编译器将源代码转译成 CPU 可以理解和执行的机器语言指令;其结果就是二进制或可执行文件。然而,你可以查看汇编指令(的助记词)来理解程序正在做什么。例如,如果你想查看 `main` 函数在做什么,你可以使用 `s main` 寻找 `main` 函数的地址,然后运行 `pdf` 命令来查看反汇编的指令。 + +要理解汇编指令,你需要参考体系结构手册(这里是 x86),它的应用二进制接口(ABI,或调用惯例),并对堆栈的工作原理有基本的了解: + +``` +[0x004004b0]> s main +[0x004005a5]> +[0x004005a5]> s +0x4005a5 +[0x004005a5]> +[0x004005a5]> pdf +            ; DATA XREF from entry0 @ 0x4004d1 +┌ 55: int main (int argc, char **argv, char **envp); +│           ; var int64_t var_8h @ rbp-0x8 +│           ; var int64_t var_4h @ rbp-0x4 +│           0x004005a5      55             push rbp +│           0x004005a6      4889e5         mov rbp, rsp +│           0x004005a9      4883ec10       sub rsp, 0x10 +│           0x004005ad      c745fc640000.  mov dword [var_4h], 0x64    ; 'd' ; 100 +│           0x004005b4      8b45fc         mov eax, dword [var_4h] +│           0x004005b7      89c7           mov edi, eax +│           0x004005b9      e8d8ffffff     call sym.adder +│           0x004005be      8945f8         mov dword [var_8h], eax +│           0x004005c1      8b45f8         mov eax, dword [var_8h] +│           0x004005c4      89c6           mov esi, eax +│           0x004005c6      bf78064000     mov edi, str.Number_now_is__:__d ; 0x400678 ; "Number now is  : %d\n" ; const char *format +│           0x004005cb      b800000000     mov eax, 0 +│           0x004005d0      e8cbfeffff     call sym.imp.printf         ; int printf(const char *format) +│           0x004005d5      b800000000     mov eax, 0 +│           0x004005da      c9             leave +└           0x004005db      c3             ret +[0x004005a5]> +``` + +这是 `adder` 函数的反汇编结果: + + +``` +[0x004005a5]> s sym.adder +[0x00400596]> +[0x00400596]> s +0x400596 +[0x00400596]> +[0x00400596]> pdf +            ; CALL XREF from main @ 0x4005b9 +┌ 15: sym.adder (int64_t arg1); +│           ; var int64_t var_4h @ rbp-0x4 +│           ; arg int64_t arg1 @ rdi +│           0x00400596      55             push rbp +│           0x00400597      4889e5         mov rbp, rsp +│           0x0040059a      897dfc         mov dword [var_4h], edi     ; arg1 +│           0x0040059d      8b45fc         mov eax, dword [var_4h] +│           0x004005a0      83c001         add eax, 1 +│           0x004005a3      5d             pop rbp +└           0x004005a4      c3             ret +[0x00400596]> +``` + +### 字符串 + +查看二进制中存在哪些字符串可以作为二进制分析的起点。字符串是硬编码到二进制中的,通常会提供重要的提示,可以让你将重点转移到分析某些区域。在二进制中运行 `iz` 命令来列出所有的字符串。这个测试二进制中只有一个硬编码的字符串: + +``` +[0x004004b0]> iz +[Strings] +nth paddr      vaddr      len size section type  string +――――――――――――――――――――――――――――――――――――――――――――――――――――――― +0   0x00000678 0x00400678 20  21   .rodata ascii Number now is  : %d\n + +[0x004004b0]> +``` + +### 交叉引用字符串 + +和函数一样,你可以交叉引用字符串,看看它们是从哪里被打印出来的,并理解它们周围的代码: + +``` +[0x004004b0]> ps @ 0x400678 +Number now is  : %d + +[0x004004b0]> +[0x004004b0]> axt 0x400678 +main 0x4005c6 [DATA] mov edi, str.Number_now_is__:__d +[0x004004b0]> +``` + +### 可视模式 + +当你的代码很复杂,有多个函数被调用时,很容易迷失方向。如果能以图形或可视化的方式查看哪些函数被调用,根据某些条件采取了哪些路径等,会很有帮助。在移动到感兴趣的函数后,可以通过 `VV` 命令来探索 `r2` 的可视化模式。例如,对于 `adder` 函数: + +``` +[0x004004b0]> s sym.adder +[0x00400596]> +[0x00400596]> VV +``` + +![Radare2 Visual mode][8] + +*(Gaurav Kamathe, [CC BY-SA 4.0][9])* + +### 调试器 + +到目前为止,你一直在做的是静态分析 —— 你只是在看二进制文件中的东西,而没有运行它,有时你需要执行二进制文件,并在运行时分析内存中的各种信息。`r2` 的内部调试器允许你运行二进制文件、设置断点、分析变量的值、或者转储寄存器的内容。 + +用 `-d` 标志启动调试器,并在加载二进制时添加 `-A` 标志进行分析。你可以通过使用 `db ` 命令在不同的地方设置断点,比如函数或内存地址。要查看现有的断点,使用 `dbi` 命令。一旦你放置了断点,使用 `dc` 命令开始运行二进制文件。你可以使用 `dbt` 命令查看堆栈,它可以显示函数调用。最后,你可以使用 `drr` 命令转储寄存器的内容: + +``` +$ r2 -d -A ./adder +Process with PID 17453 started... += attach 17453 17453 +bin.baddr 0x00400000 +Using 0x400000 +asm.bits 64 +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. + -- git checkout hamster +[0x7f77b0a28030]> +[0x7f77b0a28030]> db main +[0x7f77b0a28030]> +[0x7f77b0a28030]> db sym.adder +[0x7f77b0a28030]> +[0x7f77b0a28030]> dbi +0 0x004005a5 E:1 T:0 +1 0x00400596 E:1 T:0 +[0x7f77b0a28030]> +[0x7f77b0a28030]> afl | grep main +0x004005a5    1 55           main +[0x7f77b0a28030]> +[0x7f77b0a28030]> afl | grep sym.adder +0x00400596    1 15           sym.adder +[0x7f77b0a28030]> +[0x7f77b0a28030]> dc +hit breakpoint at: 0x4005a5 +[0x004005a5]> +[0x004005a5]> dbt +0  0x4005a5           sp: 0x0                 0    [main]  main sym.adder+15 +1  0x7f77b0687873     sp: 0x7ffe35ff6858      0    [??]  section..gnu.build.attributes-1345820597 +2  0x7f77b0a36e0a     sp: 0x7ffe35ff68e8      144  [??]  map.usr_lib64_ld_2.28.so.r_x+65034 +[0x004005a5]> dc +hit breakpoint at: 0x400596 +[0x00400596]> dbt +0  0x400596           sp: 0x0                 0    [sym.adder]  rip entry.init0+6 +1  0x4005be           sp: 0x7ffe35ff6838      0    [main]  main+25 +2  0x7f77b0687873     sp: 0x7ffe35ff6858      32   [??]  section..gnu.build.attributes-1345820597 +3  0x7f77b0a36e0a     sp: 0x7ffe35ff68e8      144  [??]  map.usr_lib64_ld_2.28.so.r_x+65034 +[0x00400596]> +[0x00400596]> +[0x00400596]> dr +rax = 0x00000064 +rbx = 0x00000000 +rcx = 0x7f77b0a21738 +rdx = 0x7ffe35ff6948 +r8 = 0x7f77b0a22da0 +r9 = 0x7f77b0a22da0 +r10 = 0x0000000f +r11 = 0x00000002 +r12 = 0x004004b0 +r13 = 0x7ffe35ff6930 +r14 = 0x00000000 +r15 = 0x00000000 +rsi = 0x7ffe35ff6938 +rdi = 0x00000064 +rsp = 0x7ffe35ff6838 +rbp = 0x7ffe35ff6850 +rip = 0x00400596 +rflags = 0x00000202 +orax = 0xffffffffffffffff +[0x00400596]> +``` + +### 反编译器 + +能够理解汇编是二进制分析的前提。汇编语言总是与二进制建立和预期运行的架构相关。一行源代码和汇编代码之间从来没有 1:1 的映射。通常,一行 C 源代码会产生多行汇编代码。所以,逐行读取汇编代码并不是最佳的选择。 + +这就是反编译器的作用。它们试图根据汇编指令重建可能的源代码。这与用于创建二进制的源代码绝不完全相同,它是基于汇编的源代码的近似表示。另外,要考虑到编译器进行的优化,它会生成不同的汇编代码以加快速度,减小二进制的大小等,会使反编译器的工作更加困难。另外,恶意软件作者经常故意混淆代码,让恶意软件的分析人员望而却步。 + +Radare2 通过插件提供反编译器。你可以安装任何 Radare2 支持的反编译器。使用 `r2pm -l` 命令可以查看当前插件。使用 `r2pm install` 命令来安装一个示例的反编译器 `r2dec`: + +``` +$ r2pm  -l +$ +$ r2pm install r2dec +Cloning into 'r2dec'... +remote: Enumerating objects: 100, done. +remote: Counting objects: 100% (100/100), done. +remote: Compressing objects: 100% (97/97), done. +remote: Total 100 (delta 18), reused 27 (delta 1), pack-reused 0 +Receiving objects: 100% (100/100), 1.01 MiB | 1.31 MiB/s, done. +Resolving deltas: 100% (18/18), done. +Install Done For r2dec +gmake: Entering directory '/root/.local/share/radare2/r2pm/git/r2dec/p' +[CC] duktape/duktape.o +[CC] duktape/duk_console.o +[CC] core_pdd.o +[CC] core_pdd.so +gmake: Leaving directory '/root/.local/share/radare2/r2pm/git/r2dec/p' +$ +$ r2pm  -l +r2dec +$ +``` + +### 反编译器视图 + +要反编译一个二进制文件,在 `r2` 中加载二进制文件并自动分析它。在本例中,使用 `s sym.adder` 命令移动到感兴趣的 `adder` 函数,然后使用 `pdda` 命令并排查看汇编和反编译后的源代码。阅读这个反编译后的源代码往往比逐行阅读汇编更容易: + +``` +$ r2 -A ./adder +[x] Analyze all flags starting with sym. and entry0 (aa) +[x] Analyze function calls (aac) +[x] Analyze len bytes of instructions for references (aar) +[x] Check for vtables +[x] Type matching analysis for all functions (aaft) +[x] Propagate noreturn information +[x] Use -AA or aaaa to perform additional experimental analysis. + -- What do you want to debug today? +[0x004004b0]> +[0x004004b0]> s sym.adder +[0x00400596]> +[0x00400596]> s +0x400596 +[0x00400596]> +[0x00400596]> pdda +    ; assembly                               | /* r2dec pseudo code output */ +                                             | /* ./adder @ 0x400596 */ +                                             | #include <stdint.h> +                                             |   +    ; (fcn) sym.adder ()                     | int32_t adder (int64_t arg1) { +                                             |     int64_t var_4h; +                                             |     rdi = arg1; +    0x00400596 push rbp                      |     +    0x00400597 mov rbp, rsp                  |     +    0x0040059a mov dword [rbp - 4], edi      |     *((rbp - 4)) = edi; +    0x0040059d mov eax, dword [rbp - 4]      |     eax = *((rbp - 4)); +    0x004005a0 add eax, 1                    |     eax++; +    0x004005a3 pop rbp                       |     +    0x004005a4 ret                           |     return eax; +                                             | } +[0x00400596]> +``` + +### 配置设置 + +随着你对 Radare2 的使用越来越熟悉,你会想改变它的配置,以适应你的工作方式。你可以使用 `e` 命令查看 `r2` 的默认配置。要设置一个特定的配置,在 `e` 命令后面添加 `config = value`: + +``` +[0x004005a5]> e | wc -l +593 +[0x004005a5]> e | grep syntax +asm.syntax = intel +[0x004005a5]> +[0x004005a5]> e asm.syntax = att +[0x004005a5]> +[0x004005a5]> e | grep syntax +asm.syntax = att +[0x004005a5]> +``` + +要使配置更改永久化,请将它们放在 `r2` 启动时读取的名为 `.radare2rc` 的启动文件中。这个文件通常在你的主目录下,如果没有,你可以创建一个。一些示例配置选项包括: + +``` +$ cat ~/.radare2rc +e asm.syntax = att +e scr.utf8 = true +eco solarized +e cmd.stack = true +e stack.size = 256 +$ +``` + +### 探索更多 + +你已经看到了足够多的 Radare2 功能,对这个工具有了一定的了解。因为 Radare2 遵循 Unix 哲学,即使你可以从它的主控台做各种事情,它也会在下面使用一套独立的二进制来完成它的任务。 + +探索下面列出的独立二进制文件,看看它们是如何工作的。例如,用 `iI` 命令在控制台看到的二进制信息也可以用 `rabin2 ` 命令找到: + +``` +$ cd bin/ +$ +$ ls +prefix  r2agent    r2pm  rabin2   radiff2  ragg2    rarun2   rasm2 +r2      r2-indent  r2r   radare2  rafind2  rahash2  rasign2  rax2 +$ +``` + +你觉得 Radare2 怎么样?请在评论中分享你的反馈。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/linux-radare2 + +作者:[Gaurav Kamathe][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/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/binary_code_computer_screen.png?itok=7IzHK1nn (Binary code on a computer screen) +[2]: https://linux.cn/article-12187-1.html +[3]: https://linux.cn/article-11441-1.html +[4]: https://rada.re/n/ +[5]: https://github.com/radareorg/radare2 +[6]: https://opensource.com/article/19/3/getting-started-vim +[7]: https://ghidra-sre.org/ +[8]: https://opensource.com/sites/default/files/uploads/radare2_visual-mode_0.png (Radare2 Visual mode) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ From 90e7ab979a33476f74f9e2f619669ef735d486a2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 31 Jan 2021 05:03:27 +0800 Subject: [PATCH 056/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210130=20?= =?UTF-8?q?How=20I=20de-clutter=20my=20digital=20workspace?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210130 How I de-clutter my digital workspace.md --- ...0 How I de-clutter my digital workspace.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20210130 How I de-clutter my digital workspace.md diff --git a/sources/tech/20210130 How I de-clutter my digital workspace.md b/sources/tech/20210130 How I de-clutter my digital workspace.md new file mode 100644 index 0000000000..4a62c73b9e --- /dev/null +++ b/sources/tech/20210130 How I de-clutter my digital workspace.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I de-clutter my digital workspace) +[#]: via: (https://opensource.com/article/21/1/declutter-workspace) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +How I de-clutter my digital workspace +====== +Archive old email and other files to de-clutter your digital workspace. +![video editing dashboard][1] + +In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 20 of 21 Days of Productivity in 2021. + +I am a digital pack-rat. So many of us are. After all, who knows when we'll need that email our partner sent asking us to pick up milk on our way home from work in 2009? + +The truth is, we don't need it. We _really_ don't. However, large cloud providers have given us so much storage space for cheap or for free that we don't even think about it anymore. When I can have unlimited documents, notes, to-do items, calendar appointments, and email, why _shouldn't_ I just keep everything? + +![Marie Kondo indicating clearing email will bring you joy][2] + +It really does. (Kevin Sonney, [CC BY-SA 4.0][3]) + +When dealing with physical items, like a notebook or a stack of documents, there comes a point where it is obvious we need to move it off our desks or out of our offices. We need to store it in some other place where we can get to it if we need to, but also know it will be safe. Eventually, that too fills up, and we are forced to clean out that storage as well. + +Digital storage is really no different, only we're tempted to keep more things in it. If I have a note on my desk to pick something up on the way home, I'm going to throw it away when I'm done with it. That same note in my shared notebook with my wife is likely just to stay there. Maybe we'll re-use it, maybe we'll just let it sit there, taking up space. + +This approach is the same as "hot" and "cold" storage. Hot storage is the most recent and relevant data that tends to be accessed frequently. Cold storage is for the archives we might need to refer to in the future and may have historical significance, but doesn't need to be accessed frequently. + +Last year I took the time to export all of my emails from before 2019 and put them in an archive file. Then I deleted them. Why? For starters, I really didn't need any of it anymore. Sure it is nice to have the emails my spouse and I sent each other when we started dating, but they are not something I look at daily or even monthly. I could put them in cold storage, where they would be safe, and I could get them when I did want to look at them. The same for the emails and schedules for the conventions I had worked at before the pandemic. Do I need to have the schedule grid for my department at AnthroCon 2015 at my fingertips? NOPE. + +### Archiving messages + +The process of archiving messages will differ, depending on what email client you use, but the general idea is the same. In KMail, the email client from KDE, you can archive (and export, by nature of the archival process) a folder of messages by right-clicking on a folder and selecting **Archive Folder**. I also have KMail remove the messages after completing the archive. + +![Archiving a directory of messages in KMail][4] + +On the GNOME side of things, you can either export a folder of messages as an **mbox** file or you can use the **Save As** option to export it as an archive. + +![Archive file of 2007-2019 email.][5] + +8 Gb of mail (Kevin Sonney, [CC BY-SA 4.0][3]) + +If you're not on Linux, you might look into using the Thunderbird client. In Thunderbird, highlight the messages you want to archive (or press **Ctrl+A** to select all of them, and then right-click and select **Archive**. + +![Archiving mail in Thunderbird][6] + +### Cold storage + +I have been managing my documents, notes, online to-do lists, and so on, by archiving the excess. I keep the most recent and relevant, and then I move the rest either into an archive file that does not live on my machine. Otherwise, if they no longer have any relevance, I just delete them altogether. That has made finding the relevant information much easier because there aren't loads of old things cluttering up my results. + +It is important to take some time and de-clutter our digital workspaces the way we de-clutter our physical workspaces. Productivity isn't just getting things done, but also being able to find the right things we need to do them. Moving data into cold storage archives means we can rest easy knowing that it is safe if we need it and out of our way for the 99.9% of the time when we don't. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/declutter-workspace + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/video_editing_folder_music_wave_play.png?itok=-J9rs-My (video editing dashboard) +[2]: https://opensource.com/sites/default/files/day20-image1.jpg +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/kmail-archive.jpg (Archiving a directory of messages in KMail) +[5]: https://opensource.com/sites/default/files/day20-image2.png +[6]: https://opensource.com/sites/default/files/thunderbird-export.jpg (Archiving mail in Thunderbird) From 66ab4ad48603a0028fc6df0e74460c977e72f37b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 31 Jan 2021 08:26:43 +0800 Subject: [PATCH 057/213] PRF @geekpi --- ...keeping a journal improves productivity.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210120 Why keeping a journal improves productivity.md b/translated/tech/20210120 Why keeping a journal improves productivity.md index 60f5d37bf6..6c2f2674de 100644 --- a/translated/tech/20210120 Why keeping a journal improves productivity.md +++ b/translated/tech/20210120 Why keeping a journal improves productivity.md @@ -1,46 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why keeping a journal improves productivity) [#]: via: (https://opensource.com/article/21/1/open-source-journal) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) -为什么写日志能提高效率 +为什么写日记能提高效率 ====== -写日志有着悠久的历史。这里有三个开源工具,可以帮助你写日志变得更轻松。 -![Note taking hand writing][1] + +> 写日记有着悠久的历史。这里有三个开源工具,可以帮助你写日记变得更轻松。 + +![](https://img.linux.net.cn/data/attachment/album/202101/31/082622p6wgh7szzuvevug4.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十天。 -在商业互联网还没有出现的我的小学时代,老师经常会给我们班级布置一个让我们写日志的作业。有时会针对一些特定的内容,例如特定格式的虫子列表和说明,或者是公民课的每周新闻摘要。 +在我的小学时代,商业互联网还没有出现,老师经常会给我们班级布置一个让我们写日记的作业。有时会针对一些特定的内容,例如特定格式的虫子列表和说明,或者是公民课的每周新闻摘要。 -几个世纪以来,人们一直在写日志。它们是一种方便的信息保存方式。它们有很多形式,比如意大利的 [Zibaldone][2]、[备忘录][3],或者记录今天做了什么的事件日志。 +几个世纪以来,人们一直在写日记。它们是一种方便的信息保存方式。它们有很多形式,比如意大利的 [Zibaldone][2]、[备忘录][3],或者记录今天做了什么的事件日记。 ![Notebook folders][4] -(Kevin Sonney, [CC BY-SA 4.0][5]) +*(Kevin Sonney, [CC BY-SA 4.0][5])* -为什么我们要写某种日志呢?第一个原因是为了让我们不至于把所有的事情都记在脑子里。我们中没有多少人有[遗觉记忆][6],维护运行日志或一组笔记可以让我们更容易地参考我们之前做的一些事情。日志也更容易分享,因为它们可以在聊天、邮件中复制/粘贴。正如 [Robert Boyce][7]的名言:”知识就是力量。知识共享就是力量倍增。“知识的共享是开源的一个内在组成部分。 +为什么我们要写某种日记呢?第一个原因是为了让我们不至于把所有的事情都记在脑子里。我们中没有多少人有[遗觉记忆][6]Eidetic memory,维护运行日记或一组笔记可以让我们更容易地参考我们之前做的一些事情。日记也更容易分享,因为它们可以在聊天、邮件中复制/粘贴。正如 [Robert Boyce][7] 的名言:“知识就是力量。知识共享使力量倍增。”知识的共享是开源的一个内在组成部分。 ![Today's journal][8] -今天的日志 (Kevin Sonney, [CC BY-SA 4.0][5]) +*今天的日记 (Kevin Sonney, [CC BY-SA 4.0][5])* -在写事件日志的时候,有一个很关键的点就是要快速、简单、方便。最简单的方法是打开文档,添加一行当前日期和备注,然后保存。 +在写事件日记的时候,有一个很关键的点就是要快速、简单、方便。最简单的方法是打开文档,添加一行当前日期和备注,然后保存。 有几个程序或附加软件可以让这一切变得更简单。[GNote 的 Note of the Day 插件][9]会自动创建一个以日期为标题的笔记,可以用来保存当天的内容。 -Emacs Org 有一个热键组合,可以”捕捉“事物并将其放入文档中。结合 [org-journal][10] 附加组件,这将在文档中创建当天的条目。 +Emacs Org 模式有一个热键组合,可以“捕捉”事物并将其放入文档中。结合 [org-journal][10] 附加组件,这将在文档中创建当天的条目。 Kontact 的 KNotes 组件会自动将日期和时间添加到新笔记中。 ![Finding a note][11] -查找笔记 (Kevin Sonney, [CC BY-SA 4.0][5]) +*查找笔记 (Kevin Sonney, [CC BY-SA 4.0][5])* -写日志或记录事情是一种方便的方法,可以记录做了什么和怎么做的。它的作用不仅仅是”我做了什么“,它还可以包括阅读的书籍、吃过的食物、去过的地方,以及一大堆对未来有用的信息。 +写日记或记录事情是一种方便的方法,可以记录做了什么和怎么做的。它的作用不仅仅是“我做了什么”,它还可以包括阅读的书籍、吃过的食物、去过的地方,以及一大堆对未来有用的信息。 -------------------------------------------------------------------------------- @@ -49,7 +51,7 @@ via: https://opensource.com/article/21/1/open-source-journal 作者:[Kevin Sonney][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 8b77f67a9dcc028df9547f24d50479292ed9bc06 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 31 Jan 2021 08:27:28 +0800 Subject: [PATCH 058/213] PUB @geekpi https://linux.cn/article-13070-1.html --- .../20210120 Why keeping a journal improves productivity.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210120 Why keeping a journal improves productivity.md (98%) diff --git a/translated/tech/20210120 Why keeping a journal improves productivity.md b/published/20210120 Why keeping a journal improves productivity.md similarity index 98% rename from translated/tech/20210120 Why keeping a journal improves productivity.md rename to published/20210120 Why keeping a journal improves productivity.md index 6c2f2674de..f82892a054 100644 --- a/translated/tech/20210120 Why keeping a journal improves productivity.md +++ b/published/20210120 Why keeping a journal improves productivity.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13070-1.html) [#]: subject: (Why keeping a journal improves productivity) [#]: via: (https://opensource.com/article/21/1/open-source-journal) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 282b43f403b0f0ef0fbeb1b9240f41d2de517e8f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 31 Jan 2021 11:35:22 +0800 Subject: [PATCH 059/213] PRF --- ...ng 52-bit virtual address support in the Arm64 kernel.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md b/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md index e6a6aa0669..c38a6e261e 100644 --- a/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md +++ b/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md @@ -14,11 +14,11 @@ ![](https://img.linux.net.cn/data/attachment/album/202101/30/170448rynbm9b6nmb90403.jpg) -当 64 位硬件变得可用之后,处理更大地址空间(大于 232 字节)的需求变得显而易见。现如今一些公司已经提供 64TiB 或更大内存的服务器,x86_64 架构和 arm64 架构现在允许寻址的地址空间大于 248 字节(可以使用默认的 48 位地址支持)。 +当 64 位硬件变得可用之后,处理更大地址空间(大于 2^32 字节)的需求变得显而易见。现如今一些公司已经提供 64TiB 或更大内存的服务器,x86_64 架构和 arm64 架构现在允许寻址的地址空间大于 2^48 字节(可以使用默认的 48 位地址支持)。 -x86_64 架构通过让硬件和软件启用五级页表以支持这些用例。它允许寻址的地址空间等于 257 字节(详情见 [x86:在 4.12 内核中启用 5 级页表][2])。它突破了过去虚拟地址空间 128PiB 和物理地址空间 4PiB 的上限。 +x86_64 架构通过让硬件和软件启用五级页表以支持这些用例。它允许寻址的地址空间等于 2^57 字节(详情见 [x86:在 4.12 内核中启用 5 级页表][2])。它突破了过去虚拟地址空间 128PiB 和物理地址空间 4PiB 的上限。 -arm64 架构通过引入两个新的体系结构 —— ARMv8.2 LVA(更大的虚拟寻址) 和 ARMv8.2 LPA(更大的物理地址寻址) —— 拓展来实现相同的功能。这允许使用 4PiB 的虚拟地址空间和 4PiB 的物理地址空间(即分别为 252 位)。 +arm64 架构通过引入两个新的体系结构 —— ARMv8.2 LVA(更大的虚拟寻址) 和 ARMv8.2 LPA(更大的物理地址寻址) —— 拓展来实现相同的功能。这允许使用 4PiB 的虚拟地址空间和 4PiB 的物理地址空间(即分别为 2^52 位)。 随着新的 arm64 CPU 中支持了 ARMv8.2 体系结构拓展,同时现在开源软件也支持了这两种新的硬件拓展。 From 48b03ad4e4d6f8e654ad28c680b7c1bf6c0d3e4e Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 31 Jan 2021 21:34:16 +0800 Subject: [PATCH 060/213] translating --- sources/tech/20201013 My first day using Ansible.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201013 My first day using Ansible.md b/sources/tech/20201013 My first day using Ansible.md index 3d3453cfa7..3953dc190f 100644 --- a/sources/tech/20201013 My first day using Ansible.md +++ b/sources/tech/20201013 My first day using Ansible.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bd6a20170550c354ccddc1451a7a861c6f65b5b0 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 31 Jan 2021 21:56:43 +0800 Subject: [PATCH 061/213] =?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 --- .../20201013 My first day using Ansible.md | 304 ------------------ .../20201013 My first day using Ansible.md | 297 +++++++++++++++++ 2 files changed, 297 insertions(+), 304 deletions(-) delete mode 100644 sources/tech/20201013 My first day using Ansible.md create mode 100644 translated/tech/20201013 My first day using Ansible.md diff --git a/sources/tech/20201013 My first day using Ansible.md b/sources/tech/20201013 My first day using Ansible.md deleted file mode 100644 index 3953dc190f..0000000000 --- a/sources/tech/20201013 My first day using Ansible.md +++ /dev/null @@ -1,304 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (My first day using Ansible) -[#]: via: (https://opensource.com/article/20/10/first-day-ansible) -[#]: author: (David Both https://opensource.com/users/dboth) - -My first day using Ansible -====== -A sysadmin shares information and advice about putting Ansible into -real-world use configuring computers on his network. -![People work on a computer server with devices][1] - -Getting a new computer, whether physical or virtual, up and running is time-consuming and requires a good deal of work—whether it's your first time or the 50th. For many years, I have used a series of scripts and RPMs that I created to install the packages I need and to perform many bits of configuration for my favorite tools. This approach has worked well and simplified my work, as well as reduced the amount of time I spend typing commands. - -I am always looking for better ways of doing things, and, for several years now, I have been hearing and reading about [Ansible][2], which is a powerful tool for automating system configuration and management. Ansible allows a sysadmin to define a specific state for each host in one or more playbooks and then performs whatever tasks are necessary to bring the host to that state. This includes installing or deleting various resources such as RPM or Apt packages, configuration and other files, users, groups, and much more. - -I have delayed learning how to use it for a long time because—stuff. Until recently, when I ran into a problem that I thought Ansible could easily solve. - -This article is not a complete how-to for getting started with Ansible; rather, it is intended to provide insight into some of the issues that I encountered and some information that I found only in some very obscure places. Much of the information I found in various online discussions and Q&A groups about Ansible was incorrect. Errors ranged from information that was really old with no indication of its date or provenance to information that was just wrong. - -The information in this article is known to work—although there might be other ways of accomplishing the same things—and it works with Ansible 2.9.13 and [Python][3] 3.8.5. - -### My problem - -All of my best learning experiences start with a problem I need to solve, and this was no exception. - -I have been working on a little project to modify the configuration files for the [Midnight Commander][4] (mc) file manager and pushing them out to various systems on my network for testing. Although I have a script to automate this, it still requires a bit of fussing with a command-line loop to provide the names of the systems to which I want to push the new code. The large number of changes I was making to the configuration files made it necessary for me to push the new ones frequently. But, just when I thought I had my new configuration just right, I would find a problem and need to do another push after making the fix. - -This environment made it difficult to keep track of which systems had the new files and which did not. I also have a couple of hosts that need to be treated differently. And my little bit of knowledge about Ansible suggested that it would probably be able to do all or most of what I need. - -### Getting started - -I had read a number of good articles and books about Ansible, but never in an "I have to get this working NOW!" kind of situation. And now was—well, NOW! - -In rereading these documents, I discovered that they mostly talk about how to install Ansible from GitHub using—wait for it—Ansible. That is cool, but I really just wanted to get started, so I installed it on my Fedora workstation using DNF and the version in the Fedora repository. Easy. - -But then I started looking for the file locations and trying to determine which configuration files I needed to modify, where to keep my playbooks, what a playbook even looks like, and what it does. I had lots of (so far) unanswered questions running around in my head. - -So, without further descriptions of my tribulations, here are the things I discovered and that got me going. - -### Configuration - -Ansible's configuration files are kept in `/etc/ansible`. Makes sense, right, since `/etc` is where system programs are supposed to keep their configuration files. The two files I needed to work with are `ansible.cfg` and `hosts`. - -#### ansible.cfg - -After getting started with some of the exercises I found in the documents and online, I began receiving warning messages about deprecating certain older Python files. So, I set `deprecation_warnings` to `false` in `ansible.cfg` and those angry red warning messages stopped: - - -``` -`deprecation_warnings = False` -``` - -Those warnings are important, so I will revisit them later and figure out what I need to do. But for now, they no longer clutter the screen and obfuscate the errors I actually need to be concerned about. - -#### The hosts file - -Not the same as the `/etc/hosts` file, the `hosts` file is also known as the inventory file, and it lists the hosts on your network. This file allows grouping hosts together in related sets, such as servers, workstations, and pretty much any designation you need. This file contains its own help and plenty of examples, so I won't go into boring detail here. However, there are some things to know. - -Hosts can be listed outside of any groups, but groups can be helpful in identifying hosts with one or more common characteristics. Groups use the INI format, so a server group looks like this: - - -``` -[servers] -server1 -server2 -...etc. -``` - -A hostname must be present in this file for Ansible to work on it. Even though some subcommands allow you to specify a hostname, the command will fail unless the hostname is in the `hosts` file. A host can also be listed in multiple groups. So `server1` might also be a member of the `[webservers]` group in addition to the `[servers]` group, and a member of the `[ubuntu]` group to differentiate it from Fedora servers. - -Ansible is smart. If the `all` argument is used for the hostname, Ansible scans the file and performs the defined tasks on all hosts listed in the file. Ansible will only attempt to work on each host once, no matter how many groups it appears in. This also means that there does not need to be a defined "all" group because Ansible can determine all hostnames in the file and create its own list of unique hostnames. - -Another little thing to look out for is multiple entries for a single host. I use `CNAME` records in my DNS zone file to create aliased names that point to the [A records][5] for some of my hosts. That way, I can refer to a host as `host1` or `h1` or `myhost`. If you use multiple hostnames for the same host in the `hosts` file, Ansible will try to perform its tasks on all of those hostnames; it has no way of knowing that they refer to the same host. The good news is that this does not affect the overall result; it just takes a bit more time as Ansible works on the secondary hostnames and determines that all of the operations have already been performed. - -### Ansible facts - -Most of the materials I have read on Ansible talk about [Ansible facts][6], which "are data related to your remote systems, including operating systems, IP addresses, attached filesystems, and more." This information is available in other ways, such as `lshw`, `dmidecode`, the `/proc` filesystem, and more, but Ansible generates a JSON file containing this information. Each time Ansible runs, it generates this facts data. There is an amazing amount of information in this data stream, all of which are in `<"variable-name": "value">` pairs. All of these variables are available for use within an Ansible playbook. The best way to understand the huge amount of information available is to display it yourself: - - -``` -`# ansible -m setup | less` -``` - -See what I mean? Everything you ever wanted to know about your host hardware and Linux distribution is there and usable in a playbook. I have not yet gotten to the point where I need to use those variables, but I am certain I will in the next couple of days. - -### Modules - -The `ansible` command above uses the `-m` option to specify the "setup" module. Ansible has many modules already built-in, so you do not need to use the `-m` for those. There are also many downloadable modules that can be installed, but the built-ins do everything I have needed for my current projects so far. - -### Playbooks - -Playbooks can be located almost anywhere. Since I need to run my playbooks as root, I placed mine in `/root/ansible`. As long as this directory is the present working directory (PWD) when I run Ansible, it can find my playbook. Ansible also has a runtime option to specify a different playbook and location. - -Playbooks can contain comments, although I have seen very few articles or books that mention this. As a sysadmin who believes in documenting everything, I find using comments can be very helpful. This is not so much about saying the same things in the comments as I do in the task name; rather, it is about identifying the purpose of groups of tasks and ensuring that I record my reasons for doing certain things in a certain way or order. This can help with debugging problems later when I may have forgotten my original thinking. - -Playbooks are simply collections of tasks that define the desired state of a host. A hostname or inventory group is specified at the beginning of the playbook and defines the hosts on which Ansible will run the playbook. - -Here is a sample of my playbook: - - -``` -################################################################################ -# This Ansible playbook updates Midnight commander configuration files.        # -################################################################################ -\- name: Update midnight commander configuration files -  hosts: all -  -  tasks: -  - name: ensure midnight commander is the latest version -    dnf: -      name: mc -      state: present - -  - name: create ~/.config/mc directory for root -    file: -      path: /root/.config/mc -      state: directory -      mode: 0755 -      owner: root -      group: root - -  - name: create ~/.config/mc directory for dboth -    file: -      path: /home/dboth/.config/mc -      state: directory -      mode: 0755 -      owner: dboth -      group: dboth - -  - name: copy latest personal skin -    copy: -      src: /root/ansible/UpdateMC/files/MidnightCommander/DavidsGoTar.ini -      dest: /usr/share/mc/skins/DavidsGoTar.ini -      mode: 0644 -      owner: root -      group: root - -  - name: copy latest mc ini file -    copy: -      src: /root/ansible/UpdateMC/files/MidnightCommander/ini -      dest: /root/.config/mc/ini -      mode: 0644 -      owner: root -      group: root - -  - name: copy latest mc panels.ini file -    copy: -      src: /root/ansible/UpdateMC/files/MidnightCommander/panels.ini -      dest: /root/.config/mc/panels.ini -      mode: 0644 -      owner: root -      group: root -<SNIP> -``` - -The playbook starts with its own name and the hosts it will act on—in this case, all of the hosts listed in my `hosts` file. The `tasks` section lists the specific tasks required to bring the host into compliance with the desired state. This playbook starts with a task in which Ansible's built-in DNF updates Midnight Commander if it is not the most recent release. The next tasks ensure that the required directories are created if they do not exist, and the remainder of the tasks copy the files to the proper locations. These `file` and `copy` tasks can also set the ownership and file modes for the directories and files. - -The details of my playbook are beyond the scope of this article, but I used a bit of a brute-force attack on the problem. There are other methods for determining which users need to have the files updated rather than using a task for each file for each user. My next objective is to simplify this playbook to use some of the more advanced techniques. - -Running a playbook is easy; just use the `ansible-playbook` command. The .yml extension stands for YAML. I have seen several meanings for that, but my bet is on "Yet Another Markup Language," despite the fact that some claim that YAML is not one. - -This command runs the playbook I created for updating my Midnight Commander files: - - -``` -`# ansible-playbook -f 10 UpdateMC.yml` -``` - -The `-f` option specifies that Ansible should fork up to 10 threads in order to perform operations in parallel. This can greatly speed overall task completion, especially when working on multiple hosts. - -### Output - -The output from a running playbook lists each task and the results. An `ok` means the machine state managed by the task is already defined in the task stanza. Because the state defined in the task is already true, Ansible did not need to perform the actions defined in the task stanza. - -The response `changed` indicates that Ansible performed the task specified in the stanza in order to bring it to the desired state. In this case, the machine state defined in the stanza was not true, so the actions defined were performed to make it true. On a color-capable terminal, the `TASK` lines are shown in color. On my host with my amber-on-black terminal color configuration, the `TASK` lines are shown in amber, `changed` lines are in brown, and `ok` lines are shown in green. Error lines are displayed in red. - -The following output is from the playbook I will eventually use to perform post-install configuration on new hosts: - - -``` -PLAY [Post-installation updates, package installation, and configuration] - -TASK [Gathering Facts] -ok: [testvm2] - -TASK [Ensure we have connectivity] -ok: [testvm2] - -TASK [Install all current updates] -changed: [testvm2] - -TASK [Install a few command line tools] -changed: [testvm2] - -TASK [copy latest personal Midnight Commander skin to /usr/share] -changed: [testvm2] - -TASK [create ~/.config/mc directory for root] -changed: [testvm2] - -TASK [Copy the most current Midnight Commander configuration files to /root/.config/mc] -changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightCommander/DavidsGoTar.ini) -changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightCommander/ini) -changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightCommander/panels.ini) - -TASK [create ~/.config/mc directory in /etc/skel] -changed: [testvm2] - -<SNIP> -``` - -### The cow - -If you have the [cowsay][7] program installed on your computer, you will notice that the `TASK` names appear in the cow's speech bubble: - - -``` - ____________________________________ -< TASK [Ensure we have connectivity] > - ------------------------------------ -        \   ^__^ -         \  (oo)\\_______ -            (__)\       )\/\ -                ||----w | -                ||     || -``` - -If you do not have this fun feature and want it, install the cowsay package using your distribution's package manager. If you have this and don't want it, disable it with by setting `nocows = 1` in the `/etc/ansible/ansible.cfg` file. - -I like the cow and think it is fun, but it reduces the amount of screen space that can be used to display messages. So I disabled it after it started getting in the way. - -### Files - -As with my Midnight Commander task, it is frequently necessary to install and maintain files of various types. There are as many "best practices" for creating a directory tree for storing files used in playbooks as there are sysadmins—or at least as many as the number of authors writing books and articles about Ansible. - -I chose a simple structure that makes sense to me: - - -``` -/root/ansible -└── UpdateMC -    ├── files -    │   └── MidnightCommander -    │       ├── DavidsGoTar.ini -    │       ├── ini -    │       └── panels.ini -    └── UpdateMC.yml -``` - -You should use whatever structure works for you. Just be aware that some other sysadmin will likely need to work with whatever you set up, so there should be some level of logic to it. When I was using RPM and Bash scripts to perform my post-install tasks, my file repository was a bit scattered and definitely not structured with any logic. As I work through creating playbooks for many of my administrative tasks, I will introduce a much more logical structure for managing my files. - -### Multiple playbook runs - -It is safe to run a playbook as many times as needed or desired. Each task will only be executed if the state does not match the one specified in the task stanza. This makes it easy to recover from errors encountered during previous playbook runs. The playbook stops running when it encounters an error. - -While testing my first playbook, I made many mistakes and corrected them. Each additional run of the playbook—assuming my fix is a good one—skips the tasks whose state already matches the specified one and executes those that did not. When my fix works, the previously failed task completes successfully, and any tasks after that one in my playbook also execute—until it encounters another error. - -This also makes testing easy. I can add new tasks and, when I run the playbook, only those new tasks are performed because they are the only ones that do not match the test host's desired state. - -### Some thoughts - -Some tasks are not appropriate for Ansible because there are better methods for achieving a specific machine state. The use case that comes to mind is that of returning a VM to an initial state so that it can be used as many times as necessary to perform testing beginning with that known state. It is much easier to get the VM into the desired state and then to take a snapshot of the then-current machine state. Reverting to that snapshot is usually going to be easier and much faster than using Ansible to return the host to that desired state. This is something I do several times a day when researching articles or testing new code. - -After completing my playbook for updating Midnight Commander, I started a new playbook that I will use to perform post-installation tasks on newly installed Fedora hosts. I have already made good progress, and the playbook is a bit more sophisticated and less brute-force than my first one. - -On my very first day using Ansible, I created a playbook that solves a problem. I also started a second playbook that will solve the very big problem of post-install configuration. And I have learned a lot. - -Although I really like using [Bash][8] scripts for many of my administrative tasks, I am already finding that Ansible can do everything I want—and in a way that can maintain the system in the state I want. After only a single day of use, I am an Ansible fan. - -### Resources - -The most complete and useful document I have found is the [User Guide][9] on the Ansible website. This document is intended as a reference and not a how-to or getting-started document. - -Opensource.com has published many [articles about Ansible][10] over the years, and I have found most of them very helpful for my needs. The Enable Sysadmin website also has a lot of [Ansible articles][11] that I have found to be helpful. You can learn even more by checking out [AnsibleFest][12] happening this week (October 13-14, 2020). The event is completely virtual and free to register. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/10/first-day-ansible - -作者:[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://www.ansible.com/ -[3]: https://www.python.org/ -[4]: https://midnight-commander.org/ -[5]: https://en.wikipedia.org/wiki/List_of_DNS_record_types -[6]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html#ansible-facts -[7]: https://en.wikipedia.org/wiki/Cowsay -[8]: https://opensource.com/downloads/bash-cheat-sheet -[9]: https://docs.ansible.com/ansible/latest/user_guide/index.html -[10]: https://opensource.com/tags/ansible -[11]: https://www.redhat.com/sysadmin/topics/ansible -[12]: https://www.ansible.com/ansiblefest diff --git a/translated/tech/20201013 My first day using Ansible.md b/translated/tech/20201013 My first day using Ansible.md new file mode 100644 index 0000000000..4182d6fa45 --- /dev/null +++ b/translated/tech/20201013 My first day using Ansible.md @@ -0,0 +1,297 @@ +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "My first day using Ansible" +[#]: via: "https://opensource.com/article/20/10/first-day-ansible" +[#]: author: "David Both https://opensource.com/users/dboth" + +使用 Ansible 的第一天 +====== +一名系统管理员分享了如何使用 Ansible 在网络中配置计算机并把其带入实际工作的信息和建议。 +![People work on a computer server with devices][1] + +无论是第一次还是第五十次,启动并运行一台新的物理或虚拟计算机都非常耗时,而且需要大量的工作。多年来,我一直使用我创建的一系列脚本和 RPM 来安装所需的软件包,并为我喜欢的工具配置选项。这种方法效果很好,简化了我的工作,而且还减少了在键盘上输入命令的时间。 + +我一直在寻找更好的工作方式。近几年来,我一直在听到并且读到有关 [Ansible][2] 的信息,它是一个自动配置和管理系统的强大工具。Ansible 允许系统管理员在一个或多个剧本中为每个主机指定一个特定状态,然后执行使主机进入该状态的所有任务。包括安装或删除各种资源,例如 RPM 或 Apt 软件包、配置和其它文件、用户、组等等。 + +因为一些琐事,我推迟了很长一段时间学习如何使用它。直到最近,我遇到了一个我认为 Ansible 可以轻松解决的问题。 + +这篇文章并不会完整地告诉你如何入门 Ansible,相反,它只是对我遇到的问题和我在一些隐秘的地方发现的信息的做一些记录。我在各种在线讨论和问答小组中找到的有关 Ansible 的许多信息都是错误的。错误范围包括明显的老旧信息(没有任何日期或来源的迹象),还有一些是完全错误的信息。 + +本文所介绍的内容是有用的,尽管可能还有其它方法可以完成相同的事情,但我使用的是 Ansible 2.9.13 和 [Python][3] 3.8.5。 + +### 我的问题 + +我所有的最佳学习经历都始于我需要解决的问题,这次也不例外。 + +我一直在做一个小项目,修改 [Midnight Commander][4] 文件管理器的配置文件,并将它们推送到我网络上的各种系统中进行测试。尽管我有一个脚本可以自动执行这个操作,但它仍然需要使用命令行循环来提供我想要推送新代码的系统名称。我对配置文件进行了大量的更改,这使我必须频繁推送新的配置文件。但是,就在我以为我的新配置刚刚好时,我发现了一个问题,所以我需要在修复后再进行一次推送。 + +这种环境使得很难跟踪哪些系统有新文件,哪些没有。我还有几个主机需要区别对待。我对 Ansible 的一点了解表明,它可能能够满足我的全部或大部分工作。 + +### 开始 + +我读过许多有关 Ansible 的好文章和书籍,但从来没有遇到过“我必须把这个用到工作中”那种情况。但是,现在就是这种情况。 + +在重读这些文档时,我发现它们主要是在讨论如何从 GitHub 开始安装并使用 Ansible,这很酷。但是我真的只是想尽快开始,所以我使用 DNF 和 Fedora 仓库中的版本在我的 Fedora 工作站上安装了它,非常简单。 + +但是后来我开始寻找文件位置,并尝试确定需要修改哪些配置文件、将我的剧本保存在什么位置,甚至一个剧本怎么写以及它的作用,我脑海中有一大堆(到目前为止)悬而未决的问题。 + +因此,在没有进一步描述我的困难的情况下,以下是我发现的东西以及促使我继续前进的东西。 + +### 配置 + +Ansible 的配置文件保存在 `/etc/ansible` 中,这很有道理,因为 `/etc/` 是系统程序应该保存配置文件的地方。我需要使用的两个文件是 `ansible.cfg` 和 `hosts`。 + +#### ansible.cfg + +在进行文档和线上找到的一些实践练习之后,我遇到了一些有关弃用某些较旧的 Python 文件的警告信息。因此,我在 `ansible.cfg` 中将 `deprecation_warnings` 设置为 `false`,这样那些愤怒的红色警告消息就不会出现了: + +```bash +deprecation_warnings = False +``` + +这些警告很重要,所以我稍后将重新回顾它们,并弄清楚我需要做什么。但是现在,它们不会再扰乱屏幕,也不会让我混淆实际上需要关注的错误。 + +#### hosts 文件 + +与 `/etc/hosts` 文件不同,`hosts` 文件也被称为清单文件,它列出了网络上的主机。此文件允许将主机分组到相关集合中,例如服务器、工作站和任何你所需的名称。这个文件包含帮助和大量示例,所以我在这里就不详细介绍了。但是,有些事情你必须知道。 + +主机可以在任何组之外列出,但是组对于识别具有一个或多个共同特征的主机很有帮助。组使用 INI 格式,所以服务器组看起来像这样: + +``` +[servers] +server1 +server2 +...etc. +``` + +这个文件中必须有一个主机名,这样 Ansible 才能对它进行操作。尽管有些子命令允许指定主机名,但除非主机名在 `hosts` 文件中,否则命令会失败。一个主机也可以在多个组中。因此,除了 `[servers]` 组之外,`server1` 也可能是 `[webservers]` 组的成员,还可以是 `[ubuntu]` 组的成员,这样以区别于 Fedora 服务器。 + +Ansible 很智能。如果 `all` 参数用作主机名,Ansible 会扫描 `hosts` 文件并在它列出的所有主机上执行定义的任务。Ansible 只会尝试在每个主机上工作一次,不管它出现在多少个组中。这也意味着不需要定义 "all" 组,因为 Ansible 可以确定文件中的所有主机名,并创建自己唯一的主机名列表。 + +另一件需要注意的事情是单个主机的多个条目。我在 DNS 文件中使用 `CNAME` 记录来创建别名,这些别名指向某些主机的 [A 记录][5],这样,我可以将一个主机称为 `host1` 或 `h1` 或 `myhost`。如果你在 `hosts` 文件中为同一主机指定多个主机名,则 Ansible 将尝试在所有这些主机名上执行其任务,它无法知道它们指向同一主机。好消息是,这并不会影响整体结果;它只是多花了一点时间,因为 Ansible在辅助主机名上工作,它会确定所有操作均已执行。 + +### Ansible facts + +我阅读过 Ansible 的大多数材料都谈到了 [Ansible facts][6],它是与远程系统相关的数据,包括操作系统、IP 地址、文件系统等等。这些信息可以通过其它方式获得,如 `lshw`、`dmidecode` 或 `/proc` 文件系统等。但是 Ansible 会生成一个包含此信息的 JSON 文件。每次 Ansible 运行时,它都会生成这些数据。在这个数据流中,有大量的信息都是键值对形式:`<"变量名": "值">`。所有这些变量都可以在 Ansible 剧本中使用,理解海量信息的最好方法是亲自实践: + +```bash +# ansible -m setup | less +``` + +明白了吗?你想知道的有关主机硬件和 Linux 发行版的所有内容都在这里,它们都可以在剧本中使用。我还没有达到需要使用这些变量的地步,但是我相信在接下来的几天中会用到。 + +### 模块 + +`ansible` 命令使用 `-m` 选项来指定 `setup` 模块。Ansible 已经内置了许多模块,所以你不需要使用 -m。也可以安装许多下载的模块,但是内置模块可以完成我目前项目所需的一切。 + +### 剧本 + +剧本可以放在任何地方。因为我需要以 root 身份运行,所以我将它放在了 `/root/ansible` 下。当我运行 Ansible 时,只要这个目录是当前的工作目录(PWD),它就可以找到我的剧本。Ansible 还有一个选项,用于在运行时指定其它剧本和位置。 + +剧本可以包含注释,但是我看到的文章或书籍很少提及此。作为一个相信记录的系统管理员,我发现使用注释很有帮助。这并不是和任务名称做同样的事情,而是要确定任务组的目的,并确保我以某种方式或顺序记录我做这些事情的原因。当我可能忘记最初的想法时,这可以帮助以后解决调试问题。 + +剧本只是定义主机所需状态的任务集合。在剧本的开头指定主机名或目录组,并定义 Ansible 将在其上运行剧本的主机。 + +以下是我的一个剧本示例: + +```bash +################################################################################ +# This Ansible playbook updates Midnight commander configuration files.        # +################################################################################ +\- name: Update midnight commander configuration files +  hosts: all +  +  tasks: +  - name: ensure midnight commander is the latest version +    dnf: +      name: mc +      state: present + +  - name: create ~/.config/mc directory for root +    file: +      path: /root/.config/mc +      state: directory +      mode: 0755 +      owner: root +      group: root + +  - name: create ~/.config/mc directory for dboth +    file: +      path: /home/dboth/.config/mc +      state: directory +      mode: 0755 +      owner: dboth +      group: dboth + +  - name: copy latest personal skin +    copy: +      src: /root/ansible/UpdateMC/files/MidnightCommander/DavidsGoTar.ini +      dest: /usr/share/mc/skins/DavidsGoTar.ini +      mode: 0644 +      owner: root +      group: root + +  - name: copy latest mc ini file +    copy: +      src: /root/ansible/UpdateMC/files/MidnightCommander/ini +      dest: /root/.config/mc/ini +      mode: 0644 +      owner: root +      group: root + +  - name: copy latest mc panels.ini file +    copy: +      src: /root/ansible/UpdateMC/files/MidnightCommander/panels.ini +      dest: /root/.config/mc/panels.ini +      mode: 0644 +      owner: root +      group: root +<SNIP> +``` + +剧本从它自己的名字和它将要操作的主机开始,在本文中,所有主机都在我的 `hosts` 文件中。`tasks` 部分列出了使主机达到所需状态的特定任务。这个剧本从使用 DNF 更新 Midnight Commander 开始(如果它不是最新的版本的话)。下一个任务确保创建所需的目录(如果它们不存在),其余任务将文件复制到合适的位置,这些 `file` 和 `copy` 任务还可以为目录和文件设置所有权和文件模式。 + +剧本细节超出了本文的范围,但是我对这个问题使用了一点蛮力。还有其它方法可以确定哪些用户需要更新文件,而不是对每个用户的每个文件使用一个任务。我的下一个目标是简化这个剧本,使用一些更先进的技术。 + +运行剧本很容易,只需要使用 `ansible-playbook` 命令。.yml 扩展名代表 YAML,我看到过它的几种不同含义,但我认为它是“另一种标记语言”,尽管有些人声称 YAML 不是这种语言。 + +这个命令将会运行剧本,它会更新 Midnight Commander 文件: + + +```bash +# ansible-playbook -f 10 UpdateMC.yml +``` + +`-f` 选项指定 Ansible 使用 10 个线程来执行操作。这可以大大加快整个任务的完成速度,特别是在多台主机上工作时。 + +### 输出 + +剧本运行时会列出每个任务和执行结果。`ok` 代表任务管理的机器状态已经完成,因为在任务中定义的状态已经为真,所以 Ansible 不需要执行任何操作。 + +`changed` 表示 Ansible 已经执行了指定的任务。在这种情况下,任务中定义的机器状态不为真,所以执行指定的操作使其为真。在彩色终端上,`TASK` 线会显示彩色。在我的咖啡色终端的主机上,`TASK` 线显示为琥珀色,`changed` 是棕色,`ok` 为绿色,错误是红色。 + +下面的输出是我最终用于在新主机执行安装后配置的剧本: + + +```bash +PLAY [Post-installation updates, package installation, and configuration] + +TASK [Gathering Facts] +ok: [testvm2] + +TASK [Ensure we have connectivity] +ok: [testvm2] + +TASK [Install all current updates] +changed: [testvm2] + +TASK [Install a few command line tools] +changed: [testvm2] + +TASK [copy latest personal Midnight Commander skin to /usr/share] +changed: [testvm2] + +TASK [create ~/.config/mc directory for root] +changed: [testvm2] + +TASK [Copy the most current Midnight Commander configuration files to /root/.config/mc] +changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightCommander/DavidsGoTar.ini) +changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightCommander/ini) +changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightCommander/panels.ini) + +TASK [create ~/.config/mc directory in /etc/skel] +changed: [testvm2] + +<SNIP> +``` + +### cowsay + +如果你的计算机上安装了 [cowsay][7] 程序,你会发现 `TASK` 的名字出现在奶牛的语音泡泡中: + +``` + ____________________________________ +< TASK [Ensure we have connectivity] > + ------------------------------------ +        \   ^__^ +         \  (oo)\\_______ +            (__)\       )\/\ +                ||----w | +                ||     || +``` + +如果你没有这个有趣的程序,你可以使用发行版的包管理器安装 Cowsay 程序。如果你有这个程序但不想要它,可以通过在 `/etc/ansible/ansible.cfg` 文件中设置 `nocows=1` 将其禁用。 + +我喜欢这头奶牛,它很有趣,但是它会占用我的一部分屏幕。因此,在它开始妨碍我使用时,我就把它禁用了。 + +### 目录 + +与我的 Midnight Commander 任务一样,经常需要安装和维护各种类型的文件。创建用于存储剧本的目录树的“最佳实践”和系统管理员一样多,至少与编写有关 Ansible 书和文章的作者数量一样多。 + +我选择了一个对我有意义的简单结构: + +```bash +/root/ansible +└── UpdateMC +    ├── files +    │   └── MidnightCommander +    │       ├── DavidsGoTar.ini +    │       ├── ini +    │       └── panels.ini +    └── UpdateMC.yml +``` + +你可以使用任何结构。但是请注意,其它系统管理员可能需要使用你设置的剧本来工作,所以目录应该具有一定程度的逻辑。当我使用 RPM 和 Bash 脚本执行安装任务后,我的文件仓库有点分散,而且绝对没有任何逻辑结构。当我为许多管理任务创建剧本时,我将介绍一个更有逻辑的结构来管理我的目录。 + +### 多个剧本运行 + +根据需要或期望多次运行剧本是安全的。只有当主机状态与任务中指定的状态不匹配时,才会执行每个任务。这使得很容易从先前的剧本运行中遇到的错误中恢复。因为当剧本遇到错误时,它将停止运行。 + +在测试我的第一个剧本时,我犯了很多错误并改正了它们。假设我的修正正确,那么剧本每次运行,都会跳过那些状态已与指定状态匹配的任务,执行不匹配状态的任务。当我的修复程序起作用时,前面失败的任务将成功完成,并且会执行此任务之后的任务--直到遇到另一个错误。 + +这使得测试变得容易。我可以添加新任务,并且在运行剧本时,只有新任务会被执行,因为它们是唯一与测试主机期望状态不匹配的任务。 + +### 一些想法 + +有些任务不适合用 Ansible,因为有更好的方法可以实现特定的计算机状态。我想到的场景是使 VM 返回到初始状态,以便可以多次使用它来执行从已知状态开始的测试。让 VM 进入特定状态,然后对此时的计算机状态进行快照要容易得多。还原到该快照通常比 Ansible 将主机返回到之前状态相比,还原到快照通常会更容易且更快。在研究文章或测试新代码时,我每天都会做几次这样的事情。 + +在完成用于更新 Midnight Commander 的剧本之后,我创建了一个新的剧本,用于在新安装的 Fedora 主机上执行安装任务。我已经取得了不错的进步,剧本比我第一个的更加复杂,但没有那么粗暴。 + +在使用 Ansible 的第一天,我创建了一个解决问题的剧本,我还开始编写第二个剧本,它将解决安装后配置的大问题,在这个过程中我学到了很多东西。 + +尽管我真的很喜欢使用 [Bash][8] 脚本来管理任务,但是我发现 Ansible 可以完成我想要的一切,并且可以使系统保持在我所需的状态。只用了一天,我就成为了 Ansible 的粉丝。 + +### 资源 + +我找到的最完整、最有用的参考文档是 Ansible 网站上的[用户指南][9]。本文仅供参考,不作为入门文档。 + +多年来,Opensource.com 已经发布了许多[有关 Ansible 的文章][10],我发现其中大多数对我的需求很有帮助。Enable Sysadmin 网站上也有很多对我有帮助 [Ansible 文章][11]。你可以通过查看本周(2020 年 10 月 13 日至 14 日)的 [AnsibleFest][12] 了解更多信息。该活动完全是虚拟的,可以免费注册。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/first-day-ansible + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[MjSeven](https://github.com/MjSeven) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/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://www.ansible.com/ +[3]: https://www.python.org/ +[4]: https://midnight-commander.org/ +[5]: https://en.wikipedia.org/wiki/List_of_DNS_record_types +[6]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_vars_facts.html#ansible-facts +[7]: https://en.wikipedia.org/wiki/Cowsay +[8]: https://opensource.com/downloads/bash-cheat-sheet +[9]: https://docs.ansible.com/ansible/latest/user_guide/index.html +[10]: https://opensource.com/tags/ansible +[11]: https://www.redhat.com/sysadmin/topics/ansible +[12]: https://www.ansible.com/ansiblefest From 9c5f690e0b8237642dbeefea17da0faea728074d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 1 Feb 2021 05:03:41 +0800 Subject: [PATCH 062/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210201=20?= =?UTF-8?q?Best=20Single=20Board=20Computers=20for=20AI=20and=20Deep=20Lea?= =?UTF-8?q?rning=20Projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210201 Best Single Board Computers for AI and Deep Learning Projects.md --- ...uters for AI and Deep Learning Projects.md | 282 ++++++++++++++++++ 1 file changed, 282 insertions(+) create mode 100644 sources/tech/20210201 Best Single Board Computers for AI and Deep Learning Projects.md diff --git a/sources/tech/20210201 Best Single Board Computers for AI and Deep Learning Projects.md b/sources/tech/20210201 Best Single Board Computers for AI and Deep Learning Projects.md new file mode 100644 index 0000000000..73cf55c47b --- /dev/null +++ b/sources/tech/20210201 Best Single Board Computers for AI and Deep Learning Projects.md @@ -0,0 +1,282 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Best Single Board Computers for AI and Deep Learning Projects) +[#]: via: (https://itsfoss.com/best-sbc-for-ai/) +[#]: author: (Community https://itsfoss.com/author/itsfoss/) + +Best Single Board Computers for AI and Deep Learning Projects +====== + +[Single-board computers][1] (SBC) are very popular with tinkerers and hobbyists alike, they offer a lot of functionality in a very small form factor. An SBC has the CPU, GPU, memory, IO ports, etc. on a small circuit board and users can add functionality by adding new devices to the [GPIO ports][2]. Some of the more popular SBCs include the [Raspberry Pi][3] and [Arduino][4] family of products. + +However, there is an increasing demand for SBC’s that can be used for edge compute applications like Artificial Intelligence (AI) or Deep Learning (DL) and there are quite a few. The list below consists of some of the best SBCs that have been developed for edge computing. + +The list is in no particular order of ranking. Some links here are affiliate links. Please read our [affiliate policy][5]. + +### 1\. Nvidia Jetson Family + +Nvidia has a great lineup of SBCs that cater to AI developers and hobbyists alike. Their line of “[Jetson Developer Kits][6]” are some of the most powerful and value for money SBCs available in the market. Below is a list of their offerings. + +#### Nvidia Jetson Nano Developer Kit + +![][7] + +Starting at **$59**, the Jetson Nano is the cheapest SBC in the list and offers a good price to performance ratio. It can run multiple neural networks alongside other applications such as object detection, segmentation, speech processing and image classification. + +The Jetson Nano is aimed towards AI enthusiasts, hobbyists and developers who want to do projects by implementing AI. + +The Jetson Nano is being offered in two variants: 4 GB and 2 GB. The main differences between the two are, the price, RAM capacity and IO ports being offered. The 4 GB variant has been showcased in the image above. + +**Key Specifications** + + * **CPU:** Quad-core ARM A57 @ 1.43 GHz + * **GPU:** 128-core NVIDIA Maxwell + * **Memory:** 4 GB 64-bit LPDDR4 @ 25.6 GB/s or 2 GB 64-bit LPDDR4 @ 25.6 GB/s + * **Storage:** microSD card support + * **Display:** HDMI and Display Port or HDMI + +Preview | Product | Price | +---|---|---|--- +![NVIDIA Jetson Nano 2GB Developer Kit \(945-13541-0000-000\)][8] ![NVIDIA Jetson Nano 2GB Developer Kit \(945-13541-0000-000\)][8] | [NVIDIA Jetson Nano 2GB Developer Kit (945-13541-0000-000)][9] | $59.00[][10] | [Buy on Amazon][11] + +#### Nvidia Jetson Xavier NX Developer Kit + +![][12] + +The Jetson Xavier NX is a step up from the Jetson Nano and is aimed more towards OEMs, start-ups and AI developers. + +The Jetson Xavier NX is meant for applications that need more serious AI processing power that an entry level offering like the Jetson Nano simply can’t deliver. The Jetson Xavier NX is being offered at **$386.99**. + +**Key Specifications** + + * **CPU:** 6-core NVIDIA Carmel ARM v8.2 64-bit CPU + * **GPU:** NVIDIA Volta architecture with 384 NVIDIA CUDA cores and 48 Tensor cores + * **DL Accelerator:** 2x NVDLA Engines + * **Vision Accelerator:** 7-Way VLIW Vision Processor + * **Memory:** 8 GB 128-bit LPDDR4x @ 51.2 GB/s + * **Storage:** microSD support + * **Display:** HDMI and Display Port + +Preview | Product | Price | +---|---|---|--- +![NVIDIA Jetson Xavier NX Developer Kit \(812674024318\)][13] ![NVIDIA Jetson Xavier NX Developer Kit \(812674024318\)][13] | [NVIDIA Jetson Xavier NX Developer Kit (812674024318)][14] | $386.89[][10] | [Buy on Amazon][15] + +#### Nvidia Jetson AGX Xavier Developer Kit + +![][16] + +The Jetson AGX Xavier is the flagship product of the Jetson family, it is meant to be deployed in servers and AI robotics applications in industries such as manufacturing, retail, automobile, agriculture, etc. + +Coming in at **$694.91**, the Jetson AGX Xavier is not meant for beginners, it is meant for developers who want top-tier edge compute performance at their disposal and for companies who want good scalability for their applications. + +**Key Specifications** + + * **CPU:** 8-core ARM v8.2 64-bit CPU + * **GPU:** 512-core Volta GPU with Tensor Cores + * **DL Accelerator:** 2x NVDLA Engines + * **Vision Accelerator:** 7-Way VLIW Vision Processor + * **Memory:** 32 GB 256-Bit LPDDR4x @ 137 GB/s + * **Storage:** 32 GB eMMC 5.1 and uSD/UFS Card Socket for storage expansion + * **Display:** HDMI 2.0 + +Preview | Product | Price | +---|---|---|--- +![NVIDIA Jetson AGX Xavier Developer Kit \(32GB\)][17] ![NVIDIA Jetson AGX Xavier Developer Kit \(32GB\)][17] | [NVIDIA Jetson AGX Xavier Developer Kit (32GB)][18] | $694.91[][10] | [Buy on Amazon][19] + +### 2\. ROCK Pi N10 + +![][20] + +The ROCK Pi N10, developed by [Radxa][21] is the second cheapest offering in this list with its base variant coming in at **$99**, its range topping variant comes in at **$169**, + +The ROCK Pi N10 is equipped with a NPU (Neural Processing Unit) that helps it in processing AI/ Deep Learning workloads with ease. It offers up to 3 TOPS (Tera Operations Per Second) of performance. + +It is being offered in three variants namely, ROCK Pi N10 Model A, ROCK Pi N10 Model B, ROCK Pi N10 Model C, the only differences between these variants are the price, RAM and Storage capacities. + +The ROCK Pi N10 is available for purchase through [Seeed Studio][22]. + +**Key Specifications** + + * **CPU:** RK3399Pro with 2-core Cortex-A72 @ 1.8 GHz and 4-Core Cortex-A53 @ 1.4 GHz + * **GPU:** Mali T860MP4 + * **NPU:** Supports 8bit/16bit computing with up to 3.0 TOPS computing power + * **Memory:** 4 GB/6 GB/8 GB 64-bit LPDDR3 @ 1866 Mb/s + * **Storage:** 16 GB/32 GB/64 GB eMMC + * **Display:** HDMI 2.0 + + + +### 3\. BeagleBone AI + +![][23] + +The BeagleBone AI is [BeagleBoard.org][24]‘s open source SBC is meant to bridge the gap between small SBCs and more powerful industrial computers. The hardware and software of the BeagleBoard are completely open source. + +It is meant for use in the automation of homes, industries and other commercial use cases. It is priced at **~$110**, the price varies across dealers, for more info check [their website][25]. + +**Key Specifications** + + * **CPU:** Texas Instrument AM5729 with Dual-core ARM Cortex-A15 @ 1.5GHz + * **Co-Processor:** 2 x Dual-core ARM Cortex-M4 + * **DSP:** 2 x C66x floating-point VLIW + * **EVE:** 4 x Embedded Vision Engines + * **GPU:** PowerVR SGX544 + * **RAM:** 1 GB + * **Storage:** 16 GB eMMC + * **Display:** microHDMI + +Preview | Product | Price | +---|---|---|--- +![BeagleBone AI][26] ![BeagleBone AI][26] | [BeagleBone AI][27] | $127.49[][10] | [Buy on Amazon][28] + +### 4\. BeagleV + +![][29] + +The BeagleV is the latest launch in the list, it is an SBC that runs Linux out of the box and has a [RISC-V][30] CPU. + +It is capable of running edge compute applications effortlessly, to know more about the BeagleV check [our coverage][31] of the launch. + +The BeagleV will be getting two variants, a 4 GB RAM variant and an 8 GB RAM variant. Pricing starts at **$119** for the base model and **$149** for the 8 GB RAM model, it is up for pre-order through [their website][32]. + +**Key Specifications** + + * **CPU:** RISC-V U74 2-Core @ 1.0GHz + * **DSP:** Vision DSP Tensilica-VP6 + * **DL Accelerator:** NVDLA Engine 1-core + * **NPU:** Neural Network Engine + * **RAM:** 4 GB/8 GB (2 x 4 GB) LPDDR4 SDRAM + * **Storage:** microSD slot + * **Display:** HDMI 1.4 + + + +### 5\. HiKey970 + +![][33] + +HiKey970 is [96 Boards][34] first SBC meant for edge compute applications and is the world’s first dedicated NPU AI platform. + +The HiKey970 features an CPU, GPU and an NPU for accelerating AI performance, it can also be used for training and building DL (Deep Learning) models. + +The HiKey970 is priced at **$299** and can be bought from their [official store][35]. + +**Key Specifications** + + * **SoC:** HiSilicon Kirin 970 + * **CPU:** ARM Cortex-A73 4-Core @ 2.36GHz and ARM Cortex-A53 4-Core @ 1.8GHz + * **GPU:** ARM Mali-G72 MP12 + * **RAM:** 6 GB LPDDR4X @ 1866MHz + * **Storage:** 64 GB UFS 2.1 microSD + * **Display:** HDMI and 4 line MIPI/LCD port + + + +### 6\. Google Coral Dev Board + +![][36] + +The Coral Dev Board is Google’s first attempt at an SBC dedicated for edge computing. It is capable of performing high speed ML (Machine Learning) inferencing and has support for TensorFlow Lite and AutoML Vision Edge. + +The board is priced at **$129.99** and is available through [Coral’s official website][37]. + +**Key Specifications** + + * **CPU:** NXP i.MX 8M SoC (4-Core Cortex-A53, Cortex-M4F) + * **ML Accelerator**: Google Edge TPU coprocessor + * **GPU:** Integrated GC7000 Lite Graphics + * **RAM:** 1 GB LPDDR4 + * **Storage:** 8 GB eMMC and microSD slot + * **Display:** HDMI 2.0a, 39-pin FFC connector for MIPI-DSI display (4-lane) and 24-pin FFC connector for MIPI-CSI2 camera (4-lane) + + + +### 7\. Google Coral Dev Board Mini + +![][38] + +The Coral Dev Board Mini is the successor to the Coral Dev Board, it packs in more processing power into a smaller form factor and a lower price point of **$99.99**. + +The Coral Dev Board Mini can be purchased from their [official web store][39]. + +**Key Specifications** + + * **CPU:** MediaTek 8167s SoC (4-core Arm Cortex-A35) + * **ML Accelerator:** Google Edge TPU coprocessor + * **GPU:** IMG PowerVR GE8300 + * **RAM:** 2 GB LPDDR3 + * **Storage:** 8 GB eMMC + * **Display:** micro HDMI (1.4), 24-pin FFC connector for MIPI-CSI2 camera (4-lane) and 24-pin FFC connector for MIPI-DSI display (4-lane) + +Preview | Product | Price | +---|---|---|--- +![Google Coral Dev Board Mini][40] ![Google Coral Dev Board Mini][40] | [Google Coral Dev Board Mini][41] | $99.99[][10] | [Buy on Amazon][42] + +### Closing Thoughts + +There is an SBC available in every price range for edge compute applications. Some are just basic, like the Nvidia Jetson Nano or the BeagleBone AI and some are performance oriented models like the BeagleV and Nvidia Jetson AGX Xavier. + +If you are looking for something more universal you can check [our article on Raspberry Pi alternatives][1] that could help you in finding a suitable SBC for your use case. + +If I missed any SBC dedicated for edge compute, feel free to let me know in the comments below. + +_**Author info: Sourav Rudra is a FOSS Enthusiast with love for Gaming Rigs/Workstation building.**_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-sbc-for-ai/ + +作者:[Community][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/raspberry-pi-alternatives/ +[2]: https://en.wikipedia.org/wiki/General-purpose_input/output +[3]: https://www.raspberrypi.org/products/ +[4]: https://www.arduino.cc/en/main/products +[5]: https://itsfoss.com/affiliate-policy/ +[6]: https://developer.nvidia.com/embedded/jetson-developer-kits +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Nvidia-Jetson-Nano.png?ssl=1 +[8]: https://i1.wp.com/m.media-amazon.com/images/I/310YWrfdnTL._SL160_.jpg?ssl=1 +[9]: https://www.amazon.com/dp/B08J157LHH?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (NVIDIA Jetson Nano 2GB Developer Kit (945-13541-0000-000)) +[10]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[11]: https://www.amazon.com/dp/B08J157LHH?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon) +[12]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Nvidia-Jetson-Xavier-NX.png?ssl=1 +[13]: https://i1.wp.com/m.media-amazon.com/images/I/31B9xMmCvwL._SL160_.jpg?ssl=1 +[14]: https://www.amazon.com/dp/B086874Q5R?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (NVIDIA Jetson Xavier NX Developer Kit (812674024318)) +[15]: https://www.amazon.com/dp/B086874Q5R?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[16]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Nvidia-Jetson-AGX-Xavier-.png?ssl=1 +[17]: https://i1.wp.com/m.media-amazon.com/images/I/41tO5hw4zHL._SL160_.jpg?ssl=1 +[18]: https://www.amazon.com/dp/B083ZL3X5B?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (NVIDIA Jetson AGX Xavier Developer Kit (32GB)) +[19]: https://www.amazon.com/dp/B083ZL3X5B?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[20]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/ROCK-Pi-N10.png?ssl=1 +[21]: https://wiki.radxa.com/Home +[22]: https://www.seeedstudio.com/ROCK-Pi-4-c-1323.html?cat=1343 +[23]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Beagle-AI.png?ssl=1 +[24]: https://beagleboard.org/ +[25]: https://beagleboard.org/ai +[26]: https://i2.wp.com/m.media-amazon.com/images/I/41K+htPCUHL._SL160_.jpg?ssl=1 +[27]: https://www.amazon.com/dp/B07YR1RV64?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (BeagleBone AI) +[28]: https://www.amazon.com/dp/B07YR1RV64?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[29]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/BeagleV.png?ssl=1 +[30]: https://en.wikipedia.org/wiki/RISC-V +[31]: https://news.itsfoss.com/beaglev-announcement/ +[32]: https://beaglev.seeed.cc/ +[33]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/HiKey970.png?ssl=1 +[34]: https://www.96boards.org/ +[35]: https://www.96boards.org/product/hikey970/ +[36]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Google-Coral-Dev-Board.png?ssl=1 +[37]: https://coral.ai/products/dev-board/ +[38]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/Google-Coral-Dev-Board-Mini.png?ssl=1 +[39]: https://coral.ai/products/dev-board-mini +[40]: https://i0.wp.com/m.media-amazon.com/images/I/41g5c6IwLmL._SL160_.jpg?ssl=1 +[41]: https://www.amazon.com/dp/B08QLXKJB7?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Google Coral Dev Board Mini) +[42]: https://www.amazon.com/dp/B08QLXKJB7?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) From b179c71fdd53e758529857c2dbe934c4c263900f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 1 Feb 2021 05:03:55 +0800 Subject: [PATCH 063/213] add done: 20210201 Best Single Board Computers for AI and Deep Learning Projects.md --- sources/tech/20210201 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210201 .md diff --git a/sources/tech/20210201 .md b/sources/tech/20210201 .md new file mode 100644 index 0000000000..c0aeb5717c --- /dev/null +++ b/sources/tech/20210201 .md @@ -0,0 +1,25 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: () +[#]: via: (https://www.2daygeek.com/edit-pdf-files-in-linux/) +[#]: author: ( ) + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/edit-pdf-files-in-linux/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From 6d07f22ad4f9fb6a086016a44b17e4f0d704c01f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 1 Feb 2021 05:04:12 +0800 Subject: [PATCH 064/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210131=20?= =?UTF-8?q?3=20wishes=20for=20open=20source=20productivity=20in=202021?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210131 3 wishes for open source productivity in 2021.md --- ...es for open source productivity in 2021.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20210131 3 wishes for open source productivity in 2021.md diff --git a/sources/tech/20210131 3 wishes for open source productivity in 2021.md b/sources/tech/20210131 3 wishes for open source productivity in 2021.md new file mode 100644 index 0000000000..a4ac62d4ef --- /dev/null +++ b/sources/tech/20210131 3 wishes for open source productivity in 2021.md @@ -0,0 +1,63 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 wishes for open source productivity in 2021) +[#]: via: (https://opensource.com/article/21/1/productivity-wishlist) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +3 wishes for open source productivity in 2021 +====== +There are plenty of ways the open source world can expand for 2021. Here +are the three areas I'm particularly interested in. +![Looking at a map for career journey][1] + +In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to the final day of 21 Days of Productivity in 2021. + +Here we are, at the end of another series. So let's talk about the things I want to see more of in 2021. + +### Disconnecting + +![Large Lego set built by the author][2] + +I built this over the holidays (Kevin Sonney, [CC BY-SA 4.0][3]) + +For many, many, _many_ people, 2020 was a very difficult year. The pandemic, the various political events, the 24-hour news cycle, and so on took a toll on our mental well-being. And while I did talk about [making time for self-care][4], I only touched on disconnecting—that is, turning off alerts, phones, tablets, etc., and just ignoring the world for a bit. One of the managers in my company actually told us to turn off all our work-related stuff if we had a holiday or a day off (unless we were on call). One of my favorite "disconnect" activities is just listening to music and building big, complex Lego sets. + +### Accessibility + +While many of the techniques I talked about are something anyone can do, the software aspects all have some difficulty with accessibility. Linux and the open source world have come a long way when it comes to assistive technologies since the early days of the movement. However, there are still far too many applications and systems that do not consider that the user may not have the same abilities as the person who designed them. I am keeping an eye on developments in this area because everyone should be able to access things. + +### More all-in-one options + +![JPilot all in one organizer software interface][5] + +JPilot (Kevin Sonney, [CC BY-SA 4.0][3]) + +There are nowhere near as many all-in-one Personal Information Manager solutions in the FOSS world as there are in the commercial software world. The overall trend has been to use individual apps that must be configured to talk to each other or through an intermediary service (like a CalDAV server). The mobile market largely drives this trend, but I still yearn for the days when something like [JPilot][6] could do almost everything I needed without extra plugins or services. + +Thank you all very much for reading the series year. Please comment with what you think I missed or need to look at for next year. + +And as I say on [Productivity Alchemy][7], do your best to Stay Productive! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/productivity-wishlist + +作者:[Kevin Sonney][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ksonney +[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://opensource.com/sites/default/files/day21-image1.png +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/21/1/self-care +[5]: https://opensource.com/sites/default/files/day21-image2.png +[6]: http://www.jpilot.org/ +[7]: https://productivityalchemy.com From a5c0f121a1d4d405ae5f2ccde55c79e7d5c29ba6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 1 Feb 2021 05:04:31 +0800 Subject: [PATCH 065/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210131=20?= =?UTF-8?q?How=20to=20teach=20open=20source=20beyond=20business?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210131 How to teach open source beyond business.md --- ...ow to teach open source beyond business.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20210131 How to teach open source beyond business.md diff --git a/sources/tech/20210131 How to teach open source beyond business.md b/sources/tech/20210131 How to teach open source beyond business.md new file mode 100644 index 0000000000..f9563e14ff --- /dev/null +++ b/sources/tech/20210131 How to teach open source beyond business.md @@ -0,0 +1,72 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to teach open source beyond business) +[#]: via: (https://opensource.com/article/21/1/open-source-beyond-business) +[#]: author: (Irit Goihman https://opensource.com/users/iritgoihman) + +How to teach open source beyond business +====== +The Beyond program connects future talents in the tech industry with +open source culture. +![Teacher or learner?][1] + +When I was a university student, I didn't understand the fuss about open source software. I used Linux and open source software but didn't really understand the open source model, how to contribute to projects, or how it could benefit my future career. My development experience consisted mainly of homework assignments and a large final project required for my degree. + +So, when I took my first steps in the tech industry, there was a big learning curve before I felt comfortable. I needed to understand how to join established, sometimes large, and distributed teams working on an ongoing project. I also needed to know how to communicate properly so that my efforts could be recognized. + +I am not special in this regard. This is a common situation among new graduates. + +### Open source gives students a head start + +Since then, as an engineer and later as a manager, I have helped onboard many junior engineers. One of the things I've noticed is that the new graduates who have already contributed to open source projects could onboard quickly and start contributing faster than those without this experience. + +By incorporating open source methodology into academic studies, students can gain experience relevant to the industry, learn to reuse their existing knowledge, and establish a good platform for formulating ideas and sharing knowledge. Practicing open source can make a positive impact on students' technical knowledge and experience. This can help them become more successful in bootstrapping their careers. + +The value of open source methodologies in the tech industry is well-established and shapes the culture of software companies worldwide. Involvement in open source projects and adoption of the [open organization culture][2] has become an industry standard. Companies seek fresh-minded, talented employees who know how to work in open source and cultivate its culture. Therefore, the tech industry must drive the academic world to embrace open source culture as one of the fundamental methodologies to learn in tech studies. + +### Moving open source culture 'Beyond' business + +When I met [Liora Milbaum][3], a senior principal software engineer at Red Hat, I learned we shared an interest in bringing open source culture and principles into academics. Liora had previously founded [DevOps Loft][4], in which she shared DevOps practices with people interested in stepping into this world, and wished to start a similar initiative to teach open source to university students. We decided to launch the [Beyond][5] program to connect future talents in the tech industry with open source culture as Red Hat practices it. + +We started the Beyond program at the [Academic College of Tel Aviv-Yafo][6], where we were warmly welcomed by the information systems faculty. We started by teaching an "Introduction to DevOps'' course to introduce elements of the DevOps tech stack. Our biggest challenge at the start was deciding how to teach what open source is. The answer was simple: by practicing it, of course. We didn't want to deliver yet another old-school academic course; rather, we wanted to expose students to industry standards. + +We created a syllabus that incorporated common open source projects and tools to teach the DevOps stack. The course consisted of lectures and hands-on participation taught by engineers. The students were divided into groups, each one mentored and supported by an engineer. They practiced working in teams, sharing knowledge (both inside and outside of their groups), and collaborating effectively. + +During our second course, "Open source development pillars," for students in the computer science department, we encountered another big obstacle. Two weeks after the course started, we became fully remote as the COVID pandemic hit the globe. We solved this problem by using the same remote collaboration tools with our students that we were using for our daily work at Red Hat. We were amazed at how simple and smooth the transition was. + +![Beyond teaching online][7] + +(Irit Goihman, [CC BY-SA 4.0][8]) + +### Successful early outcomes + +The two courses were a huge success, and we even hired one of the top students we taught. The feedback we received was amazing; the students said we positively impacted their knowledge, thinking, and soft skills. A few students were hired for their first tech job based on their open source contributions during the course. + +Other academic institutions have expressed interest in adopting these courses, so we've expanded the program to another university. + +I am fortunate to co-lead this successful initiative with Liora, accompanied by a team of talented engineers. Together, we are helping increase the open source community a bit more. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/open-source-beyond-business + +作者:[Irit Goihman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/iritgoihman +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) +[2]: https://opensource.com/open-organization/resources/open-org-definition +[3]: https://www.linkedin.com/in/lioramilbaum +[4]: https://www.devopsloft.io/ +[5]: https://research.redhat.com/blog/2020/05/24/open-source-development-course-and-devops-methodology/ +[6]: https://www.int.mta.ac.il/ +[7]: https://opensource.com/sites/default/files/pictures/beyond_mta.png (Beyond teaching online) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ From b03f53bbd35dcdbc9825c105609f3c7a6cccb5ee Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 1 Feb 2021 08:53:06 +0800 Subject: [PATCH 066/213] translated --- ...spberry Pi as a productivity powerhouse.md | 74 ------------------- ...spberry Pi as a productivity powerhouse.md | 73 ++++++++++++++++++ 2 files changed, 73 insertions(+), 74 deletions(-) delete mode 100644 sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md create mode 100644 translated/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md diff --git a/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md b/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md deleted file mode 100644 index f731211028..0000000000 --- a/sources/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Use your Raspberry Pi as a productivity powerhouse) -[#]: via: (https://opensource.com/article/21/1/raspberry-pi-productivity) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -Use your Raspberry Pi as a productivity powerhouse -====== -The Raspberry Pi has come a long way from being primarily for hacking -and hobbyists to a solid choice for a small productive workstation. -![Team checklist and to dos][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 16 of 21 Days of Productivity in 2021. - -The [Raspberry Pi][2] is a pretty amazing little computer—small, surprisingly powerful, and very easy to set up and use. I have used them for home automation projects, dashboards, and a dedicated media player. But can it be a productivity powerhouse as well? - -The answer is, quite simply, yes. - -![Geary and Calendar apps on the Raspberry Pi][3] - -Geary and Calendar (Kevin Sonney, [CC BY-SA 4.0][4]) - -The base [Raspbian][5] install includes [Claws Mail][6], which is a lightweight mail client. The UI is a little dated, and it is very bare-bones. If you are a [Mutt user][7], this will probably meet your needs just fine. - -I prefer to install [Geary][8] since it is also lightweight and has a modern interface. Also, unlike Claws, Geary has support for rich-text (HTML) email by default. I dislike rich-text email, but it has become necessary, so having good support for it is critical. - -The default Raspbian installation does not include a calendar, so I added [GNOME Calendar][9] since it can talk to remote services (since almost all of my calendars are on cloud providers). - -![GTG and GNote open on Raspberry Pi][10] - -GTG and GNote (Kevin Sonney, [CC BY-SA 4.0][4]) - -What about notes and to-do lists? There are a lot of options out there, but I'm a fan of [GNote][11] for notes and [Getting-Things-GNOME!][12] for to-do lists. Both are reasonably lightweight and can sync to each other, as well as to other services. - -You'll note that I'm using quite a few GNOME applications here. Why not just install the full GNOME Desktop? On the Raspberry Pi 4 with 4Gb (or 8Gb) of memory, GNOME works exceptionally well. You will need to take some extra steps to disable the default wifi setup on Raspbian and replace it with Network Manager, but that is well documented on the internet and really easy. - -Included with GNOME is [Evolution][13], which combines mail, calendars, notes, to-do lists, and contact management into a single app. It is a little heavy compared to Geary and GNOME Calendar, but it is rock solid on the Raspberry Pi 4. This was surprising to me since I'm used to Evolution being kind of a resource hog, but the Raspberry Pi 4 runs it as well as my brand-name laptops with resources to spare. - -![Evolution on Raspbian][14] - -Evolution on Raspbian (Kevin Sonney, [CC BY-SA 4.0][4]) - -The Raspberry Pi has come a long way in the last few years and has gone from being primarily for hacking and hobbyists to a solid choice for a small productive workstation. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/raspberry-pi-productivity - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) -[2]: https://www.raspberrypi.org/ -[3]: https://opensource.com/sites/default/files/day16-image1.png -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://www.raspbian.org/ -[6]: https://www.claws-mail.org/ -[7]: http://www.mutt.org/ -[8]: https://wiki.gnome.org/Apps/Geary -[9]: https://wiki.gnome.org/Apps/Calendar -[10]: https://opensource.com/sites/default/files/day16-image2.png -[11]: https://wiki.gnome.org/Apps/Gnote -[12]: https://wiki.gnome.org/Apps/GTG -[13]: https://opensource.com/business/18/1/desktop-email-clients -[14]: https://opensource.com/sites/default/files/day16-image3.png diff --git a/translated/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md b/translated/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md new file mode 100644 index 0000000000..5ee3f52a43 --- /dev/null +++ b/translated/tech/20210126 Use your Raspberry Pi as a productivity powerhouse.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use your Raspberry Pi as a productivity powerhouse) +[#]: via: (https://opensource.com/article/21/1/raspberry-pi-productivity) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +将你的树莓派用作生产力源泉 +====== +树莓派已经从主要为 hack 和业余爱好者服务,成为了小型生产力工作站的可靠选择。 +![Team checklist and to dos][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十六天。 + +[树莓派][2]是一台相当棒的小电脑。它体积小,功能却出奇的强大,而且非常容易设置和使用。我曾将它们用于家庭自动化项目、面板和专用媒体播放器。但它也能成为生产力的动力源泉么? + +答案相当简单:是的。 + +![Geary and Calendar apps on the Raspberry Pi][3] + +Geary 和 Calendar 应用 (Kevin Sonney, [CC BY-SA 4.0][4]) + +基本的 [Raspbian][5] 安装包括 [Claw Mail][6],这是一个轻量级的邮件客户端。它的用户界面有点过时了,而且非常的简陋。如果你是一个 [Mutt 用户][7],它可能会满足你的需求。 + +我更喜欢安装 [Geary][8],因为它也是轻量级的,而且有一个现代化的界面。另外,与 Claws 不同的是,Geary 默认支持富文本 (HTML) 邮件。我不喜欢富文本电子邮件,但它已经成为必要的,所以对它有良好的支持是至关重要的。 + +默认的 Raspbian 安装不包含日历,所以我添加了 [GNOME Calendar][9] ,因为它可以与远程服务通信(因为我的几乎所有日历都在云提供商那里)。 + +![GTG and GNote open on Raspberry Pi][10] + +GTG 和 GNote(Kevin Sonney, [CC BY-SA 4.0][4]) + +那笔记和待办事项清单呢?有很多选择,但我喜欢用 [GNote][11] 来做笔记,用 [Getting-Things-GNOME!][12] 来做待办事项。两者都相当轻量级,并且可以相互同步,也可以同步到其他服务。 + +你会注意到,我在这里使用了不少 GNOME 应用。为什么不直接安装完整的 GNOME 桌面呢?在内存为 4Gb(或 8Gb)的树莓派 4 上,GNOME 工作得很好。你需要采取一些额外的步骤来禁用 Raspbian 上的默认 wifi 设置,并用 Network Manager 来代替它,但这个在网上有很好的文档,而且真的很简单。 + +GNOME 中包含了 [Evolution][13],它将邮件、日历、笔记、待办事项和联系人管理整合到一个应用中。与 Geary 和 GNOME Calendar 相比,它有点重,但在树莓派 4 上却很稳定。这让我很惊讶,因为我习惯了 Evolution 有点消耗资源,但树莓派 4 却和我的品牌笔记本一样运行良好,而且资源充足。 + +![Evolution on Raspbian][14] + +Raspbian 上的 Evolution (Kevin Sonney, [CC BY-SA 4.0][4]) + +树莓派在过去的几年里走过了很长的路,已经从主要为 hack 和业余爱好者服务,成为了小型生产力工作站的可靠选择。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/raspberry-pi-productivity + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/todo_checklist_team_metrics_report.png?itok=oB5uQbzf (Team checklist and to dos) +[2]: https://www.raspberrypi.org/ +[3]: https://opensource.com/sites/default/files/day16-image1.png +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://www.raspbian.org/ +[6]: https://www.claws-mail.org/ +[7]: http://www.mutt.org/ +[8]: https://wiki.gnome.org/Apps/Geary +[9]: https://wiki.gnome.org/Apps/Calendar +[10]: https://opensource.com/sites/default/files/day16-image2.png +[11]: https://wiki.gnome.org/Apps/Gnote +[12]: https://wiki.gnome.org/Apps/GTG +[13]: https://opensource.com/business/18/1/desktop-email-clients +[14]: https://opensource.com/sites/default/files/day16-image3.png From 5d132c9fdf96efb6c74d11067bdbfeaf66f96a03 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 1 Feb 2021 09:01:21 +0800 Subject: [PATCH 067/213] translating --- .../tech/20210128 4 tips for preventing notification fatigue.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210128 4 tips for preventing notification fatigue.md b/sources/tech/20210128 4 tips for preventing notification fatigue.md index 96e2e66660..345b1adf8b 100644 --- a/sources/tech/20210128 4 tips for preventing notification fatigue.md +++ b/sources/tech/20210128 4 tips for preventing notification fatigue.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c37b193e014eb13c6387f6a170f94f44528d232e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 1 Feb 2021 09:04:40 +0800 Subject: [PATCH 068/213] Delete 20210201 .md --- sources/tech/20210201 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210201 .md diff --git a/sources/tech/20210201 .md b/sources/tech/20210201 .md deleted file mode 100644 index c0aeb5717c..0000000000 --- a/sources/tech/20210201 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: () -[#]: via: (https://www.2daygeek.com/edit-pdf-files-in-linux/) -[#]: author: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/edit-pdf-files-in-linux/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From 9ae8d5e23a5f4d1e2252afeda3af4f14def28c2e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 1 Feb 2021 10:26:42 +0800 Subject: [PATCH 069/213] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202101?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20160302 Go channels are bad and you should feel bad.md | 0 ...0181009 GCC- Optimizing Linux, the Internet, and Everything.md | 0 published/{ => 202101}/20181123 Three SSH GUI Tools for Linux.md | 0 ...190104 Search, Study And Practice Linux Commands On The Fly.md | 0 .../20190204 Getting started with Git- Terminology 101.md | 0 .../{ => 202101}/20190205 5 Streaming Audio Players for Linux.md | 0 ...Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md | 0 .../20190215 Make websites more readable with a shell script.md | 0 ...0190220 Do Linux distributions still matter with containers.md | 0 .../{ => 202101}/20190322 Printing from the Linux command line.md | 0 ...age Docker Containers with Portainer.io (GUI tool) - Part-2.md | 0 ...e documents editors, into a Python web app using ONLYOFFICE.md | 0 .../20191010 The biggest risk to uptime- Your staff.md | 0 .../20191224 Top articles for learning Python in 2020.md | 0 .../20191225 Making trade-offs when writing Python code.md | 0 .../{ => 202101}/20191226 How the Zen of Python handles errors.md | 0 ...hon scripts for automating basic community management tasks.md | 0 .../20200522 A beginner-s guide to web scraping with Python.md | 0 .../20200629 A minimalist Mac terminal for Linux fans.md | 0 ...ies of a Package in Ubuntu-Debian-based Linux Distributions.md | 0 .../20201001 Level up your shell history with Loki and fzf.md | 0 .../20201015 Learn Python by creating a video game.md | 0 .../20201216 How to use Kubernetes resource quotas.md | 0 ...standing 52-bit virtual address support in the Arm64 kernel.md | 0 .../20201219 6 ways this fullscreen text editor improves focus.md | 0 .../{ => 202101}/20201222 Learn Rust by writing a simple game.md | 0 .../{ => 202101}/20201222 Learn to use the Sed text editor.md | 0 .../20201224 5 reasons to use the Atom text editor.md | 0 .../{ => 202101}/20201225 How to use heredoc as a text editor.md | 0 .../20201226 Try GNU nano, a lightweight alternative to Vim.md | 0 .../{ => 202101}/20201228 Learn Python by coding a simple game.md | 0 .../20201228 Learn to use the JOE text editor on Linux.md | 0 ...201228 Practice programming in C-- by writing a simple game.md | 0 .../20201229 Bring an old MacBook back to life with Linux.md | 0 .../20201229 Show progress in your Python apps with tqdm.md | 0 .../{ => 202101}/20201230 Choose between Btrfs and LVM-ext4.md | 0 .../20201230 Learn Lua by writing a -guess the number- game.md | 0 .../20201230 Use the Markdown Editor app in Nextcloud.md | 0 published/{ => 202101}/20201231 10 things to love about Git.md | 0 .../{ => 202101}/20201231 Build your own text editor in Java.md | 0 published/{ => 202101}/20210101 Resize images using Python.md | 0 .../20210105 4 lines of code to improve your Ansible play.md | 0 .../{ => 202101}/20210106 Learn C by writing a simple game.md | 0 .../20210106 My 3 favorite open source productivity apps.md | 0 ...107 8 open source software cheat sheets you-ll need in 2021.md | 0 published/{ => 202101}/20210108 Why I like the FED text editor.md | 0 .../20210109 Homura- A WINE-based Game Launcher for BSD.md | 0 .../20210111 Deploy Ceph in a Raspberry Pi cluster.md | 0 ...prove your productivity with this lightweight Linux desktop.md | 0 .../{ => 202101}/20210112 3 email rules to live by in 2021.md | 0 ...per Cool Open Source To-Do List App with GitHub Integration.md | 0 ...t Battery status notification when a battery is full or low.md | 0 published/{ => 202101}/20210115 3 plain text note-taking tools.md | 0 .../20210116 How to use KDE-s productivity suite, Kontact.md | 0 ...Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md | 0 .../{ => 202101}/20210119 Organize your task list using labels.md | 0 .../20210120 Why keeping a journal improves productivity.md | 0 .../{ => 202101}/20210122 How to implement a DevOps toolchain.md | 0 58 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202101}/20160302 Go channels are bad and you should feel bad.md (100%) rename published/{ => 202101}/20181009 GCC- Optimizing Linux, the Internet, and Everything.md (100%) rename published/{ => 202101}/20181123 Three SSH GUI Tools for Linux.md (100%) rename published/{ => 202101}/20190104 Search, Study And Practice Linux Commands On The Fly.md (100%) rename published/{ => 202101}/20190204 Getting started with Git- Terminology 101.md (100%) rename published/{ => 202101}/20190205 5 Streaming Audio Players for Linux.md (100%) rename published/{ => 202101}/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md (100%) rename published/{ => 202101}/20190215 Make websites more readable with a shell script.md (100%) rename published/{ => 202101}/20190220 Do Linux distributions still matter with containers.md (100%) rename published/{ => 202101}/20190322 Printing from the Linux command line.md (100%) rename published/{ => 202101}/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md (100%) rename published/{ => 202101}/20190924 Integrate online documents editors, into a Python web app using ONLYOFFICE.md (100%) rename published/{ => 202101}/20191010 The biggest risk to uptime- Your staff.md (100%) rename published/{ => 202101}/20191224 Top articles for learning Python in 2020.md (100%) rename published/{ => 202101}/20191225 Making trade-offs when writing Python code.md (100%) rename published/{ => 202101}/20191226 How the Zen of Python handles errors.md (100%) rename published/{ => 202101}/20200323 5 Python scripts for automating basic community management tasks.md (100%) rename published/{ => 202101}/20200522 A beginner-s guide to web scraping with Python.md (100%) rename published/{ => 202101}/20200629 A minimalist Mac terminal for Linux fans.md (100%) rename published/{ => 202101}/20200827 How to Check Dependencies of a Package in Ubuntu-Debian-based Linux Distributions.md (100%) rename published/{ => 202101}/20201001 Level up your shell history with Loki and fzf.md (100%) rename published/{ => 202101}/20201015 Learn Python by creating a video game.md (100%) rename published/{ => 202101}/20201216 How to use Kubernetes resource quotas.md (100%) rename published/{ => 202101}/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md (100%) rename published/{ => 202101}/20201219 6 ways this fullscreen text editor improves focus.md (100%) rename published/{ => 202101}/20201222 Learn Rust by writing a simple game.md (100%) rename published/{ => 202101}/20201222 Learn to use the Sed text editor.md (100%) rename published/{ => 202101}/20201224 5 reasons to use the Atom text editor.md (100%) rename published/{ => 202101}/20201225 How to use heredoc as a text editor.md (100%) rename published/{ => 202101}/20201226 Try GNU nano, a lightweight alternative to Vim.md (100%) rename published/{ => 202101}/20201228 Learn Python by coding a simple game.md (100%) rename published/{ => 202101}/20201228 Learn to use the JOE text editor on Linux.md (100%) rename published/{ => 202101}/20201228 Practice programming in C-- by writing a simple game.md (100%) rename published/{ => 202101}/20201229 Bring an old MacBook back to life with Linux.md (100%) rename published/{ => 202101}/20201229 Show progress in your Python apps with tqdm.md (100%) rename published/{ => 202101}/20201230 Choose between Btrfs and LVM-ext4.md (100%) rename published/{ => 202101}/20201230 Learn Lua by writing a -guess the number- game.md (100%) rename published/{ => 202101}/20201230 Use the Markdown Editor app in Nextcloud.md (100%) rename published/{ => 202101}/20201231 10 things to love about Git.md (100%) rename published/{ => 202101}/20201231 Build your own text editor in Java.md (100%) rename published/{ => 202101}/20210101 Resize images using Python.md (100%) rename published/{ => 202101}/20210105 4 lines of code to improve your Ansible play.md (100%) rename published/{ => 202101}/20210106 Learn C by writing a simple game.md (100%) rename published/{ => 202101}/20210106 My 3 favorite open source productivity apps.md (100%) rename published/{ => 202101}/20210107 8 open source software cheat sheets you-ll need in 2021.md (100%) rename published/{ => 202101}/20210108 Why I like the FED text editor.md (100%) rename published/{ => 202101}/20210109 Homura- A WINE-based Game Launcher for BSD.md (100%) rename published/{ => 202101}/20210111 Deploy Ceph in a Raspberry Pi cluster.md (100%) rename published/{ => 202101}/20210111 Improve your productivity with this lightweight Linux desktop.md (100%) rename published/{ => 202101}/20210112 3 email rules to live by in 2021.md (100%) rename published/{ => 202101}/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md (100%) rename published/{ => 202101}/20210113 How to get Battery status notification when a battery is full or low.md (100%) rename published/{ => 202101}/20210115 3 plain text note-taking tools.md (100%) rename published/{ => 202101}/20210116 How to use KDE-s productivity suite, Kontact.md (100%) rename published/{ => 202101}/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md (100%) rename published/{ => 202101}/20210119 Organize your task list using labels.md (100%) rename published/{ => 202101}/20210120 Why keeping a journal improves productivity.md (100%) rename published/{ => 202101}/20210122 How to implement a DevOps toolchain.md (100%) diff --git a/published/20160302 Go channels are bad and you should feel bad.md b/published/202101/20160302 Go channels are bad and you should feel bad.md similarity index 100% rename from published/20160302 Go channels are bad and you should feel bad.md rename to published/202101/20160302 Go channels are bad and you should feel bad.md diff --git a/published/20181009 GCC- Optimizing Linux, the Internet, and Everything.md b/published/202101/20181009 GCC- Optimizing Linux, the Internet, and Everything.md similarity index 100% rename from published/20181009 GCC- Optimizing Linux, the Internet, and Everything.md rename to published/202101/20181009 GCC- Optimizing Linux, the Internet, and Everything.md diff --git a/published/20181123 Three SSH GUI Tools for Linux.md b/published/202101/20181123 Three SSH GUI Tools for Linux.md similarity index 100% rename from published/20181123 Three SSH GUI Tools for Linux.md rename to published/202101/20181123 Three SSH GUI Tools for Linux.md diff --git a/published/20190104 Search, Study And Practice Linux Commands On The Fly.md b/published/202101/20190104 Search, Study And Practice Linux Commands On The Fly.md similarity index 100% rename from published/20190104 Search, Study And Practice Linux Commands On The Fly.md rename to published/202101/20190104 Search, Study And Practice Linux Commands On The Fly.md diff --git a/published/20190204 Getting started with Git- Terminology 101.md b/published/202101/20190204 Getting started with Git- Terminology 101.md similarity index 100% rename from published/20190204 Getting started with Git- Terminology 101.md rename to published/202101/20190204 Getting started with Git- Terminology 101.md diff --git a/published/20190205 5 Streaming Audio Players for Linux.md b/published/202101/20190205 5 Streaming Audio Players for Linux.md similarity index 100% rename from published/20190205 5 Streaming Audio Players for Linux.md rename to published/202101/20190205 5 Streaming Audio Players for Linux.md diff --git a/published/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md b/published/202101/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md similarity index 100% rename from published/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md rename to published/202101/20190205 Install Apache, MySQL, PHP (LAMP) Stack On Ubuntu 18.04 LTS.md diff --git a/published/20190215 Make websites more readable with a shell script.md b/published/202101/20190215 Make websites more readable with a shell script.md similarity index 100% rename from published/20190215 Make websites more readable with a shell script.md rename to published/202101/20190215 Make websites more readable with a shell script.md diff --git a/published/20190220 Do Linux distributions still matter with containers.md b/published/202101/20190220 Do Linux distributions still matter with containers.md similarity index 100% rename from published/20190220 Do Linux distributions still matter with containers.md rename to published/202101/20190220 Do Linux distributions still matter with containers.md diff --git a/published/20190322 Printing from the Linux command line.md b/published/202101/20190322 Printing from the Linux command line.md similarity index 100% rename from published/20190322 Printing from the Linux command line.md rename to published/202101/20190322 Printing from the Linux command line.md diff --git a/published/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md b/published/202101/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md similarity index 100% rename from published/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md rename to published/202101/20190516 Monitor and Manage Docker Containers with Portainer.io (GUI tool) - Part-2.md diff --git a/published/20190924 Integrate online documents editors, into a Python web app using ONLYOFFICE.md b/published/202101/20190924 Integrate online documents editors, into a Python web app using ONLYOFFICE.md similarity index 100% rename from published/20190924 Integrate online documents editors, into a Python web app using ONLYOFFICE.md rename to published/202101/20190924 Integrate online documents editors, into a Python web app using ONLYOFFICE.md diff --git a/published/20191010 The biggest risk to uptime- Your staff.md b/published/202101/20191010 The biggest risk to uptime- Your staff.md similarity index 100% rename from published/20191010 The biggest risk to uptime- Your staff.md rename to published/202101/20191010 The biggest risk to uptime- Your staff.md diff --git a/published/20191224 Top articles for learning Python in 2020.md b/published/202101/20191224 Top articles for learning Python in 2020.md similarity index 100% rename from published/20191224 Top articles for learning Python in 2020.md rename to published/202101/20191224 Top articles for learning Python in 2020.md diff --git a/published/20191225 Making trade-offs when writing Python code.md b/published/202101/20191225 Making trade-offs when writing Python code.md similarity index 100% rename from published/20191225 Making trade-offs when writing Python code.md rename to published/202101/20191225 Making trade-offs when writing Python code.md diff --git a/published/20191226 How the Zen of Python handles errors.md b/published/202101/20191226 How the Zen of Python handles errors.md similarity index 100% rename from published/20191226 How the Zen of Python handles errors.md rename to published/202101/20191226 How the Zen of Python handles errors.md diff --git a/published/20200323 5 Python scripts for automating basic community management tasks.md b/published/202101/20200323 5 Python scripts for automating basic community management tasks.md similarity index 100% rename from published/20200323 5 Python scripts for automating basic community management tasks.md rename to published/202101/20200323 5 Python scripts for automating basic community management tasks.md diff --git a/published/20200522 A beginner-s guide to web scraping with Python.md b/published/202101/20200522 A beginner-s guide to web scraping with Python.md similarity index 100% rename from published/20200522 A beginner-s guide to web scraping with Python.md rename to published/202101/20200522 A beginner-s guide to web scraping with Python.md diff --git a/published/20200629 A minimalist Mac terminal for Linux fans.md b/published/202101/20200629 A minimalist Mac terminal for Linux fans.md similarity index 100% rename from published/20200629 A minimalist Mac terminal for Linux fans.md rename to published/202101/20200629 A minimalist Mac terminal for Linux fans.md diff --git a/published/20200827 How to Check Dependencies of a Package in Ubuntu-Debian-based Linux Distributions.md b/published/202101/20200827 How to Check Dependencies of a Package in Ubuntu-Debian-based Linux Distributions.md similarity index 100% rename from published/20200827 How to Check Dependencies of a Package in Ubuntu-Debian-based Linux Distributions.md rename to published/202101/20200827 How to Check Dependencies of a Package in Ubuntu-Debian-based Linux Distributions.md diff --git a/published/20201001 Level up your shell history with Loki and fzf.md b/published/202101/20201001 Level up your shell history with Loki and fzf.md similarity index 100% rename from published/20201001 Level up your shell history with Loki and fzf.md rename to published/202101/20201001 Level up your shell history with Loki and fzf.md diff --git a/published/20201015 Learn Python by creating a video game.md b/published/202101/20201015 Learn Python by creating a video game.md similarity index 100% rename from published/20201015 Learn Python by creating a video game.md rename to published/202101/20201015 Learn Python by creating a video game.md diff --git a/published/20201216 How to use Kubernetes resource quotas.md b/published/202101/20201216 How to use Kubernetes resource quotas.md similarity index 100% rename from published/20201216 How to use Kubernetes resource quotas.md rename to published/202101/20201216 How to use Kubernetes resource quotas.md diff --git a/published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md b/published/202101/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md similarity index 100% rename from published/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md rename to published/202101/20201216 Understanding 52-bit virtual address support in the Arm64 kernel.md diff --git a/published/20201219 6 ways this fullscreen text editor improves focus.md b/published/202101/20201219 6 ways this fullscreen text editor improves focus.md similarity index 100% rename from published/20201219 6 ways this fullscreen text editor improves focus.md rename to published/202101/20201219 6 ways this fullscreen text editor improves focus.md diff --git a/published/20201222 Learn Rust by writing a simple game.md b/published/202101/20201222 Learn Rust by writing a simple game.md similarity index 100% rename from published/20201222 Learn Rust by writing a simple game.md rename to published/202101/20201222 Learn Rust by writing a simple game.md diff --git a/published/20201222 Learn to use the Sed text editor.md b/published/202101/20201222 Learn to use the Sed text editor.md similarity index 100% rename from published/20201222 Learn to use the Sed text editor.md rename to published/202101/20201222 Learn to use the Sed text editor.md diff --git a/published/20201224 5 reasons to use the Atom text editor.md b/published/202101/20201224 5 reasons to use the Atom text editor.md similarity index 100% rename from published/20201224 5 reasons to use the Atom text editor.md rename to published/202101/20201224 5 reasons to use the Atom text editor.md diff --git a/published/20201225 How to use heredoc as a text editor.md b/published/202101/20201225 How to use heredoc as a text editor.md similarity index 100% rename from published/20201225 How to use heredoc as a text editor.md rename to published/202101/20201225 How to use heredoc as a text editor.md diff --git a/published/20201226 Try GNU nano, a lightweight alternative to Vim.md b/published/202101/20201226 Try GNU nano, a lightweight alternative to Vim.md similarity index 100% rename from published/20201226 Try GNU nano, a lightweight alternative to Vim.md rename to published/202101/20201226 Try GNU nano, a lightweight alternative to Vim.md diff --git a/published/20201228 Learn Python by coding a simple game.md b/published/202101/20201228 Learn Python by coding a simple game.md similarity index 100% rename from published/20201228 Learn Python by coding a simple game.md rename to published/202101/20201228 Learn Python by coding a simple game.md diff --git a/published/20201228 Learn to use the JOE text editor on Linux.md b/published/202101/20201228 Learn to use the JOE text editor on Linux.md similarity index 100% rename from published/20201228 Learn to use the JOE text editor on Linux.md rename to published/202101/20201228 Learn to use the JOE text editor on Linux.md diff --git a/published/20201228 Practice programming in C-- by writing a simple game.md b/published/202101/20201228 Practice programming in C-- by writing a simple game.md similarity index 100% rename from published/20201228 Practice programming in C-- by writing a simple game.md rename to published/202101/20201228 Practice programming in C-- by writing a simple game.md diff --git a/published/20201229 Bring an old MacBook back to life with Linux.md b/published/202101/20201229 Bring an old MacBook back to life with Linux.md similarity index 100% rename from published/20201229 Bring an old MacBook back to life with Linux.md rename to published/202101/20201229 Bring an old MacBook back to life with Linux.md diff --git a/published/20201229 Show progress in your Python apps with tqdm.md b/published/202101/20201229 Show progress in your Python apps with tqdm.md similarity index 100% rename from published/20201229 Show progress in your Python apps with tqdm.md rename to published/202101/20201229 Show progress in your Python apps with tqdm.md diff --git a/published/20201230 Choose between Btrfs and LVM-ext4.md b/published/202101/20201230 Choose between Btrfs and LVM-ext4.md similarity index 100% rename from published/20201230 Choose between Btrfs and LVM-ext4.md rename to published/202101/20201230 Choose between Btrfs and LVM-ext4.md diff --git a/published/20201230 Learn Lua by writing a -guess the number- game.md b/published/202101/20201230 Learn Lua by writing a -guess the number- game.md similarity index 100% rename from published/20201230 Learn Lua by writing a -guess the number- game.md rename to published/202101/20201230 Learn Lua by writing a -guess the number- game.md diff --git a/published/20201230 Use the Markdown Editor app in Nextcloud.md b/published/202101/20201230 Use the Markdown Editor app in Nextcloud.md similarity index 100% rename from published/20201230 Use the Markdown Editor app in Nextcloud.md rename to published/202101/20201230 Use the Markdown Editor app in Nextcloud.md diff --git a/published/20201231 10 things to love about Git.md b/published/202101/20201231 10 things to love about Git.md similarity index 100% rename from published/20201231 10 things to love about Git.md rename to published/202101/20201231 10 things to love about Git.md diff --git a/published/20201231 Build your own text editor in Java.md b/published/202101/20201231 Build your own text editor in Java.md similarity index 100% rename from published/20201231 Build your own text editor in Java.md rename to published/202101/20201231 Build your own text editor in Java.md diff --git a/published/20210101 Resize images using Python.md b/published/202101/20210101 Resize images using Python.md similarity index 100% rename from published/20210101 Resize images using Python.md rename to published/202101/20210101 Resize images using Python.md diff --git a/published/20210105 4 lines of code to improve your Ansible play.md b/published/202101/20210105 4 lines of code to improve your Ansible play.md similarity index 100% rename from published/20210105 4 lines of code to improve your Ansible play.md rename to published/202101/20210105 4 lines of code to improve your Ansible play.md diff --git a/published/20210106 Learn C by writing a simple game.md b/published/202101/20210106 Learn C by writing a simple game.md similarity index 100% rename from published/20210106 Learn C by writing a simple game.md rename to published/202101/20210106 Learn C by writing a simple game.md diff --git a/published/20210106 My 3 favorite open source productivity apps.md b/published/202101/20210106 My 3 favorite open source productivity apps.md similarity index 100% rename from published/20210106 My 3 favorite open source productivity apps.md rename to published/202101/20210106 My 3 favorite open source productivity apps.md diff --git a/published/20210107 8 open source software cheat sheets you-ll need in 2021.md b/published/202101/20210107 8 open source software cheat sheets you-ll need in 2021.md similarity index 100% rename from published/20210107 8 open source software cheat sheets you-ll need in 2021.md rename to published/202101/20210107 8 open source software cheat sheets you-ll need in 2021.md diff --git a/published/20210108 Why I like the FED text editor.md b/published/202101/20210108 Why I like the FED text editor.md similarity index 100% rename from published/20210108 Why I like the FED text editor.md rename to published/202101/20210108 Why I like the FED text editor.md diff --git a/published/20210109 Homura- A WINE-based Game Launcher for BSD.md b/published/202101/20210109 Homura- A WINE-based Game Launcher for BSD.md similarity index 100% rename from published/20210109 Homura- A WINE-based Game Launcher for BSD.md rename to published/202101/20210109 Homura- A WINE-based Game Launcher for BSD.md diff --git a/published/20210111 Deploy Ceph in a Raspberry Pi cluster.md b/published/202101/20210111 Deploy Ceph in a Raspberry Pi cluster.md similarity index 100% rename from published/20210111 Deploy Ceph in a Raspberry Pi cluster.md rename to published/202101/20210111 Deploy Ceph in a Raspberry Pi cluster.md diff --git a/published/20210111 Improve your productivity with this lightweight Linux desktop.md b/published/202101/20210111 Improve your productivity with this lightweight Linux desktop.md similarity index 100% rename from published/20210111 Improve your productivity with this lightweight Linux desktop.md rename to published/202101/20210111 Improve your productivity with this lightweight Linux desktop.md diff --git a/published/20210112 3 email rules to live by in 2021.md b/published/202101/20210112 3 email rules to live by in 2021.md similarity index 100% rename from published/20210112 3 email rules to live by in 2021.md rename to published/202101/20210112 3 email rules to live by in 2021.md diff --git a/published/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md b/published/202101/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md similarity index 100% rename from published/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md rename to published/202101/20210112 Super Productivity- A Super Cool Open Source To-Do List App with GitHub Integration.md diff --git a/published/20210113 How to get Battery status notification when a battery is full or low.md b/published/202101/20210113 How to get Battery status notification when a battery is full or low.md similarity index 100% rename from published/20210113 How to get Battery status notification when a battery is full or low.md rename to published/202101/20210113 How to get Battery status notification when a battery is full or low.md diff --git a/published/20210115 3 plain text note-taking tools.md b/published/202101/20210115 3 plain text note-taking tools.md similarity index 100% rename from published/20210115 3 plain text note-taking tools.md rename to published/202101/20210115 3 plain text note-taking tools.md diff --git a/published/20210116 How to use KDE-s productivity suite, Kontact.md b/published/202101/20210116 How to use KDE-s productivity suite, Kontact.md similarity index 100% rename from published/20210116 How to use KDE-s productivity suite, Kontact.md rename to published/202101/20210116 How to use KDE-s productivity suite, Kontact.md diff --git a/published/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md b/published/202101/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md similarity index 100% rename from published/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md rename to published/202101/20210119 Haruna Video Player- An Open-Source Qt-based MPV GUI Front-end for Linux.md diff --git a/published/20210119 Organize your task list using labels.md b/published/202101/20210119 Organize your task list using labels.md similarity index 100% rename from published/20210119 Organize your task list using labels.md rename to published/202101/20210119 Organize your task list using labels.md diff --git a/published/20210120 Why keeping a journal improves productivity.md b/published/202101/20210120 Why keeping a journal improves productivity.md similarity index 100% rename from published/20210120 Why keeping a journal improves productivity.md rename to published/202101/20210120 Why keeping a journal improves productivity.md diff --git a/published/20210122 How to implement a DevOps toolchain.md b/published/202101/20210122 How to implement a DevOps toolchain.md similarity index 100% rename from published/20210122 How to implement a DevOps toolchain.md rename to published/202101/20210122 How to implement a DevOps toolchain.md From 0313cbe4cfd43587525b570f06c6f7fea8d53ccc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 1 Feb 2021 10:37:05 +0800 Subject: [PATCH 070/213] PRF @geekpi --- ... tips for automating your email filters.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210122 3 tips for automating your email filters.md b/translated/tech/20210122 3 tips for automating your email filters.md index cbd6589161..55d112b114 100644 --- a/translated/tech/20210122 3 tips for automating your email filters.md +++ b/translated/tech/20210122 3 tips for automating your email filters.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (3 tips for automating your email filters) @@ -9,34 +9,34 @@ 3 个自动化电子邮件过滤器的技巧 ====== -通过这些简单的建议,减少你的电子邮件并让你的生活更轻松。 -![gears and lightbulb to represent innovation][1] + +> 通过这些简单的建议,减少你的电子邮件并让你的生活更轻松。 + +![](https://img.linux.net.cn/data/attachment/album/202102/01/103638ozdejmy6eycm6omx.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十二天。 -如果有一件事是我喜欢的,那就是自动化。只要有机会,我就会把小任务自动化掉。早起打开鸡舍的门?我买了一扇门,可以在日出和日落时开门和关门。每天从早到晚实时监控鸡群?用 Node-RED 和 [OBS-Websockets][2] 稍微花点时间,就能搞定。 +如果有一件事是我喜欢的,那就是自动化。只要有机会,我就会把小任务进行自动化。早起打开鸡舍的门?我买了一扇门,可以在日出和日落时开门和关门。每天从早到晚实时监控鸡群?用 Node-RED 和 [OBS-Websockets][2] 稍微花点时间,就能搞定。 我们还有电子邮件。几天前,我写过关于处理邮件的文章,也写过关于标签和文件夹的文章。只要做一点前期的工作,你就可以在邮件进来的时候,你就可以自动摆脱掉大量管理邮件的开销。 ![Author has 480 filters][3] -是的,我有很多过滤器。(Kevin Sonney, [CC BY-SA 4.0][4]) +*是的,我有很多过滤器。(Kevin Sonney, [CC BY-SA 4.0][4])* -有两种主要方式来过滤你的电子邮件:在服务端或者客户端上。我更喜欢在服务端上做,因为我不断地在尝试新的和不同的电子邮件客户端。(不,真的,我光这个星期就已经使用了五个不同的客户端。我可能有问题。) - -无论哪种方式,我都喜欢用电子邮件规则做几件事,以使我的电子邮件更容易浏览,并保持我的收件箱不混乱。 - - 1. 将不紧急的邮件移到”稍后阅读“文件夹中。对我而言,这包括来自社交网络、新闻简报和邮件列表的通知。 - 2. 按列表或主题给消息贴上标签。我属于几个组织,虽然它们经常会被放在”稍后阅读“文件夹中,但我会添加第二个或第三个标签,以说明该源或项目的内容,以帮助搜索时找到相关的东西。 - 3. 不要把规则搞得太复杂。这个想法让我有一段困难的时间。我想把邮件发送到某个文件夹的所有可能情况都加到一个规则里。如果有什么问题或需要添加或删除的东西,有一个大规则只是让它更难修复。 +有两种主要方式来过滤你的电子邮件:在服务端或者客户端上。我更喜欢在服务端上做,因为我不断地在尝试新的和不同的电子邮件客户端。(不,真的,我光这个星期就已经使用了五个不同的客户端。我可能有问题。) +无论哪种方式,我都喜欢用电子邮件过滤规则做几件事,以使我的电子邮件更容易浏览,并保持我的收件箱不混乱。 + 1. 将不紧急的邮件移到“稍后阅读”文件夹中。对我而言,这包括来自社交网络、新闻简报和邮件列表的通知。 + 2. 按列表或主题给消息贴上标签。我属于几个组织,虽然它们经常会被放在“稍后阅读”文件夹中,但我会添加第二个或第三个标签,以说明该来源或项目的内容,以帮助搜索时找到相关的东西。 + 3. 不要把规则搞得太复杂。这个想法让我困难了一段时间。我想把邮件发送到某个文件夹的所有可能情况都加到一个规则里。如果有什么问题或需要添加或删除的东西,有一个大规则只是让它更难修复。 ![Unsubscribe from email][5] -点击它,点击它就行!(Kevin Sonney, [CC BY-SA 4.0][4]) +*点击它,点击它就行!(Kevin Sonney, [CC BY-SA 4.0][4])* -说了这么多,还有一件事我一直在做,它有助于减少我花在电子邮件上的时间:退订邮件。两年前我感兴趣的那个邮件列表已经不感兴趣了,所以就不订阅了。产品更新通讯是我去年停止使用的商品?退订!这一直在积极解放。我每年都会试着评估几次列表中的邮件信息是否(仍然)有用。 +说了这么多,还有一件事我一直在做,它有助于减少我花在电子邮件上的时间:退订邮件。两年前我感兴趣的那个邮件列表已经不感兴趣了,所以就不订阅了。产品更新通讯是我去年停止使用的商品?退订!这一直在积极解放我。我每年都会试着评估几次列表中的邮件信息是否(仍然)有用。 过滤器和规则可以是非常强大的工具,让你的电子邮件保持集中,减少花在它们身上的时间。而点击取消订阅按钮是一种解放。试试就知道了! @@ -47,7 +47,7 @@ via: https://opensource.com/article/21/1/email-filter 作者:[Kevin Sonney][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 d8758270162aa1385b94b2c4ab02e5151809b0f3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 1 Feb 2021 10:37:42 +0800 Subject: [PATCH 071/213] PUB @geekpi https://linux.cn/article-13073-1.html --- .../20210122 3 tips for automating your email filters.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210122 3 tips for automating your email filters.md (98%) diff --git a/translated/tech/20210122 3 tips for automating your email filters.md b/published/20210122 3 tips for automating your email filters.md similarity index 98% rename from translated/tech/20210122 3 tips for automating your email filters.md rename to published/20210122 3 tips for automating your email filters.md index 55d112b114..f3644bb0e5 100644 --- a/translated/tech/20210122 3 tips for automating your email filters.md +++ b/published/20210122 3 tips for automating your email filters.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13073-1.html) [#]: subject: (3 tips for automating your email filters) [#]: via: (https://opensource.com/article/21/1/email-filter) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 7d521485c4e2b6c163989a2434a095509eb4bcf6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 1 Feb 2021 11:26:52 +0800 Subject: [PATCH 072/213] PRF @wxy --- ...ies using this full-featured Linux tool.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md b/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md index 1f728df0be..5ce3f5daaa 100644 --- a/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md +++ b/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Explore binaries using this full-featured Linux tool) @@ -12,13 +12,13 @@ > Radare2 是一个为二进制分析定制的开源工具。 -![电脑屏幕上的二进制代码][1] +![](https://img.linux.net.cn/data/attachment/album/202102/01/112611baw4gpqlch10ps1c.jpg) -在《[Linux 上分析二进制文件的 10 种方法][2]》中,我解释了如何使用 Linux 上丰富的原生工具集来分析二进制文件。但如果你想进一步探索你的二进制文件,你需要一个为二进制分析定制的工具。如果你是二进制分析的新手,并且大多使用的是脚本语言,《[GNU binutils 里的九种武器][3]》将帮助你开始学习编译过程和什么是二进制。 +在《[Linux 上分析二进制文件的 10 种方法][2]》中,我解释了如何使用 Linux 上丰富的原生工具集来分析二进制文件。但如果你想进一步探索你的二进制文件,你需要一个为二进制分析定制的工具。如果你是二进制分析的新手,并且大多使用的是脚本语言,这篇文章《[GNU binutils 里的九种武器][3]》可以帮助你开始学习编译过程和什么是二进制。 ### 为什么我需要另一个工具? -如果现有的 Linux 原生工具也能做类似的事情,那么自然会问为什么你需要另一个工具。嗯,这和你用手机做闹钟、做笔记、做相机、听音乐、上网、偶尔打电话和接电话的原因是一样的。以前,使用单独的设备和工具处理这些功能 —— 比如拍照的实体相机,记笔记的小记事本,起床的床头闹钟等等。对用户来说,有一个设备来做多件(但相关的)事情是*方便的*。另外,杀手锏就是独立功能之间的*互操作性*。 +如果现有的 Linux 原生工具也能做类似的事情,你自然会问为什么需要另一个工具。嗯,这和你用手机做闹钟、做笔记、做相机、听音乐、上网、偶尔打电话和接电话的原因是一样的。以前,使用单独的设备和工具处理这些功能 —— 比如拍照的实体相机,记笔记的小记事本,起床的床头闹钟等等。对用户来说,有一个设备来做多件(但相关的)事情是*方便的*。另外,杀手锏就是独立功能之间的*互操作性*。 同样,即使许多 Linux 工具都有特定的用途,但在一个工具中捆绑类似(和更好)的功能是非常有用的。这就是为什么我认为 [Radare2][4] 应该是你需要处理二进制文件时的首选工具。 @@ -26,11 +26,11 @@ ### 为什么选择 Radare2? -有大量(非原生的)Linux 工具可用于二进制分析,为什么你要选择 Radare2?我的理由很简单。 +有大量(非原生的)Linux 工具可用于二进制分析,为什么要选择 Radare2 呢?我的理由很简单。 -首先,它是一个开源项目,有一个活跃而健康的社区。如果你正在寻找新颖的功能或有着 bug 修复的工具,这很重要。 +首先,它是一个开源项目,有一个活跃而健康的社区。如果你正在寻找新颖的功能或提供着 bug 修复的工具,这很重要。 -其次,Radare2 可以在命令行上使用,而且它有一个功能丰富的图形用户界面(GUI)环境,叫做 Cutter,适合那些对 GUI 比较熟悉的人。作为一个长期使用 Linux 的用户,我对在 shell 上输入感到更舒服。虽然熟悉 Radare2 的命令稍微有一点学习曲线,但我会把它比作 [学习 Vim][6]。你先学习基本的东西,一旦你掌握了它们,你就可以继续学习更高级的东西。很快,它就变成了肌肉记忆。 +其次,Radare2 可以在命令行上使用,而且它有一个功能丰富的图形用户界面(GUI)环境,叫做 Cutter,适合那些对 GUI 比较熟悉的人。作为一个长期使用 Linux 的用户,我对习惯于在 shell 上输入。虽然熟悉 Radare2 的命令稍微有一点学习曲线,但我会把它比作 [学习 Vim][6]。你可以先学习基本的东西,一旦你掌握了它们,你就可以继续学习更高级的东西。很快,它就变成了肌肉记忆。 第三,Radare2 通过插件可以很好的支持外部工具。例如,最近开源的 [Ghidra][7] 二进制分析和逆向工具reversing tool很受欢迎,因为它的反编译器功能是逆向软件的关键要素。你可以直接从 Radare2 控制台安装 Ghidra 反编译器并使用,这很神奇,让你两全其美。 @@ -76,9 +76,6 @@ int main() { ``` $ gcc adder.c -o adder -``` - -``` $ file adder adder: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=9d4366f7160e1ffb46b14466e8e0d70f10de2240, not stripped $ ./adder @@ -87,7 +84,7 @@ Number now is : 101 #### 加载二进制文件 -要分析二进制文件,你必须在 Radare2 中加载它。通过提供文件作为 `r2` 命令的一个命令行参数来加载它。你会进入一个独立的 Radare2 控制台,与你的 shell 不同。要退出控制台,你可以输入 `Quit` 或 `Exit` 或按 `Ctrl+D`: +要分析二进制文件,你必须在 Radare2 中加载它。通过提供文件名作为 `r2` 命令的一个命令行参数来加载它。你会进入一个独立的 Radare2 控制台,这与你的 shell 不同。要退出控制台,你可以输入 `Quit` 或 `Exit` 或按 `Ctrl+D`: ``` $ r2 ./adder @@ -133,7 +130,7 @@ $ r2 -A ./adder #### 获取一些关于二进制的基本信息 -在开始分析一个二进制文件之前,你需要一些背景信息。在许多情况下,这可以是二进制文件的格式(ELF、PE 等),二进制的架构(x86、AMD、ARM 等),以及二进制是 32 位还是 64 位。方便的 `r2` 的 `iI` 命令可以提供所需的信息: +在开始分析一个二进制文件之前,你需要一些背景信息。在许多情况下,这可以是二进制文件的格式(ELF、PE 等)、二进制的架构(x86、AMD、ARM 等),以及二进制是 32 位还是 64 位。方便的 `r2` 的 `iI` 命令可以提供所需的信息: ``` [0x004004b0]> iI @@ -175,7 +172,7 @@ va true ### 导入和导出 -通常情况下,当你知道你要处理的是什么样的文件后,你就想知道二进制程序使用了什么样的标准库函数,或者了解程序的潜在功能。在本教程中的示例 C 程序中,唯一的库函数是 `printf` 来打印信息。你可以通过运行 `ii` 命令看到这一点,它显示了二进制的所有导入的库: +通常情况下,当你知道你要处理的是什么样的文件后,你就想知道二进制程序使用了什么样的标准库函数,或者了解程序的潜在功能。在本教程中的示例 C 程序中,唯一的库函数是 `printf`,用来打印信息。你可以通过运行 `ii` 命令看到这一点,它显示了该二进制所有导入的库: ``` [0x004004b0]> ii @@ -189,7 +186,7 @@ nth vaddr bind type lib name 5 0x00000000 WEAK NOTYPE _ITM_registerTMCloneTable ``` -二进制也可以有自己的符号、函数或数据。这些函数通常显示在 `Exports` 下。这个测试的二进制导出了两个函数:`main` 和 `adder`。其余的函数是在编译阶段,当二进制文件被构建时添加的。加载器需要这些函数来加载二进制文件(现在不用太关心它们): +该二进制也可以有自己的符号、函数或数据。这些函数通常显示在 `Exports` 下。这个测试的二进制导出了两个函数:`main` 和 `adder`。其余的函数是在编译阶段,当二进制文件被构建时添加的。加载器需要这些函数来加载二进制文件(现在不用太关心它们): ``` [0x004004b0]> @@ -359,7 +356,6 @@ entry0 0x4004d1 [DATA] mov rdi, main 这是 `adder` 函数的反汇编结果: - ``` [0x004005a5]> s sym.adder [0x00400596]> @@ -622,7 +618,7 @@ via: https://opensource.com/article/21/1/linux-radare2 作者:[Gaurav Kamathe][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 051f0104a9d0cc2aff0690cc18fda2470cb3d6ba Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 1 Feb 2021 11:27:20 +0800 Subject: [PATCH 073/213] PUB @wxy https://linux.cn/article-13074-1.html --- ...25 Explore binaries using this full-featured Linux tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210125 Explore binaries using this full-featured Linux tool.md (99%) diff --git a/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md b/published/20210125 Explore binaries using this full-featured Linux tool.md similarity index 99% rename from translated/tech/20210125 Explore binaries using this full-featured Linux tool.md rename to published/20210125 Explore binaries using this full-featured Linux tool.md index 5ce3f5daaa..ffa4c8554b 100644 --- a/translated/tech/20210125 Explore binaries using this full-featured Linux tool.md +++ b/published/20210125 Explore binaries using this full-featured Linux tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13074-1.html) [#]: subject: (Explore binaries using this full-featured Linux tool) [#]: via: (https://opensource.com/article/21/1/linux-radare2) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) From 9cba753d43ee9aceb54f0f5d33598ebc2560f8c5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 2 Feb 2021 05:04:15 +0800 Subject: [PATCH 074/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210202=20?= =?UTF-8?q?Filmulator=20is=20a=20Simple,=20Open=20Source,=20Raw=20Image=20?= =?UTF-8?q?Editor=20for=20Linux=20Desktop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md --- ...rce, Raw Image Editor for Linux Desktop.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md diff --git a/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md new file mode 100644 index 0000000000..7bf58a094b --- /dev/null +++ b/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) +[#]: via: (https://itsfoss.com/filmulator/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop +====== + +_**Brief: Filmulator is an open source raw photo editing application with library management focusing on simplicity, ease of use and streamlined workflow.**_ + +### Filmulator: Raw Image Editor for Linux (and Windows) + +There are a [bunch of raw photo editors for Linux][1]. [Filmulator][2] is one of them. Filmulator aims to make raw image editing simple by giving only the essential elements. It also adds the feature of library handling which is a plus if you are looking for a decent application for your camera images. + +For those unaware, [raw image file][3] is a minimally processed, uncompressed file. In other words, it is untouched digital file with no compression and minimal processing applied to it. Professional photographers prefer to capture photos in raw file and process it themselves. Normal people take photos from their smartphones and it is usually compressed in JPEG format or filtered. + +Let’s see what features you get in the Filmulator editor. + +### Features of Filmulator + +![Filmulator interface][4] + +Filmulator claims that it is not the typical “film effect filter” that merely copies the outward characteristics of film. Instead, Filmulator gets to the root of what makes film so appealing: the development process. + +It simulates film development process: from “exposure” of film, to the growth of “silver crystals” within each pixel, to the diffusion of “developer” both between neighboring pixels and with the bulk developer in the tank. + +Fimulator developer says that the simulation brings about the following benefits: + + * Large bright regions become darker, compressing the output dynamic range. + * Small bright regions make their surroundings darker, enhancing local contrast. + * In bright regions, saturation is enhanced, helping retain color in blue skies, brighter skin tones, and sunsets. + * In extremely saturated regions, the brightness is attenuated, helping retain detail e.g. in flowers. + + + +Here’s a comparison of a raw image processed by Filmulator to enhance colors in a natural manner without inducing color clipping. + +![][5] + +### Installing Filmulator on Ubuntu/Linux + +There is an AppImage available for Filmulator so that you can use it easily on Linux. [Using AppImage files][6] is really simple. You download it, make it executable and make it run by double-clicking on it. + +[Download Filmulator for Linux][7] + +There is also a Windows version available for Windows users. Apart from that, you can always head over to [its GitHub repository][8] and peek into its source code. + +There is a [little documentation][9] to help you get started with Fimulator. + +### Conclusion + +Fimulator’s design ideology is to have the best tool for any job, and only that one tool. This means compromising flexibility, but gaining a greatly simplified and streamlined user interface. + +I am not even an amateur photographer, let alone be a professional one. I do not own a DSLR or other high-end photography equipments. For this reason, I cannot test and share my experience on the usefulness of Filmulator. + +If you have more experience dealing with raw images, I let you try Filmulator and share your opinion on it. There is an AppImage available so you can quickly test it and see if it fits your needs or not. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/filmulator/ + +作者:[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/raw-image-tools-linux/ +[2]: https://filmulator.org/ +[3]: https://www.findingtheuniverse.com/what-is-raw-in-photography/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/Filmulate.jpg?resize=799%2C463&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/image-without-filmulator.jpeg?ssl=1 +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://filmulator.org/download/ +[8]: https://github.com/CarVac/filmulator-gui +[9]: https://github.com/CarVac/filmulator-gui/wiki From 20c467e6ec13edda22283c29cf96cca3c042b492 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 2 Feb 2021 05:04:53 +0800 Subject: [PATCH 075/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210201=20?= =?UTF-8?q?My=20handy=20guide=20to=20software=20development=20and=20testin?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210201 My handy guide to software development and testing.md --- ...ide to software development and testing.md | 229 ++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 sources/tech/20210201 My handy guide to software development and testing.md diff --git a/sources/tech/20210201 My handy guide to software development and testing.md b/sources/tech/20210201 My handy guide to software development and testing.md new file mode 100644 index 0000000000..2ac51f55f3 --- /dev/null +++ b/sources/tech/20210201 My handy guide to software development and testing.md @@ -0,0 +1,229 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My handy guide to software development and testing) +[#]: via: (https://opensource.com/article/21/2/development-guide) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +My handy guide to software development and testing +====== +Programming can feel like a battle against a horde of zombies at times. +In this series, learn how to put this ZOMBIES acronym to work for you. +![Gears above purple clouds][1] + +A long time ago, when I was but a budding computer programmer, we used to work in large batches. We were each assigned a programming task, and then we'd go away and hide in our cubicles and bang on the keyboard. I remember my team members spending hours upon hours in isolation, each of us in our own cubicle, wrestling with challenges to create defect-free apps. The theory was, the larger the batch, the better the evidence that we're awesome problem solvers. + +For me, it was a badge of honor to see how long I could write new code or modify existing code before stopping to check to see whether what I did worked. Back then, many of us thought stopping to verify that our code worked was a sign of weakness, a sign of a rookie programmer. A "real developer" should be able to crank out the entire app without stopping to check anything! + +When I did stop to test my code, however unwillingly, I usually got a reality check. Either my code wouldn't compile, or it wouldn't build, or it wouldn't run, or it just wouldn't process the data the way I'd intended. Inevitably, I'd scramble in desperation to fix all the pesky problems I'd uncovered. + +### Avoiding the zombie horde + +If the old style of working sounds chaotic, that's because it was. We tackled our tasks all at once, hacking and slashing through problems only to be overwhelmed by more. It was like a battle against a horde of zombies. + +Today, we've learned to avoid large batches. Hearing some experts extolling the virtues of avoiding large batches sounded completely counterintuitive at first, but I've learned a lot from past mistakes. Appropriately, I'm using a system James Grenning () calls **ZOMBIES** to guide my software development efforts. + +### ZOMBIES to the rescue! + +There's nothing mysterious about **ZOMBIES**. It's an acronym that stands for: + +**Z** – Zero +**O** – One +**M** – Many (or more complex) +**B** – Boundary behaviors +**I** – Interface definition +**E** – Exercise exceptional behavior +**S** – Simple scenarios, simple solutions + +I'll break it down for you in this article series. + +### Zero in action! + +**Z**ero stands for the simplest possible case. + +A solution is _simplest_ because everyone initially prefers to use hard-coded values. By starting a coding session with hard-coded values, you quickly create a situation that gives you immediate feedback. Without having to wait several minutes or potentially hours, hard-coded values provide instant feedback on whether you like interacting with what you're building. If you find out you like interacting with it, great! Carry on in that direction. If you discover, for one reason or another, that you don't like interacting with it, there's been no big loss. You can easily dismiss it; you don't even have any losses to cut. + +As an example, build a simple backend shopping API. This service lets users grab a shopping basket, add items to the basket, remove items from the basket, and get the order total from the API. + +Create the necessary infrastructure (segregate the shipping app into an `app` folder and tests into a `tests` folder). This example uses the open source [xUnit][2] testing framework. + +Roll up your sleeves, and see the Zero principle in action! + + +``` +[Fact] +public void NewlyCreatedBasketHas0Items() {     +    var expectedNoOfItems = 0; +    var actualNoOfItems = 1; +    Assert.Equal(expectedNoOfItems, actualNoOfItems); +} +``` + +This test is _faking it_ because it is testing for hard-coded values. When the shopping basket is newly created, it contains no items; therefore, the expected number of items in the basket is 0. This expectation is put to the test (or _asserted_) by comparing expected and actual values for equality. + +When the test runs, it produces the following results: + + +``` +Starting test execution, please wait... + +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.57] tests.UnitTest1.NewlyCreatedBasketHas0Items [FAIL] +  X tests.UnitTest1.NewlyCreatedBasketHas0Items [4ms] +  Error Message: +   Assert.Equal() Failure +Expected: 0 +Actual: 1 +[...] +``` + +The test fails for obvious reasons: you expected the number of items to be 0, but the actual number of items was hard-coded as 1. + +Of course, you can quickly remedy that error by modifying the hard-coded value assigned to the actual variable from 1 to 0: + + +``` +[Fact] +public void NewlyCreatedBasketHas0Items() { +    var expectedNoOfItems = 0; +    var actualNoOfItems = 0; +    Assert.Equal(expectedNoOfItems, actualNoOfItems); +} +``` + +As expected, when this test runs, it passes successfully: + + +``` +Starting test execution, please wait... + +A total of 1 test files matched the specified pattern. + +Test Run Successful. +Total tests: 1 +     Passed: 1 + Total time: 1.0950 Seconds +``` + +You might not think it's worth testing code you're forcing to fail, but no matter how simple a test may be, it is absolutely mandatory to see it fail at least once. That way, you can rest assured that the test will alert you later should some inadvertent change corrupt your processing logic. + +Now's the time to stop faking the Zero case and replace that hard-coded value with a value that will be provided by the running API. Now that you know you have a reliably failing test that expects an empty basket to have 0 items, it's time to write some application code. + +As with any other modeling exercise in software, begin by crafting a simple _interface_. Create a new file in the solution's `app` folder and name it `IShoppingAPI.cs` (by convention, preface every interface name with an upper-case **I**). In the interface, declare the method `NoOfItems()` to return the number of items as an `int`. Here's the listing of the interface: + + +``` +using System; + +namespace app {     +    public interface IShoppingAPI { +        int NoOfItems(); +    } +} +``` + +Of course, this interface is incapable of doing any work until you implement it. Create another file in the `app` folder and name it `ShoppingAPI`. Declare `ShoppingAPI` as a public class that implements `IShoppingAPI`. In the body of the class, define `NoOfItems` to return the integer 1: + + +``` +using System; + +namespace app { +    public class ShoppingAPI : IShoppingAPI { +        public int NoOfItems() { +            return 1; +        } +    } +} +``` + +You can see in the above that you are faking the processing logic again by hard-coding the return value to 1. That's good for now because you want to keep everything super brain-dead simple. Now's not the time (not yet, at least) to start mulling over how you're going to implement this shopping basket. Leave that for later! For now, you're playing with the Zero case, which means you want to see whether you like your current arrangement. + +To ascertain that, replace the hard-coded expected value with the value that will be delivered when your shopping API runs and receives the request. You need to let the tests know where the shipping code is located by declaring that you are using the `app` folder. + +Next, you need to instantiate the `IShoppingAPI` interface: + + +``` +`IShoppingAPI shoppingAPI = new ShoppingAPI();` +``` + +This instance is used to send requests and receive actual values after the code runs. + +Now the listing looks like: + + +``` +using System; +using Xunit; +using app; + +namespace tests { +    public class ShoppingAPITests { +        IShoppingAPI shoppingAPI = [new][3] ShoppingAPI(); +  +        [Fact]         +        public void NewlyCreatedBasketHas0Items() { +            var expectedNoOfItems = 0; +            var actualNoOfItems = shoppingAPI.NoOfItems(); +            Assert.Equal(expectedNoOfItems, actualNoOfItems); +        } +    } +} +``` + +Of course, when this test runs, it fails because you hard-coded an incorrect return value (the test expects 0, but the app returns 1). + +Again, you can easily make the test pass by modifying the hard-coded value from 1 to 0, but that would be a waste of time at this point. Now that you have a proper interface hooked up to your test, the onus is on you to write programming logic that results in expected code behavior. + +For the application code, you need to decide which data structure to use to represent the shopping cart. To keep things bare-bones, strive to identify the simplest representation of a collection in C#. The thing that immediately comes to mind is `ArrayList`. This collection is perfect for these purposes—it can take an indefinite number of items and is easy and simple to traverse. + +In your app code, declare that you're using `System.Collections` because `ArrayList` is part of that package: + + +``` +`using System.Collections;` +``` + +Then declare your `basket`: + + +``` +`ArrayList basket = new ArrayList();` +``` + +Finally, replace the hard-coded value in the `NoOfItems()` with actual running code: + + +``` +public int NoOfItems() { +    return basket.Count; +} +``` + +This time, the test passes because your instantiated basket is empty, so `basket.Count` returns 0 items. + +Which is exactly what your first Zero test expects. + +### More examples + +Your homework is to tackle just one zombie for now, and that's the Zeroeth zombie. In the next article, I'll take a look at **O**ne and **M**any. Stay strong! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/development-guide + +作者:[Alex Bunardzic][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/chaos_engineer_monster_scary_devops_gear_kubernetes.png?itok=GPYLvfVh (Gears above purple clouds) +[2]: https://xunit.net/ +[3]: http://www.google.com/search?q=new+msdn.microsoft.com From bab21d7856a297bed734f01693f5265c05604e51 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 2 Feb 2021 05:05:09 +0800 Subject: [PATCH 076/213] add done: 20210201 My handy guide to software development and testing.md --- .../20210201 Use Mac-style emoji on Linux.md | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 sources/tech/20210201 Use Mac-style emoji on Linux.md diff --git a/sources/tech/20210201 Use Mac-style emoji on Linux.md b/sources/tech/20210201 Use Mac-style emoji on Linux.md new file mode 100644 index 0000000000..81c80366bc --- /dev/null +++ b/sources/tech/20210201 Use Mac-style emoji on Linux.md @@ -0,0 +1,74 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Use Mac-style emoji on Linux) +[#]: via: (https://opensource.com/article/21/2/emoji-linux) +[#]: author: (Matthew Broberg https://opensource.com/users/mbbroberg) + +Use Mac-style emoji on Linux +====== +Splatmoji provides an easy way to spice up your communication with +emoji. +![Emoji keyboard][1] + +Linux provides an amazing desktop experience by default. Although advanced users have the flexibility to choose their own [window manager][2], the day-to-day flow of Gnome is better than ever since the [GNOME 3.36 improvements][3]. As a long-time Mac enthusiast turned Linux user, that's huge. + +There is, however, one shortcut I use every day on a Mac that you won't find by default on Linux. It's a task I do dozens of times a day and an essential part of my digital communication. It's the emoji launcher. + +You might laugh when you see that, but stick with me. + +Most communication includes body language, and experts estimate upwards of 80% of what people remember comes from it. According to Advancement Courses' [History of emoji][4], people have been using "typographical art" since the 1800s. It's indisputable that in 1881, _Puck Magazine_ included four emotional faces for joy, melancholy, indifference, and astonishment. There is some disagreement about whether Abraham Lincoln's use of a winking smiley face, `;)`, in 1862 was a typo or an intentional form of expression. I could speculate further back into hieroglyphics, as this [museum exhibit][5] did. However you look at it, emoji and their ancestorial predecessors have conveyed complex human emotion in writing for a long time. That power is not going away. + +Macs make it trivial to add these odd forms of expression to text with a shortcut to insert emoji into a sentence quickly. Pressing **Cmd**+**Ctrl**+**Space** launches a menu, and a quick click completes the keystroke. + +GNOME does not (yet) have this functionality by default, but there is open source software to add it. + +## My first attempts at emoji on Linux + +So how can you add emoji-shortcut functionality to a Linux window manager? I began with trial and error. I tried about a dozen different tools along the way. I found [Autokey][6], which has been a great way to insert text using shortcuts or keywords (and I still use for that), but the [emoji extension][7] did not render for me (on Fedora or Pop!_OS). I hope one day it does, so I can use colon notation to insert emoji, like `:+1:` to get a 👍️. + +It turns out that the way emoji render and interact with font choices throughout a window manager is nontrivial. Partway through my struggle, I reached out to the GNOME emoji team (yes, there's a [team for emoji][8]!) and got a small taste of its complexity. + +I did, however, find a project that works consistently across multiple Linux distributions. It's called Splatmoji. + +## Splatmoji for inserting emoji + +[Splatmoji][9] lets me consistently insert emoji into my Linux setup exactly like I would on a Mac. Here is what it looks like in action: + +![Splatmoji scroll example][10] + +(Matthew Broberg, [CC BY-SA 4.0][11]) + +It's written in Bash, which is impressive for all that it does. Splatmoji depends on a pretty interesting toolchain outside of Bash to avoid a lot of complexity in its main features. It uses: + + * **[rofi][12]** to provide a smooth window-switcher experience + * [**xdotool**][13] to input the keystrokes into the window + * [**xsel**][14] or [**xclipboard**][15] to copy the selected item + * [**jq**][16], a JSON processor, if JSON escaping is called + + + +Thanks to these dependencies, Splatmoji is a surprisingly straightforward tool that calls these pieces in the right order. + +## Set up Splatmoji + +Splatmoji offers packaged releases for dnf and apt-based systems, but I set it up using the source code to keep up with the latest updates to the project: + + +``` +# Go to whatever directory you want to store the source code. +# I keep everything in a ~/Development folder, and do so here. +# Note that `mkdir -p` will make that folder if you haven't already. +$ mkdir -p ~/Development +$ cd ~/Development +$ git clone +$ cd splatmoji/ +``` + +Install the requirements above using the syntax for your package manager. I usually use [Homebrew][17] and add `/home/linuxbrew/.linuxbrew/bin/` to my path, but I will use `dnf` for this example: + + +``` +`$ sudo dnf install rofi xdoto \ No newline at end of file From 8cee0dbdf43ad19bdc3a74cc532ebdd4731f5acd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 2 Feb 2021 05:05:26 +0800 Subject: [PATCH 077/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210201=20?= =?UTF-8?q?Generate=20QR=20codes=20with=20this=20open=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210201 Generate QR codes with this open source tool.md --- ...ate QR codes with this open source tool.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20210201 Generate QR codes with this open source tool.md diff --git a/sources/tech/20210201 Generate QR codes with this open source tool.md b/sources/tech/20210201 Generate QR codes with this open source tool.md new file mode 100644 index 0000000000..c26b7552bf --- /dev/null +++ b/sources/tech/20210201 Generate QR codes with this open source tool.md @@ -0,0 +1,85 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Generate QR codes with this open source tool) +[#]: via: (https://opensource.com/article/21/2/zint-barcode-generator) +[#]: author: (Don Watkins https://opensource.com/users/don-watkins) + +Generate QR codes with this open source tool +====== +Zint makes it easy to generate more than 50 types of custom barcodes. +![Working from home at a laptop][1] + +QR codes are an excellent way to provide information to people without the trouble and expense of printing it. Most people have smartphones that support QR code scanning, regardless of the operating system. + +There are many reasons you might want to use QR codes. Maybe you're a teacher looking to challenge your students with supplemental material to enhance learning or a restaurant that needs to provide menus while complying with social-distancing guidelines. I often walk on nature trails where trees and other flora are labeled. Supplementing those small labels with QR codes is a great way to provide additional information about the park's exhibits without the expense and maintenance of signage. In these cases and others, QR codes are very useful. + +In searching the internet for an easy, open source way to create QR codes, I discovered [Zint][2]. Zint is an excellent open source (GPLv3.0) solution for generating barcodes. According to the project's [GitHub repository][3], "Zint is a suite of programs to allow easy encoding of data in any of a wide range of public domain barcode standards and to allow integration of this capability into your own programs." + +Zint supports more than 50 types of barcodes, including QR codes (ISO 18004), that you can easily create, then copy and paste into word processing documents, blogs, wikis, and other digital media. People can scan these QR codes with their smartphones to quickly link to information. + +### Install Zint + +Zint is available for Linux, macOS, and Windows. + +You can install the Zint command with Apt on Ubuntu-based Linux distributions: + + +``` +`$ sudo apt install zint` +``` + +I also wanted a graphical user interface (GUI), so I installed Zint-QT: + + +``` +`$ sudo apt install zint-qt` +``` + +Consult the manual's [installation section][4] for macOS and Windows instructions. + +### Generate QR codes with Zint + +Once I installed the application, I launched it and created my first QR code, which is a link to Opensource.com. + +![Generating QR code with Zint][5] + +(Don Watkins, [CC BY-SA 4.0][6]) + +Zint's 50-plus other barcode options include postal codes for many countries, DotCode, EAN, EAN-14, and Universal Product Code (UPC). The [project documentation][2] contains a complete list of all the codes it can render. + +You can copy any barcode as a BMP or SVG or save the output as an image file in any size you need for your application. This is my QR code at 77x77 pixels. + +![QR code][7] + +(Don Watkins, [CC BY-SA 4.0][6]) + +The project maintains an excellent user manual with instructions for using Zint on the [command line][8] and in the [GUI][9]. You can even try Zint [online][10]. For feature requests or bug reports, [visit the site][11] or [send an email][12]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/zint-barcode-generator + +作者:[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]: http://www.zint.org.uk/ +[3]: https://github.com/zint/zint +[4]: http://www.zint.org.uk/Manual.aspx?type=p&page=2 +[5]: https://opensource.com/sites/default/files/uploads/zintqrcode_generation.png (Generating QR code with Zint) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/zintqrcode_77px.png (QR code) +[8]: http://zint.org.uk/Manual.aspx?type=p&page=4 +[9]: http://zint.org.uk/Manual.aspx?type=p&page=3 +[10]: http://www.barcode-generator.org/ +[11]: https://lists.sourceforge.net/lists/listinfo/zint-barcode +[12]: mailto:zint-barcode@lists.sourceforge.net From d4ae4e029a29cb3edd03c62ce0ee476215c327e6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 2 Feb 2021 08:45:57 +0800 Subject: [PATCH 078/213] translated --- ... 3 email mistakes and how to avoid them.md | 81 ------------------- ... 3 email mistakes and how to avoid them.md | 77 ++++++++++++++++++ 2 files changed, 77 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20210127 3 email mistakes and how to avoid them.md create mode 100644 translated/tech/20210127 3 email mistakes and how to avoid them.md diff --git a/sources/tech/20210127 3 email mistakes and how to avoid them.md b/sources/tech/20210127 3 email mistakes and how to avoid them.md deleted file mode 100644 index 61ab55cc07..0000000000 --- a/sources/tech/20210127 3 email mistakes and how to avoid them.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (3 email mistakes and how to avoid them) -[#]: via: (https://opensource.com/article/21/1/email-mistakes) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -3 email mistakes and how to avoid them -====== -Automation is wonderful, except when it's not. Be sure your email -auto-responds and CCs are properly configured so you don't waste -everyone else's time. -![Computer screen with files or windows open][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 17 of 21 Days of Productivity in 2021. - -OK, so we've talked about some things we should do with our email - [Stop treating it as an instant messenger][2], [Prioritize things][3], [trying to reach Inbox Zero][4], and [filtering it effectively][5]. But what things SHOULDN'T we do? - -  - -![Automated email reply][6] - -Lucky you (Kevin Sonney, [CC BY-SA 4.0][7]) - -### 1\. Please do not Auto-respond to _everything_ - -There is always that one person on any mailing list. They have gone on vacation and set up an "I'm on vacation" auto-reply message. However, they didn't set it up correctly, so it responds to every email on the list with "I'm on vacation" until an admin mutes or unsubscribes them. - -We have all felt this pain, and I'll admit that at least once in the past, I was that person. - -Learn from my mistakes, and make sure that your auto-responders or vacation messages have limits on who they will respond to and how often. - -![An actual email with lots of CC'd recipients][8] - -This is a real email (Kevin Sonney, [CC BY-SA 4.0][7]) - -### 2\. Please do not CC everyone and the world - -We've all done it at least once. There is that big list of people we need to send an email to, so we just carbon copy (CC) _all_ of them. Sometimes this is warranted, but most of the time, it isn't. Sure, it's nice that you invited everyone to have birthday cake in the atrium, or that your cousin twice removed is getting married, or that the company just got a big account. Please, use a mailing list if you have one, or blind carbon copy (BCC) everyone if you don't. Seriously, BCC is your friend. - -### 3\. Reply All is NOT your friend - -![Reply options in Kmail][9] - -This one goes hand-in-hand with the previous item. I do not know how many times I have seen someone send a message to a list (or just a big group of people) that was meant to go a single person. I have seen the relatively benign emails that have been sent that way and resulting disciplinary action emails that followed. - -Seriously, do not use "Reply All" button unless you have to. And even then, make sure you _really_ have to. - -Some email applications manage this better than others. Kmail, the email component of [KDE Kontact][10], has several different reply options available in a sub-menu of the **Reply** toolbar button. You can choose to just reply to whatever entity is in the **From** field (usually a person, but sometimes a mailing list), or to the author (dropping anyone in CC or BCC), just to a mailing list, or to _all_ (don't do this). Seeing the options listed explicitly can really help you understand who's going to get a copy of an email you're about to send, which is sometimes more thought-provoking than you might expect. I've caught myself changing the recipient of an email to just the author instead of to an entire list upon realizing that a comment doesn't necessarily add to the end goal of a complex discussion. - -(Also, if you write an email that could get you in trouble with HR or your company, think about it for a long time before hitting Send.) - -Hopefully, these are things you are already _not_ doing with email. And if someone you know is? Feel free to share this with them. - -Ditch Outlook and check out six of the best open source desktop email applications. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/email-mistakes - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[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://opensource.com/article/21/1/email-rules -[3]: https://opensource.com/article/21/1/prioritize-tasks -[4]: https://opensource.com/article/21/1/inbox-zero -[5]: https://opensource.com/article/21/1/email-filter -[6]: https://opensource.com/sites/default/files/day17-image1.png -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/day17-image2.png -[9]: https://opensource.com/sites/default/files/kmail-replies.jpg (Reply options in Kmail) -[10]: https://opensource.com/article/21/1/kde-kontact diff --git a/translated/tech/20210127 3 email mistakes and how to avoid them.md b/translated/tech/20210127 3 email mistakes and how to avoid them.md new file mode 100644 index 0000000000..a065a4e917 --- /dev/null +++ b/translated/tech/20210127 3 email mistakes and how to avoid them.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 email mistakes and how to avoid them) +[#]: via: (https://opensource.com/article/21/1/email-mistakes) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +3 个电子邮件错误以及如何避免它们 +====== +自动化是美好的,除非不是那样。确保你的电子邮件自动回复和抄送配置正确,这样你就不会浪费大家的时间。 +![Computer screen with files or windows open][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十七天。 + +好了,我们已经谈到了一些我们应该对电子邮件做的事情:[不要再把它当作即时通讯工具][2]、[优先处理事情][3]、[努力达到收件箱 0 新邮件][4],以及[有效过滤][5]。但哪些事情是我们不应该做的呢? + +  + +![Automated email reply][6] + +你真幸运 (Kevin Sonney, [CC BY-SA 4.0][7]) + +### 1\. 请不要对_所有事情_自动回复 + +任何邮件列表中总有些人,他们去度假了,并设置了一个“我在度假”的自动回复信息。然而,他们没有正确地设置,所以它对列表上的每一封邮件都会回复“我在度假”,直到管理员将其屏蔽或取消订阅。 + +我们都感受到了这种痛苦,我承认过去至少有一次,我就是那个人。 + +从我的错误中吸取教训,并确保你的自动回复器或假期信息对它们将回复谁和多久回复一次有限制。 + +![An actual email with lots of CC'd recipients][8] + +这是一封真实的电子邮件 (Kevin Sonney, [CC BY-SA 4.0][7]) + +### 2\. 请不要抄送给所有人 + +我们都至少做过一次。我们需要发送邮件的人员众多,因此我们只需抄送他们_所有人_。有时这是有必要的,但大多数时候,它并不是。当然,你邀请每个人在庭院吃生日蛋糕,或者你的表姐要结婚了,或者公司刚拿到一个大客户,这都是好事。如果你有邮件列表的话,请用邮件列表,如果没有的话,请给每个人密送。说真的,密送是你的朋友。 + +### 3\. 回复所有人不是你的朋友 + +![Reply options in Kmail][9] + +这一条与上一条是相辅相成的。我不知道有多少次看到有人向一个名单(或者是一个大群的人)发送信息,而这个信息本来是要发给一个人的。我见过这样发送的相对好的邮件,以及随之而来的纪律处分邮件。 + +认真地说,除非必须,不要使用“回复全部”按钮。即使是这样,也要确保你_真的_需要这样做。 + +有些电子邮件应用比其他应用管理得更好。Kmail,[KDE Kontact][10] 的电子邮件组件,在**回复**工具栏按钮的子菜单中,有几个不同的回复选项。你可以选择只回复给**发件人**字段中的任何实体(通常是一个人,但有时是一个邮件列表),或者回复给作者(在抄送或密送中去除任何一个人),只回复给一个邮件列表,或者回复_所有人_(不要这样做)。看到明确列出的选项,的确可以帮助你了解谁会收到你要发送的邮件副本,这有时比你想象的更发人深省。我曾经发现,当我意识到一个评论并不一定会对一个复杂的讨论的最终目标有所帮助时,我就会把邮件的收件人改为只收作者,而不是整个列表。 + +(另外,如果你写的邮件可能会给你的 HR 或公司带来麻烦,请在点击发送之前多考虑下。) + +希望你已经_不再_电子邮件中这么做了。如果你认识的人是这样的呢?欢迎与他们分享。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/email-mistakes + +作者:[Kevin Sonney][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/ksonney +[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://opensource.com/article/21/1/email-rules +[3]: https://opensource.com/article/21/1/prioritize-tasks +[4]: https://opensource.com/article/21/1/inbox-zero +[5]: https://opensource.com/article/21/1/email-filter +[6]: https://opensource.com/sites/default/files/day17-image1.png +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/day17-image2.png +[9]: https://opensource.com/sites/default/files/kmail-replies.jpg (Reply options in Kmail) +[10]: https://opensource.com/article/21/1/kde-kontact From ac665123aad99d29463474860391684b9526413a Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 2 Feb 2021 08:55:51 +0800 Subject: [PATCH 079/213] translating --- .../20210131 3 wishes for open source productivity in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210131 3 wishes for open source productivity in 2021.md b/sources/tech/20210131 3 wishes for open source productivity in 2021.md index a4ac62d4ef..261065ddd5 100644 --- a/sources/tech/20210131 3 wishes for open source productivity in 2021.md +++ b/sources/tech/20210131 3 wishes for open source productivity in 2021.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 71581f220d92da098aff8fb322c0c3386228365e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 2 Feb 2021 12:20:15 +0800 Subject: [PATCH 080/213] PRF @geekpi --- ...ultimate open source productivity suite.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md b/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md index 8bb5a49cc0..5f70ec8990 100644 --- a/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md +++ b/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How Nextcloud is the ultimate open source productivity suite) @@ -9,40 +9,42 @@ Nextcloud 是如何成为终极开源生产力套件的 ====== -Nextcloud 可以取代你用于协作、组织和任务管理的许多在线应用。 -![Working on a team, busy worklife][1] + +> Nextcloud 可以取代你用于协作、组织和任务管理的许多在线应用。 + +![](https://img.linux.net.cn/data/attachment/album/202102/02/121553uhl3pjljjkhj0h8p.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十一天。 -基于网络的服务几乎可以在任何地方访问你的数据,它们每小时支持数百万用户。不过对于我们中的一些人来说,由于各种原因,运行自己的服务比使用大公司的服务更可取。也许我们的工作是受监管或有明确安全要求。也许我们有隐私方面的考虑,或者只是喜欢能够自己构建、运行和修复事物。不管是什么情况,[Nextcloud][2] 都可以提供你所需要的大部分服务,但是是在你自己的硬件上。 +基于 Web 的服务几乎可以在任何地方访问你的数据,它们每小时可以支持数百万用户。不过对于我们中的一些人来说,由于各种原因,运行自己的服务比使用大公司的服务更可取。也许我们的工作是受监管的或有明确安全要求。也许我们有隐私方面的考虑,或者只是喜欢能够自己构建、运行和修复事物。不管是什么情况,[Nextcloud][2] 都可以提供你所需要的大部分服务,但是是在你自己的硬件上。 ![NextCloud Dashboard displaying service options][3] -Nextcloud 控制面板(Kevin Sonney, [CC BY-SA 4.0][4]) +*Nextcloud 控制面板(Kevin Sonney, [CC BY-SA 4.0][4])* 大多数时候,当我们想到 Nextcloud 时,我们会想到文件共享和同步,类似于 Dropbox、OneDrive 和 Google Drive 等商业产品。然而,如今,它是一个完整的生产力套件,拥有电子邮件客户端、日历、任务和笔记本。 -有几种方法可以安装和运行 Nextcloud。你可以把它安装到裸机服务器上、在 Docker 容器中运行,或者作为虚拟机运行。如果你选择的话,还有一些托管服务将为你运行 Nextcloud。最后,有适用于所有主流操作系统的应用,包括移动应用,以便随时访问。 +有几种方法可以安装和运行 Nextcloud。你可以把它安装到裸机服务器上、在 Docker 容器中运行,或者作为虚拟机运行。如果可以考虑,还有一些托管服务将为你运行 Nextcloud。最后,有适用于所有主流操作系统的应用,包括移动应用,以便随时访问。 ![Nextcloud virtual machine][5] -Nextcloud 虚拟机(Kevin Sonney, [CC BY-SA 4.0][4]) +*Nextcloud 虚拟机(Kevin Sonney, [CC BY-SA 4.0][4])* -默认情况下,Nextcloud 会安装文件共享和其他一些相关应用(或附加组件)。你可以在管理界面中找到”应用“页面,这里允许你安装单个附加组件和一些预定义的相关应用捆绑。对我而言,我选择了 _Groupware Bundle_,其中包括邮件、日历、联系人和 Deck。Deck 是一个轻量级的看板,用于处理任务。我也安装了 _Notes_ 和 _Tasks_ 应用。 +默认情况下,Nextcloud 会安装文件共享和其他一些相关应用(或附加组件)。你可以在管理界面中找到“应用”页面,这里允许你安装单个附加组件和一些预定义的相关应用捆绑。对我而言,我选择了 “Groupware Bundle”,其中包括“邮件”、“日历”、“联系人”和 “Deck”。“Deck” 是一个轻量级的看板,用于处理任务。我也安装了“记事本”和“任务”应用。 -Nextcloud Mail 是一个非常直接的 IMAP 邮件客户端。虽然 Nextcloud 没有将 IMAP 或 SMTP 服务器作为软件包的一部分,但你可以很容易地在操作系统中添加一个或使用远程服务。日历应用是相当标准的,也允许你订阅远程日历。有一个缺点是,远程日历(例如,来自大型云提供商)是只读的,所以你可以查看但不能修改它们。 +Nextcloud “邮件” 是一个非常直白的 IMAP 邮件客户端。虽然 Nextcloud 没有将 IMAP 或 SMTP 服务器作为软件包的一部分,但你可以很容易地在操作系统中添加一个或使用远程服务。“日历”应用是相当标准的,也允许你订阅远程日历。有一个缺点是,远程日历(例如,来自大型云提供商)是只读的,所以你可以查看但不能修改它们。 ![NextCoud App Interface][6] -Nextcloud 应用界面 (Kevin Sonney, [CC BY-SA 4.0][4]) +*Nextcloud 应用界面 (Kevin Sonney, [CC BY-SA 4.0][4])* -Notes 是一个简单的文本记事本,允许你创建和更新简短的笔记、日记和相关的东西。Tasks 是一款待办事项应用,支持多个列表、任务优先级、完成百分比以及其他一些用户期待的标准功能。如果你安装了 Deck,它的任务卡也会被列出来。每个看板都会显示自己的列表,所以你可以使用 Deck 或 Tasks 来跟踪完成的内容。 +“记事本” 是一个简单的文本记事本,允许你创建和更新简短的笔记、日记和相关的东西。“任务” 是一款待办事项应用,支持多个列表、任务优先级、完成百分比以及其他一些用户期待的标准功能。如果你安装了 “Deck”,它的任务卡也会被列出来。每个看板都会显示自己的列表,所以你可以使用 “Deck” 或 “任务” 来跟踪完成的内容。 -Deck 本身就是一个看板应用,将任务以卡片的形式呈现在流程中。如果你喜欢看板流程,它是一个追踪进度的优秀应用。 +“Deck” 本身就是一个看板应用,将任务以卡片的形式呈现在流程中。如果你喜欢看板流程,它是一个追踪进度的优秀应用。 ![Taking notes][7] -做笔记 (Kevin Sonney, [CC BY-SA 4.0][4]) +*做笔记 (Kevin Sonney, [CC BY-SA 4.0][4])* Nextcloud 中所有的应用都原生支持通过标准协议进行共享。与一些类似的解决方案不同,它的分享并不是为了完成功能列表中的一项而加上去的。分享是 Nextcloud 存在的主要原因之一,所以使用起来非常简单。你还可以将链接分享到社交媒体、通过电子邮件分享等。你可以用一个 Nextcloud 取代多个在线服务,它在任何地方都可以访问,以协作为先。 @@ -53,7 +55,7 @@ via: https://opensource.com/article/21/1/nextcloud-productivity 作者:[Kevin Sonney][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 cbf771afbca3c3ac07145732dbfbe23aa0656bf0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 2 Feb 2021 12:20:49 +0800 Subject: [PATCH 081/213] PUB @geekpi https://linux.cn/article-13077-1.html --- ...extcloud is the ultimate open source productivity suite.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210121 How Nextcloud is the ultimate open source productivity suite.md (98%) diff --git a/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md b/published/20210121 How Nextcloud is the ultimate open source productivity suite.md similarity index 98% rename from translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md rename to published/20210121 How Nextcloud is the ultimate open source productivity suite.md index 5f70ec8990..397dfea81f 100644 --- a/translated/tech/20210121 How Nextcloud is the ultimate open source productivity suite.md +++ b/published/20210121 How Nextcloud is the ultimate open source productivity suite.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13077-1.html) [#]: subject: (How Nextcloud is the ultimate open source productivity suite) [#]: via: (https://opensource.com/article/21/1/nextcloud-productivity) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From 60416506d5bfd4ca89371fa8a708a60cf44255dc Mon Sep 17 00:00:00 2001 From: amwps290 Date: Tue, 2 Feb 2021 16:32:13 +0800 Subject: [PATCH 082/213] translating --- ...210126 Write GIMP scripts to make image processing faster.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210126 Write GIMP scripts to make image processing faster.md b/sources/tech/20210126 Write GIMP scripts to make image processing faster.md index a4b5adc523..ffe60e8538 100644 --- a/sources/tech/20210126 Write GIMP scripts to make image processing faster.md +++ b/sources/tech/20210126 Write GIMP scripts to make image processing faster.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 09540c08c2480c8e9adeb40dace0169159aa8951 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 2 Feb 2021 22:28:55 +0800 Subject: [PATCH 083/213] APL --- .../20191228 The Zen of Python- Why timing is everything.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191228 The Zen of Python- Why timing is everything.md b/sources/tech/20191228 The Zen of Python- Why timing is everything.md index fe99c2c868..925cd7cb2c 100644 --- a/sources/tech/20191228 The Zen of Python- Why timing is everything.md +++ b/sources/tech/20191228 The Zen of Python- Why timing is everything.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 434e38d1193a1ad280cba24d19a949c15edb8765 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 2 Feb 2021 22:54:07 +0800 Subject: [PATCH 084/213] TSL&PRF --- ...Zen of Python- Why timing is everything.md | 44 ------------------ ...Zen of Python- Why timing is everything.md | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 44 deletions(-) delete mode 100644 sources/tech/20191228 The Zen of Python- Why timing is everything.md create mode 100644 translated/tech/20191228 The Zen of Python- Why timing is everything.md diff --git a/sources/tech/20191228 The Zen of Python- Why timing is everything.md b/sources/tech/20191228 The Zen of Python- Why timing is everything.md deleted file mode 100644 index 925cd7cb2c..0000000000 --- a/sources/tech/20191228 The Zen of Python- Why timing is everything.md +++ /dev/null @@ -1,44 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (The Zen of Python: Why timing is everything) -[#]: via: (https://opensource.com/article/19/12/zen-python-timeliness) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -The Zen of Python: Why timing is everything -====== -This is part of a special series about the Zen of Python focusing on the -15th and 16th principles: now vs. never. -![Clock, pen, and notepad on a desk][1] - -Python is always evolving. The Python community has an unending appetite for feature requests but also an unending bias toward the status quo. As Python gets more popular, changes to the language affect more people. - -The exact timing for when a change happens is often hard, but the [Zen of Python][2] offers guidance. - -### Now is better than never. - -There is always the temptation to delay things until they are perfect. They will never be perfect, though. When they look "ready" enough, that is when it is time to take the plunge and put them out there. Ultimately, a change always happens at _some_ now: the only thing that delaying does is move it to a future person's "now." - -### Although never is often better than _right now_. - -This, however, does not mean things should be rushed. Decide the criteria for release in terms of testing, documentation, user feedback, and so on. "Right now," as in before the change is ready, is not a good time. - -This is a good lesson not just for popular languages like Python, but also for your personal little open source project. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-timeliness - -作者:[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/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk) -[2]: https://www.python.org/dev/peps/pep-0020/ diff --git a/translated/tech/20191228 The Zen of Python- Why timing is everything.md b/translated/tech/20191228 The Zen of Python- Why timing is everything.md new file mode 100644 index 0000000000..1e00ed28cb --- /dev/null +++ b/translated/tech/20191228 The Zen of Python- Why timing is everything.md @@ -0,0 +1,45 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Zen of Python: Why timing is everything) +[#]: via: (https://opensource.com/article/19/12/zen-python-timeliness) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +Python 之禅:为什么时间就是一切 +====== + +> 这是 Python 之禅特别系列的一部分,重点是第十五和第十六条原则:现在与永远。 + +!["桌子上的时钟、笔和记事本"][1] + +Python 一直在不断发展。Python 社区对特性请求的渴求是无止境的,对现状也总是不满意的。随着 Python 越来越流行,这门语言的变化会影响到更多的人。 + +确定什么时候该进行变化往往很难,但 [Python 之禅][2] 给你提供了指导。 + +### 现在有总比永远没有好Now is better than never + +总有一种诱惑,就是要等到事情完美才去做,虽然,它们永远没有完美的一天。当它们看起来已经“准备”得足够好了,那就大胆采取行动吧,去做出改变吧。无论如何,变化总是发生在*某个*现在:拖延的唯一作用就是把它移到未来的“现在”。 + +### 虽然将来总比现在好Although never is often better than right now + +然而,这并不意味着应该急于求成。从测试、文档、用户反馈等方面决定发布的标准。在变化就绪之前的“现在”,并不是一个好时机。 + +这不仅对 Python 这样的流行语言是个很好的经验,对你个人的小开源项目也是如此。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-timeliness + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk) +[2]: https://www.python.org/dev/peps/pep-0020/ From 67baf6e02dc67f16b34b8e6472484fba2fa9859d Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 3 Feb 2021 00:05:05 +0800 Subject: [PATCH 085/213] Translating --- ...125 Why you need to drop ifconfig for ip.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sources/tech/20210125 Why you need to drop ifconfig for ip.md b/sources/tech/20210125 Why you need to drop ifconfig for ip.md index 4bbe5b2cdc..0717a20ef1 100644 --- a/sources/tech/20210125 Why you need to drop ifconfig for ip.md +++ b/sources/tech/20210125 Why you need to drop ifconfig for ip.md @@ -1,11 +1,11 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why you need to drop ifconfig for ip) -[#]: via: (https://opensource.com/article/21/1/ifconfig-ip-linux) -[#]: author: (Rajan Bhardwaj https://opensource.com/users/rajabhar) +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Why you need to drop ifconfig for ip" +[#]: via: "https://opensource.com/article/21/1/ifconfig-ip-linux" +[#]: author: "Rajan Bhardwaj https://opensource.com/users/rajabhar" Why you need to drop ifconfig for ip ====== @@ -209,6 +209,6 @@ via: https://opensource.com/article/21/1/ifconfig-ip-linux [a]: https://opensource.com/users/rajabhar [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://en.wikipedia.org/wiki/OSI_model [3]: https://en.wikipedia.org/wiki/Multicast From 69c431ed6b51033804c1da41af1dc83f60d3c4a7 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 3 Feb 2021 00:13:32 +0800 Subject: [PATCH 086/213] =?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 --- ...25 Why you need to drop ifconfig for ip.md | 127 +++++++++--------- 1 file changed, 64 insertions(+), 63 deletions(-) rename {sources => translated}/tech/20210125 Why you need to drop ifconfig for ip.md (51%) diff --git a/sources/tech/20210125 Why you need to drop ifconfig for ip.md b/translated/tech/20210125 Why you need to drop ifconfig for ip.md similarity index 51% rename from sources/tech/20210125 Why you need to drop ifconfig for ip.md rename to translated/tech/20210125 Why you need to drop ifconfig for ip.md index 0717a20ef1..a9ed73b4e0 100644 --- a/sources/tech/20210125 Why you need to drop ifconfig for ip.md +++ b/translated/tech/20210125 Why you need to drop ifconfig for ip.md @@ -7,31 +7,32 @@ [#]: via: "https://opensource.com/article/21/1/ifconfig-ip-linux" [#]: author: "Rajan Bhardwaj https://opensource.com/users/rajabhar" -Why you need to drop ifconfig for ip + +放弃 ifconfig,拥抱 ip ====== -Start using the modern method for configuring a Linux network interface. +开始使用现代方法配置 Linux 网络接口。 ![Tips and gears turning][1] -For a long time, the `ifconfig` command was the default method for configuring a network interface. It served Linux users well, but networking is complex, and the commands to configure it must be robust. The `ip` command is the new default networking command for modern systems, and in this article, I'll show you how to use it. +在很长一段时间内,`ifconfig` 命令是配置网络接口的默认方法。它为 Linux 用户提供了很好的服务,但是网络很复杂,所以配置网络的命令必须健壮。`ip` 命令是现代系统中新的默认网络命令,在本文中,我将向你展示如何使用它。 -The `ip` command is functionally organized on two layers of the [OSI networking stack][2]: Layer 2 (data link layer) and Layer 3 (network or IP layer). It does all the work in the old `net-tools` package. +`ip` 命令工作在 [OSI 网络栈][2] 上:数据链路层和网络(IP)层。它做了之前 `net-tools` 包的所有工作。 -### Installing ip +### 安装 ip -The `ip` command is included in the `iproute2util` package. It's probably already included in your Linux distribution. If it's not, you can install it from your distro's software repository. +`ip` 命令包含在 `iproute2util` 包中,它可能已经在你的 Linux 发行版中安装了。如果没有,你可以从发行版的仓库中进行安装。 -### Comparing ipconfig and ip usage +### ifconfig 和 ip 使用对比 -The `ip` and `ipconfic` commands can be used to configure a network interface, but they do things differently. I'll compare how to do common tasks with the old (`ipconfig`) and new (`ip`) commands. +`ip` 和 `ifconfig` 命令可以用来配置网络接口,但它们做事方法不同。接下来,作为对比,我将用它们来执行一些常见的任务。 -#### View network interface and IP address +#### 查看网口和 IP 地址 -If you want to see the IP address of a host or view network interface information, the old `ifconfig` command, with no arguments, provides a good summary: +如果你想查看主机的 IP 地址或网络接口信息,`ifconfig` (不带任何参数)命令提供了一个很好的总结。 ``` $ ifconfig -                                                                                                 +                                                                        eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                                                         ether bc:ee:7b:5e:7d:d8  txqueuelen 1000  (Ethernet)                                                               RX packets 0  bytes 0 (0.0 B) @@ -59,7 +60,7 @@ wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 ``` -The new `ip` command provides similar results, but the command is `ip address show`, or just `ip a` for short: +新的 `ip` 命令提供了类似的结果,但命令是 `ip address show`,或者简写为 `ip a`: ``` @@ -83,118 +84,118 @@ $ ip a       valid_lft forever preferred_lft forever ``` -#### Add IP address +#### 添加 IP 地址 -To add an IP address to an interface with `ifconfig`, the command is: +使用 `ifconfig` 命令添加 IP 地址命令为: -``` -`$ ifconfig eth0 add 192.9.203.21` +```bash +$ ifconfig eth0 add 192.9.203.21 ``` -The command is similar for `ip`: +`ip` 类似: -``` -`$ ip address add 192.9.203.21 dev eth0` +```bash +$ ip address add 192.9.203.21 dev eth0 ``` -Subcommands in `ip` can be shortened, so this command is equally valid: +`ip` 中的子命令可以缩短,所以下面这个命令同样有效: -``` -`$ ip addr add 192.9.203.21 dev eth0` +```bash +$ ip addr add 192.9.203.21 dev eth0 ``` -You can make it even shorter: +你甚至可以更短些: -``` -`$ ip a add 192.9.203.21 dev eth0` +```bash +$ ip a add 192.9.203.21 dev eth0 ``` -#### Remove an IP address +#### 移除一个 IP 地址 -The inverse of adding an IP address is to remove one. +添加 IP 地址与删除 IP 地址正好相反。 -With `ifconfig`, the syntax is: +使用 `ifconfig`,命令是: -``` -`$ ifconfig eth0 del 192.9.203.21` +```bash +$ ifconfig eth0 del 192.9.203.21 ``` -The `ip` command syntax is: +`ip` 命令的语法是: -``` -`$ ip a del 192.9.203.21 dev eth0` +```bash +$ ip a del 192.9.203.21 dev eth0 ``` -#### Enable or disable multicast +#### 启用或禁用组播 -Enabling (or disabling) [multicast][3] on an interface with `ifconfig` happens with the `multicast` argument: +使用 `ifconfig` 接口来启用或禁用[组播][3]: -``` -`# ifconfig eth0 multicast` +```bash +# ifconfig eth0 multicast ``` -With `ip`, use the `set` subcommand with the device (`dev`) and a Boolean or toggle `multicast` option: +对于 `ip`,使用 `set` 子命令与设备(`dev`)以及一个布尔值和 `multicast` 选项: -``` -`# ip link set dev eth0 multicast on` +```bash +# ip link set dev eth0 multicast on ``` -#### Enable or disable a network +#### 启用或禁用网络 -Every sysadmin is familiar with the old "turn it off and then on again" trick to fix a problem. In terms of networking interfaces, that translates to bringing a network up or down. +每个系统管理员都熟悉“先关闭,然后打开”这个技巧来解决问题。在网络接口上,即打开或关闭网络。 -The `ifconfig` command does this with the `up` or `down` keywords: +`ifconfig` 命令使用 `up` 或 `down` 关键字来实现: -``` -`# ifconfig eth0 up` +```bash +# ifconfig eth0 up ``` -Or you could use a dedicated command: +或者你可以使用一个专用命令: -``` -`# ifup eth0` +```bash +# ifup eth0 ``` -The `ip` command uses the `set` subcommand to set the interface to an `up` or `down` state: +`ip` 命令使用 `set` 子命令将网络设置为 `up` 或 `down` 状态: -``` -`# ip link set eth0 up` +```bash +# ip link set eth0 up ``` -#### Enable or disable the Address Resolution Protocol (ARP) +#### 开启或关闭地址解析功能(ARP) -With `ifconfig`, you enable ARP by declaring it: +使用 `ifconfig`,你可以通过声明来启用: -``` -`# ifconfig eth0 arp` +```bash +# ifconfig eth0 arp ``` -With `ip`, you _set_ the `arp` property as `on` or `off`: +使用 `ip`,你可以将 `arp` 属性设置为 `on` 或 `off`: -``` -`# ip link set dev eth0 arp on` +```bash +# ip link set dev eth0 arp on ``` -### Pros and cons of ip and ipconfig +### ip 和 ipconfig 的优缺点 -The `ip` command is more versatile and technically more efficient than `ifconfig` because it uses `Netlink` sockets rather than `ioctl` system calls. +`ip` 命令比 `ifconfig` 更通用,技术上也更有效,因为它使用的是 `Netlink` 套接字,而不是 `ioctl` 系统调用。 -The `ip` command may appear more verbose and more complex than `ifconfig`, but that's one reason it's more versatile. Once you start using it, you'll get a feel for its internal logic (for instance, using `set` instead of a seemingly arbitrary mix of declarations or settings). +`ip` 命令可能看起来比 `ifconfig` 更详细、更复杂,但这是它拥有更多功能的一个原因。一旦你开始使用它,你会了解它的内部逻辑(例如,使用 `set` 而不是看起来随意叠加的声明或设置)。 -Ultimately, `ifconfig` is outdated (for instance, it lacks full support for network namespaces), and `ip` is designed for the modern network. Try it out, learn it, use it. You'll be glad you did! +最后,`ifconfig` 已经过时了(例如,它缺乏对网络名称空间的支持),而 `ip` 是为现代网络而生的。尝试并学习它,使用它,你会很感激你使用它的! -------------------------------------------------------------------------------- @@ -202,7 +203,7 @@ via: https://opensource.com/article/21/1/ifconfig-ip-linux 作者:[Rajan Bhardwaj][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5b16de4dd3a53f7c81a4dace341f01fed7a1969c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 3 Feb 2021 05:03:53 +0800 Subject: [PATCH 087/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210203=20?= =?UTF-8?q?Paru=20=E2=80=93=20A=20New=20AUR=20Helper=20and=20Pacman=20Wrap?= =?UTF-8?q?per=20Based=20on=20Yay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md --- ... Helper and Pacman Wrapper Based on Yay.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md diff --git a/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md new file mode 100644 index 0000000000..ebbc04f3a9 --- /dev/null +++ b/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) +[#]: via: (https://itsfoss.com/paru-aur-helper/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +Paru – A New AUR Helper and Pacman Wrapper Based on Yay +====== + +One of the [main reasons that a user chooses Arch Linux][1] or an [Arch based Linux distribution][2] is the [Arch User repository (AUR)][3]. + +Unfortunately, [pacman][4], the package manager of Arch, can’t access the AUR in a similar way to the official repositories. The packages in AUR are in the form of [PKGBUILD][5] and require a manual process to be built. + +An AUR helper can automate this process. Without any doubt [yay][6] is one of the most popular and highly favoured AUR helper. + +Recently [Morganamilo][7], one of the two developers of yay, [announced][8] that is stepping away from maintaining yay and starting his own AUR helper called [paru][9]. Paru is written in [Rust][10] compared to yay that is written in [Go][11] and its design is based on yay. + +Please note that yay hasn’t reach the end of life and is still being actively maintained by [Jguer][12]. He also [commented][13] that paru may be suitable for users that looking for a feature rich AUR helper; thus I would recommend giving it a try. + +### Installing Paru AUR helper + +To install paru, open your terminal and type the following commands one by one. + +``` +sudo pacman -S --needed base-devel +git clone https://aur.archlinux.org/paru.git +cd paru +makepkg -si +``` + +Now that you have it installed, let’s see how to use it. + +### Essential commands to use Paru AUR helper + +In my opinion these are the most essential commands of paru. You can explore more on the official repository on [GitHub][9]. + + * **paru <userinput>** : Search and install <userinput>. + * **paru —** : Alias for paru -Syu + * **paru -Sua** : Upgrade AUR packages only + * **paru -Qua** : Print available AUR updates + * **paru -Gc <userinput>** : Print the AUR comments of <userinput> + + + +### Using Paru AUR helper to its full extent + +You can access the [changelog][14] of paru on GitHub for the full changelog history or you can see the changes from yay at the [first release][15]. + +#### Enable colour in Paru + +To enable colour in paru, you have to enable it first in pacman. All the [configuration files][16] are in /etc directory. In this example, I [use Nano text editor][17] but, you may use any [terminal-based text editor][18] of your choice. + +``` +sudo nano /etc/pacman.conf +``` + +Once you open the pacman configuration file, uncomment the “Color” to enable this feature. + +![][19] + +#### **Flip search order** + +The most relevant package according to your search term is normally displayed on the top of the search result. In paru, you can flip the search order to make your search easier. + +Similar to the previous example, open the paru configuration file: + +``` +sudo nano /etc/paru.conf +``` + +Uncomment the “BottomUp” term and save the file. + +![][20] + +As you can see the order is flipped and the first package appears on the bottom. + +![][21] + +#### **Edit PKGBUILDs** (For advanced user) + +If you are an experienced Linux user, you can edit AUR packages through paru. To do so, you need to enable the feature from the paru configuration file and set the file manager of your choice. + +In this example I will use the default in the configuration file i.e. the vifm file manager. If you haven’t used it you may need to install it. + +``` +sudo pacman -S vifm +sudo nano /etc/paru.conf +``` + +Open the configuration file and uncomment as shown below. + +![][22] + +Let’s go back to the [Google Calendar][23] AUR package and try to install it. You will be prompted to review the package. Type yes and click enter. + +![][24] + +Choose the PKGBUILD from the file manager and hit enter to view the package. + +![][25] + +Any change that you make will be permanent and the next time you upgrade the package, your changes will be merged with the upstream package. + +![][26] + +### Conclusion + +Paru is another interesting addition to the [AUR helpers family][27] with a promising future. At this point I wouldn’t suggest replacing yay as it is still maintained but definitely give paru a try. You can have both of them installed to your system and come to your own conclusions. + +To get the latest [Linux news][28], subscribe to our social media to be among the first to get them whilst they are fresh! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/paru-aur-helper/ + +作者:[Dimitrios Savvopoulos][a] +选题:[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://itsfoss.com/why-arch-linux/ +[2]: https://itsfoss.com/arch-based-linux-distros/ +[3]: https://itsfoss.com/aur-arch-linux/ +[4]: https://itsfoss.com/pacman-command/ +[5]: https://wiki.archlinux.org/index.php/PKGBUILD +[6]: https://news.itsfoss.com/qt-6-released/ +[7]: https://github.com/Morganamilo +[8]: https://www.reddit.com/r/archlinux/comments/jjn1c1/paru_v100_and_stepping_away_from_yay/ +[9]: https://github.com/Morganamilo/paru +[10]: https://www.rust-lang.org/ +[11]: https://golang.org/ +[12]: https://github.com/Jguer +[13]: https://aur.archlinux.org/packages/yay/#pinned-788241 +[14]: https://github.com/Morganamilo/paru/releases +[15]: https://github.com/Morganamilo/paru/releases/tag/v1.0.0 +[16]: https://linuxhandbook.com/linux-directory-structure/#-etc-configuration-files +[17]: https://itsfoss.com/nano-editor-guide/ +[18]: https://itsfoss.com/command-line-text-editors-linux/ +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/pacman.conf-color.png?resize=800%2C480&ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup.png?resize=800%2C480&ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup-2.png?resize=800%2C480&ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-vifm.png?resize=732%2C439&ssl=1 +[23]: https://aur.archlinux.org/packages/gcalcli/ +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review.png?resize=800%2C480&ssl=1 +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-2.png?resize=800%2C480&ssl=1 +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-3.png?resize=800%2C480&ssl=1 +[27]: https://itsfoss.com/best-aur-helpers/ +[28]: https://news.itsfoss.com/ From 0fd03c20a15240c7198fda9a854b073550a42089 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 3 Feb 2021 05:04:15 +0800 Subject: [PATCH 088/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210202=20?= =?UTF-8?q?Convert=20audio=20files=20with=20this=20versatile=20Linux=20com?= =?UTF-8?q?mand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210202 Convert audio files with this versatile Linux command.md --- ...files with this versatile Linux command.md | 240 ++++++++++++++++++ 1 file changed, 240 insertions(+) create mode 100644 sources/tech/20210202 Convert audio files with this versatile Linux command.md diff --git a/sources/tech/20210202 Convert audio files with this versatile Linux command.md b/sources/tech/20210202 Convert audio files with this versatile Linux command.md new file mode 100644 index 0000000000..683907b70f --- /dev/null +++ b/sources/tech/20210202 Convert audio files with this versatile Linux command.md @@ -0,0 +1,240 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Convert audio files with this versatile Linux command) +[#]: via: (https://opensource.com/article/20/2/linux-sox) +[#]: author: (Klaatu https://opensource.com/users/klaatu) + +Convert audio files with this versatile Linux command +====== +SoX Sound Exchange can even add effects to your audio files. +![HiFi vintage stereo][1] + +I work with media, and when you work with any kind of media, you learn pretty quickly that standardization is a valuable tool. Just as you wouldn't try to add a fraction to a decimal without converting one or the other, I've learned that it's not ideal to combine media of differing formats. Most hobbyist-level applications make the conversion process invisible to the user as a convenience. Flexible software aimed at users needing control over the fine details of their assets, however, often leave it up to you to convert your media to your desired format in advance. I have a few favorite tools for conversion, and one of those is the so-called _Swiss army knife of sound_, [SoX][2]. + +### Installing + +On Linux or BSD, you can install the **sox** command (and some helpful symlinks) from your software repository or ports tree. + +You can also install SoX from its home on [Sourceforge.net][3]. It doesn't release often, but its codebase tends to be stable, so if you want the latest features (such as Opus support), it's easy and safe to build. + +SoX provides primarily the **sox** command, but installation also creates a few useful symlinks: **play**, **rec**, and **soxi**. + +### Getting information about files with SoX + +SoX reads and rewrites audio data. Whether it stores the rewritten audio data is up to you. There are use cases in which you don't need to store the converted data, for instance, when you're sending the output directly to your speakers for playback. Before doing any conversion, however, it's usually a good idea to determine exactly what you're dealing with in the first place. + +To gather information about an audio file, use the **soxi** command. This is a symlink to **sox --info**. + + +``` +$ soxi countdown.mp3 +Input File     : '/home/tux/countdown.mp3' +Channels       : 1 +Sample Rate    : 44100 +Precision      : 16-bit +Duration       : 00:00:11.21 = 494185 samples... +File Size      : 179k +Bit Rate       : 128k +Sample Encoding: MPEG audio (layer I, II or III) +``` + +This output gives you a good idea of what codec the audio file is encoded in, the file length, file size, sample rate, and the number of channels. Some of these you might _think_ you already know, but I never trust assumptions when media is brought to me by a client. Verify media attributes with **soxi**. + +### Converting files + +In this example, the audio of a game show countdown has been delivered as an MP3 file. While nearly all editing applications accept compressed audio, none of them actually edit the compressed data. Conversion is happening somewhere, whether it's a secret background task or a prompt for you to save a copy. I generally prefer to do the conversion myself, in advance. This way, I can control what format I'm using. I can do lots of media in batches overnight instead of wasting valuable production time waiting for an editing application to churn through them on demand. + +The **sox** command is meant for converting audio files. There are a few stages in the **sox** pipeline: + + * input + * combine + * effects + * output + + + +In command syntax, the effects step is, confusingly, written _last_. That means the pipeline is composed this way: + + +``` +`input → combine → output → effects` +``` + +### Encoding + +The simplest conversion command involves only an input file and an output file. Here's the command to convert an MP3 file to a lossless FLAC file: + + +``` +$ sox countdown.mp3 output.flac +$ soxi output.flac + +Input File     : 'output.flac' +Channels       : 1 +Sample Rate    : 44100 +Precision      : 16-bit +Duration       : 00:00:11.18 = 493056 samples... +File Size      : 545k +Bit Rate       : 390k +Sample Encoding: 16-bit FLAC +Comment        : 'Comment=Processed by SoX' +``` + +#### Effects + +The effects chain is specified at the end of a command. It can alter audio prior to sending the data to its final destination. For instance, sometimes audio that's too loud can cause problems during conversion: + + +``` +$ sox bad.wav bad.ogg +sox WARN sox: `bad.ogg' output clipped 126 samples; decrease volume? +``` + +Applying a **gain** effect can often solve this problem: + + +``` +`$ sox bad.wav bad.ogg gain -1` +``` + +#### Fade + +Another useful effect is **fade**. This effect lets you define the shape of a fade-in or fade-out, along with how many seconds you want the fade to span. + +Here's an example of a six-second fade-in using an inverted parabola: + + +``` +`$ sox intro.ogg intro.flac fade p 6` +``` + +This applies a three-second fade-in to the head of the audio and a fade-out starting at the eight-second mark (the intro music is only 11 seconds, so the fade-out is also three-seconds in this case): + + +``` +`$ sox intro.ogg intro.flac fade p 3 8` +``` + +The different kinds of fades (sine, linear, inverted parabola, and so on), as well as the options **fade** offers (fade-in, fade-out), are listed in the **sox** man page. + +#### Effect syntax + +Each effect plugin has its own syntax, so refer to the man page for details on how to invoke each one. + +Effects can be daisy-chained in one command, at least to the extent that you want to combine them. In other words, there's no syntax to apply a **flanger** effect only during a six-second fade-out. For something that precise, you need a graphical sound wave editor or a digital audio workstation such as [LMMS][4] or [Rosegarden][5]. However, if you just have effects that you want to apply once, you can list them together in the same command. + +This command applies a -1 **gain** effect, a tempo **stretch** of 1.35, and a **fade-out**: + + +``` +$ sox intro.ogg output.flac gain -1 stretch 1.35 fade p 0 6 +$ soxi output.flac + +Input File     : 'output.flac' +Channels       : 1 +Sample Rate    : 44100 +Precision      : 16-bit +Duration       : 00:00:15.10 = 665808 samples... +File Size      : 712k +Bit Rate       : 377k +Sample Encoding: 16-bit FLAC +Comment        : 'Comment=Processed by SoX' +``` + +### Combining audio + +SoX can also combine audio files, either by concatenating them or by mixing them. + +To join (or _concatenate_) files into one, provide more than one input file in your command: + + +``` +`$ sox countdown.mp3 intro.ogg output.flac` +``` + +In this example, **output.flac** now contains **countdown** audio, followed immediately by **intro** music. + +If you want the two tracks to play over one another at the same time, though, you can use the **\--combine mix** option: + + +``` +`$ sox --combine mix countdown.mp3 intro.ogg output.flac` +``` + +Imagine, however, that the two input files differed in more than just their codecs. It's not uncommon for vocal tracks to be recorded in mono (one channel), but for music to be recorded in at least stereo (two channels). SoX won't default to a solution, so you have to standardize the format of the two files yourself first. + +#### Altering audio files + +Options related to the file name listed _after_ it. For instance, the **\--channels** option in this command applies _only_ to **input.wav** and NOT to **example.ogg** or **output.flac**: + + +``` +`$ sox --channels 2 input.wav example.ogg output.flac` +``` + +This means that the position of an option is very significant in SoX. Should you specify an option at the start of your command, you're essentially only overriding what SoX gleans from the input files on its own. Options placed immediately before the _output_ file, however, determine how SoX writes the audio data. + +To solve the previous problem of incompatible channels, you can first standardize your inputs, and then mix: + + +``` +$ sox countdown.mp3 --channels 2 countdown-stereo.flac gain -1 +$ soxi countdown-stereo.flac + +Input File     : 'countdown-stereo.flac' +Channels       : 2 +Sample Rate    : 44100 +Precision      : 16-bit +Duration       : 00:00:11.18 = 493056 samples... +File Size      : 545k +Bit Rate       : 390k +Sample Encoding: 16-bit FLAC +Comment        : 'Comment=Processed by SoX' + +$ sox --combine mix \ +countdown-stereo.flac \ +intro.ogg \ +output.flac +``` + +SoX absolutely requires multiple commands for complex actions, so it's normal to create several temporary and intermediate files as needed. + +### Multichannel audio + +Not all audio is constrained to one or two channels, of course. If you want to combine several audio channels into one file, you can do that with SoX and the **\--combine merge** option: + + +``` +$ sox --combine merge countdown.mp3 intro.ogg output.flac +$ soxi output.flac + +Input File     : 'output.flac' +Channels       : 3 +[...] +``` + +### Easy audio manipulation + +It might seem strange to work with audio using no visual interface, and for some tasks, SoX definitely isn't the best tool. However, for many tasks, SoX provides an easy and lightweight toolkit. SoX is a simple command with powerful potential. With it, you can convert audio, manipulate channels and waveforms, and even generate your own sounds. This article has only provided a brief overview of its capabilities, so go read its man page or [online documentation][2] and then see what you can create. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/linux-sox + +作者:[Klaatu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/klaatu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/hi-fi-stereo-vintage.png?itok=KYY3YQwE (HiFi vintage stereo) +[2]: http://sox.sourceforge.net/sox.html +[3]: http://sox.sourceforge.net +[4]: https://opensource.com/life/16/2/linux-multimedia-studio +[5]: https://opensource.com/article/18/3/make-sweet-music-digital-audio-workstation-rosegarden From 7353da38c93c7e77bf2853fa09af9e8c6de2e042 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 3 Feb 2021 05:04:32 +0800 Subject: [PATCH 089/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210202=20?= =?UTF-8?q?How=20I=20build=20and=20expand=20application=20development=20an?= =?UTF-8?q?d=20testing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210202 How I build and expand application development and testing.md --- ...and application development and testing.md | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 sources/tech/20210202 How I build and expand application development and testing.md diff --git a/sources/tech/20210202 How I build and expand application development and testing.md b/sources/tech/20210202 How I build and expand application development and testing.md new file mode 100644 index 0000000000..f01b3f4355 --- /dev/null +++ b/sources/tech/20210202 How I build and expand application development and testing.md @@ -0,0 +1,204 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How I build and expand application development and testing) +[#]: via: (https://opensource.com/article/21/2/build-expand-software) +[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic) + +How I build and expand application development and testing +====== +Start development simply, by writing and testing your code with One +element and then expand it out to Many. +![Security monster][1] + +In my [previous article][2], I explained why tackling coding problems all at once, as if they were hordes of zombies, is a mistake. I also explained the first **ZOMBIES** principle, **Zero**. In this article, I'll demonstrate the next two principles: **One** and **Many**. + +**ZOMBIES** is an acronym that stands for: + +**Z** – Zero +**O** – One +**M** – Many (or more complex) +**B** – Boundary behaviors +**I** – Interface definition +**E** – Exercise exceptional behavior +**S** – Simple scenarios, simple solutions + +In the previous article, you implemented Zero, which provides the simplest possible path through your code. There is absolutely no conditional processing logic anywhere to be found. Now it's time for you to move into **O**ne. + +Unlike with **Z**ero, which basically means nothing is added, or we have an empty case, nothing to take care of, **O**ne means we have a single case to take care of. That single case could be one item in the collection, or one visitor, or one event that demands special treatment. + +With **M**any, we are now dealing with potentially more complicated cases. Two or more items in the collection, two or more events that demand special treatment, and so on. + +### One in action + +Build on the code from the previous article by adding something to your virtual shopping basket. First, write a fake test: + + +``` +[Fact] +public void Add1ItemBasketHas1Item() { +        var expectedNoOfItems = 1; +        var actualNoOfItems = 0; +        Assert.Equal(expectedNoOfItems, actualNoOfItems); +} +``` + +As expected, this test fails because you hard-coded an incorrect value: + + +``` +Starting test execution, please wait... + +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.57] tests.UnitTest1.NewlyCreatedBasketHas0Items [FAIL] +  X tests.UnitTest1.NewlyCreatedBasketHas0Items [4ms] +  Error Message: +   Assert.Equal() Failure +Expected: 0 +Actual: 1 +[...] +``` + +Now is the time to think about how to stop faking it. You already created an implementation of a shopping basket (an `ArrayList` to hold items). But how do you implement an _item_? + +Simplicity should always be your guiding principle, and not knowing much about the actual item, you could fake it a little by implementing it as another collection. What could that collection contain? Well, because you're mostly interested in calculating basket totals, the item collection should, at minimum, contain a price (in any currency, but for simplicity, use dollars). + +A simple collection can hold an ID on an item (a pointer to the item, which may be kept elsewhere on the system) and the associated price of an item. + +A good data structure that can easily capture this is a key/value structure. In C#, the first thing that comes to mind is `Hashtable`. + +In the app code, add a new capability to the `IShoppingAPI` interface: + + +``` +`int AddItem(Hashtable item);` +``` + +This new capability accepts one item (an instance of a `Hashtable`) and returns the number of items found in the shopping basket. + +In your tests, replace the hard-coded value with a call to the interface: + + +``` +[Fact] +public void Add1ItemBasketHas1Item() {             +    var expectedNoOfItems = 1; +    Hashtable item = [new][3] Hashtable(); +    var actualNoOfItems = shoppingAPI.AddItem(item); +    Assert.Equal(expectedNoOfItems, actualNoOfItems); +} +``` + +This code instantiates `Hashtable` and names it `item`, then invokes `AddItem(item)` on the shopping interface, which returns the actual number of items in the basket. + +To implement it, turn to the `ShoppingAPI` class: + + +``` +public int AddItem(Hashtable item) { +    return 0; +} +``` + +You are faking it again just to see the results of your tests (which are the first customers of your code). Should the test fail (as expected), replace the hard-coded values with actual code: + + +``` +public int AddItem(Hashtable item) { +    basket.Add(item); +    return basket.Count; +} +``` + +In the working code, add an item to the basket, and then return the count of the items in the basket: + + +``` +Test Run Successful. +Total tests: 2 +     Passed: 2 + Total time: 1.0633 Seconds +``` + +So now you have two tests passing and have pretty much covered **Z** and **O**, the first two parts of **ZOMBIES**. + +### A moment of reflection + +If you look back at what you've done so far, you will notice that by focusing your attention on dealing with the simplest possible **Z**ero and **O**ne scenarios, you have managed to create an interface as well as define some processing logic boundaries! Isn't that awesome? You now have the most important abstractions partially implemented, and you know how to process cases where nothing is added and when one thing is added. And because you are building an e-commerce API, you certainly do not foresee placing any other boundaries that would limit your customers when shopping. Your virtual shopping basket is, for all intents and purposes, limitless. + +Another important (although not necessarily immediately obvious) aspect of the stepwise refinement that **ZOMBIES** offers is a reluctance to leap head-first into the brambles of implementation. You may have noticed how sheepish this is about implementing anything. For starters, it's better to fake the implementation by hard-coding the values. Only after you see that the interface interacts with your test in a sensible way are you willing to roll up your sleeves and harden the implementation code. + +But even then, you should always prefer simple, straightforward constructs. And strive to avoid conditional logic as much as you can. + +### Many in action + +Expand your application by defining your expectations when a customer adds two items to the basket. The first test is a fake. It expects 2, but force it to fail by hard-coding 0 items: + + +``` +[Fact] +public void Add2ItemsBasketHas2Items() { +        var expectedNoOfItems = 2; +        var actualNoOfItems = 0; +        Assert.Equal(expectedNoOfItems, actualNoOfItems); +} +``` + +When you run the test, two of them pass successfuy (the previous two, the **Z** and **O** tests), but as expected, the hard-coded test fails: + + +``` +A total of 1 test files matched the specified pattern. +[xUnit.net 00:00:00.57] tests.UnitTest1.Add2ItemsBasketHas2Items [FAIL] +  X tests.UnitTest1.Add2ItemsBasketHas2Items [2ms] +  Error Message: +   Assert.Equal() Failure +Expected: 2 +Actual: 0 + +Test Run Failed. +Tatal tests: 3 +     Passed: 2 +     Failed: 1 +``` + +Replace the hard-coded values with the call to the app code: + + +``` +[Fact] +public void Add2ItemsBasketHas2Items() { +        var expectedNoOfItems = 2; +        Hashtable item = [new][3] Hashtable(); +        shoppingAPI.AddItem(item); +        var actualNoOfItems = shoppingAPI.AddItem(item); +        Assert.Equal(expectedNoOfItems, actualNoOfItems); +} +``` + +In the test, you add two items (actually, you're adding the same item twice) and then compare the expected number of items to the number of items from the `shoppingAPI` instance after adding the item the second time. + +All tests now pass! + +### Stay tuned + +You have now completed the first pass of the **ZOM** part of the equation. You did a pass on **Z**ero, on **O**ne, and on **M**any. In the next article, I'll take a look at **B** and **I**. Stay vigilant! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/build-expand-software + +作者:[Alex Bunardzic][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alex-bunardzic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security_password_chaos_engineer_monster.png?itok=J31aRccu (Security monster) +[2]: https://opensource.com/article/21/1/zombies-zero +[3]: http://www.google.com/search?q=new+msdn.microsoft.com From 5ab597cde00d7ca042f698d0a225369511bc253f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 3 Feb 2021 08:41:20 +0800 Subject: [PATCH 090/213] translated --- ...ips for preventing notification fatigue.md | 80 ------------------- ...ips for preventing notification fatigue.md | 76 ++++++++++++++++++ 2 files changed, 76 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20210128 4 tips for preventing notification fatigue.md create mode 100644 translated/tech/20210128 4 tips for preventing notification fatigue.md diff --git a/sources/tech/20210128 4 tips for preventing notification fatigue.md b/sources/tech/20210128 4 tips for preventing notification fatigue.md deleted file mode 100644 index 345b1adf8b..0000000000 --- a/sources/tech/20210128 4 tips for preventing notification fatigue.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (4 tips for preventing notification fatigue) -[#]: via: (https://opensource.com/article/21/1/alert-fatigue) -[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) - -4 tips for preventing notification fatigue -====== -Don't overwhelm yourself with alerts—set the ones that matter and let -the others go. You'll feel better and be more productive. -![Working on a team, busy worklife][1] - -In prior years, this annual series covered individual apps. This year, we are looking at all-in-one solutions in addition to strategies to help in 2021. Welcome to day 18 of 21 Days of Productivity in 2021. - -One thing I notice when I talk to people about productivity is that almost everyone is doing it to keep a clearer head. Instead of keeping all our appointments in our heads, we put them on a digital calendar that alerts us before the event. We have digital or physical notes so that we don't have to remember every little detail of something. We have to-do lists to remind us to do the things we need to do. - -![Text box offering to send notifications][2] - -NOPE (Kevin Sonney, [CC BY-SA 4.0][3]) - -So many applications, websites, and services want to alert us about every little thing that it is easy just to tune them all out. And if we don't do that, we start to suffer from *alert fatigue—*where we are on edge, just waiting for that next alert, and living in dread of it. - -Alert fatigue is very common among people who are on-call for their jobs. It also happens to people who have *FOMO—*the Fear Of Missing Out—and so set alerts on every keyword, hashtag, or mention on social media of a thing they are interested in. - -Setting up alerts that will get our attention but won't be ignored is tricky with all this going on. However, I do have some helpful hints, so that maybe the important alerts get past our own mental filters in this hectic world. - -![Alert for a task][4] - -I can ignore this, right? (Kevin Sonney, [CC BY-SA 4.0][3]) - - 1. Figure out what works better for you: Visual alerts or audible alerts. I use a combination of visual pop-ups and noises, but that is what works for me. Some people need tactile alerts—things like phone or watch vibrations. Find the one that works for you. - 2. Assign unique tones or visuals to important alerts. I have a friend who has the loudest, most obnoxious ring tone for work pages. It is _designed_ to get his attention and make him look at the alert. I have a light on my monitor that blinks red when I get an alert for work when I am on-call, as well as notifications sent to my phone. - 3. Turn off the alerts that don't actually matter. Social networks, websites, and apps want your attention. They don't care if you miss a meeting, are late to an appointment, or stay up until 4 am doom-scrolling. Turn off the ones that aren't important so the ones that are can be seen. - 4. Change things up every so often. What worked last month may not work next month. We adapt, we get used to things, and then we tune them out. If something isn't working, try something different! It can't hurt, and even if it doesn't work out, maybe you'll learn something new. - - - -![Blue alert indicators light][5] - -Blue is good. Red is bad. (Kevin Sonney, [CC BY-SA 4.0][3]) - -### Open source and choice - -A good application provides lots of choices for notifications. One of my favorites is the Etar calendar app for Android. [Etar is available from the open source F-droid repository][6]. - -Etar, like many open source applications, provides you with all the options, especially for notification settings. - -![Etar][7] - -(Seth Kenlon, [CC BY-SA 4.0][3]) - -With Etar, you can activate or deactivate pop-up notifications, set snooze times, snooze delay, whether to remind you about declined events, and so on. Combined with an intentional scheduling strategy, you can change the course of your day by taking control of how often your digital assistance nudges you about things you need to do. - -Reminders and alerts can be really useful, as long as we receive the ones that matter and pay attention to them. It can take some experimentation, but in the end, less noise is good, and it is easier to notice the alerts that truly need our attention. - -Need to keep your schedule straight? Learn how to do it using open source with these free... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/alert-fatigue - -作者:[Kevin Sonney][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/ksonney -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) -[2]: https://opensource.com/sites/default/files/day18-image1.png -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/sites/default/files/day18-image2.png -[5]: https://opensource.com/sites/default/files/day18-image3.png -[6]: https://f-droid.org/en/packages/ws.xsoh.etar/ -[7]: https://opensource.com/sites/default/files/etar.jpg (Etar) diff --git a/translated/tech/20210128 4 tips for preventing notification fatigue.md b/translated/tech/20210128 4 tips for preventing notification fatigue.md new file mode 100644 index 0000000000..e63eeda8d2 --- /dev/null +++ b/translated/tech/20210128 4 tips for preventing notification fatigue.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (4 tips for preventing notification fatigue) +[#]: via: (https://opensource.com/article/21/1/alert-fatigue) +[#]: author: (Kevin Sonney https://opensource.com/users/ksonney) + +防止通知疲劳的 4 个技巧 +====== +不要让提醒淹没自己:设置重要的提醒,让其他提醒消失。 你会感觉更好,工作效率更高。 +![Working on a team, busy worklife][1] + +在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十八天。 + +当我和人们谈论生产力时,我注意到一件事,那就是几乎每个人都是为了保持更清晰的头脑。我们不是把所有的约会都记在脑子里,而是把它们放在一个数字日历上,在事件发生前提醒我们。我们有数字或实体笔记,这样我们就不必记住某件事的每一个小细节。我们有待办事项清单,提醒我们去做该做的事情。 + +![Text box offering to send notifications][2] + +NOPE(Kevin Sonney, [CC BY-SA 4.0][3]) + +如此多的应用、网站和服务想要提醒我们每一件小事,以至于我们很容易就把它们全部调出来。而且,如果我们不这样做,我们将开始遭受**提醒疲劳**的困扰,这时我们处于边缘的状态,只是等待下一个提醒,并生活在恐惧之中。 + +提醒疲劳在那些因工作而被随叫随到的人中非常常见。它也发生在那些 **FOMO** (错失恐惧症)的人身上,从而对每一个关键词、标签或在社交媒体上提到他们感兴趣的事情都会设置提醒。 + +此时,设置能引起我们的注意,但不会被忽略的提醒是件棘手的事情。不过,我确实有一些有用的提示,这样重要的提醒可能会在这个忙碌的世界中越过我们自己的心理过滤器。 + +![Alert for a task][4] + +我可以忽略这个,对吧?(Kevin Sonney, [CC BY-SA 4.0][3]) + + 1. 弄清楚什么更适合你:视觉提醒或声音提醒。我使用视觉弹出和声音的组合,但这对我是有效的。有些人需要触觉提醒。比如手机或手表的震动。找到适合你的那一种。 + 2. 为重要的提醒指定独特的音调或视觉效果。我有一个朋友,他的工作页面有最响亮、最讨厌的铃声。这个_设计_是为了吸引他的注意力,让他看到提醒。我的显示器上有一盏灯,当我在待命时收到工作提醒时,它就会闪烁红灯,以及发送通知到我手机上。 + 3. 关掉那些其实不重要的警报。社交网络、网站和应用都希望得到你的关注。他们不会在意你是否错过会议、约会迟到,或者熬夜到凌晨4点厄运滚动。关掉那些不重要的,让那些重要的可以被看到。 + 4. 每隔一段时间就改变一下。上个月有效的东西,下个月可能就不行了。我们会适应、习惯一些东西,然后我们会忽略。如果有些东西不奏效,就换个东西试试吧!它不会伤害你,即使无法解决问题,也许你也会学到一些新知识。 + + +![Blue alert indicators light][5] + +蓝色是没问题。红色是有问题。(Kevin Sonney, [CC BY-SA 4.0][3]) + +### 开源和选择 + +一个好的应用为通知提供了很多选择。我最喜欢的一个是 Android 的 Etar 日历应用。[Etar 可以从开源 F-droid 仓库中获得][6]。 + +Etar 和许多开源应用一样,为你提供了所有的选项,尤其是通知设置。 + +![Etar][7] + +(Seth Kenlon, [CC BY-SA 4.0][3]) + +通过 Etar,你可以激活或停用弹出式通知,设置打盹时间、打盹延迟、是否提醒你已拒绝的事件等。结合有计划的日程安排策略,你可以通过控制数字助手对你需要做的事情进行提示的频率来改变你一天的进程。 + +提醒和警报真的很有用,只要我们收到重要的提醒并予以注意即可。这可能需要一些实验,但最终,少一些噪音是好事,而且更容易注意到真正需要我们注意的提醒。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/alert-fatigue + +作者:[Kevin Sonney][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/ksonney +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) +[2]: https://opensource.com/sites/default/files/day18-image1.png +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/sites/default/files/day18-image2.png +[5]: https://opensource.com/sites/default/files/day18-image3.png +[6]: https://f-droid.org/en/packages/ws.xsoh.etar/ +[7]: https://opensource.com/sites/default/files/etar.jpg (Etar) From ab6c613dfdf7685acce6736ba030b7274a9e19af Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 3 Feb 2021 08:46:53 +0800 Subject: [PATCH 091/213] translating --- .../20210201 Generate QR codes with this open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210201 Generate QR codes with this open source tool.md b/sources/tech/20210201 Generate QR codes with this open source tool.md index c26b7552bf..f33601d7d0 100644 --- a/sources/tech/20210201 Generate QR codes with this open source tool.md +++ b/sources/tech/20210201 Generate QR codes with this open source tool.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4a89ca30943b7ed0bd56727de129265550321022 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Wed, 3 Feb 2021 10:05:22 +0800 Subject: [PATCH 092/213] Delete 20210126 Write GIMP scripts to make image processing faster.md --- ...scripts to make image processing faster.md | 271 ------------------ 1 file changed, 271 deletions(-) delete mode 100644 sources/tech/20210126 Write GIMP scripts to make image processing faster.md diff --git a/sources/tech/20210126 Write GIMP scripts to make image processing faster.md b/sources/tech/20210126 Write GIMP scripts to make image processing faster.md deleted file mode 100644 index ffe60e8538..0000000000 --- a/sources/tech/20210126 Write GIMP scripts to make image processing faster.md +++ /dev/null @@ -1,271 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (amwps290) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Write GIMP scripts to make image processing faster) -[#]: via: (https://opensource.com/article/21/1/gimp-scripting) -[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) - -Write GIMP scripts to make image processing faster -====== -Learn GIMP's scripting language Script-Fu by adding an effect to a batch -of images. -![Painting art on a computer screen][1] - -Some time ago, I wanted to give a blackboard-style look to a typeset equation. I started playing around with the [GNU Image Manipulation Program (GIMP)][2] and was satisfied with the result. The problem was that I had to perform several actions on the image, I wanted to use this style again, and I did not want to repeat the steps for all the images. Besides, I was sure that I would forget them in no time. - -![Fourier transform equations][3] - -Fourier transform equations (Cristiano Fontana, [CC BY-SA 4.0][4]) - -GIMP is a great open source image editor. Although I have been using it for years, I had never investigated its batch-processing abilities nor its [Script-Fu menu][5]. This was the perfect chance to explore them. - -### What is Script-Fu? - -[Script-Fu][6] is the scripting language built into GIMP. It is an implementation of the [Scheme][7] programming language. If you have never used Scheme, give it a try, as it can be very useful. I think Script-Fu is a great way to start because it has an immediate effect on image processing, so you can feel productive very quickly. You can also write scripts in [Python][8], but Script-Fu is the default option. - -To help you get acquainted with Scheme, GIMP's documentation offers an [in-depth tutorial][9]. Scheme is a [Lisp][10]-like language, so a major characteristic is that it uses a [prefix notation][11] and a [lot of parentheses][12]. Functions and operators are applied to a list of operands by prefixing them: - - -``` -(function-name operand operand ...) - -(+ 2 3) -↳ Returns 5 - -(list 1 2 3 5) -↳ Returns a list containing 1, 2, 3, and 5 -``` - -It took me a while to find the documentation for the full list of GIMP's functions, but it was actually straightforward. In the **Help** menu, there is a **Procedure Browser** with very extensive and detailed documentation about all the possible functions. - -![GIMP Procedure Browser][13] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -### Accessing GIMP's batch mode - -You can run GIMP with batch mode enabled by using the `-b` option. The `-b` option's argument can be the script you want to run or a dash (`-`) that makes GIMP launch in an interactive mode instead of the command line. Normally when you start GIMP, it loads its graphical user interface (GUI), but you can disable that with the `-i` option. - -### Writing your first script - -Create a file called `chalk.scm` and save it to the `scripts` folder found in the **Preferences** window under **Folders → Scripts**. In my case, it is at `$HOME/.config/GIMP/2.10/scripts`. - -Inside the `chalk.scm` file, write your first script with: - - -``` -(define (chalk filename grow-pixels spread-amount percentage) -   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) -          (drawable (car (gimp-image-get-active-layer image))) -          (new-filename (string-append "modified_" filename))) -     (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) -     (gimp-selection-grow image grow-pixels) -     (gimp-context-set-foreground '(0 0 0)) -     (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) -     (gimp-selection-none image) -     (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) -     (gimp-drawable-invert drawable TRUE) -     (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) -     (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) -     (gimp-image-delete image))) -``` - -### Defining the script variables - -In the script, the `(define (chalk filename grow-pixels spread-amound percentage) ...)` function defines a new function called `chalk` that accepts the parameters: `filename`, `grow-pixels`, `spread-amound`, and `percentage`. Everything else inside the `define` function is the body of the `chalk` function. You might have noticed that variables with long names are spelled with dashes between the words; this is the idiomatic style of Lisp-like languages. - -The `(let* ...)` function is a special procedure that allows you to define some temporary variables that are valid only inside the body. In this case, the variables are `image`, `drawable`, and `new-filename`. It loads the image with `gimp-file-load`, which returns a list that includes the image, then it selects the first entry with the `car` function. Then, it selects the first active layer and stores its reference in the `drawable` variable. Finally, it defines the string containing the new filename of the resulting image. - -To help you better understand the procedure, I'll break it down. First, start GIMP with the GUI enabled and the Script-Fu console, which is found in **Filters → Script-Fu → Console**. In this case, you cannot use `let*` because the variables must be persistent. Define the `image` variable using the `define` function, and give it the proper path to find the image: - - -``` -`(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png")))` -``` - -It appears that nothing has happened in the GUI, but the image is loaded. You need to enable the image display with: - - -``` -`(gimp-display-new image)` -``` - -![GUI with the displayed image][14] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Now, get the active layer and store it in the `drawable` variable: - - -``` -`(define drawable (car (gimp-image-get-active-layer image)))` -``` - -Finally, define the image's new filename: - - -``` -`(define new-filename "modified_Fourier.png")` -``` - -Here is what you should see in the Script-Fu console after running these commands: - -![Script-Fu console][15] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Before acting on the image, you need to define the variables that would be defined as the function arguments in the script: - - -``` -(define grow-pixels 2) -(define spread-amount 4) -(define percentage 3) -``` - -### Acting on the image - -Now that all the relevant variables are defined, you can act on the image. The script's actions can be executed directly on the console. The first step is to select the color black on the active layer. The color is written as a list of three numbers—either as `(list 0 0 0)` or `'(0 0 0)`: - - -``` -`(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0))` -``` - -![Image with the selected color][16] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Grow the selection by two pixels: - - -``` -`(gimp-selection-grow image grow-pixels)` -``` - -![Image with the selected color][17] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Set the foreground color to black, and fill the selection with it: - - -``` -(gimp-context-set-foreground '(0 0 0)) -(gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) -``` - -![Image with the selection filled with black][18] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Delete the selection: - - -``` -`(gimp-selection-none image)` -``` - -![Image with no selection][19] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Move the pixels around randomly: - - -``` -`(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount)` -``` - -![Image with pixels moved around][20] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Invert the image colors: - - -``` -`(gimp-drawable-invert drawable TRUE)` -``` - -![Image with pixels moved around][21] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Randomize the pixels: - - -``` -`(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0)` -``` - -![Image with pixels moved around][22] - -(Cristiano Fontana, [CC BY-SA 4.0][4]) - -Save the image to a new file: - - -``` -`(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename)` -``` - -![Equations of the Fourier transform and its inverse][23] - -Fourier transform equations (Cristiano Fontana, [CC BY-SA 4.0][4]) - -### Running the script in batch mode - -Now that you know what the script does, you can run it in batch mode: - - -``` -`gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)'` -``` - -After the `chalk` function runs, it calls a second function with the `-b` option to tell GIMP to quit: `gimp-quit`. - -### Learn more - -This tutorial showed you how to get started with GIMP's built-in scripting features and introduced Script-Fu, GIMP's Scheme implementation. If you want to move forward, I suggest you look at the official documentation and its [tutorial][9]. If you are not familiar with Scheme or Lisp, the syntax could be a little intimidating at first, but I suggest you give it a try anyway. It might be a nice surprise. - -Professional design software like Photoshop is terrific, but it’s also expensive. What do you do... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/gimp-scripting - -作者:[Cristiano L. Fontana][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/cristianofontana -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) -[2]: https://www.gimp.org/ -[3]: https://opensource.com/sites/default/files/uploads/fourier.png (Fourier transform equations) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://docs.gimp.org/en/gimp-filters-script-fu.html -[6]: https://docs.gimp.org/en/gimp-concepts-script-fu.html -[7]: https://en.wikipedia.org/wiki/Scheme_(programming_language) -[8]: https://docs.gimp.org/en/gimp-filters-python-fu.html -[9]: https://docs.gimp.org/en/gimp-using-script-fu-tutorial.html -[10]: https://en.wikipedia.org/wiki/Lisp_%28programming_language%29 -[11]: https://en.wikipedia.org/wiki/Polish_notation -[12]: https://xkcd.com/297/ -[13]: https://opensource.com/sites/default/files/uploads/procedure_browser.png (GIMP Procedure Browser) -[14]: https://opensource.com/sites/default/files/uploads/gui01_image.png (GUI with the displayed image) -[15]: https://opensource.com/sites/default/files/uploads/console01_variables.png (Script-Fu console) -[16]: https://opensource.com/sites/default/files/uploads/gui02_selected.png (Image with the selected color) -[17]: https://opensource.com/sites/default/files/uploads/gui03_grow.png (Image with the selected color) -[18]: https://opensource.com/sites/default/files/uploads/gui04_fill.png (Image with the selection filled with black) -[19]: https://opensource.com/sites/default/files/uploads/gui05_no_selection.png (Image with no selection) -[20]: https://opensource.com/sites/default/files/uploads/gui06_spread.png (Image with pixels moved around) -[21]: https://opensource.com/sites/default/files/uploads/gui07_invert.png (Image with pixels moved around) -[22]: https://opensource.com/sites/default/files/uploads/gui08_hurl.png (Image with pixels moved around) -[23]: https://opensource.com/sites/default/files/uploads/modified_fourier.png (Equations of the Fourier transform and its inverse) From d2967e9bf2737ad23caec920714df2ef1466f84f Mon Sep 17 00:00:00 2001 From: amwps290 Date: Wed, 3 Feb 2021 10:15:12 +0800 Subject: [PATCH 093/213] translated --- ...scripts to make image processing faster.md | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 translated/tech/20210126 Write GIMP scripts to make image processing faster.md diff --git a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md b/translated/tech/20210126 Write GIMP scripts to make image processing faster.md new file mode 100644 index 0000000000..72007740eb --- /dev/null +++ b/translated/tech/20210126 Write GIMP scripts to make image processing faster.md @@ -0,0 +1,271 @@ +[#]: collector: (lujun9972) +[#]: translator: (amwps290) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Write GIMP scripts to make image processing faster) +[#]: via: (https://opensource.com/article/21/1/gimp-scripting) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +编写 GIMP 脚本使图像处理更快 +====== +通过向一批图像添加效果来学习 GIMP 的脚本语言 Script-Fu。 + +![Painting art on a computer screen][1] + +前一段时间,我想给方程图片加一个黑板式的外观。 我开始使用 [GNU Image Manipulation Program (GIMP)][2] 来处理,并对结果感到满意。 问题是我必须对图像执行几个操作,当我想再次使用此样式,不想对所有图像重复这些步骤。 此外,我确信我会很快忘记他们。 + +![Fourier transform equations][3] + +傅立叶变换方程式(Cristiano Fontana,[CC BY-SA 4.0] [4]) + +GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年,但从未研究过其批处理功能或 [Script-Fu][5] 菜单。 这是探索它们的绝好机会。 + +### 什么是 Script-Fu? + +[Script-Fu][6] 是 GIMP 内置的脚本语言。 是一种基于 [Scheme ][7]的编程语言。 如果您从未使用过 Scheme,请尝试一下,因为它可能非常有用。 我认为 Script-Fu 是一个很好的入门方法,因为它对图像处理具有立竿见影的效果,因此您可以非常快速地提高工作效率。 您也可以使用 [Python][8] 编写脚本,但是 Script-Fu 是默认选项。 + +为了帮助您熟悉 Scheme,GIMP 的文档提供了深入的[教程][9]。 Scheme 是一种类似于 [Lisp][10] 的语言,因此主要特征是它使用[前缀][11]表示法和[许多括号][12]。 通过为操作数和操作符添加前缀来将它们应用到操作数列表: + + +``` +(function-name operand operand ...) + +(+ 2 3) +↳ Returns 5 + +(list 1 2 3 5) +↳ Returns a list containing 1, 2, 3, and 5 +``` + +我花了一些时间才能找到 GIMP 功能完整列表的文档,但实际上很简单。 在 **Help** 菜单中,有一个 **Procedure Browser**,其中包含有关所有可能功能的非常详尽的文档。 + +![GIMP Procedure Browser][13] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +### 使用 GIMP 的批处理模式 + +您可以使用 `-b` 选项以批处理的方式启动 GIMP. `-b` 选项的参数可以是你想要运行的脚本,或者用一个 `-` 来让 GIMP 进入交互模式而不是命令行模式。正常情况下,当你启动 GIMP 的时候,它会启动图形界面,但是你可以使用 `-i` 选项来禁用它。 + +### 开始编写你的第一个脚本 + +创建一个名为 `chalk.scm` 的文件,并把它保存在 **Preferences** 窗口中 **Folders** 选项下的 **Script** 中指定的 `script` 文件夹下。就我而言,是在 `$HOME/.config/GIMP/2.10/scripts`. + +在 `chalk.scm` 文件中,写入下面的内容: + + +``` +(define (chalk filename grow-pixels spread-amount percentage) +   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) +          (drawable (car (gimp-image-get-active-layer image))) +          (new-filename (string-append "modified_" filename))) +     (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) +     (gimp-selection-grow image grow-pixels) +     (gimp-context-set- '(0 0 0)) +     (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) +     (gimp-selection-none image) +     (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) +     (gimp-drawable-invert drawable TRUE) +     (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) +     (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) +     (gimp-image-delete image))) +``` + +### 定义脚本变量 + +在脚本中, `(define (chalk filename grow-pixels spread-amound percentage) ...)` 函数定义了一个名叫 `chalk` 的新函数。它的函数参数是 `filename`, `grow-pixels`, `spread-amound` 和 `percentage`. 在 `define` 中的所有内容都是 `chalk` 函数的主体。你可能已经注意到,那些名字比较长的变量中间都有一个破折号来分割。这是类 Lisp 语言的惯用风格。 + +`(let* ...)` 函数是一个特殊的函数可以让你定义一些只有在这个函数体中才有效的临时变量。临时变量有 `image`, `drawable`, 以及 `new-filename`. 它使用 `gimp-file-load` 来载入图片,这会返回它所包含的图片的一个列表。并通过 `car` 函数来选取第一项。 然后,它选择第一个活动层并将其引用存储在 `drawable` 变量中。 最后,它定义了包含图像新文件名的字符串。 + +为了帮助您更好地了解该过程,我将对其进行分解。 首先,启动带 GUI 的 GIMP,然后你可以通过依次点击 **Filters → Script-Fu → Console** 来打开 Script-Fu 控制台。 在这种情况下,不能使用 `let *`,因为变量必须是持久的。 使用 `define` 函数定义 `image` 变量,并为其提供查找图像的正确路径: + + +``` +`(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png")))` +``` + +似乎在 GUI 中什么也没有发生,但是图像已加载。 您需要通过以下方式来让图像显示: + + +``` +`(gimp-display-new image)` +``` + +![GUI with the displayed image][14] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +现在,获取活动层并将其存储在 `drawable` 变量中: + + +``` +`(define drawable (car (gimp-image-get-active-layer image)))` +``` + +最后,定义图像的新文件名: + + +``` +`(define new-filename "modified_Fourier.png")` +``` + +运行命令后,您将在 Script-Fu 控制台中看到以下内容: + +![Script-Fu console][15] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +在对图像执行操作之前,需要定义将在脚本中作为函数参数的变量: + + +``` +(define grow-pixels 2) +(define spread-amount 4) +(define percentage 3) +``` + +### 处理图片 + +现在,所有相关变量都已定义,您可以对图像进行操作了。 脚本的操作可以直接在控制台上执行。第一步是在活动层上选择黑色。 颜色被写成一个由三个数字组成的列表,即 `(list 0 0 0)` 或者是 `'(0 0 0)`: + + +``` +`(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0))` +``` + +![Image with the selected color][16] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +扩大选取两个像素: + + +``` +`(gimp-selection-grow image grow-pixels)` +``` + +![Image with the selected color][17] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +将前景色设置为黑色,并用它填充选区: + + +``` +(gimp-context-set-foreground '(0 0 0)) +(gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) +``` + +![Image with the selection filled with black][18] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +删除选区: + + +``` +`(gimp-selection-none image)` +``` + +![Image with no selection][19] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +随机移动像素: + + +``` +`(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount)` +``` + +![Image with pixels moved around][20] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +反转图像颜色: + + +``` +`(gimp-drawable-invert drawable TRUE)` +``` + +![Image with pixels moved around][21] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +随机化像素: + + +``` +`(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0)` +``` + +![Image with pixels moved around][22] + +(Cristiano Fontana, [CC BY-SA 4.0][4]) + +将图像保存到新文件: + + +``` +`(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename)` +``` + +![Equations of the Fourier transform and its inverse][23] + +傅立叶变换方程 (Cristiano Fontana, [CC BY-SA 4.0][4]) + +### 以批处理模式运行脚本 + +现在您知道了脚本的功能,可以在批处理模式下运行它: + + +``` +`gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)'` +``` + +在运行 `chalk` 函数之后,它将使用 `-b` 选项调用第二个函数 `gimp-quit` 来告诉 GIMP 退出。 + +### 了解更多 + +本教程向您展示了如何开始使用 GIMP 的内置脚本功能,并介绍了 GIMP 的 Scheme 实现的 Script-Fu。 如果您想继续前进,建议您查看官方文档及其[入门教程][9]。 如果您不熟悉 Scheme 或 Lisp,那么一开始的语法可能有点吓人,但我还是建议您尝试一下。 这可能是一个不错的惊喜。 + +Photoshop 之类的专业设计软件非常棒,但价格也很昂贵。 你会怎么做... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/gimp-scripting + +作者:[Cristiano L. Fontana][a] +选题:[lujun9972][b] +译者:[amwps290](https://github.com/amwps290) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) +[2]: https://www.gimp.org/ +[3]: https://opensource.com/sites/default/files/uploads/fourier.png (Fourier transform equations) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://docs.gimp.org/en/gimp-filters-script-fu.html +[6]: https://docs.gimp.org/en/gimp-concepts-script-fu.html +[7]: https://en.wikipedia.org/wiki/Scheme_(programming_language) +[8]: https://docs.gimp.org/en/gimp-filters-python-fu.html +[9]: https://docs.gimp.org/en/gimp-using-script-fu-tutorial.html +[10]: https://en.wikipedia.org/wiki/Lisp_%28programming_language%29 +[11]: https://en.wikipedia.org/wiki/Polish_notation +[12]: https://xkcd.com/297/ +[13]: https://opensource.com/sites/default/files/uploads/procedure_browser.png (GIMP Procedure Browser) +[14]: https://opensource.com/sites/default/files/uploads/gui01_image.png (GUI with the displayed image) +[15]: https://opensource.com/sites/default/files/uploads/console01_variables.png (Script-Fu console) +[16]: https://opensource.com/sites/default/files/uploads/gui02_selected.png (Image with the selected color) +[17]: https://opensource.com/sites/default/files/uploads/gui03_grow.png (Image with the selected color) +[18]: https://opensource.com/sites/default/files/uploads/gui04_fill.png (Image with the selection filled with black) +[19]: https://opensource.com/sites/default/files/uploads/gui05_no_selection.png (Image with no selection) +[20]: https://opensource.com/sites/default/files/uploads/gui06_spread.png (Image with pixels moved around) +[21]: https://opensource.com/sites/default/files/uploads/gui07_invert.png (Image with pixels moved around) +[22]: https://opensource.com/sites/default/files/uploads/gui08_hurl.png (Image with pixels moved around) +[23]: https://opensource.com/sites/default/files/uploads/modified_fourier.png (Equations of the Fourier transform and its inverse) From 7ea59187def0269b8d959229f27a392debfe50b2 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Wed, 3 Feb 2021 10:21:15 +0800 Subject: [PATCH 094/213] Update 20210120 Learn JavaScript by writing a guessing game.md --- .../20210120 Learn JavaScript by writing a guessing game.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210120 Learn JavaScript by writing a guessing game.md b/sources/tech/20210120 Learn JavaScript by writing a guessing game.md index c7ed63e81e..a285bf45cf 100644 --- a/sources/tech/20210120 Learn JavaScript by writing a guessing game.md +++ b/sources/tech/20210120 Learn JavaScript by writing a guessing game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 7c33f69ada4d309128c25b9d5d20d2416fe52398 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 3 Feb 2021 10:58:43 +0800 Subject: [PATCH 095/213] PRF @MjSeven --- .../20201013 My first day using Ansible.md | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/translated/tech/20201013 My first day using Ansible.md b/translated/tech/20201013 My first day using Ansible.md index 4182d6fa45..93bc08d699 100644 --- a/translated/tech/20201013 My first day using Ansible.md +++ b/translated/tech/20201013 My first day using Ansible.md @@ -1,6 +1,6 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "My first day using Ansible" @@ -9,16 +9,18 @@ 使用 Ansible 的第一天 ====== -一名系统管理员分享了如何使用 Ansible 在网络中配置计算机并把其带入实际工作的信息和建议。 -![People work on a computer server with devices][1] -无论是第一次还是第五十次,启动并运行一台新的物理或虚拟计算机都非常耗时,而且需要大量的工作。多年来,我一直使用我创建的一系列脚本和 RPM 来安装所需的软件包,并为我喜欢的工具配置选项。这种方法效果很好,简化了我的工作,而且还减少了在键盘上输入命令的时间。 +> 一名系统管理员分享了如何使用 Ansible 在网络中配置计算机并把其带入实际工作的信息和建议。 -我一直在寻找更好的工作方式。近几年来,我一直在听到并且读到有关 [Ansible][2] 的信息,它是一个自动配置和管理系统的强大工具。Ansible 允许系统管理员在一个或多个剧本中为每个主机指定一个特定状态,然后执行使主机进入该状态的所有任务。包括安装或删除各种资源,例如 RPM 或 Apt 软件包、配置和其它文件、用户、组等等。 +![](https://img.linux.net.cn/data/attachment/album/202102/03/105826sn41jj0i8evu19nn.jpg) + +无论是第一次还是第五十次,启动并运行一台新的物理或虚拟计算机都非常耗时,而且需要大量的工作。多年来,我一直使用我创建的一系列脚本和 RPM 来安装所需的软件包,并为我喜欢的工具配置各种选项。这种方法效果很好,简化了我的工作,而且还减少了在键盘上输入命令的时间。 + +我一直在寻找更好的工作方式。近几年来,我一直在听到并且读到有关 [Ansible][2] 的信息,它是一个自动配置和管理系统的强大工具。Ansible 允许系统管理员在一个或多个剧本playbook中为每个主机指定一个特定状态,然后执行各种必要的任务,使主机进入该状态。这包括安装或删除各种资源,例如 RPM 或 Apt 软件包、配置文件和其它文件、用户、组等等。 因为一些琐事,我推迟了很长一段时间学习如何使用它。直到最近,我遇到了一个我认为 Ansible 可以轻松解决的问题。 -这篇文章并不会完整地告诉你如何入门 Ansible,相反,它只是对我遇到的问题和我在一些隐秘的地方发现的信息的做一些记录。我在各种在线讨论和问答小组中找到的有关 Ansible 的许多信息都是错误的。错误范围包括明显的老旧信息(没有任何日期或来源的迹象),还有一些是完全错误的信息。 +这篇文章并不会完整地告诉你如何入门 Ansible,相反,它只是对我遇到的问题和我在一些隐秘的地方发现的信息的做了一些记录。我在各种在线讨论和问答小组中找到的有关 Ansible 的许多信息都是错误的。错误范围包括明显的老旧信息(没有任何日期或来源的迹象),还有一些是完全错误的信息。 本文所介绍的内容是有用的,尽管可能还有其它方法可以完成相同的事情,但我使用的是 Ansible 2.9.13 和 [Python][3] 3.8.5。 @@ -32,13 +34,13 @@ ### 开始 -我读过许多有关 Ansible 的好文章和书籍,但从来没有遇到过“我必须把这个用到工作中”那种情况。但是,现在就是这种情况。 +我读过许多有关 Ansible 的好文章和书籍,但从来没有在“我必须现在就把这个做好!”的情况下读过。而现在 —— 好吧,就是现在! 在重读这些文档时,我发现它们主要是在讨论如何从 GitHub 开始安装并使用 Ansible,这很酷。但是我真的只是想尽快开始,所以我使用 DNF 和 Fedora 仓库中的版本在我的 Fedora 工作站上安装了它,非常简单。 但是后来我开始寻找文件位置,并尝试确定需要修改哪些配置文件、将我的剧本保存在什么位置,甚至一个剧本怎么写以及它的作用,我脑海中有一大堆(到目前为止)悬而未决的问题。 -因此,在没有进一步描述我的困难的情况下,以下是我发现的东西以及促使我继续前进的东西。 +因此,不不需要进一步描述我的困难的情况下,以下是我发现的东西以及促使我继续前进的东西。 ### 配置 @@ -46,9 +48,9 @@ Ansible 的配置文件保存在 `/etc/ansible` 中,这很有道理,因为 ` #### ansible.cfg -在进行文档和线上找到的一些实践练习之后,我遇到了一些有关弃用某些较旧的 Python 文件的警告信息。因此,我在 `ansible.cfg` 中将 `deprecation_warnings` 设置为 `false`,这样那些愤怒的红色警告消息就不会出现了: +在进行了从文档和线上找到的一些实践练习之后,我遇到了一些有关弃用某些较旧的 Python 文件的警告信息。因此,我在 `ansible.cfg` 中将 `deprecation_warnings` 设置为 `false`,这样那些愤怒的红色警告消息就不会出现了: -```bash +``` deprecation_warnings = False ``` @@ -56,28 +58,28 @@ deprecation_warnings = False #### hosts 文件 -与 `/etc/hosts` 文件不同,`hosts` 文件也被称为清单文件,它列出了网络上的主机。此文件允许将主机分组到相关集合中,例如服务器、工作站和任何你所需的名称。这个文件包含帮助和大量示例,所以我在这里就不详细介绍了。但是,有些事情你必须知道。 +与 `/etc/hosts` 文件不同,`hosts` 文件也被称为清单inventory文件,它列出了网络上的主机。此文件允许将主机分组到相关集合中,例如“servers”、“workstations”和任何你所需的名称。这个文件包含帮助和大量示例,所以我在这里就不详细介绍了。但是,有些事情你必须知道。 -主机可以在任何组之外列出,但是组对于识别具有一个或多个共同特征的主机很有帮助。组使用 INI 格式,所以服务器组看起来像这样: +主机也可以列在组之外,但是组对于识别具有一个或多个共同特征的主机很有帮助。组使用 INI 格式,所以服务器组看起来像这样: ``` [servers] server1 server2 -...etc. +...... ``` -这个文件中必须有一个主机名,这样 Ansible 才能对它进行操作。尽管有些子命令允许指定主机名,但除非主机名在 `hosts` 文件中,否则命令会失败。一个主机也可以在多个组中。因此,除了 `[servers]` 组之外,`server1` 也可能是 `[webservers]` 组的成员,还可以是 `[ubuntu]` 组的成员,这样以区别于 Fedora 服务器。 +这个文件中必须有一个主机名,这样 Ansible 才能对它进行操作。即使有些子命令允许指定主机名,但除非主机名在 `hosts` 文件中,否则命令会失败。一个主机也可以放在多个组中。因此,除了 `[servers]` 组之外,`server1` 也可能是 `[webservers]` 组的成员,还可以是 `[ubuntu]` 组的成员,这样以区别于 Fedora 服务器。 -Ansible 很智能。如果 `all` 参数用作主机名,Ansible 会扫描 `hosts` 文件并在它列出的所有主机上执行定义的任务。Ansible 只会尝试在每个主机上工作一次,不管它出现在多少个组中。这也意味着不需要定义 "all" 组,因为 Ansible 可以确定文件中的所有主机名,并创建自己唯一的主机名列表。 +Ansible 很智能。如果 `all` 参数用作主机名,Ansible 会扫描 `hosts` 文件并在它列出的所有主机上执行定义的任务。Ansible 只会尝试在每个主机上工作一次,不管它出现在多少个组中。这也意味着不需要定义 `all` 组,因为 Ansible 可以确定文件中的所有主机名,并创建自己唯一的主机名列表。 -另一件需要注意的事情是单个主机的多个条目。我在 DNS 文件中使用 `CNAME` 记录来创建别名,这些别名指向某些主机的 [A 记录][5],这样,我可以将一个主机称为 `host1` 或 `h1` 或 `myhost`。如果你在 `hosts` 文件中为同一主机指定多个主机名,则 Ansible 将尝试在所有这些主机名上执行其任务,它无法知道它们指向同一主机。好消息是,这并不会影响整体结果;它只是多花了一点时间,因为 Ansible在辅助主机名上工作,它会确定所有操作均已执行。 +另一件需要注意的事情是单个主机的多个条目。我在 DNS 文件中使用 `CNAME` 记录来创建别名,这些别名指向某些主机的 [A 记录][5],这样,我可以将一个主机称为 `host1` 或 `h1` 或 `myhost`。如果你在 `hosts` 文件中为同一主机指定多个主机名,则 Ansible 将尝试在所有这些主机名上执行其任务,它无法知道它们指向同一主机。好消息是,这并不会影响整体结果;它只是多花了一点时间,因为 Ansible 会在次要主机名上工作,它会确定所有操作均已执行。 -### Ansible facts +### Ansible 实情 -我阅读过 Ansible 的大多数材料都谈到了 [Ansible facts][6],它是与远程系统相关的数据,包括操作系统、IP 地址、文件系统等等。这些信息可以通过其它方式获得,如 `lshw`、`dmidecode` 或 `/proc` 文件系统等。但是 Ansible 会生成一个包含此信息的 JSON 文件。每次 Ansible 运行时,它都会生成这些数据。在这个数据流中,有大量的信息都是键值对形式:`<"变量名": "值">`。所有这些变量都可以在 Ansible 剧本中使用,理解海量信息的最好方法是亲自实践: +我阅读过 Ansible 的大多数材料都谈到了 Ansible [实情][6]facts,它是与远程系统相关的数据,包括操作系统、IP 地址、文件系统等等。这些信息可以通过其它方式获得,如 `lshw`、`dmidecode` 或 `/proc` 文件系统等。但是 Ansible 会生成一个包含此信息的 JSON 文件。每次 Ansible 运行时,它都会生成这些实情数据。在这个数据流中,有大量的信息,都是以键值对形式出现的:`<"variable-name": "value">`。所有这些变量都可以在 Ansible 剧本中使用,理解大量可用信息的最好方法是实际显示一下: -```bash +``` # ansible -m setup | less ``` @@ -85,23 +87,23 @@ Ansible 很智能。如果 `all` 参数用作主机名,Ansible 会扫描 `host ### 模块 -`ansible` 命令使用 `-m` 选项来指定 `setup` 模块。Ansible 已经内置了许多模块,所以你不需要使用 -m。也可以安装许多下载的模块,但是内置模块可以完成我目前项目所需的一切。 +上面的 `ansible` 命令使用 `-m` 选项来指定 `setup` 模块。Ansible 已经内置了许多模块,所以你对这些模块不需要使用 `-m`。也可以安装许多下载的模块,但是内置模块可以完成我目前项目所需的一切。 ### 剧本 -剧本可以放在任何地方。因为我需要以 root 身份运行,所以我将它放在了 `/root/ansible` 下。当我运行 Ansible 时,只要这个目录是当前的工作目录(PWD),它就可以找到我的剧本。Ansible 还有一个选项,用于在运行时指定其它剧本和位置。 +剧本playbook几乎可以放在任何地方。因为我需要以 root 身份运行,所以我将它放在了 `/root/ansible` 下。当我运行 Ansible 时,只要这个目录是当前的工作目录(PWD),它就可以找到我的剧本。Ansible 还有一个选项,用于在运行时指定不同的剧本和位置。 -剧本可以包含注释,但是我看到的文章或书籍很少提及此。作为一个相信记录的系统管理员,我发现使用注释很有帮助。这并不是和任务名称做同样的事情,而是要确定任务组的目的,并确保我以某种方式或顺序记录我做这些事情的原因。当我可能忘记最初的想法时,这可以帮助以后解决调试问题。 +剧本可以包含注释,但是我看到的文章或书籍很少提及此。但作为一个相信记录一切的系统管理员,我发现使用注释很有帮助。这并不是说在注释中做和任务名称同样的事情,而是要确定任务组的目的,并确保我以某种方式或顺序记录我做这些事情的原因。当我可能忘记最初的想法时,这可以帮助以后解决调试问题。 -剧本只是定义主机所需状态的任务集合。在剧本的开头指定主机名或目录组,并定义 Ansible 将在其上运行剧本的主机。 +剧本只是定义主机所需状态的任务集合。在剧本的开头指定主机名或清单组,并定义 Ansible 将在其上运行剧本的主机。 以下是我的一个剧本示例: -```bash +``` ################################################################################ # This Ansible playbook updates Midnight commander configuration files.        # ################################################################################ -\- name: Update midnight commander configuration files +- name: Update midnight commander configuration files   hosts: all     tasks: @@ -149,19 +151,18 @@ Ansible 很智能。如果 `all` 参数用作主机名,Ansible 会扫描 `host       mode: 0644       owner: root       group: root -<SNIP> +<截断> ``` 剧本从它自己的名字和它将要操作的主机开始,在本文中,所有主机都在我的 `hosts` 文件中。`tasks` 部分列出了使主机达到所需状态的特定任务。这个剧本从使用 DNF 更新 Midnight Commander 开始(如果它不是最新的版本的话)。下一个任务确保创建所需的目录(如果它们不存在),其余任务将文件复制到合适的位置,这些 `file` 和 `copy` 任务还可以为目录和文件设置所有权和文件模式。 剧本细节超出了本文的范围,但是我对这个问题使用了一点蛮力。还有其它方法可以确定哪些用户需要更新文件,而不是对每个用户的每个文件使用一个任务。我的下一个目标是简化这个剧本,使用一些更先进的技术。 -运行剧本很容易,只需要使用 `ansible-playbook` 命令。.yml 扩展名代表 YAML,我看到过它的几种不同含义,但我认为它是“另一种标记语言”,尽管有些人声称 YAML 不是这种语言。 +运行剧本很容易,只需要使用 `ansible-playbook` 命令。`.yml` 扩展名代表 YAML,我看到过它的几种不同含义,但我认为它是“另一种标记语言Yet Another Markup Language”,尽管有些人声称 YAML 不是这种语言。 这个命令将会运行剧本,它会更新 Midnight Commander 文件: - -```bash +``` # ansible-playbook -f 10 UpdateMC.yml ``` @@ -171,12 +172,11 @@ Ansible 很智能。如果 `all` 参数用作主机名,Ansible 会扫描 `host 剧本运行时会列出每个任务和执行结果。`ok` 代表任务管理的机器状态已经完成,因为在任务中定义的状态已经为真,所以 Ansible 不需要执行任何操作。 -`changed` 表示 Ansible 已经执行了指定的任务。在这种情况下,任务中定义的机器状态不为真,所以执行指定的操作使其为真。在彩色终端上,`TASK` 线会显示彩色。在我的咖啡色终端的主机上,`TASK` 线显示为琥珀色,`changed` 是棕色,`ok` 为绿色,错误是红色。 +`changed` 表示 Ansible 已经执行了指定的任务。在这种情况下,任务中定义的机器状态不为真,所以执行指定的操作使其为真。在彩色终端上,`TASK` 行会以彩色显示。我的终端配色为“amber-on-black”,`TASK` 行显示为琥珀色,`changed` 是棕色,`ok` 为绿色,错误是红色。 下面的输出是我最终用于在新主机执行安装后配置的剧本: - -```bash +``` PLAY [Post-installation updates, package installation, and configuration] TASK [Gathering Facts] @@ -205,16 +205,16 @@ changed: [testvm2] => (item=/root/ansible/PostInstallMain/files/MidnightComma TASK [create ~/.config/mc directory in /etc/skel] changed: [testvm2] -<SNIP> +<截断> ``` ### cowsay -如果你的计算机上安装了 [cowsay][7] 程序,你会发现 `TASK` 的名字出现在奶牛的语音泡泡中: +如果你的计算机上安装了 [cowsay][7] 程序,你会发现 `TASK` 的名字出现在奶牛的语音泡泡中: ```  ____________________________________ -< TASK [Ensure we have connectivity] > +< TASK [Ensure we have connectivity] >  ------------------------------------         \   ^__^          \  (oo)\\_______ @@ -244,19 +244,19 @@ changed: [testvm2]     └── UpdateMC.yml ``` -你可以使用任何结构。但是请注意,其它系统管理员可能需要使用你设置的剧本来工作,所以目录应该具有一定程度的逻辑。当我使用 RPM 和 Bash 脚本执行安装任务后,我的文件仓库有点分散,而且绝对没有任何逻辑结构。当我为许多管理任务创建剧本时,我将介绍一个更有逻辑的结构来管理我的目录。 +你可以使用任何结构。但是请注意,其它系统管理员可能需要使用你设置的剧本来工作,所以目录应该具有一定程度的逻辑。当我使用 RPM 和 Bash 脚本执行安装任务后,我的文件仓库有点分散,绝对没有任何逻辑结构。当我为许多管理任务创建剧本时,我将介绍一个更有逻辑的结构来管理我的目录。 -### 多个剧本运行 +### 多次运行剧本 根据需要或期望多次运行剧本是安全的。只有当主机状态与任务中指定的状态不匹配时,才会执行每个任务。这使得很容易从先前的剧本运行中遇到的错误中恢复。因为当剧本遇到错误时,它将停止运行。 -在测试我的第一个剧本时,我犯了很多错误并改正了它们。假设我的修正正确,那么剧本每次运行,都会跳过那些状态已与指定状态匹配的任务,执行不匹配状态的任务。当我的修复程序起作用时,前面失败的任务将成功完成,并且会执行此任务之后的任务--直到遇到另一个错误。 +在测试我的第一个剧本时,我犯了很多错误并改正了它们。假设我的修正正确,那么剧本每次运行,都会跳过那些状态已与指定状态匹配的任务,执行不匹配状态的任务。当我的修复程序起作用时,之前失败的任务就会成功完成,并且会执行此任务之后的任务 —— 直到遇到另一个错误。 这使得测试变得容易。我可以添加新任务,并且在运行剧本时,只有新任务会被执行,因为它们是唯一与测试主机期望状态不匹配的任务。 -### 一些想法 +### 一些思考 -有些任务不适合用 Ansible,因为有更好的方法可以实现特定的计算机状态。我想到的场景是使 VM 返回到初始状态,以便可以多次使用它来执行从已知状态开始的测试。让 VM 进入特定状态,然后对此时的计算机状态进行快照要容易得多。还原到该快照通常比 Ansible 将主机返回到之前状态相比,还原到快照通常会更容易且更快。在研究文章或测试新代码时,我每天都会做几次这样的事情。 +有些任务不适合用 Ansible,因为有更好的方法可以实现特定的计算机状态。我想到的场景是使 VM 返回到初始状态,以便可以多次使用它来执行从已知状态开始的测试。让 VM 进入特定状态,然后对此时的计算机状态进行快照要容易得多。还原到该快照与 Ansible 将主机返回到之前状态相比,通常还原到快照通常会更容易且更快。在研究文章或测试新代码时,我每天都会做几次这样的事情。 在完成用于更新 Midnight Commander 的剧本之后,我创建了一个新的剧本,用于在新安装的 Fedora 主机上执行安装任务。我已经取得了不错的进步,剧本比我第一个的更加复杂,但没有那么粗暴。 @@ -268,7 +268,7 @@ changed: [testvm2] 我找到的最完整、最有用的参考文档是 Ansible 网站上的[用户指南][9]。本文仅供参考,不作为入门文档。 -多年来,Opensource.com 已经发布了许多[有关 Ansible 的文章][10],我发现其中大多数对我的需求很有帮助。Enable Sysadmin 网站上也有很多对我有帮助 [Ansible 文章][11]。你可以通过查看本周(2020 年 10 月 13 日至 14 日)的 [AnsibleFest][12] 了解更多信息。该活动完全是虚拟的,可以免费注册。 +多年来,我们已经发布了许多[有关 Ansible 的文章][10],我发现其中大多数对我的需求很有帮助。Enable Sysadmin 网站上也有很多对我有帮助 [Ansible 文章][11]。你可以通过查看本周(2020 年 10 月 13 日至 14 日)的 [AnsibleFest][12] 了解更多信息。该活动完全是线上的,可以免费注册。 -------------------------------------------------------------------------------- @@ -277,7 +277,7 @@ via: https://opensource.com/article/20/10/first-day-ansible 作者:[David Both][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 00e8afc43cfa939387c908a5e54d0ab2cb01df78 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 3 Feb 2021 10:59:36 +0800 Subject: [PATCH 096/213] PUB @MjSeven https://linux.cn/article-13079-1.html --- .../tech => published}/20201013 My first day using Ansible.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201013 My first day using Ansible.md (99%) diff --git a/translated/tech/20201013 My first day using Ansible.md b/published/20201013 My first day using Ansible.md similarity index 99% rename from translated/tech/20201013 My first day using Ansible.md rename to published/20201013 My first day using Ansible.md index 93bc08d699..990ddc1f24 100644 --- a/translated/tech/20201013 My first day using Ansible.md +++ b/published/20201013 My first day using Ansible.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13079-1.html" [#]: subject: "My first day using Ansible" [#]: via: "https://opensource.com/article/20/10/first-day-ansible" [#]: author: "David Both https://opensource.com/users/dboth" From f150ca065668c192e785b91d35c1cab7f2c5e4b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 3 Feb 2021 12:03:03 +0800 Subject: [PATCH 097/213] PRF @geekpi --- ...25 Use Joplin to find your notes faster.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20210125 Use Joplin to find your notes faster.md b/translated/tech/20210125 Use Joplin to find your notes faster.md index 212025a919..e6a530e170 100644 --- a/translated/tech/20210125 Use Joplin to find your notes faster.md +++ b/translated/tech/20210125 Use Joplin to find your notes faster.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Use Joplin to find your notes faster) @@ -9,20 +9,22 @@ 使用 Joplin 更快地找到你的笔记 ====== -在多个手写和数字平台上整理笔记是一个严峻的挑战。这里有一个小技巧,可以更好地组织你的笔记,并快速找到你需要的东西。 -![Working from home at a laptop][1] + +> 在多个手写和数字平台上整理笔记是一个严峻的挑战。这里有一个小技巧,可以更好地组织你的笔记,并快速找到你需要的东西。 + +![](https://img.linux.net.cn/data/attachment/album/202102/03/120141dkiqil1vlqiz6wql.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十五天。 -保持生产力也意味着(在某种程度上)要有足够的组织能力,以便找到笔记并在需要时参考它们。这不仅是对我自己的挑战,也是我交谈的很多人的挑战。 +保持生产力也意味着(在某种程度上)要有足够的组织能力,以便找到笔记并在需要时参考它们。这不仅是对我自己的挑战,也是与我交谈的很多人的挑战。 -多年来,我在应用中单独或使用数字笔记、纸质笔记、便签、数字便签、word 文档、纯文本文件以及一堆我忘记的其他格式的组合。这不仅让寻找笔记变得困难,而且知道把它们放在哪里是一个更大的挑战。 +多年来,我在应用中单独或使用数字笔记、纸质笔记、便签、数字便签、Word 文档、纯文本文件以及一堆我忘记的其他格式的组合。这不仅让寻找笔记变得困难,而且知道把它们放在哪里是一个更大的挑战。 ![Stacks of paper notes on a desk][2] -一堆笔记 (Jessica Cherry, [CC BY-SA 4.0][3]) +*一堆笔记 (Jessica Cherry, [CC BY-SA 4.0][3])* -还有就是做笔记最重要的一点:如果你以后找不到它,笔记就没有任何价值。知道含有你所需信息的笔记存在于你保存笔记的_某处_,根本没有任何帮助。 +还有就是做笔记最重要的一点:如果你以后找不到它,笔记就没有任何价值。知道含有你所需信息的笔记存在于你保存笔记的*某处*,根本没有任何帮助。 我是如何为自己解决这个问题的呢?正如他们所说,这是一个过程,我希望这也是一个对其他人有效的过程。 @@ -30,13 +32,13 @@ ![Man holding a binder full of notes][4] -三年多的笔记 (Kevin Sonney, [CC BY-SA 4.0][3]) +*三年多的笔记 (Kevin Sonney, [CC BY-SA 4.0][3])* -为了保存我的数字笔记,我需要将它们全部集中到一个地方。这个工具需要能够从多种设备上访问,具有有用的搜索功能,并且能够导出或共享我的笔记。在尝试了很多很多不同的选项之后,我选择了 [Joplin][5]。Joplin 可以让我用 markdown 写笔记,有一个相当不错的搜索功能,有适用于所有操作系统(包括手机)的应用,并支持几种不同的设备同步方式。另外,它还有文件夹_和_标签,因此我可以按照对我有意义的方式将笔记分组。 +为了保存我的数字笔记,我需要将它们全部集中到一个地方。这个工具需要能够从多种设备上访问,具有有用的搜索功能,并且能够导出或共享我的笔记。在尝试了很多很多不同的选项之后,我选择了 [Joplin][5]。Joplin 可以让我用 Markdown 写笔记,有一个相当不错的搜索功能,有适用于所有操作系统(包括手机)的应用,并支持几种不同的设备同步方式。另外,它还有文件夹*和*标签,因此我可以按照对我有意义的方式将笔记分组。 ![Organized Joplin notes management page][6] -我的 Joplin +*我的 Joplin* 我花了一些时间才把所有的东西都放在我想要的地方,但最后,这真的是值得的。现在,我可以找到我所做的笔记,而不是让它们散落在我的办公室、不同的机器和各种服务中。 @@ -47,7 +49,7 @@ via: https://opensource.com/article/21/1/notes-joplin 作者:[Kevin Sonney][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 625e651be6e26461ea53894f190bd365c6dfca97 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 3 Feb 2021 12:03:41 +0800 Subject: [PATCH 098/213] PUB @geekpi https://linux.cn/article-13080-1.html --- .../20210125 Use Joplin to find your notes faster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210125 Use Joplin to find your notes faster.md (98%) diff --git a/translated/tech/20210125 Use Joplin to find your notes faster.md b/published/20210125 Use Joplin to find your notes faster.md similarity index 98% rename from translated/tech/20210125 Use Joplin to find your notes faster.md rename to published/20210125 Use Joplin to find your notes faster.md index e6a530e170..13e6be8bdf 100644 --- a/translated/tech/20210125 Use Joplin to find your notes faster.md +++ b/published/20210125 Use Joplin to find your notes faster.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13080-1.html) [#]: subject: (Use Joplin to find your notes faster) [#]: via: (https://opensource.com/article/21/1/notes-joplin) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) From e120fbcb0875d74af95bee7c7f771fafc82bf83e Mon Sep 17 00:00:00 2001 From: amwps290 Date: Wed, 3 Feb 2021 14:21:04 +0800 Subject: [PATCH 099/213] Delete 20210120 Learn JavaScript by writing a guessing game.md --- ...n JavaScript by writing a guessing game.md | 300 ------------------ 1 file changed, 300 deletions(-) delete mode 100644 sources/tech/20210120 Learn JavaScript by writing a guessing game.md diff --git a/sources/tech/20210120 Learn JavaScript by writing a guessing game.md b/sources/tech/20210120 Learn JavaScript by writing a guessing game.md deleted file mode 100644 index a285bf45cf..0000000000 --- a/sources/tech/20210120 Learn JavaScript by writing a guessing game.md +++ /dev/null @@ -1,300 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (amwps290) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Learn JavaScript by writing a guessing game) -[#]: via: (https://opensource.com/article/21/1/learn-javascript) -[#]: author: (Mandy Kendall https://opensource.com/users/mkendall) - -Learn JavaScript by writing a guessing game -====== -Take the first steps toward creating interactive, dynamic web content by -practicing some basic JavaScript concepts with a simple game. -![Javascript code close-up with neon graphic overlay][1] - -It's pretty safe to say that most of the modern web would not exist without [JavaScript][2]. It's one of the three standard web technologies (along with HTML and CSS) and allows anyone to create much of the interactive, dynamic content we have come to expect in our experiences with the World Wide Web. From frameworks like [React][3] to data visualization libraries like [D3][4], it's hard to imagine the web without it. - -There's a lot to learn, and a great way to begin learning this popular language is by writing a simple application to become familiar with some concepts. Recently, some Opensource.com correspondents have written about how to learn their favorite language by writing a simple guessing game, so that's a great place to start! - -### Getting started - -JavaScript comes in many flavors, but I'll start with the basic version, commonly called "Vanilla JavaScript." JavaScript is primarily a client-side scripting language, so it can run in any standard browser without installing anything. All you need is a code editor ([Brackets][5] is a great one to try) and the web browser of your choice. - -### HTML user interface - -JavaScript runs in a web browser and interacts with the other standard web technologies, HTML and CSS. To create this game, you'll first use HTML (Hypertext Markup Language) to create a simple interface for your players to use. In case you aren't familiar, HTML is a markup language used to provide structure to content on the web. - -To start, create an HTML file for your code. The file should have the `.html` extension to let the browser know that it is an HTML document. You can call your file `guessingGame.html`. - -Use a few basic HTML tags in this file to display the game's title, instructions for how to play, interactive elements for the player to use to enter and submit their guesses, and a placeholder for providing feedback to the player: - - -``` -<!DOCTYPE> -  <[html][6]> -    <[head][7]> -      <[meta][8] charset="UTF-8" /> -      <[title][9]> JavaScript Guessing Game </[title][9]> -    </[head][7]> -    <[body][10]> -      <[h1][11]>Guess the Number!</[h1][11]> -      <[p][12]>I am thinking of a number between 1 and 100. Can you guess what it is?</[p][12]> -    -      <[label][13] for="guess">My Guess</[label][13]> -      <[input][14] type="number" id="guess"> -      <[input][14] type="submit" id="submitGuess" value="Check My Guess"> -    -      <[p][12] id="feedback"></[p][12]> -    </[body][10]> -  </[html][6]> -``` - -The `

` and `

` elements let the browser know what type of text to display on the page. The set of `

` tags signifies that the text between those two tags (`Guess the Number!`) is a heading. The set of `

` tags that follow signify that the short block of text with the instructions is a paragraph. The empty set of `

` tags at the end of this code block serve as a placeholder for the feedback the game will give the player based on their guess. - -### The <script> tag - -There are many ways to include JavaScript in a web page, but for a short script like this one, you can use a set of ` -</[body][10]> + -</[html][6]> + ``` -要在浏览器中运行此文件,请双击文件或打开您喜欢的浏览器,点击菜单,然后选择**文件->打开文件**。 (如果使用 Brackets 软件,也可以使用角落处的闪电图标在浏览器中打开文件)。 +要在浏览器中运行此文件,请双击文件或打开你喜欢的浏览器,点击菜单,然后选择**文件->打开文件**。(如果使用 Brackets 软件,也可以使用角落处的闪电图标在浏览器中打开文件)。 + ### 生成伪随机数 -猜谜游戏的第一步是为玩家生成一个数字供玩家猜测。 JavaScript 包含几个内置的全局对象,可帮助您编写代码。 要生成随机数,请使用 Math 对象。 +猜谜游戏的第一步是为玩家生成一个数字供玩家猜测。JavaScript 包含几个内置的全局对象,可帮助你编写代码。要生成随机数,请使用 `Math` 对象。 -JavaScript中的 [Math][17] 具有处理和数学相关的属性和功能。 您将使用两个数学函数来生成随机数,供您的玩家猜测。 +JavaScript中的 [Math][17] 具有处理和数学相关的属性和功能。你将使用两个数学函数来生成随机数,供你的玩家猜测。 -[Math.random()][18],会将生成一个介于 0 和 1 之间的伪随机数。( Math.random 包含 0 但不包含 1。这意味着该函数可以生成 0 ,永远不会产生 1.) +[Math.random()][18],会将生成一个介于 0 和 1 之间的伪随机数。(`Math.random` 包含 0 但不包含 1。这意味着该函数可以生成 0 ,永远不会产生 1) -对于此游戏,请将随机数设置在 1 到 100 之间以缩小玩家的选择范围。 取刚刚生成的小数,然后乘以 100,以产生一个介于 0 到......甚至不是 100 之间的小数。至此,您将需要其他步骤来解决这个问题。 +对于此游戏,请将随机数设置在 1 到 100 之间以缩小玩家的选择范围。取刚刚生成的小数,然后乘以 100,以产生一个介于 0 到……甚至不是 100 之间的小数。至此,你将需要其他步骤来解决这个问题。 -现在,您的数字仍然是小数,但您希望它是一个整数。 为此,您可以使用属于 Math 对象的另一个函数 [Math.floor()][19]。 Math.floor() 的目的是返回小于或等于您作为参数指定的数字的最大整数,这意味着它会四舍五入为最接近的整数: +现在,你的数字仍然是小数,但你希望它是一个整数。为此,你可以使用属于 `Math` 对象的另一个函数 [Math.floor()][19]。`Math.floor()` 的目的是返回小于或等于你作为参数指定的数字的最大整数,这意味着它会四舍五入为最接近的整数: - -```javascript -`Math.floor(Math.random() * 100)` +``` +Math.floor(Math.random() * 100) ``` -这样您将得到 0 到 99 之间的整数,这不是您想要的范围。 您可以在最后一步修复该问题,即在结果中加 1。 瞧! 现在,您有一个(有点)随机生成的数字,介于 1 到 100 之间: +这样你将得到 0 到 99 之间的整数,这不是你想要的范围。你可以在最后一步修复该问题,即在结果中加 1。瞧!现在,你有一个(有点)随机生成的数字,介于 1 到 100 之间: - -```javascript -`Math.floor(Math.random() * 100) + 1` +``` +Math.floor(Math.random() * 100) + 1 ``` ### 变量 -现在,您需要存储随机生成的数字,以便可以将其与玩家的猜测进行比较。 为此,您可以将其存储到一个 **变量**。 +现在,你需要存储随机生成的数字,以便可以将其与玩家的猜测进行比较。为此,你可以将其存储到一个 **变量**。 -JavaScript 具有不同类型的变量,您可以选择这些类型,具体取决于您要如何使用该变量。 对于此游戏,请使用 const 和 let 。 +JavaScript 具有不同类型的变量,你可以选择这些类型,具体取决于你要如何使用该变量。对于此游戏,请使用 `const` 和 `let`。 - * **let** 用于指示变量在整个程序中可以改变 - * **const** 用于指示变量不应该被修改. + * `let` 用于指示变量在整个程序中可以改变。 + * `const` 用于指示变量不应该被修改。 -const 和 let 还有很多要说的,但现在知道这些就足够了。 +`const` 和 `let` 还有很多要说的,但现在知道这些就足够了。 -随机数在游戏中仅生成一次,因此您将使用 const 变量来保存该值。 您想给变量起一个清楚地表明要存储什么值的名称,因此将其命名为 `randomNumber`: +随机数在游戏中仅生成一次,因此你将使用 `const` 变量来保存该值。你想给变量起一个清楚地表明要存储什么值的名称,因此将其命名为 `randomNumber`: - -```javascript -`const randomNumber` +``` +const randomNumber ``` -有关命名的注意事项:JavaScript 中的变量和函数名称以驼峰形式编写。 如果只有一个单词,则全部以小写形式书写。 如果有多个单词,则第一个单词均为小写,其他任何单词均以大写字母开头,且单词之间没有空格。 +有关命名的注意事项:JavaScript 中的变量和函数名称以驼峰形式编写。如果只有一个单词,则全部以小写形式书写。如果有多个单词,则第一个单词均为小写,其他任何单词均以大写字母开头,且单词之间没有空格。 ### 打印到控制台 -通常,您不想向任何人显示随机数,但是开发人员可能想知道生成的数字以使用它来帮助调试代码。 使用 JavaScript,您可以使用另一个内置函数 [console.log()][20] 将数字输出到浏览器的控制台。 +通常,你不想向任何人显示随机数,但是开发人员可能想知道生成的数字以使用它来帮助调试代码。 使用 JavaScript,你可以使用另一个内置函数 [console.log()][20] 将数字输出到浏览器的控制台。 -大多数浏览器都包含开发人员工具,您可以通过按键盘上的 **F12** 键来打开它们。 从那里,您应该看到一个标签为 **控制台** 的标签。 打印到控制台的所有信息都将显示在此处。 由于到目前为止编写的代码将在浏览器加载后立即运行,因此,如果您查看控制台,您应该会看到刚刚生成的随机数! 万岁! +大多数浏览器都包含开发人员工具,你可以通过按键盘上的 `F12` 键来打开它们。从那里,你应该看到一个 **控制台** 标签。打印到控制台的所有信息都将显示在此处。由于到目前为止编写的代码将在浏览器加载后立即运行,因此,如果你查看控制台,你应该会看到刚刚生成的随机数! ![Javascript game with console][21] -### 函数 +### 函数 -接下来,您需要一种方法来从数字输入字段中获得玩家的猜测,将其与您刚刚生成的随机数进行比较,并向玩家提供反馈,让他们知道他们是否正确猜到了。 为此,编写一个函数。 **函数** 是执行一定任务的代码块。 函数是可以重用的,这意味着如果您需要多次运行相同的代码,则可以调用函数,而不必重写执行任务所需的所有步骤。 +接下来,你需要一种方法来从数字输入字段中获得玩家的猜测,将其与你刚刚生成的随机数进行比较,并向玩家提供反馈,让他们知道他们是否正确猜到了。为此,编写一个函数。 **函数** 是执行一定任务的代码块。函数是可以重用的,这意味着如果你需要多次运行相同的代码,则可以调用函数,而不必重写执行任务所需的所有步骤。 -根据您使用的 JavaScript 版本,有许多不同的方法来编写或声明函数。 由于这是该语言的基础入门,因此请使用基本函数语法声明函数。 - -以关键字 `function` 开头,然后起一个函数名。 好的做法是使用一个描述该函数的功能的名称。 在这个例子中,您正在检查玩家的猜测的数,因此此函数的名字可以是 `checkGuess`。 在函数名称之后,写上一组括号,然后写上一组花括号。 您将在以下花括号之间编写函数的主体: +根据你使用的 JavaScript 版本,有许多不同的方法来编写或声明函数。由于这是该语言的基础入门,因此请使用基本函数语法声明函数。 +以关键字 `function` 开头,然后起一个函数名。好的做法是使用一个描述该函数的功能的名称。在这个例子中,你正在检查玩家的猜测的数,因此此函数的名字可以是 `checkGuess`。在函数名称之后,写上一组小括号,然后写上一组花括号。 你将在以下花括号之间编写函数的主体: ``` -`function checkGuess() {}` +function checkGuess() {} ``` ### 使用 DOM -JavaScript 的目的之一是与网页上的 HTML 交互。 它通过文档对象模型(DOM)进行此操作,DOM 是 JavaScript 用于访问和更改网页信息的对象。 现在,您需要从 HTML 中获取数字输入字段中玩家的猜测。 您可以使用分配给 HTML 元素的 `id` 属性(在这种情况下为 `guess`)来做到这一点: - +JavaScript 的目的之一是与网页上的 HTML 交互。它通过文档对象模型(DOM)进行此操作,DOM 是 JavaScript 用于访问和更改网页信息的对象。现在,你需要从 HTML 中获取数字输入字段中玩家的猜测。你可以使用分配给 HTML 元素的 `id` 属性(在这种情况下为 `guess`)来做到这一点: ``` -`` + ``` -JavaScript 可以通过访问玩家输入到数字输入字段中的数来获取其值。 您可以通过引用元素的 ID 并在末尾添加 `.value` 来实现。 这次,使用 `let` 定义的变量来保存用户的猜测值: +JavaScript 可以通过访问玩家输入到数字输入字段中的数来获取其值。你可以通过引用元素的 ID 并在末尾添加 `.value` 来实现。这次,使用 `let` 定义的变量来保存用户的猜测值: ``` -`let myGuess = guess.value` +let myGuess = guess.value ``` 玩家在数字输入字段中输入的任何数字都将被分配给 `checkGuess` 函数中的 `myGuess` 变量。 ### 条件语句 -下一步是将玩家的猜测与游戏产生的随机数进行比较。 您还想给玩家反馈,让他们知道他们的猜测是太高,太低还是正确。 -您可以使用一系列条件语句来决定玩家将收到的反馈。 **条件语句** 在运行代码块之前检查是否满足条件。 如果不满足条件,则代码停止,继续检查下一个条件,或者继续执行其余代码,而无需执行条件块中的代码: +下一步是将玩家的猜测与游戏产生的随机数进行比较。你还想给玩家反馈,让他们知道他们的猜测是太高,太低还是正确。 + +你可以使用一系列条件语句来决定玩家将收到的反馈。**条件语句** 在运行代码块之前检查是否满足条件。如果不满足条件,则代码停止,继续检查下一个条件,或者继续执行其余代码,而无需执行条件块中的代码: ``` if (myGuess === randomNumber){   feedback.textContent = "You got it right!" } -else if(myGuess > randomNumber) { +else if(myGuess > randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!" } -else if(myGuess < randomNumber) { +else if(myGuess < randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!" } ``` -第一个条件块使用比较运算符 `===` 将玩家的猜测与游戏生成的随机数进行比较。 比较运算符检查右侧的值,将其与左侧的值进行比较,如果匹配则返回布尔值 `true` ,否则返回布尔值 `false`。 - -如果数字匹配(猜对了!),为了让玩家知道。 通过将文本添加到具有 id 属性 "feedback" 的 `

` 标记中来操作 DOM。 就像上面的 `guess.value` 一样工作,除了不是从 DOM 获取信息,而是更改其中的信息。 `

` 元素没有像 `` 元素那样的值,而是具有文本,因此请使用 `.textContent` 访问元素并设置要显示的文本: +第一个条件块使用比较运算符 `===` 将玩家的猜测与游戏生成的随机数进行比较。比较运算符检查右侧的值,将其与左侧的值进行比较,如果匹配则返回布尔值 `true`,否则返回布尔值 `false`。 +如果数字匹配(猜对了!),为了让玩家知道。通过将文本添加到具有 `id` 属性 `feedback` 的 `

` 标记中来操作 DOM。就像上面的 `guess.value` 一样,除了不是从 DOM 获取信息,而是更改其中的信息。`

` 元素没有像 `` 元素那样的值,而是具有文本,因此请使用 `.textContent` 访问元素并设置要显示的文本: ``` -`feedback.textContent = "You got it right!"` +feedback.textContent = "You got it right!" ``` -当然,玩家很有可能在第一次尝试时就猜错了,因此,如果 `myGuess` 和 `randomNumber` 不匹配,请给玩家一个线索,以帮助他们缩小猜测范围。 如果第一个条件失败,则代码将跳过该 if 语句中的代码块,并检查下一个条件是否为 true。 这使您进入 `else if` 块: +当然,玩家很有可能在第一次尝试时就猜错了,因此,如果 `myGuess` 和 `randomNumber` 不匹配,请给玩家一个线索,以帮助他们缩小猜测范围。如果第一个条件失败,则代码将跳过该 `if` 语句中的代码块,并检查下一个条件是否为 `true`。 这使你进入 `else if` 块: ``` -else if(myGuess > randomNumber) { +else if(myGuess > randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too high. Try Again!" } ``` -如果您将其作为句子阅读,则可能是这样的:“如果玩家的猜测等于随机数,请让他们知道他们猜对了。否则,请检查玩家的猜测是否大于 `randomNumber`,如果是,则显示玩家的猜测并告诉他们太高了。” +如果你将其作为句子阅读,则可能是这样的:“如果玩家的猜测等于随机数,请让他们知道他们猜对了。否则,请检查玩家的猜测是否大于 `randomNumber`,如果是,则显示玩家的猜测并告诉他们太高了。” 最后一种可能性是玩家的猜测低于随机数。 要检查这一点,再添加一个 `else if` 块: ``` -else if(myGuess < randomNumber) { +else if(myGuess < randomNumber) {   feedback.textContent = "Your guess was " + myGuess + ". That's too low. Try Again!" } ``` ### 用户事件和事件监听器 -如果您看上面的代码,则会看到某些代码在页面加载时自动运行,但有些则不会。 您想在玩游戏之前生成随机数,但是您不想在玩家将数字输入到数字输入字段并准备检查它之前检查其猜测。 +如果你看上面的代码,则会看到某些代码在页面加载时自动运行,但有些则不会。你想在玩游戏之前生成随机数,但是你不想在玩家将数字输入到数字输入字段并准备检查它之前检查其猜测。 -生成随机数并将其打印到控制台的代码不在函数的范围内,因此它将在浏览器加载脚本时自动运行。 但是,要使函数内部的代码运行,您必须对其进行调用。 +生成随机数并将其打印到控制台的代码不在函数的范围内,因此它将在浏览器加载脚本时自动运行。 但是,要使函数内部的代码运行,你必须对其进行调用。 -调用函数有几种方法。 在此,您希望该函数在用户单击“检查我的猜测”按钮时运行。 单击按钮将创建一个用户事件,然后 JavaScript 可以 “监听” 这个事件,以便知道何时需要运行函数。 - -代码的最后一行将事件侦听器添加到按钮上,以在单击按钮时调用函数。 当它“听到”该事件时,它将运行分配给事件侦听器的函数: +调用函数有几种方法。在此,你希望该函数在用户单击 “Check My Guess” 按钮时运行。单击按钮将创建一个用户事件,然后 JavaScript 可以 “监听” 这个事件,以便知道何时需要运行函数。 +代码的最后一行将事件侦听器添加到按钮上,以在单击按钮时调用函数。当它“听到”该事件时,它将运行分配给事件侦听器的函数: ``` -`submitGuess.addEventListener('click', checkGuess)` +submitGuess.addEventListener('click', checkGuess) ``` -就像访问 DOM 元素的其他实例一样,您可以使用按钮的 ID 告诉 JavaScript 与哪个元素进行交互。 然后,您可以使用内置的 `addEventListener` 函数来告诉 JavaScript 要监听的事件。 +就像访问 DOM 元素的其他实例一样,你可以使用按钮的 ID 告诉 JavaScript 与哪个元素进行交互。 然后,你可以使用内置的 `addEventListener` 函数来告诉 JavaScript 要监听的事件。 -您已经看到了带有参数的函数,但花点时间看一下它是如何工作的。 参数是函数执行其任务所需的信息。 并非所有函数都需要参数,但是 `addEventListener` 函数需要两个参数。 它采用的第一个参数是将为其侦听的用户事件的名称。 用户可以通过多种方式与 DOM 交互,例如键入,移动鼠标,键盘上的 TAB 键和粘贴文本。 在这种情况下,您正在监听的用户事件是单击按钮,因此第一个参数将是 ` click`。 +你已经看到了带有参数的函数,但花点时间看一下它是如何工作的。参数是函数执行其任务所需的信息。并非所有函数都需要参数,但是 `addEventListener` 函数需要两个参数。它采用的第一个参数是将为其监听的用户事件的名称。用户可以通过多种方式与 DOM 交互,例如键入、移动鼠标,键盘上的 `TAB` 键和粘贴文本。在这种情况下,你正在监听的用户事件是单击按钮,因此第一个参数将是 `click`。 `addEventListener`的第二个所需的信息是用户单击按钮时要运行的函数的名称。 这里我们需要 `checkGuess` 函数。 -现在,当玩家按下“检查我的猜测”按钮时,`checkGuess` 函数将获得他们在数字输入字段中输入的值,将其与随机数进行比较,并在浏览器中显示反馈,以使玩家知道他们猜的怎么样。 太棒了! 您的游戏已准备就绪。 +现在,当玩家按下 “Check My Guess” 按钮时,`checkGuess` 函数将获得他们在数字输入字段中输入的值,将其与随机数进行比较,并在浏览器中显示反馈,以使玩家知道他们猜的怎么样。 太棒了!你的游戏已准备就绪。 ### 学习 JavaScript 以获取乐趣和收益 -一点点的 Vanilla JavaScript 只是这个庞大的生态系统所提供功能的一小部分。 这是一种值得花时间投入学习的语言,我鼓励您继续挖掘并学习更多。 + +这一点点的平凡无奇的 JavaScript 只是这个庞大的生态系统所提供功能的一小部分。这是一种值得花时间投入学习的语言,我鼓励你继续挖掘并学习更多。 -------------------------------------------------------------------------------- @@ -262,7 +257,7 @@ via: https://opensource.com/article/21/1/learn-javascript 作者:[Mandy Kendall][a] 选题:[lujun9972][b] 译者:[amwps290](https://github.com/amwps290) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8505b07da6450f4e339d218b9b132c8039990504 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 5 Feb 2021 15:16:29 +0800 Subject: [PATCH 123/213] PUB @amwps290 https://linux.cn/article-13087-1.html --- .../20210120 Learn JavaScript by writing a guessing game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210120 Learn JavaScript by writing a guessing game.md (99%) diff --git a/translated/tech/20210120 Learn JavaScript by writing a guessing game.md b/published/20210120 Learn JavaScript by writing a guessing game.md similarity index 99% rename from translated/tech/20210120 Learn JavaScript by writing a guessing game.md rename to published/20210120 Learn JavaScript by writing a guessing game.md index 64e91e358c..e457842c51 100644 --- a/translated/tech/20210120 Learn JavaScript by writing a guessing game.md +++ b/published/20210120 Learn JavaScript by writing a guessing game.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "amwps290" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13087-1.html" [#]: subject: "Learn JavaScript by writing a guessing game" [#]: via: "https://opensource.com/article/21/1/learn-javascript" [#]: author: "Mandy Kendall https://opensource.com/users/mkendall" From 2a651392d23a030de3746cf909916821623cd568 Mon Sep 17 00:00:00 2001 From: amwps290 Date: Fri, 5 Feb 2021 17:17:52 +0800 Subject: [PATCH 124/213] Update 20210204 A hands-on tutorial of SQLite3.md --- sources/tech/20210204 A hands-on tutorial of SQLite3.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210204 A hands-on tutorial of SQLite3.md b/sources/tech/20210204 A hands-on tutorial of SQLite3.md index a2c73e3461..b5427ff9b7 100644 --- a/sources/tech/20210204 A hands-on tutorial of SQLite3.md +++ b/sources/tech/20210204 A hands-on tutorial of SQLite3.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (amwps290) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 705966b1967e88bceb960a717b9f0e2f4bec1bbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 5 Feb 2021 17:49:52 +0800 Subject: [PATCH 125/213] translating by Chao-zhi --- ... With Pacman Commands in Arch-based Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index f2fd06793f..1e9567a2f7 100644 --- a/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -221,7 +221,7 @@ via: https://itsfoss.com/pacman-command/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b45cb59afc92818ad42c38d70de7602e127b6a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Fri, 5 Feb 2021 21:22:34 +0800 Subject: [PATCH 126/213] translate done: 20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md --- ...mands in Arch-based Linux Distributions.md | 250 ------------------ ...mands in Arch-based Linux Distributions.md | 250 ++++++++++++++++++ 2 files changed, 250 insertions(+), 250 deletions(-) delete mode 100644 sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md create mode 100644 translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md diff --git a/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md deleted file mode 100644 index 1e9567a2f7..0000000000 --- a/sources/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ /dev/null @@ -1,250 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Getting Started With Pacman Commands in Arch-based Linux Distributions) -[#]: via: (https://itsfoss.com/pacman-command/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -Getting Started With Pacman Commands in Arch-based Linux Distributions -====== - -_**Brief: This beginner’s guide shows you what you can do with pacmancommands in Linux, how to use them to find new packages, install and upgrade new packages, and clean your system.**_ - -The [pacman][1] package manager is one of the main difference between [Arch Linux][2] and other major distributions like Red Hat and Ubuntu/Debian. It combines a simple binary package format with an easy-to-use [build system][3]. The aim of pacman is to easily manage packages, either from the [official repositories][4] or the user’s own builds. - -If you ever used Ubuntu or Debian-based distributions, you might have used the apt-get or apt commands. Pacman is the equivalent in Arch Linux. If you [just installed Arch Linux][5], one of the first few [things to do after installing Arch Linux][6] is to learn to use pacman commands. - -In this beginner’s guide, I’ll explain some of the essential usage of the pacmand command that you should know for managing your Arch-based system. - -### Essential pacman commands Arch Linux users should know - -![][7] - -Like other package managers, pacman can synchronize package lists with the software repositories to allow the user to download and install packages with a simple command by solving all required dependencies. - -#### Install packages with pacman - -You can install a single package or multiple packages using pacman command in this fashion: - -``` -pacman -S _package_name1_ _package_name2_ ... -``` - -![Installing a package][8] - -The -S stands for synchronization. It means that pacman first synchronizes - -The pacman database categorises the installed packages in two groups according to the reason why they were installed: - - * **explicitly-installed**: the packages that were installed by a generic pacman -S or -U command - * **dependencies**: the packages that were implicitly installed because [required][9] by another package that was explicitly installed. - - - -#### Remove an installed package - -To remove a single package, leaving all of its dependencies installed: - -``` -pacman -R package_name_ -``` - -![Removing a package][10] - -To remove a package and its dependencies which are not required by any other installed package: - -``` -pacman -Rs _package_name_ -``` - -To remove dependencies that are no longer needed. For example, the package which needed the dependencies was removed. - -``` -pacman -Qdtq | pacman -Rs - -``` - -#### Upgrading packages - -Pacman provides an easy way to [update Arch Linux][11]. You can update all installed packages with just one command. This could take a while depending on how up-to-date the system is. - -The following command synchronizes the repository databases _and_ updates the system’s packages, excluding “local” packages that are not in the configured repositories: - -``` -pacman -Syu -``` - - * S stands for sync - * y is for refresh (local - * u is for system update - - - -Basically it is saying that sync to central repository (master package database), refresh the local copy of the master package database and then perform the system update (by updating all packages that have a newer version available). - -![System update][12] - -Attention! - -If you are an Arch Linux user before upgrading, it is advised to visit the [Arch Linux home page][2] to check the latest news for out-of-the-ordinary updates. If manual intervention is needed an appropriate news post will be made. Alternatively you can subscribe to the [RSS feed][13] or the [arch-announce mailing list][14]. - -Be also mindful to look over the appropriate [forum][15] before upgrading fundamental software (such as the kernel, xorg, systemd, or glibc), for any reported problems. - -**Partial upgrades are unsupported** at a rolling release distribution such as Arch and Manjaro. That means when new library versions are pushed to the repositories, all the packages in the repositories need to be rebuilt against the libraries. For example, if two packages depend on the same library, upgrading only one package, might break the other package which depends on an older version of the library. - -#### Use pacman to search for packages - -Pacman queries the local package database with the -Q flag, the sync database with the -S flag and the files database with the -F flag. - -Pacman can search for packages in the database, both in packages’ names and descriptions: - -``` -pacman -Ss _string1_ _string2_ ... -``` - -![Searching for a package][16] - -To search for already installed packages: - -``` -pacman -Qs _string1_ _string2_ ... -``` - -To search for package file names in remote packages: - -``` -pacman -F _string1_ _string2_ ... -``` - -To view the dependency tree of a package: - -``` -pactree _package_naenter code hereme_ -``` - -#### Cleaning the package cache - -Pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically. This has some advantages: - - 1. It allows to [downgrade][17] a package without the need to retrieve the previous version through other sources. - 2. A package that has been uninstalled can easily be reinstalled directly from the cache folder. - - - -However, it is necessary to clean up the cache periodically to prevent the folder to grow in size. - -The [paccache(8)][18] script, provided within the [pacman-contrib][19] package, deletes all cached versions of installed and uninstalled packages, except for the most recent 3, by default: - -``` -paccache -r -``` - -![Clear cache][20] - -To remove all the cached packages that are not currently installed, and the unused sync database, execute: - -``` -pacman -Sc -``` - -To remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache folder: - -``` -pacman -Scc -``` - -#### Installing local or third-party packages - -Install a ‘local’ package that is not from a remote repository: - -``` -pacman -U _/path/to/package/package_name-version.pkg.tar.xz_ -``` - -Install a ‘remote’ package, not contained in an official repository: - -``` -pacman -U http://www.example.com/repo/example.pkg.tar.xz -``` - -### Bonus: Troubleshooting common errors with pacman - -Here are some common errors you may encounter while managing packages with pacman. - -#### Failed to commit transaction (conflicting files) - -If you see the following error: - -``` -error: could not prepare transaction -error: failed to commit transaction (conflicting files) -package: /path/to/file exists in filesystem -Errors occurred, no packages were upgraded. -``` - -This is happening because pacman has detected a file conflict and will not overwrite files for you. - -A safe way to solve this is to first check if another package owns the file (pacman -Qo _/path/to/file_). If the file is owned by another package, file a bug report. If the file is not owned by another package, rename the file which ‘exists in filesystem’ and re-issue the update command. If all goes well, the file may then be removed. - -Instead of manually renaming and later removing all the files that belong to the package in question, you may explicitly run _**pacman -S –overwrite glob package**_ to force pacman to overwrite files that match _glob_. - -#### Failed to commit transaction (invalid or corrupted package) - -Look for .part files (partially downloaded packages) in /var/cache/pacman/pkg/ and remove them. It is often caused by usage of a custom XferCommand in pacman.conf. - -#### Failed to init transaction (unable to lock database) - -When pacman is about to alter the package database, for example installing a package, it creates a lock file at /var/lib/pacman/db.lck. This prevents another instance of pacman from trying to alter the package database at the same time. - -If pacman is interrupted while changing the database, this stale lock file can remain. If you are certain that no instances of pacman are running then delete the lock file. - -Check if a process is holding the lock file: - -``` -lsof /var/lib/pacman/db.lck -``` - -If the above command doesn’t return anything, you can remove the lock file: - -``` -rm /var/lib/pacman/db.lck -``` - -If you find the PID of the process holding the lock file with lsof command output, kill it first and then remove the lock file. - -I hope you like my humble effort in explaining the basic pacman commands. Please leave your comments below and don’t forget to subscribe on our social media. Stay safe! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/pacman-command/ - -作者:[Dimitrios Savvopoulos][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者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://www.archlinux.org/pacman/ -[2]: https://www.archlinux.org/ -[3]: https://wiki.archlinux.org/index.php/Arch_Build_System -[4]: https://wiki.archlinux.org/index.php/Official_repositories -[5]: https://itsfoss.com/install-arch-linux/ -[6]: https://itsfoss.com/things-to-do-after-installing-arch-linux/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/essential-pacman-commands.jpg?ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-S.png?ssl=1 -[9]: https://wiki.archlinux.org/index.php/Dependency -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-R.png?ssl=1 -[11]: https://itsfoss.com/update-arch-linux/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Syu.png?ssl=1 -[13]: https://www.archlinux.org/feeds/news/ -[14]: https://mailman.archlinux.org/mailman/listinfo/arch-announce/ -[15]: https://bbs.archlinux.org/ -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Ss.png?ssl=1 -[17]: https://wiki.archlinux.org/index.php/Downgrade -[18]: https://jlk.fjfi.cvut.cz/arch/manpages/man/paccache.8 -[19]: https://www.archlinux.org/packages/?name=pacman-contrib -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-paccache-r.png?ssl=1 diff --git a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md new file mode 100644 index 0000000000..d33bb59f36 --- /dev/null +++ b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -0,0 +1,250 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting Started With Pacman Commands in Arch-based Linux Distributions) +[#]: via: (https://itsfoss.com/pacman-command/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +基于 Arch 的 Linux 发行版中 Pacman 命令入门 +====== + +_**简介:这本初学者指南向您展示了在 Linux 中可以使用 pacman 命令做什么,如何使用它们来查找新的软件包,安装和升级新的软件包,以及清理您的系统。**_ + +[pacman][1] 包管理器是 [Arch Linux][2] 和其他主要发行版如 Red Hat 和 Ubuntu/Debian 之间的主要区别之一。它结合了简单的二进制包格式和易于使用的[构建系统 ][3]。pacman 的目标是方便地管理软件包,无论它是来自[官方库 ][4] 还是用户自己的构建软件库。 + +如果您曾经使用过 Ubuntu 或基于 debian 的 发行版,那么您可能使用过 apt-get 或 apt 命令。pacman 在 Arch Linux 中是同样的。如果你[刚刚安装了 Arch Linux][5],在安装 Arch Linux 后,首先要做的[几件事 ][6] 之一就是学习使用 pacman 命令。 + +在这个初学者指南中,我将解释一些基本的 pacman 命令的用法,你应该知道如何用这些命令来管理你的基于 Archlinux 的系统。 + +### Arch Linux 用户应该知道的几个重要的 pacman 命令 + +![][7] + +与其他包管理器一样,pacman 可以将包列表与软件库同步,它能够自动解决所有所需的依赖项,以使得用户可以通过一个简单的命令下载和安装软件。 + +#### 通过 pacman 安装软件 + +你可以用一下形式的代码来安装一个或者多个软件包: + +``` +pacman -S _package_name1_ _package_name2_ ... +``` + +![安装一个包 ][8] + +-S 选项的意思是同步 (synchronization),它的意思是 pacman 在安装之前先与软件库进行同步。 + +pacman 数据库根据安装的原因将安装的包分为两组: + + * **显式安装**:由 pacman -S 或 -U 命令直接安装的包 + * **依赖安装**:由于被其他显式安装的包所[依赖 ][9],而被自动安装的包。 + + + +#### 卸载已安装的软件包 + +卸载一个包,并且删除它的所有依赖。 + +``` +pacman -R package_name_ +``` + +![移除一个包 ][10] + +删除一个包,以及其不被其他包所需要的依赖项: + +``` +pacman -Rs _package_name_ +``` + +删除所有不再需要的依赖项。比如,需要这个依赖的包已经被删除了。 + +``` +pacman -Qdtq | pacman -Rs - +``` + +#### 升级软件包 + +Pacman 提供了一个简单的办法来[升级 Arch Linux][11]。你只需要一条命令就可以升级所有已安装的软件包。这可能需要一段时间,这取决于系统的新旧程度。 + +以下命令可以同步存储库数据库 _并且_ 更新系统的所有软件包,但不包括不在软件库中的“本地安装的”包: + +``` +pacman -Syu +``` + + * S 代表同步 + * y 代表更新本地存储库 + * u 代表系统更新 + + + +也就是说,同步到中央存储库(主程序包数据库),刷新主程序包数据库的本地副本,然后执行系统更新(通过更新所有有更新版本可用的程序包)。 + +![系统更新 ][12] + +注意! + +Arch Linux 用户在系统升级前,建议您访问 [Arch-Linux 主页 ][2] 查看最新消息,以了解异常更新的情况。如果系统更新需要人工干预,主页上将发布相关的新闻。您也可以订阅 [RSS feed][13] 或 [Arch 的声明邮件 ][14]。 + +在升级基础软件(如 kernel、xorg、systemd 或 glibc) 之前,请注意查看相应的 [论坛 ][15],以了解大家报告的各种问题。 + +**在 Arch 和 Manjaro 等滚动发行版中不支持仅部分升级**。这意味着,当新的库版本被推送到存储库时,存储库中的所有包都需要根据库进行升级。例如,如果两个包依赖于同一个库,则仅升级一个包可能会破坏依赖于库的旧版本的另一个包。 + +#### 用 Pacman 查找包 + +Pacman 使用 -Q 选项查询本地包数据库,使用 -S 选项查询同步数据库,使用 -F 选项查询文件数据库。 + +Pacman 可以在数据库中搜索包,包括包的名称和描述: + +``` +pacman -Ss _string1_ _string2_ ... +``` + +![查找一个包 ][16] + +查找已经被安装的包: + +``` +pacman -Qs _string1_ _string2_ ... +``` + +根据文件名在远程数据库中查找它所属的包: + +``` +pacman -F _string1_ _string2_ ... +``` + +查看一个包的依赖树: + +``` +pactree _package_naenter code hereme_ +``` + +#### 清除包缓存 + +Pacman 将其下载的包存储在 /var/cache/Pacman/pkg/ 中,并且不会自动删除旧版本或卸载的版本。这有一些优点: + + 1。它允许[降级 ][17] 一个包,而不需要通过其他来源检索以前的版本。 + 2。已卸载的软件包可以轻松地直接从缓存文件夹重新安装。 + + + +但是,有必要定期清理缓存以防止文件夹增大。 + +[pacman contrib][19] 包中提供的 [paccache(8)][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: + +``` +paccache -r +``` + +![清除缓存 ][20] + +要删除当前未安装的所有缓存包和未使用的同步数据库,请执行: + +``` +pacman -Sc +``` + +要从缓存中删除所有文件,请使用 clean 选项两次,这是最激进的方法,不会在缓存文件夹中留下任何内容: + +``` +pacman -Scc +``` + +#### 安装本地或者第三方的包 + +安装不是来自远程存储库的“本地”包: + +``` +pacman -U _/path/to/package/package_name-version.pkg.tar.xz_ +``` + +安装官方存储库中未包含的“远程”软件包: + +``` +pacman -U http://www.example.com/repo/example.pkg.tar.xz +``` + +### 额外内容:用 pacman 排除常见错误 + +下面是使用 pacman 管理包时可能遇到的一些常见错误。 + +#### 提交事务失败(文件冲突) + +如果你看到以下报错: + +``` +error: could not prepare transaction +error: failed to commit transaction (conflicting files) +package: /path/to/file exists in filesystem +Errors occurred, no packages were upgraded. +``` + +这是因为 pacman 检测到文件冲突,不会为您覆盖文件。 + +解决这个问题的一个安全方法是首先检查另一个包是否拥有这个文件 (pacman-Qo\path/to/file)。如果该文件属于另一个包,请提交错误报告。如果文件不属于另一个包,请重命名“存在于文件系统中”的文件,然后重新发出 update 命令。如果一切顺利,文件可能会被删除。 + +您可以显式地运行 **pacman -S –overwrite glob package**,强制 pacman 覆盖与 _glob_ 匹配的文件,而不是手动重命名并在以后删除属于所讨论的包的所有文件。 + +#### 提交事务失败(包无效或损坏) + +在 /var/cache/pacman/pkg/ 中查找 .part 文件(部分下载的包),并将其删除。这通常是由在 pacman.conf 文件中使用自定义 XferCommand 引起的。 + +#### 初始化事务失败(无法锁定数据库) + +当 pacman 要修改包数据库时,例如安装包时,它会在 /var/lib/pacman/db.lck 处创建一个锁文件。这可以防止 pacman 的另一个实例同时尝试更改包数据库。 + +如果 pacman 在更改数据库时被中断,这个过时的锁文件可能仍然保留。如果您确定没有 pacman 实例正在运行,那么请删除锁文件。 + +检查进程是否持有锁定文件: + +``` +lsof /var/lib/pacman/db.lck +``` + +如果上述命令未返回任何内容,则可以删除锁文件: + +``` +rm /var/lib/pacman/db.lck +``` + +如果您发现 lsof 命令输出了使用锁文件的进程的 PID,请先杀死这个进程,然后删除锁文件。 + +我希望你喜欢我对 Pacman 基础命令的解释。请在下面留言,不要忘记订阅我们的社交媒体。注意安全! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pacman-command/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者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://www.archlinux.org/pacman/ +[2]: https://www.archlinux.org/ +[3]: https://wiki.archlinux.org/index.php/Arch_Build_System +[4]: https://wiki.archlinux.org/index.php/Official_repositories +[5]: https://itsfoss.com/install-arch-linux/ +[6]: https://itsfoss.com/things-to-do-after-installing-arch-linux/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/essential-pacman-commands.jpg?ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-S.png?ssl=1 +[9]: https://wiki.archlinux.org/index.php/Dependency +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-R.png?ssl=1 +[11]: https://itsfoss.com/update-arch-linux/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Syu.png?ssl=1 +[13]: https://www.archlinux.org/feeds/news/ +[14]: https://mailman.archlinux.org/mailman/listinfo/arch-announce/ +[15]: https://bbs.archlinux.org/ +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Ss.png?ssl=1 +[17]: https://wiki.archlinux.org/index.php/Downgrade +[18]: https://jlk.fjfi.cvut.cz/arch/manpages/man/paccache.8 +[19]: https://www.archlinux.org/packages/?name=pacman-contrib +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-paccache-r.png?ssl=1 From fbefc4774b80dc87ca2b480e5faec08ece15dd13 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 5 Feb 2021 23:39:24 +0800 Subject: [PATCH 127/213] PRF @MjSeven --- ...25 Why you need to drop ifconfig for ip.md | 152 ++++++++---------- 1 file changed, 69 insertions(+), 83 deletions(-) diff --git a/translated/tech/20210125 Why you need to drop ifconfig for ip.md b/translated/tech/20210125 Why you need to drop ifconfig for ip.md index a9ed73b4e0..c7c431c22f 100644 --- a/translated/tech/20210125 Why you need to drop ifconfig for ip.md +++ b/translated/tech/20210125 Why you need to drop ifconfig for ip.md @@ -1,21 +1,22 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "Why you need to drop ifconfig for ip" [#]: via: "https://opensource.com/article/21/1/ifconfig-ip-linux" [#]: author: "Rajan Bhardwaj https://opensource.com/users/rajabhar" - -放弃 ifconfig,拥抱 ip +放弃 ifconfig,拥抱 ip 命令 ====== -开始使用现代方法配置 Linux 网络接口。 -![Tips and gears turning][1] + +> 开始使用现代方法配置 Linux 网络接口。 + +![](https://img.linux.net.cn/data/attachment/album/202102/05/233847lpg1lnz7kl2czgfj.jpg) 在很长一段时间内,`ifconfig` 命令是配置网络接口的默认方法。它为 Linux 用户提供了很好的服务,但是网络很复杂,所以配置网络的命令必须健壮。`ip` 命令是现代系统中新的默认网络命令,在本文中,我将向你展示如何使用它。 -`ip` 命令工作在 [OSI 网络栈][2] 上:数据链路层和网络(IP)层。它做了之前 `net-tools` 包的所有工作。 +`ip` 命令工作在 [OSI 网络栈][2] 的两个层上:第二层(数据链路层)和第三层(网络 或 IP)层。它做了之前 `net-tools` 包的所有工作。 ### 安装 ip @@ -23,94 +24,88 @@ ### ifconfig 和 ip 使用对比 -`ip` 和 `ifconfig` 命令可以用来配置网络接口,但它们做事方法不同。接下来,作为对比,我将用它们来执行一些常见的任务。 +`ip` 和 `ifconfig` 命令都可以用来配置网络接口,但它们做事方法不同。接下来,作为对比,我将用它们来执行一些常见的任务。 #### 查看网口和 IP 地址 如果你想查看主机的 IP 地址或网络接口信息,`ifconfig` (不带任何参数)命令提供了一个很好的总结。 - ``` $ ifconfig -                                                                        -eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                                                  -       ether bc:ee:7b:5e:7d:d8  txqueuelen 1000  (Ethernet)                                                        -       RX packets 0  bytes 0 (0.0 B) -       RX errors 0  dropped 0  overruns 0  frame 0 -       TX packets 0  bytes 0 (0.0 B) -       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 + +eth0: flags=4099 mtu 1500 + ether bc:ee:7b:5e:7d:d8 txqueuelen 1000 (Ethernet) + RX packets 0 bytes 0 (0.0 B) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 0 bytes 0 (0.0 B) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 -lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536 -       inet 127.0.0.1  netmask 255.0.0.0 -       inet6 ::1  prefixlen 128  scopeid 0x10<host> -       loop  txqueuelen 1000  (Local Loopback) -       RX packets 41  bytes 5551 (5.4 KiB) -       RX errors 0  dropped 0  overruns 0  frame 0 -       TX packets 41  bytes 5551 (5.4 KiB) -       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 +lo: flags=73 mtu 65536 + inet 127.0.0.1 netmask 255.0.0.0 + inet6 ::1 prefixlen 128 scopeid 0x10 + loop txqueuelen 1000 (Local Loopback) + RX packets 41 bytes 5551 (5.4 KiB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 41 bytes 5551 (5.4 KiB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 -wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500 -       inet 10.1.1.6  netmask 255.255.255.224  broadcast 10.1.1.31 -       inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212  prefixlen 64  scopeid 0x0<global> -       inet6 fe80::8eb3:4bc0:7cbb:59e8  prefixlen 64  scopeid 0x20<link> -       ether 08:71:90:81:1e:b5  txqueuelen 1000  (Ethernet) -       RX packets 569459  bytes 779147444 (743.0 MiB) -       RX errors 0  dropped 0  overruns 0  frame 0 -       TX packets 302882  bytes 38131213 (36.3 MiB) -       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 +wlan0: flags=4163 mtu 1500 + inet 10.1.1.6 netmask 255.255.255.224 broadcast 10.1.1.31 + inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212 prefixlen 64 scopeid 0x0 + inet6 fe80::8eb3:4bc0:7cbb:59e8 prefixlen 64 scopeid 0x20 + ether 08:71:90:81:1e:b5 txqueuelen 1000 (Ethernet) + RX packets 569459 bytes 779147444 (743.0 MiB) + RX errors 0 dropped 0 overruns 0 frame 0 + TX packets 302882 bytes 38131213 (36.3 MiB) + TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` 新的 `ip` 命令提供了类似的结果,但命令是 `ip address show`,或者简写为 `ip a`: - ``` $ ip a -1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 -   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 -   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: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 -   link/ether bc:ee:7b:5e:7d:d8 brd ff:ff:ff:ff:ff:ff -3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 -   link/ether 08:71:90:81:1e:b5 brd ff:ff:ff:ff:ff:ff -   inet 10.1.1.6/27 brd 10.1.1.31 scope global dynamic wlan0 -      valid_lft 83490sec preferred_lft 83490sec -   inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212/64 scope global noprefixroute dynamic   -      valid_lft 6909sec preferred_lft 3309sec -   inet6 fe80::8eb3:4bc0:7cbb:59e8/64 scope link   -      valid_lft forever preferred_lft forever +1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 + 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: mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000 + link/ether bc:ee:7b:5e:7d:d8 brd ff:ff:ff:ff:ff:ff +3: wlan0: mtu 1500 qdisc noqueue state UP group default qlen 1000 + link/ether 08:71:90:81:1e:b5 brd ff:ff:ff:ff:ff:ff + inet 10.1.1.6/27 brd 10.1.1.31 scope global dynamic wlan0 + valid_lft 83490sec preferred_lft 83490sec + inet6 fdb4:f58e:49f:4900:d46d:146b:b16:7212/64 scope global noprefixroute dynamic + valid_lft 6909sec preferred_lft 3309sec + inet6 fe80::8eb3:4bc0:7cbb:59e8/64 scope link + valid_lft forever preferred_lft forever ``` #### 添加 IP 地址 使用 `ifconfig` 命令添加 IP 地址命令为: - -```bash +``` $ ifconfig eth0 add 192.9.203.21 ``` -`ip` 类似: +`ip` 类似: - -```bash +``` $ ip address add 192.9.203.21 dev eth0 ``` `ip` 中的子命令可以缩短,所以下面这个命令同样有效: - -```bash +``` $ ip addr add 192.9.203.21 dev eth0 ``` 你甚至可以更短些: - -```bash +``` $ ip a add 192.9.203.21 dev eth0 ``` @@ -118,74 +113,65 @@ $ ip a add 192.9.203.21 dev eth0 添加 IP 地址与删除 IP 地址正好相反。 -使用 `ifconfig`,命令是: +使用 `ifconfig`,命令是: - -```bash +``` $ ifconfig eth0 del 192.9.203.21 ``` `ip` 命令的语法是: - -```bash +``` $ ip a del 192.9.203.21 dev eth0 ``` #### 启用或禁用组播 -使用 `ifconfig` 接口来启用或禁用[组播][3]: +使用 `ifconfig` 接口来启用或禁用 [组播][3]multicast: - -```bash +``` # ifconfig eth0 multicast ``` 对于 `ip`,使用 `set` 子命令与设备(`dev`)以及一个布尔值和 `multicast` 选项: - -```bash +``` # ip link set dev eth0 multicast on ``` #### 启用或禁用网络 -每个系统管理员都熟悉“先关闭,然后打开”这个技巧来解决问题。在网络接口上,即打开或关闭网络。 +每个系统管理员都熟悉“先关闭,然后打开”这个技巧来解决问题。对于网络接口来说,即打开或关闭网络。 `ifconfig` 命令使用 `up` 或 `down` 关键字来实现: - -```bash +``` # ifconfig eth0 up ``` 或者你可以使用一个专用命令: - -```bash +``` # ifup eth0 ``` `ip` 命令使用 `set` 子命令将网络设置为 `up` 或 `down` 状态: - -```bash +``` # ip link set eth0 up ``` #### 开启或关闭地址解析功能(ARP) -使用 `ifconfig`,你可以通过声明来启用: +使用 `ifconfig`,你可以通过声明它来启用: - -```bash +``` # ifconfig eth0 arp ``` 使用 `ip`,你可以将 `arp` 属性设置为 `on` 或 `off`: - -```bash +``` # ip link set dev eth0 arp on ``` @@ -193,9 +179,9 @@ $ ip a del 192.9.203.21 dev eth0 `ip` 命令比 `ifconfig` 更通用,技术上也更有效,因为它使用的是 `Netlink` 套接字,而不是 `ioctl` 系统调用。 -`ip` 命令可能看起来比 `ifconfig` 更详细、更复杂,但这是它拥有更多功能的一个原因。一旦你开始使用它,你会了解它的内部逻辑(例如,使用 `set` 而不是看起来随意叠加的声明或设置)。 +`ip` 命令可能看起来比 `ifconfig` 更详细、更复杂,但这是它拥有更多功能的一个原因。一旦你开始使用它,你会了解它的内部逻辑(例如,使用 `set` 而不是看起来随意混合的声明或设置)。 -最后,`ifconfig` 已经过时了(例如,它缺乏对网络名称空间的支持),而 `ip` 是为现代网络而生的。尝试并学习它,使用它,你会很感激你使用它的! +最后,`ifconfig` 已经过时了(例如,它缺乏对网络命名空间的支持),而 `ip` 是为现代网络而生的。尝试并学习它,使用它,你会由衷高兴的! -------------------------------------------------------------------------------- @@ -204,7 +190,7 @@ via: https://opensource.com/article/21/1/ifconfig-ip-linux 作者:[Rajan Bhardwaj][a] 选题:[lujun9972][b] 译者:[MjSeven](https://github.com/MjSeven) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5962d43647837a6bcb9c2f8619ac688022cb951d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 5 Feb 2021 23:40:02 +0800 Subject: [PATCH 128/213] PUB @MjSeven https://linux.cn/article-13089-1.html --- .../20210125 Why you need to drop ifconfig for ip.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210125 Why you need to drop ifconfig for ip.md (98%) diff --git a/translated/tech/20210125 Why you need to drop ifconfig for ip.md b/published/20210125 Why you need to drop ifconfig for ip.md similarity index 98% rename from translated/tech/20210125 Why you need to drop ifconfig for ip.md rename to published/20210125 Why you need to drop ifconfig for ip.md index c7c431c22f..c4370c6f6d 100644 --- a/translated/tech/20210125 Why you need to drop ifconfig for ip.md +++ b/published/20210125 Why you need to drop ifconfig for ip.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "MjSeven" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13089-1.html" [#]: subject: "Why you need to drop ifconfig for ip" [#]: via: "https://opensource.com/article/21/1/ifconfig-ip-linux" [#]: author: "Rajan Bhardwaj https://opensource.com/users/rajabhar" From 32c83db6d5e1b3568f4d90d9cd75286e74abca35 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 00:19:00 +0800 Subject: [PATCH 129/213] PRF @Chao-zhi --- ...nhance your command line skills in 2021.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md b/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md index c72e61228c..8f07344db8 100644 --- a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md +++ b/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md @@ -1,48 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (7 Bash tutorials to enhance your command line skills in 2021) [#]: via: (https://opensource.com/article/21/1/bash) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) -7 个 Bash 教程,提高你的命令行技能,2021 年版 +7 个 Bash 教程,提高你的命令行技能(2021 版) ====== -Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢? +> Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢? -![Terminal command prompt on orange background][1] +![](https://img.linux.net.cn/data/attachment/album/202102/06/001837cujo0ql3utfobrrj.jpg) -Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢?今年,Opensource.com 推荐了许多很棒的文章来帮助您充分利用 Bash shell 的强大功能。以下是一些关于 Bash 阅读次数最多的文章: +Bash 是大多数 Linux 系统上的默认命令行 shell。所以你为什么不试着学习如何最大限度地利用它呢?今年,我们推荐了许多很棒的文章来帮助你充分利用 Bash shell 的强大功能。以下是一些关于 Bash 阅读次数最多的文章: -## [在 Linux 终端中通过重定向从任何地方读取和写入数据 ][2] +### 《通过重定向在 Linux 终端任意读写数据》 -输入和输出重定向是任何编程或脚本语言的基础功能。从技术上讲,只要你与电脑互动,它就会自然而然地发生。输入从 stdin( 标准输入,通常是您的键盘或鼠标)读取,输出到 stdout (标准输出,一般是文本或数据流),而错误被发送到 stderr。了解这些数据流的存在,使您能够在使用 Bash 等 shell 时控制信息的去向。Seth Kenlon 分享了这些很棒的技巧,可以让你在不需要大量鼠标移动和按键的情况下从一个地方获取数据。您可能不经常使用重定向,但学习使用它可以为您节省大量不必要的打开文件和复制粘贴数据的时间。 +输入和输出重定向是任何编程或脚本语言的基础功能。从技术上讲,只要你与电脑互动,它就会自然而然地发生。输入从 stdin(标准输入,通常是你的键盘或鼠标)读取,输出到 stdout(标准输出,一般是文本或数据流),而错误被发送到 stderr(标准错误,一般和标准输出是一个位置)。了解这些数据流的存在,使你能够在使用 Bash 等 shell 时控制信息的去向。Seth Kenlon [分享][2]了这些很棒的技巧,可以让你在不需要大量鼠标移动和按键的情况下从一个地方获取数据。你可能不经常使用重定向,但学习使用它可以为你节省大量不必要的打开文件和复制粘贴数据的时间。 -## [系统管理员 Bash 脚本入门 ][3] +### 《系统管理员 Bash 脚本入门》 -Bash 是免费的开源软件,所以任何人都可以安装它,不管他们运行的是 Linux、BSD、OpenIndiana、Windows 还是 macOS。Seth Kenlon 帮助您学习如何使用 Bash 的命令和特性,使其成为最强大的 shell 之一。 +Bash 是自由开源软件,所以任何人都可以安装它,不管他们运行的是 Linux、BSD、OpenIndiana、Windows 还是 macOS。Seth Kenlon [帮助][3]你学习如何使用 Bash 的命令和特性,使其成为最强大的 shell 之一。 -## [试试这个针对大型文件系统的 Bash 脚本 ][4] +### 《针对大型文件系统可以试试此 Bash 脚本》 -您是否曾经想列出一个目录中的所有文件,只显示其中的文件,不包括其他内容?或者只显示目录?如果你有,那么 Nick Clifton 的文章可能正是你正在寻找的。Nick 分享了一个漂亮的 Bash 脚本,它可以列出目录、文件、链接或可执行文件。该脚本使用 **find** 命令进行搜索,然后运行 **ls** 显示详细信息。对于管理大型 Linux 系统的人来说,这是一个漂亮的解决方案。 +你是否曾经想列出一个目录中的所有文件,只显示其中的文件,不包括其他内容?或者只显示目录?如果你有,那么 Nick Clifton 的[文章][4]可能正是你正在寻找的。Nick 分享了一个漂亮的 Bash 脚本,它可以列出目录、文件、链接或可执行文件。该脚本使用 `find` 命令进行搜索,然后运行 `ls` 显示详细信息。对于管理大型 Linux 系统的人来说,这是一个漂亮的解决方案。 -## [用 Bash 工具对你的 Linux 系统配置进行快照 ][5] +### 《用 Bash 工具对你的 Linux 系统配置进行快照》 -您可能想与他人分享您的 Linux 配置,原因有很多。您可能需要帮助排除系统上的一个问题,或者您对自己创建的环境非常自豪,想向其他开源爱好者展示它。Don Watkins 向我们展示了 screenFetch 和 Neofetch 来捕获和分享您的系统配置。 +你可能想与他人分享你的 Linux 配置,原因有很多。你可能需要帮助排除系统上的一个问题,或者你对自己创建的环境非常自豪,想向其他开源爱好者展示它。Don Watkins 向我们[展示][5]了 screenFetch 和 Neofetch 来捕获和分享你的系统配置。 -## [Git 的 6 个好用的 Bash 脚本 ][6] +### 《6 个方便的 Git 脚本》 -Git 已经成为一个无处不在的代码管理系统。了解如何管理 Git 存储库可以简化您的开发体验。Bob Peterson 分享了 6 个 Bash 脚本,它们将使您在使用 Git 存储库时更加轻松。**gitlog** 打印当前 patch 和 主版本的缩写列表。另一种脚本可以显示 patch 的 SHA1 id 或在一组 patch 中搜索字符串。 +Git 已经成为一个无处不在的代码管理系统。了解如何管理 Git 存储库可以简化你的开发体验。Bob Peterson [分享][6]了 6 个 Bash 脚本,它们将使你在使用 Git 存储库时更加轻松。`gitlog` 打印当前补丁的简略列表,并与主版本相对照。这个脚本的不同版本可以显示补丁的 SHA1 id 或在一组补丁中搜索字符串。 -## [改进你 Bash 脚本的 5 种方法 ][7] +### 《改进你 Bash 脚本的 5 种方法》 -系统管理员通常编写各种或长或短的 Bash 脚本,以完成各种任务。Alan Formy-Duval 解释了如何使 Bash 脚本更简单、更健壮、更易于阅读和调试。我们可能会考虑到我们需要使用诸如 Python、C 或 Java 之类的语言来实现更高的功能,但其实也不一定需要。因为 Bash 脚本语言就已经非常强大。要最大限度地发挥它的效用,还有很多东西要学。 +系统管理员通常编写各种或长或短的 Bash 脚本,以完成各种任务。Alan Formy-Duval [解释][7]了如何使 Bash 脚本更简单、更健壮、更易于阅读和调试。我们可能会考虑到我们需要使用诸如 Python、C 或 Java 之类的语言来实现更高的功能,但其实也不一定需要。因为 Bash 脚本语言就已经非常强大。要最大限度地发挥它的效用,还有很多东西要学。 -## [我最喜欢的 Bash 技巧 ][8] +### 《我珍藏的 Bash 秘籍》 -Katie McLaughlin 帮助你提高你的工作效率,用别名和其他快捷方式解决你经常忘记的事情。当你整天与计算机打交道时,找到可重复的命令并标记它们以方便以后使用是非常美妙的。Katie 总结了一些有用的 Bash 特性和帮助命令,可以节省您的时间。 +Katie McLaughlin 帮助你提高你的工作效率,用别名和其他快捷方式解决你经常忘记的事情。当你整天与计算机打交道时,找到可重复的命令并标记它们以方便以后使用是非常美妙的。Katie [总结][8]了一些有用的 Bash 特性和帮助命令,可以节省你的时间。 这些 Bash 小技巧将一个已经很强大的 shell 提升到一个全新的级别。也欢迎分享你自己的建议。 @@ -53,17 +53,17 @@ via: https://opensource.com/article/21/1/bash 作者:[Jim Hall][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/jim-hall [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) -[2]: https://opensource.com/article/20/6/redirection-bash +[2]: https://linux.cn/article-12385-1.html [3]: https://opensource.com/article/20/4/bash-sysadmins-ebook -[4]: https://opensource.com/article/20/2/script-large-files +[4]: https://linux.cn/article-12025-1.html [5]: https://opensource.com/article/20/1/screenfetch-neofetch -[6]: https://opensource.com/article/20/1/bash-scripts-git +[6]: https://linux.cn/article-11797-1.html [7]: https://opensource.com/article/20/1/improve-bash-scripts -[8]: https://opensource.com/article/20/1/bash-scripts-aliases +[8]: https://linux.cn/article-11841-1.html From c0d782f11f3b64f9afe1f80190e42c31767363f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 00:19:37 +0800 Subject: [PATCH 130/213] PUB @Chao-zhi https://linux.cn/article-13090-1.html --- ...h tutorials to enhance your command line skills in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210111 7 Bash tutorials to enhance your command line skills in 2021.md (98%) diff --git a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md b/published/20210111 7 Bash tutorials to enhance your command line skills in 2021.md similarity index 98% rename from translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md rename to published/20210111 7 Bash tutorials to enhance your command line skills in 2021.md index 8f07344db8..ce0f61adc5 100644 --- a/translated/tech/20210111 7 Bash tutorials to enhance your command line skills in 2021.md +++ b/published/20210111 7 Bash tutorials to enhance your command line skills in 2021.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13090-1.html) [#]: subject: (7 Bash tutorials to enhance your command line skills in 2021) [#]: via: (https://opensource.com/article/21/1/bash) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) From 4f7b4eb14c4b44a186638f270be09a2c1568d276 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 6 Feb 2021 05:03:22 +0800 Subject: [PATCH 131/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210205=20?= =?UTF-8?q?Astrophotography=20with=20Fedora=20Astronomy=20Lab:=20setting?= =?UTF-8?q?=20up?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md --- ...y with Fedora Astronomy Lab- setting up.md | 243 ++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md diff --git a/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md b/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md new file mode 100644 index 0000000000..7077d9544b --- /dev/null +++ b/sources/tech/20210205 Astrophotography with Fedora Astronomy Lab- setting up.md @@ -0,0 +1,243 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Astrophotography with Fedora Astronomy Lab: setting up) +[#]: via: (https://fedoramagazine.org/astrophotography-with-fedora-astronomy-lab-setting-up/) +[#]: author: (Geoffrey Marr https://fedoramagazine.org/author/coremodule/) + +Astrophotography with Fedora Astronomy Lab: setting up +====== + +![][1] + +Photo by Geoffrey Marr + +You love astrophotography. You love Fedora Linux. What if you could do the former using the latter? Capturing stunning and awe-inspiring astrophotographs, processing them, and editing them for printing or sharing online using Fedora is absolutely possible! This tutorial guides you through the process of setting up a computer-guided telescope mount, guide cameras, imaging cameras, and other pieces of equipment. A future article will cover capturing and processing data into pleasing images. Please note that while this article is written with certain aspects of the astrophotography process included or omitted based off my own equipment, you can custom-tailor it to fit your own equipment and experience. Let’s capture some photons! + +![][2] + +### Installing Fedora Astronomy Lab + +This tutorial focuses on [Fedora Astronomy Lab][3], so it only makes sense that the first thing we should do is get it installed. But first, a quick introduction: based on the KDE Plasma desktop, Fedora Astronomy Lab includes many pieces of open source software to aid astronomers in planning observations, capturing data, processing images, and controlling astronomical equipment. + +Download Fedora Astronomy Lab from the [Fedora Labs website][4]. You will need a USB flash-drive with at least eight GB of storage. Once you have downloaded the ISO image, use [Fedora Media Writer][5] to [write the image to your USB flash-drive.][6] After this is done, [boot from the USB drive][7] you just flashed and [install Fedora Astronomy Lab to your hard drive.][8] While you can use Fedora Astronomy Lab in a live-environment right from the flash drive, you should install to the hard drive to prevent bottlenecks when processing large amounts of astronomical data. + +### Configuring your installation + +Before you can go capturing the heavens, you need to do some minor setup in Fedora Astronomy Lab. + +First of all, you need to add your user to the _dialout_ group so that you can access certain pieces of astronomical equipment from within the guiding software. Do that by opening the terminal (Konsole) and running this command (replacing _user_ with your username): + +sudo usermod -a -G dialout user + +My personal setup includes a guide camera (QHY5 series, also known as Orion Starshoot) that does not have a driver in the mainline Fedora repositories. To enable it, ypu need to install the [qhyccd SDK][9]. (_Note that this package is not officially supported by Fedora. Use it at your own risk.)_ At the time of writing, I chose to use the latest stable release, 20.08.26. Once you download the Linux 64-bit version of the SDK, to extract it: +``` + +``` + +tar zxvf sdk_linux64_20.08.26.tgz +``` + +``` + +Now change into the directory you just extracted, change the permissions of the _install.sh_ file to give you execute privileges, and run the _install.sh_: + +``` +cd sdk_linux64_20.08.26 +chmod +x install.sh +sudo ./install.sh +``` + +Now it’s time to install the qhyccd INDI driver. INDI is an open source software library used to control astronomical equipment. Unfortunately, the driver is unavailable in the mainline Fedora repositories, but it is in a Copr repository. (_Note: Copr is not officially supported by Fedora infrastructure. Use packages at your own risk.)_ If you prefer to have the newest (and perhaps unstable!) pieces of astronomy software, you can also enable the “bleeding” repositories at this time by following [this guide][10]. For this tutorial, you are only going to enable one repo: +``` + +``` + +sudo dnf copr enable xsnrg/indi-3rdparty-bleeding +``` + +``` + +Install the driver by running the following command: +``` + +``` + +sudo dnf install indi-qhy +``` + +``` + +Finally, update all of your system packages: + +sudo dnf update -y + +To recap what you accomplished in this sectio: you added your user to the _dialout_ group, downloaded and installed the qhyccd driver, enabled the _indi-3rdparty-bleeding_ copr, installed the qhyccd-INDI driver with dnf, and updated your system. + +### Connecting your equipment + +This is the time to connect all your equipment to your computer. Most astronomical equipment will connect via USB, and it’s really as easy as plugging each device into your computer’s USB ports. If you have a lot of equipment (mount, imaging camera, guide camera, focuser, filter wheel, etc), you should use an external powered-USB hub to make sure that all connected devices have adequate power. Once you have everything plugged in, run the following command to ensure that the system recognizes your equipment: +``` + +``` + +lsusb +``` + +``` + +You should see output similar to (but not the same as) the output here: + +![][11] + +You see in the output that the system recognizes the telescope mount (a SkyWatcher EQM-35 Pro) as _Prolific Technology, Inc. PL2303 Serial Port_, the imaging camera (a Sony a6000) as _Sony Corp. ILCE-6000_, and the guide camera (an Orion Starshoot, aka QHY5) as _Van Ouijen Technische Informatica_. Now that you have made sure your system recognizes your equipment, it’s time to open your desktop planetarium and telescope controller, KStars! + +### Setting up KStars + +It’s time to open [KStars][12], which is a desktop planetarium and also includes the Ekos telescope control software. The first time you open KStars, you will see the KStars Startup Wizard. + +![][13] + +Follow the prompts to choose your home location (where you will be imaging from) and _Download Extra Data…_ + +![Setting your location][14] + +![“Download Extra Data”][15] + +![Choosing which catalogs to download][16] + +This will allow you to install additional star, nebula, and galaxy catalogs. You don’t need them, but they don’t take up too much space and add to the experience of using KStars. Once you’ve completed this, hit _Done_ in the bottom right corner to continue. + +### Getting familiar with KStars + +Now is a good time to play around with the KStars interface. You are greeted with a spherical image with a coordinate plane and stars in the sky. + +![][17] + +This is the desktop planetarium which allows you to view the placement of objects in the night sky. Double-clicking an object selects it, and right clicking on an object gives you options like _Center & Track_ which will follow the object in the planetarium, compensating for [sidereal time][18]. _Show DSS Image_ shows a real [digitized sky survey][19] image of the selected object. + +![][20] + +Another essential feature is the _Set Time_ option in the toolbar. Clicking this will allow you to input a future (or past) time and then simulate the night sky as if that were the current date. + +![The Set Time button][21] + +### Configuring capture equipment with Ekos + +You’re familiar with the KStars layout and some basic functions, so it’s time to move on configuring your equipment using the [Ekos][22] observatory controller and automation tool. To open Ekos, click the observatory button in the toolbar or go to _Tools_ > _Ekos_. + +![The Ekos button on the toolbar][23] + +You will see another setup wizard: the _Ekos Profile Wizard_. Click _Next_ to start the wizard. + +![][24] + +In this tutorial, you have all of our equipment connected directly to your computer. A future article we will cover using an INDI server installed on a remote computer to control our equipment, allowing you to connect over a network and not have to be in the same physical space as your gear. For now though, select _Equipment is attached to this device_. + +![][25] + +You are now asked to name your equipment profile. I usually name mine something like “Local Gear” to differentiate between profiles that are for remote gear, but name your profile what you wish. We will leave the button marked _Internal Guide_ checked and won’t select any additional services. Now click the _Create Profile & Select Devices_ button. + +![][26] + +This next screen is where we can select your particular driver to use for each individual piece of equipment. This part will be specific to your setup depending on what gear you use. For this tutorial, I will select the drivers for my setup. + +My mount, a [SkyWatcher EQM-35 Pro][27], uses the _EQMod Mount_ under _SkyWatcher_ in the menu (this driver is also compatible with all SkyWatcher equatorial mounts, including the [EQ6-R Pro][28] and the [EQ8-R Pro][29]). For my Sony a6000 imaging camera, I choose the _Sony DSLR_ under _DSLRs_ under the CCD category. Under _Guider_, I choose the _QHY CCD_ under _QHY_ for my Orion Starshoot (and any QHY5 series camera). That last driver we want to select will be under the Aux 1 category. We want to select _Astrometry_ from the drop-down window. This will enable the Astrometry plate-solver from within Ekos that will allow our telescope to automatically figure out where in the night sky it is pointed, saving us the time and hassle of doing a one, two, or three star calibration after setting up our mount. + +You selected your drivers. Now it’s time to configure your telescope. Add new telescope profiles by clicking on the + button in the lower right. This is essential for computing field-of-view measurements so you can tell what your images will look like when you open the shutter. Once you click the + button, you will be presented with a form where you can enter the specifications of your telescope and guide scope. For my imaging telescope, I will enter Celestron into the _Vendor_ field, SS-80 into the _Model_ field, I will leave the _Driver_ field as None, _Type_ field as Refractor, _Aperture_ as 80mm, and _Focal Length_ as 400mm. + +![][30] + +After you enter the data, hit the _Save_ button. You will see the data you just entered appear in the left window with an index number of 1 next to it. Now you can go about entering the specs for your guide scope following the steps above. Once you hit save here, the guide scope will also appear in the left window with an index number of 2. Once all of your scopes are entered, close this window. Now select your _Primary_ and _Guide_ telescopes from the drop-down window. + +![][31] + +After all that work, everything should be correctly configured! Click the _Close_ button and complete the final bit of setup. + +### Starting your capture equipment + +This last step before you can start taking images should be easy enough. Click the _Play_ button under Start & Stop Ekos to connect to your equipment. + +![][32] + +You will be greeted with a screen that looks similar to this: + +![][33] + +When you click on the tabs at the top of the screen, they should all show a green dot next to _Connection_, indicating that they are connected to your system. On my setup, the baud rate for my mount (the EQMod Mount tab) is set incorrectly, and so the mount is not connected. + +![][34] + +This is an easy fix; click on the _EQMod Mount_ tab, then the _Connection_ sub-tab, and then change the baud rate from 9600 to 115200. Now is a good time to ensure the serial port under _Ports_ is the correct serial port for your mount. You can check which port the system has mounted your device on by running the command: +``` + +``` + +ls /dev + +``` +| grep USB +``` + +You should see _ttyUSB0_. If there is more than one USB-serial device plugged in at a time, you will see more than one ttyUSB port, with an incrementing following number. To figure out which port is correct. unplug your mount and run the command again. + +Now click on the _Main Control_ sub-tab, click _Connect_ again, and wait for the mount to connect. It might take a few seconds, be patient and it should connect. + +The last thing to do is set the sensor and pixel size parameters for my camera. Under the _Sony DSLR Alpha-A6000 (Control)_ tab, select the _Image Info_ sub-tab. This is where you can enter your sensor specifications; if you don’t know them, a quick search on the internet will bring you your sensor’s maximum resolution as well as pixel pitch. Enter this data into the right-side boxes, then press the _Set_ button to load them into the left boxes and save them into memory. Hit the _Close_ button when you are done. + +![][35] + +### Conclusion + +Your equipment is ready to use. In the next article, you will learn how to capture and process the images. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/astrophotography-with-fedora-astronomy-lab-setting-up/ + +作者:[Geoffrey Marr][a] +选题:[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/coremodule/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/astrophotography-setup-2-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2020/11/IMG_4151-768x1024.jpg +[3]: https://labs.fedoraproject.org/en/astronomy/ +[4]: https://labs.fedoraproject.org/astronomy/download/index.html +[5]: https://github.com/FedoraQt/MediaWriter +[6]: https://docs.fedoraproject.org/en-US/fedora/f33/install-guide/install/Preparing_for_Installation/#_fedora_media_writer +[7]: https://docs.fedoraproject.org/en-US/fedora/f33/install-guide/install/Booting_the_Installation/ +[8]: https://docs.fedoraproject.org/en-US/fedora/f33/install-guide/install/Installing_Using_Anaconda/#sect-installation-graphical-mode +[9]: https://www.qhyccd.com/html/prepub/log_en.html#!log_en.md +[10]: https://www.indilib.org/download/fedora/category/8-fedora.html +[11]: https://fedoramagazine.org/wp-content/uploads/2020/11/lsusb_output_rpi.png +[12]: https://edu.kde.org/kstars/ +[13]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_setuo_wizard-2.png +[14]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_location_select-2.png +[15]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars-download-extra-data-1.png +[16]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_install_extra_Data-1.png +[17]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_planetarium-1024x549.png +[18]: https://en.wikipedia.org/wiki/Sidereal_time +[19]: https://en.wikipedia.org/wiki/Digitized_Sky_Survey +[20]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_right_click_object-1024x576.png +[21]: https://fedoramagazine.org/wp-content/uploads/2020/11/kstars_planetarium_clock_icon.png +[22]: https://www.indilib.org/about/ekos.html +[23]: https://fedoramagazine.org/wp-content/uploads/2020/11/open_ekos_icon.png +[24]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos-profile-wizard.png +[25]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_equipment_attached_to_this_device.png +[26]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_wizard_local_gear.png +[27]: https://www.skywatcherusa.com/products/eqm-35-mount +[28]: https://www.skywatcherusa.com/products/eq6-r-pro +[29]: https://www.skywatcherusa.com/collections/eq8-r-series-mounts/products/eq8-r-mount-with-pier-tripod +[30]: https://fedoramagazine.org/wp-content/uploads/2020/11/setup_telescope_profiles.png +[31]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_setup_aux_1_astrometry-1024x616.png +[32]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_start_equip_connect.png +[33]: https://fedoramagazine.org/wp-content/uploads/2020/11/ekos_startup_equipment.png +[34]: https://fedoramagazine.org/wp-content/uploads/2020/11/set_baud_rate_to_115200.png +[35]: https://fedoramagazine.org/wp-content/uploads/2020/11/set_camera_sensor_settings.png From a24e4380a9cb60f1eaa275475712d0f5b1120514 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 6 Feb 2021 05:04:38 +0800 Subject: [PATCH 132/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210205=20?= =?UTF-8?q?Integrate=20devices=20and=20add-ons=20into=20your=20home=20auto?= =?UTF-8?q?mation=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md --- ...add-ons into your home automation setup.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md diff --git a/sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md b/sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md new file mode 100644 index 0000000000..d82dcc262e --- /dev/null +++ b/sources/tech/20210205 Integrate devices and add-ons into your home automation setup.md @@ -0,0 +1,190 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Integrate devices and add-ons into your home automation setup) +[#]: via: (https://opensource.com/article/21/2/home-automation-addons) +[#]: author: (Steve Ovens https://opensource.com/users/stratusss) + +Integrate devices and add-ons into your home automation setup +====== +Learn how to set up initial integrations and install add-ons in Home +Assistant in the fifth article in this series. +![Looking at a map][1] + +In the four previous articles in this series about home automation, I have discussed [what Home Assistant is][2], why you may want [local control][3], some of the [communication protocols][4] for smart home components, and how to [install Home Assistant][5] in a virtual machine (VM) using libvirt. In this fifth article, I will talk about configuring some initial integrations and installing some add-ons. + +### Set up initial integrations + +It's time to start getting into some of the fun stuff. The whole reason Home Assistant (HA) exists is to pull together various "smart" devices from different manufacturers. To do so, you have to make Home Assistant aware of which devices it should coordinate. I'll demonstrate by adding a [Sonoff Zigbee Bridge][6]. + +I followed [DigiBlur's Sonoff Guide][7] to replace the stock firmware with the open source firmware [Tasmota][8] to decouple my sensors from the cloud. My [second article][3] in this series explains why you might wish to replace the stock firmware. (I won't go into the device's setup with either the stock or custom firmware, as that is outside of the scope of this tutorial.) + +First, navigate to the **Configuration** menu on the left side of the HA interface, and make sure **Integrations** is selected: + +![Home Assistant integration configuration][9] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +From there, click the **Add Integration** button in the bottom-right corner and search for Zigbee: + +![Add Zigbee integration in Home Assistant][11] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Enter the device manually. If the Zigbee Bridge was physically connected to the Home Assistant interface, you could select the device path. For instance, I have a ZigBee CC2531 USB stick that I use for some Zigbee devices that do not communicate correctly with the Sonoff Bridge. It attaches directly to the Home Assistant host and shows up as a Serial Device. See my [third article][12] for details on wireless standards. However, in this tutorial, we will continue to configure and use the Sonoff Bridge. + +![Enter device manually][13] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The next step is to choose the radio type, using the information in the DigiBlur tutorial. In this case, the radio is an EZSP radio: + +![Choose the radio type][14] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Finally, you need to know the IP address of the Sonoff Bridge, the port it is listening on, and the speed of the connection. Once I found the Sonoff Bridge's MAC address, I used my DHCP server to ensure that the device always uses the same IP on my network. DigiBlur's guide provides the port and speed numbers. + +![IP, port, and speed numbers][15] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Once you've added the Bridge, you can begin pairing devices to it. Ensure that your devices are in pairing mode. The Bridge will eventually find your device(s). + +![Device pairing][16] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +You can name the device(s) and assign an area (if you set them up). + +![Name device][17] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The areas displayed will vary based on whether or not you have any configured. Bedroom, Kitchen, and Living Room exist by default. As you add a device, HA will add a new Card to the **Integrations** tab. A Card is a user interface (UI) element that groups information related to a specific entity. The Zigbee card looks like this: + +![Integration card][18] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Later, I'll come back to using this integration. I'll also get into how to use this device in automation flows. But now, I will show you how to add functionality to Home Assistant to make your life easier. + +### Add functionality with add-ons + +Out of the box, HA has some pretty great features for home automation. If you are buying commercial-off-the-shelf (CoTS) products, there is a good chance you can accomplish everything you need without the help of add-ons. However, you may want to investigate some of the add-ons, especially if (like me) you want to make your own sensors. + +There are all kinds of HA add-ons, ranging from Android debugging (ADB) tools to MQTT brokers to the Visual Studio Code editor. With each release, the number of add-ons grows. Some people make HA the center of their local system, encompassing DHCP, Plex, databases, and other useful programs. In fact, HA now ships with a built-in media browser for playing any media that you expose to it. + +I won't go too crazy in this article; I'll show you some of the basics and let you decide how you want to proceed. + +#### Install official add-ons + +Some of the many HA add-ons are available for installation right from the web UI, and others can be installed from alternative sources, such as Git. + +To see what's available, click on the **Supervisor** menu on the left panel. Near the top, you will see a tab called **Add-on store**. + +![Home Assistant add-on store][19] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Below are three of the more useful add-ons that I think should be standard for any HA deployment: + +![Home Assistant official add-ons][20] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +The **File Editor** allows you to manage Home Assistant configuration files directly from your browser. I find this far more convenient for quick edits than obtaining a copy of the file, editing it, and pushing it back to HA. If you use add-ons like the Visual Studio Code editor, you can edit the same files. + +The **Samba share** add-on is an excellent way to extract HA backups from the system or push configuration files or assets to the **web** directory. You should _never_ leave your backups sitting on the machine being backed up. + +Finally, **Mosquitto broker** is my preferred method for managing an [MQTT][21] client. While you can install a broker that's external to the HA machine, I find low value in doing this. Since I am using MQTT just to communicate with my IoT devices, and HA is the primary method of coordinating that communication, there is a low risk in having these components vertically integrated. If HA is offline, the MQTT broker is almost useless in my arrangement. + +#### Install community add-ons + +Home Assistant has a prolific community and passionate developers. In fact, many of the "community" add-ons are developed and maintained by the HA developers themselves. For my needs, I install: + +![Home Assistant community add-ons][22] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +**Grafana** (graphing program) and **InfluxDB** (a time-series database) are largely optional and relate to the ability to customize how you visualize the data HA collects. I like to have historical data handy and enjoy looking at the graphs from time to time. While not exactly HA-related, I have my pfSense firewall/router forward metrics to InfluxDB so that I can make some nice graphs over time. + +![Home Assistant Grafana add-on][23] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +**ESPHome** is definitely an optional add-on that's warranted only if you plan on making your own sensors. + +**NodeRED** is my preferred automation flow-handling solution. Although HA has some built-in automation, I find a visual flow editor is preferable for some of the logic I use in my system. + +#### Configure add-ons + +Some add-ons (such as File Editor) require no configuration to start them. However, most—such as Node-RED—require at least a small amount of configuration. Before you can start Node-RED, you will need to set a password: + +![Home Assistant Node-RED add-on][24] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +**IMPORTANT:** Many people will abstract passwords through the `secrets.yaml` file. This does not provide any additional security other than not having passwords in the add-on configuration's YAML. See [the official documentation][25] for more information. + +In addition to the password requirement, most of the add-ons that have a web UI default to having the `ssl: true` option set. A self-signed cert on my local LAN is not a requirement, so I usually set this to false. There is an add-on for Let's Encrypt, but dealing with certificates is outside the scope of this series. + +After you have looked through the **Configuration** tab, save your changes, and enable Node-RED on the add-on's main screen. + +![Home Assistant Node-RED add-on][26] + +(Steve Ovens, [CC BY-SA 4.0][10]) + +Don't forget to start the plugin. + +Most add-ons follow a similar procedure, so you can use this approach to set up other add-ons. + +### Wrapping up + +Whew, that was a lot of screenshots! Fortunately, when you are doing the configuration, the UI makes these steps relatively painless. + +At this point, your HA instance should be installed with some basic configurations and a few essential add-ons. + +In the next article, I will discuss integrating custom Internet of Things (IoT) devices into Home Assistant. Don't worry; the fun is just beginning! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/home-automation-addons + +作者:[Steve Ovens][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stratusss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://opensource.com/article/20/11/home-assistant +[3]: https://opensource.com/article/20/11/cloud-vs-local-home-automation +[4]: https://opensource.com/article/20/11/home-automation-part-3 +[5]: https://opensource.com/article/20/12/home-assistant +[6]: https://sonoff.tech/product/smart-home-security/zbbridge +[7]: https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-with.html +[8]: https://tasmota.github.io/docs/ +[9]: https://opensource.com/sites/default/files/uploads/ha-setup20-configuration-integration.png (Home Assistant integration configuration) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee.png (Add Zigbee integration in Home Assistant) +[12]: https://opensource.com/article/20/11/wireless-protocol-home-automation +[13]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-2.png (Enter device manually) +[14]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-3.png (Choose the radio type) +[15]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-4.png (IP, port, and speed numbers) +[16]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-5.png (Device pairing) +[17]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-6.png (Name device) +[18]: https://opensource.com/sites/default/files/uploads/ha-setup21-int-zigbee-7_0.png (Integration card) +[19]: https://opensource.com/sites/default/files/uploads/ha-setup7-addons.png (Home Assistant add-on store) +[20]: https://opensource.com/sites/default/files/uploads/ha-setup8-official-addons.png (Home Assistant official add-ons) +[21]: https://en.wikipedia.org/wiki/MQTT +[22]: https://opensource.com/sites/default/files/uploads/ha-setup9-community-addons.png (Home Assistant community add-ons) +[23]: https://opensource.com/sites/default/files/uploads/ha-setup9-community-grafana-pfsense.png (Home Assistant Grafana add-on) +[24]: https://opensource.com/sites/default/files/uploads/ha-setup27-nodered2.png (Home Assistant Node-RED add-on) +[25]: https://www.home-assistant.io/docs/configuration/secrets/ +[26]: https://opensource.com/sites/default/files/uploads/ha-setup26-nodered1.png (Home Assistant Node-RED add-on) From bd1f1bb2590bb276c0fa253cfd27c6e04d9dcf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 6 Feb 2021 14:37:41 +0800 Subject: [PATCH 133/213] translating by Chao-zhi --- ...at are Easier to Install and Use Than Arch Linux Itself.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md index 9231d75240..f332898f20 100644 --- a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ b/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -146,7 +146,7 @@ via: https://itsfoss.com/arch-based-linux-distros/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cf0afbbadf01eb573eaad46781a4904217d4ea03 Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Sat, 6 Feb 2021 16:27:54 +0800 Subject: [PATCH 134/213] translating --- sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md index ac60a02d17..662a093a57 100644 --- a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (rakino) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -241,7 +241,7 @@ via: https://fedoramagazine.org/latex-typesetting-part-1/ 作者:[Earl Ramirez][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[rakino](https://github.com/rakino) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c91bb6d7d1124de868042369587d027ef05ee258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sat, 6 Feb 2021 16:38:35 +0800 Subject: [PATCH 135/213] translate done: 20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md --- ... Install and Use Than Arch Linux Itself.md | 201 ------------------ ... Install and Use Than Arch Linux Itself.md | 201 ++++++++++++++++++ 2 files changed, 201 insertions(+), 201 deletions(-) delete mode 100644 sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md create mode 100644 translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md diff --git a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md deleted file mode 100644 index f332898f20..0000000000 --- a/sources/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ /dev/null @@ -1,201 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) -[#]: via: (https://itsfoss.com/arch-based-linux-distros/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself -====== - -In the Linux community, [Arch Linux][1] has a cult following. This lightweight distribution provides the bleeding edge updates with a DIY (do it yourself) attitude. - -However, Arch is also aimed at more experienced users. As such, it is generally considered to be beyond the reach of those who lack the technical expertise (or persistence) required to use it. - -In fact, the very first steps, [installing Arch Linux itself is enough to scare many people off][2]. Unlike most other distributions, Arch Linux doesn’t have an easy to use graphical installer. You have to do disk partitions, connect to internet, mount drives and create file system etc using command line tools only. - -For those who want to experience Arch without the hassle of the complicated installation and set up, there exists a number of user-friendly Arch-based distributions. - -In this article, I’ll show you some of these Arch alternative distributions. These distributions come with graphical installer, graphical package manager and other tools that are easier to use than their command line alternatives. - -### Arch-based Linux distributions that are easier to set up and use - -![][3] - -Please note that this is not a ranking list. The numbers are just for counting purpose. Distribution at number two should not be considered better than distribution at number seven. - -#### 1\. Manjaro Linux - -![][4] - -[Manjaro][5] doesn’t need any introduction. It is one of the most popular Linux distributions for several years and it deserves it. - -Manjaro provides all the benefits of the Arch Linux combined with a focus on user-friendliness and accessibility. Manjaro is suitable for both newcomers and experienced Linux users alike. - -**For newcomers**, a user-friendly installer is provided, and the system itself is designed to work fully ‘straight out of the box’ with your [favourite desktop environment][6] (DE) or window manager. - -**For more experienced users,** Manjaro also offers versatility to suit every personal taste and preference. [Manjaro Architect][7] is giving the option to install any Manjaro flavour and offers unflavoured DE installation, filesystem ([recently introduced ZFS][8]) and bootloader choice for those who wants complete freedom to shape their system. - -Manjaro is also a rolling release cutting-edge distribution. However, unlike Arch, Manjaro tests the updates first and then provides it to its users. Stability also gets importance here. - -#### 2\. ArcoLinux - -![][9] - -[ArcoLinux][10] (previously known as ArchMerge) is a distribution based on Arch Linux. The development team offers three variations. ArcoLinux, ArcoLinuxD and ArcoLinuxB. - -ArcoLinux ****is a full-featured distribution that ships with the [Xfce desktop][11], [Openbox][12] and [i3 window managers][13]. - -**ArcoLinuxD** is a minimal distribution that includes scripts that enable power users to install any desktop and application. - -**ArcoLinuxB** is a project that gives users the power to build custom distributions, while also developing several community editions with pre-configured desktops, such as Awesome, bspwm, Budgie, Cinnamon, Deepin, GNOME, MATE and KDE Plasma. - -ArcoLinux also provides various video tutorials as it places strong focus on learning and acquiring Linux skills. - -#### Archlabs Linux - -![][14] - -[ArchLabs Linux][15] is a lightweight rolling release Linux distribution based on a minimal Arch Linux base with the [Openbox][16] window manager. [ArchLabs][17] is influenced and inspired by the look and feel of [BunsenLabs][18] with the intermediate to advanced user in mind. - -#### Archman Linux - -![][19] - -[Archman][20] is an independent project. Arch Linux distros in general are not ideal operating systems for users with little Linux experience. Considerable background reading is necessary for things to make sense with minimal frustration. Developers of Archman Linux are trying to change that reputation. - -Archman’s development is based on an understanding of development that includes user feedback and experience components. With the past experience of our team, the feedbacks and requests from the users are blended together and the road maps are determined and the build works are done. - -#### EndeavourOS - -![][21] - -When the popular Arch-based distribution [Antergos was discontinued in 2019][22], it left a friendly and extremely helpful community behind. The Antergos project ended because the system was too hard to maintain for the developers. - -Within a matter of days after the announcement, a few experienced users palnned on maintaining the former community by creating a new distribution to fill the void left by Antergos. That’s how [EndeavourOS][23] was born. - -[EndeavourOS][24] is lightweight and ships with a minimum amount of preinstalled apps. An almost blank canvas ready to personalise. - -#### RebornOS - -![][25] - -[RebornOS][26] developers’ goal is to bring the true power of Linux to everyone, with one ISO for 15 desktop environments and full of unlimited opportunities for customization. - -RebornOS also claims to have support for [Anbox][27] for running Android applications on desktop Linux. It also offers a simple kernel manager GUI tool. - -Coupled with [Pacman][28], the [AUR][29], and a customized version of Cnchi graphical installer, Arch Linux is finally available for even the least inexperienced users. - -#### Chakra Linux - -![][30] - -A community-developed GNU/Linux distribution with an emphasis on KDE and Qt technologies. [Chakra Linux][31] does not schedule releases for specific dates but uses a “Half-Rolling release” system. - -This means that the core packages of Chakra Linux are frozen and only updated to fix any security problems. These packages are updated after the latest versions have been thoroughly tested before being moved to permanent repository (about every six months). - -In addition to the official repositories, users can install packages from the Chakra Community Repository (CCR), which provides user made PKGINFOs and [PKGBUILD][32] scripts for software which is not included in the official repositories and is inspired by the Arch User Repository. - -#### Artix Linux - -![Artix Mate Edition][33] - -[Artix Linux][34] is a rolling-release distribution based on Arch Linux that uses [OpenRC][35], [runit][36] or [s6][37] init instead of [systemd][38]. - -Artix Linux has its own package repositories but as a pacman-based distribution, it can use packages from Arch Linux repositories or any other derivative distribution, even packages explicitly depending on systemd. The [Arch User Repository][29] (AUR) can also be used. - -#### BlackArch Linux - -![][39] - -BlackArch is a [penetration testing distribution][40] based on Arch Linux that provides a large amount of cyber security tools. It is specially created for penetration testers and security researchers. The repository contains more than 2400 [hacking and pen-testing tools][41] that can be installed individually or in groups. BlackArch Linux is compatible with existing Arch Linux packages. - -### Want real Arch Linux? Simplify the installation with graphical Arch installer - -If you want to use the actual Arch Linux but you are not comfortable with the difficult installation, fortunately you can download an Arch Linux iso baked with a graphical installer. - -An Arch installer is basically Arch Linux ISO with a relatively easy to use text-based installer. It is much easier than bare-bone Arch installation. - -#### Anarchy Installer - -![][42] - -The [Anarchy installer][43] intends to provide both novice and experienced Linux users a simple and pain free way to install Arch Linux. Install when you want it, where you want it, and however you want it. That is the Anarchy philosophy. - -Once you boot up the installer, you’ll be shown a simple [TUI menu][44], listing all the available installer options. - -#### Zen Installer - -![][45] - -The [Zen Installer][46] provides a full graphical (point and click) environment for installing Arch Linux. It provides support for installing multiple desktop environments, AUR, and all of the power and flexiblity of Arch Linux with the ease of a graphical installer. - -The ISO will boot the live environment, and then download the most current stable version of the installer after you connect to the internet. So, you will always get the newest installer with updated features. - -### Conclusion - -An Arch-based distribution is always an excellent hassle-free choice for the many users, but a graphical installer like Anarchy is at least a step closer to how Arch Linux truly tastes. - -In my opinion the [real beauty of Arch Linux is its installation process][2] and for a Linux enthusiast is an opportunity to learn rather than a hassle. Arch Linux and its derivatives has a lot for you mess up with, but It’s FOSS will unravel the mystery behind the scenes. See you at my next tutorial! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/arch-based-linux-distros/ - -作者:[Dimitrios Savvopoulos][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者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://www.archlinux.org/ -[2]: https://itsfoss.com/install-arch-linux/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/arch-based-linux-distributions.png?ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/manjaro-20.jpg?ssl=1 -[5]: https://manjaro.org/ -[6]: https://itsfoss.com/best-linux-desktop-environments/ -[7]: https://itsfoss.com/manjaro-architect-review/ -[8]: https://itsfoss.com/manjaro-20-release/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/arcolinux.png?ssl=1 -[10]: https://arcolinux.com/ -[11]: https://www.xfce.org/ -[12]: http://openbox.org/wiki/Main_Page -[13]: https://i3wm.org/ -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archlabs.jpg?ssl=1 -[15]: https://itsfoss.com/archlabs-review/ -[16]: https://en.wikipedia.org/wiki/Openbox -[17]: https://archlabslinux.com/ -[18]: https://www.bunsenlabs.org/ -[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archman.png?ssl=1 -[20]: https://archman.org/en/ -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/04_endeavouros_slide.jpg?ssl=1 -[22]: https://itsfoss.com/antergos-linux-discontinued/ -[23]: https://itsfoss.com/endeavouros/ -[24]: https://endeavouros.com/ -[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/RebornOS.png?ssl=1 -[26]: https://rebornos.org/ -[27]: https://anbox.io/ -[28]: https://itsfoss.com/pacman-command/ -[29]: https://itsfoss.com/aur-arch-linux/ -[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Chakra_Goedel_Screenshot.png?ssl=1 -[31]: https://www.chakralinux.org/ -[32]: https://wiki.archlinux.org/index.php/PKGBUILD -[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Artix_MATE_edition.png?ssl=1 -[34]: https://artixlinux.org/ -[35]: https://en.wikipedia.org/wiki/OpenRC -[36]: https://en.wikipedia.org/wiki/Runit -[37]: https://en.wikipedia.org/wiki/S6_(software) -[38]: https://en.wikipedia.org/wiki/Systemd -[39]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/BlackArch.png?ssl=1 -[40]: https://itsfoss.com/linux-hacking-penetration-testing/ -[41]: https://itsfoss.com/best-kali-linux-tools/ -[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/anarchy.jpg?ssl=1 -[43]: https://anarchyinstaller.org/ -[44]: https://en.wikipedia.org/wiki/Text-based_user_interface -[45]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/zen.jpg?ssl=1 -[46]: https://sourceforge.net/projects/revenge-installer/ diff --git a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md new file mode 100644 index 0000000000..d8d06a1e79 --- /dev/null +++ b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -0,0 +1,201 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) +[#]: via: (https://itsfoss.com/arch-based-linux-distros/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +最好用的几个基于 Arch 的用户友好型 Linux 发行版,它们比 Arch Linux 更容易安装和使用 +====== + +在 Linux 社区中,[Arch Linux][1] 有一群狂热的追随者。这个轻量级的发行版以 DIY 的态度提供了最前沿的更新。 + +但是,Arch 的目标用户是那些更有经验的用户。因此,它通常被认为是那些技术不够(或耐心不够)的人所无法触及的。 + +事实上,第一步,[安装 Arch Linux 就足以把很多人吓跑 ][2]。与大多数其他发行版不同,Arch Linux 没有一个易于使用的图形安装程序。安装过程中涉及到的磁盘分区,连接到互联网,挂载驱动器和创建文件系统等只用命令行工具来操作。 + +对于那些不想经历复杂的安装和设置的人来说,有许多用户友好的基于 Arch 的发行版。 + +在本文中,我将向您展示一些 Arch 替代发行版。这些发行版附带了图形安装程序、图形包管理器和其他工具,它们比命令行工具更容易使用。 + +### 更容易设置和使用的基于 Arch 的 Linux 发行版 + +![][3] + +请注意,这不是一个排名列表。这些数字只是为了计数的目的。排第二的发行版不应该被认为比排第七的发行版好。 + +#### 1\。Manjaro Linux + +![][4] + +[Manjaro][5] 不需要任何介绍。它是几年来最流行的 Linux 发行版之一,它值得拥有。 + +Manjaro 提供了 Arch Linux 的所有优点,同时注重用户友好性和可访问性。Manjaro 既适合新手,也适合有经验的 Linux 用户。 + +**对于新手**,我们提供了一个用户友好的安装程序,系统本身的设计可以完全“开箱即用”地工作在您[最喜爱的桌面环境 ][6](DE) 或窗口管理器中。 + +**对于更有经验的用户,** Manjaro 还提供多种功能,以满足每个个人的口味和喜好。[Manjaro Architect][7] 提供了安装各种 Manjaro 风格的选项,并为那些想要完全自由地塑造系统的人提供了各种桌面环境、文件系统([最近推出的 ZFS][8]) 和引导程序选择。 + +Manjaro 也是一个滚动发行的前沿发行版。然而,与 Arch 不同的是,Manjaro 首先测试更新,然后将其提供给用户。稳定在这里也很重要。 + +#### 2\。ArcoLinux + +![][9] + +[ArcoLinux][10]( 以前称为 ArchMerge) 是一个基于 Arch Linux 的发行版。开发团队提供了三种变体。ArcoLinux、ArcoLinuxD 和 ArcoLinuxB。 + +ArcoLinux 是一个功能齐全的发行版,附带有 [Xfce desktop][11]、[Openbox][12] 和 [i3 window managers][13]。 + +**ArcoLinuxD** 是一个最小的发行版,包含允许高级用户安装任何桌面和应用程序的脚本。 + +**ArcoLinuxB** 是一个让用户能够构建自定义发行版的项目,同时还开发了几个带有预配置桌面的社区版本,如 Awesome、bspwm、Budgie、Cinnamon、Deepin、GNOME、MATE 和 KDE Plasma。 + +ArcoLinux 还提供了各种视频教程,因为它非常注重学习和获取 Linux 技能。 + +#### 3\。Archlabs Linux + +![][14] + +[ArchLabs Linux][15] 是一个轻量级的滚动版 Linux 发行版,基于最基础的 Arch Linux,带有 [Openbox][16] 窗口管理器。[ArchLabs][17] 在观感设计中受到 [BunsenLabs][18] 的影响和启发,主要考虑到中级到高级用户的需求。 + +#### 4\。Archman Linux + +![][19] + +[Archman][20] 是一个独立的项目。Arch Linux 发行版对于没有多少 Linux 经验的用户来说通常不是理想的操作系统。大量的背景阅读是必要的事情,以尽可能减少挫折感的意义。Archman Linux 的开发人员正试图改变这种评价。 + +Archman 的开发基于对开发的理解,包括用户反馈和体验组件。根据我们团队过去的经验,将用户的反馈和要求融合在一起,确定路线图并完成构建工作。 + +#### 5\。EndeavourOS + +![][21] + +当流行的基于 Arch 的发行版 [Antergos 在 2019 停止 ][22] 时,它留下了一个友好且非常有用的社区。Antergos 项目结束了,因为系统对于开发人员来说太难维护了。 + +在发布后的几天内,一些有经验的用户通过创建一个新的发行版来填补 Antergos 留下的空白,从而维护了以前的社区。这就是 [EndeavourOS][23] 的诞生。 + +[EndeavourOS][24] 是轻量级的,并且附带了最少数量的预装应用程序。一块近乎空白的画布,随时可以个性化。 + +#### 6\。RebornOS + +![][25] + +[RebornOS][26] 开发人员的目标是将 Linux 的真正威力带给每个人,一个 ISO 提供了 15 个桌面环境可供选择,并提供无限的定制机会。 + +RebornOS 还声称支持 [Anbox][27],它可以在桌面 Linux 上运行 Android 应用程序。它还提供了一个简单的内核管理器 GUI 工具。 + +再加上 [Pacman][28],[AUR][29],以及定制版本的 Cnchi 图形安装程序,Arch Linux 终于可以让最没有经验的用户也能够使用了。 + +#### 7\。Chakra Linux + +![][30] + +一个社区开发的 GNU/Linux 发行版,它的亮点在 KDE 和 Qt 技术。[Chakra Linux][31] 不在特定日期安排发布,而是使用“半滚动发布”系统。 + +这意味着 Chakra Linux 的核心包被冻结,只更新以修复任何安全问题。这些软件包是在最新版本经过彻底测试后更新的,然后再转移到永久存储库(大约每六个月更新一次)。 + +除官方存储库外,用户还可以安装 Chakra 社区存储库 (CCR) 的软件包,该库为官方存储库中未包含的软件提供用户制作的 PKGINFOs 和 [PKGBUILD][32] 脚本,这是受 Arch 用户存储库的启发而出现的。 + +#### 8\。Artix Linux + +![Artix Mate Edition][33] + +[Artix Linux][34] 也是一个基于 Arch Linux 的滚动发行版,它使用 [OpenRC][35]、[runit][36] 或 [s6][37] 作为初始化工具而不是 [systemd][38]。 + +Artix Linux 有自己的软件包存储库,但作为一个基于 pacman 的发行版,它可以使用 Arch Linux 存储库或任何其他衍生发行版的软件包,甚至可以使用显式依赖于 systemd 的软件包。也可以使用 [Arch User Repository][29](AUR)。 + +#### 10\。BlackArch Linux + +![][39] + +BlackArch 是一个基于 Arch Linux 的[渗透测试发行版 ][40],它提供了大量的网络安全工具。它是专门为渗透测试人员和安全研究人员创建的。该存储库包含 2400 多个[黑客和渗透测试工具 ][41],可以单独安装,也可以分组安装。BlackArch Linux 兼容现有的 Arch Linux 包。 + +### 想要真正的原版 Arch Linux 吗?可以使用图形化 Arch 安装程序简化安装 + +如果您想使用原版的 Arch Linux,但又被它困难的安装所难倒。幸运的是,您可以下载一个带有图形安装程序的 Arch Linux ISO。 + +Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基于文本的安装程序。它比原版的 Arch 安装容易得多。 + +#### Anarchy Installer + +![][42] + +[Anarchy installer][43] 打算为新手和有经验的 Linux 用户提供一种简单而无痛苦的方式来安装 ArchLinux。在需要的时候安装,在需要的地方安装,并且以您想要的方式安装。这就是 Anarchy 的哲学。 + +启动安装程序后,将显示一个简单的 [TUI menu][44],列出所有可用的安装程序选项。 + +#### Zen Installer + +![][45] + +[Zen Installer][46] 为安装 Arch Linux 提供了一个完整的图形(点击式)环境。它支持安装多个桌面环境 、AUR 以及 Arch Linux 的所有功能和灵活性,并且易于图形化安装。 + +ISO 将引导实时环境,然后在您连接到 internet 后下载最新稳定版本的安装程序。因此,您将始终获得最新的安装程序和更新的功能。 + +### 总结 + +对于许多用户来说,基于 Arch 的发行版会是一个很好的无障碍选择,但是像 Anarchy 这样的图形化安装程序至少离原版的 Arch Linux 更近了一步。 + +在我看来,[Arch Linux 的真正魅力在于它的安装过程 ][2] 对于 Linux 爱好者来说,这是一个学习的机会,而不是麻烦。Arch Linux 及其衍生产品有很多东西需要你去折腾,但是在折腾的过程中你就会进入到开源软件的世界,这里是神奇的新世界。下次上课见! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/arch-based-linux-distros/ + +作者:[Dimitrios Savvopoulos][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者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://www.archlinux.org/ +[2]: https://itsfoss.com/install-arch-linux/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/arch-based-linux-distributions.png?ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/manjaro-20.jpg?ssl=1 +[5]: https://manjaro.org/ +[6]: https://itsfoss.com/best-linux-desktop-environments/ +[7]: https://itsfoss.com/manjaro-architect-review/ +[8]: https://itsfoss.com/manjaro-20-release/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/arcolinux.png?ssl=1 +[10]: https://arcolinux.com/ +[11]: https://www.xfce.org/ +[12]: http://openbox.org/wiki/Main_Page +[13]: https://i3wm.org/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archlabs.jpg?ssl=1 +[15]: https://itsfoss.com/archlabs-review/ +[16]: https://en.wikipedia.org/wiki/Openbox +[17]: https://archlabslinux.com/ +[18]: https://www.bunsenlabs.org/ +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/06/Archman.png?ssl=1 +[20]: https://archman.org/en/ +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/04_endeavouros_slide.jpg?ssl=1 +[22]: https://itsfoss.com/antergos-linux-discontinued/ +[23]: https://itsfoss.com/endeavouros/ +[24]: https://endeavouros.com/ +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/RebornOS.png?ssl=1 +[26]: https://rebornos.org/ +[27]: https://anbox.io/ +[28]: https://itsfoss.com/pacman-command/ +[29]: https://itsfoss.com/aur-arch-linux/ +[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/Chakra_Goedel_Screenshot.png?ssl=1 +[31]: https://www.chakralinux.org/ +[32]: https://wiki.archlinux.org/index.php/PKGBUILD +[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/Artix_MATE_edition.png?ssl=1 +[34]: https://artixlinux.org/ +[35]: https://en.wikipedia.org/wiki/OpenRC +[36]: https://en.wikipedia.org/wiki/Runit +[37]: https://en.wikipedia.org/wiki/S6_(software) +[38]: https://en.wikipedia.org/wiki/Systemd +[39]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/06/BlackArch.png?ssl=1 +[40]: https://itsfoss.com/linux-hacking-penetration-testing/ +[41]: https://itsfoss.com/best-kali-linux-tools/ +[42]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/05/anarchy.jpg?ssl=1 +[43]: https://anarchyinstaller.org/ +[44]: https://en.wikipedia.org/wiki/Text-based_user_interface +[45]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/zen.jpg?ssl=1 +[46]: https://sourceforge.net/projects/revenge-installer/ From ddf71cb14e34a53232255e20ab5342117b1b5af2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 23:10:47 +0800 Subject: [PATCH 136/213] PRF @amwps290 --- ...scripts to make image processing faster.md | 139 +++++++----------- 1 file changed, 51 insertions(+), 88 deletions(-) diff --git a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md b/translated/tech/20210126 Write GIMP scripts to make image processing faster.md index 72007740eb..995ad6f5de 100644 --- a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md +++ b/translated/tech/20210126 Write GIMP scripts to make image processing faster.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (amwps290) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Write GIMP scripts to make image processing faster) @@ -9,116 +9,104 @@ 编写 GIMP 脚本使图像处理更快 ====== -通过向一批图像添加效果来学习 GIMP 的脚本语言 Script-Fu。 -![Painting art on a computer screen][1] +> 通过向一批图像添加效果来学习 GIMP 的脚本语言 Script-Fu。 -前一段时间,我想给方程图片加一个黑板式的外观。 我开始使用 [GNU Image Manipulation Program (GIMP)][2] 来处理,并对结果感到满意。 问题是我必须对图像执行几个操作,当我想再次使用此样式,不想对所有图像重复这些步骤。 此外,我确信我会很快忘记他们。 +![](https://img.linux.net.cn/data/attachment/album/202102/06/231011c0xhvxitxjv899qv.jpg) + +前一段时间,我想给方程图片加一个黑板式的外观。我开始是使用 [GIMP][2] 来处理的,我对结果很满意。问题是我必须对图像执行几个操作,当我想再次使用此样式,不想对所有图像重复这些步骤。此外,我确信我会很快忘记这些步骤。 ![Fourier transform equations][3] -傅立叶变换方程式(Cristiano Fontana,[CC BY-SA 4.0] [4]) +*傅立叶变换方程式(Cristiano Fontana,[CC BY-SA 4.0] [4])* -GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年,但从未研究过其批处理功能或 [Script-Fu][5] 菜单。 这是探索它们的绝好机会。 +GIMP 是一个很棒的开源图像编辑器。尽管我已经使用了多年,但从未研究过其批处理功能或 [Script-Fu][5] 菜单。这是探索它们的绝好机会。 ### 什么是 Script-Fu? -[Script-Fu][6] 是 GIMP 内置的脚本语言。 是一种基于 [Scheme ][7]的编程语言。 如果您从未使用过 Scheme,请尝试一下,因为它可能非常有用。 我认为 Script-Fu 是一个很好的入门方法,因为它对图像处理具有立竿见影的效果,因此您可以非常快速地提高工作效率。 您也可以使用 [Python][8] 编写脚本,但是 Script-Fu 是默认选项。 - -为了帮助您熟悉 Scheme,GIMP 的文档提供了深入的[教程][9]。 Scheme 是一种类似于 [Lisp][10] 的语言,因此主要特征是它使用[前缀][11]表示法和[许多括号][12]。 通过为操作数和操作符添加前缀来将它们应用到操作数列表: +[Script-Fu][6] 是 GIMP 内置的脚本语言。是一种基于 [Scheme][7] 的编程语言。如果你从未使用过 Scheme,请尝试一下,因为它可能非常有用。我认为 Script-Fu 是一个很好的入门方法,因为它对图像处理具有立竿见影的效果,所以你可以很快感觉到自己的工作效率的提高。你也可以使用 [Python][8] 编写脚本,但是 Script-Fu 是默认选项。 +为了帮助你熟悉 Scheme,GIMP 的文档提供了深入的 [教程][9]。Scheme 是一种类似于 [Lisp][10] 的语言,因此它的主要特征是使用 [前缀][11] 表示法和 [许多括号][12]。函数和运算符通过前缀应用到操作数列表中: ``` -(function-name operand operand ...) +(函数名 操作数 操作数 ...) (+ 2 3) -↳ Returns 5 +↳ 返回 5 (list 1 2 3 5) -↳ Returns a list containing 1, 2, 3, and 5 +↳ 返回一个列表,包含 1、 2、 3 和 5 ``` -我花了一些时间才能找到 GIMP 功能完整列表的文档,但实际上很简单。 在 **Help** 菜单中,有一个 **Procedure Browser**,其中包含有关所有可能功能的非常详尽的文档。 +我花了一些时间才找到完整的 GIMP 函数列表文档,但实际上很简单。在 **Help** 菜单中,有一个 **Procedure Browser**,其中包含所有可用的函数的丰富详尽文档。 ![GIMP Procedure Browser][13] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - ### 使用 GIMP 的批处理模式 -您可以使用 `-b` 选项以批处理的方式启动 GIMP. `-b` 选项的参数可以是你想要运行的脚本,或者用一个 `-` 来让 GIMP 进入交互模式而不是命令行模式。正常情况下,当你启动 GIMP 的时候,它会启动图形界面,但是你可以使用 `-i` 选项来禁用它。 +你可以使用 `-b` 选项以批处理的方式启动 GIMP。`-b` 选项的参数可以是你想要运行的脚本,或者用一个 `-` 来让 GIMP 进入交互模式而不是命令行模式。正常情况下,当你启动 GIMP 的时候,它会启动图形界面,但是你可以使用 `-i` 选项来禁用它。 ### 开始编写你的第一个脚本 -创建一个名为 `chalk.scm` 的文件,并把它保存在 **Preferences** 窗口中 **Folders** 选项下的 **Script** 中指定的 `script` 文件夹下。就我而言,是在 `$HOME/.config/GIMP/2.10/scripts`. +创建一个名为 `chalk.scm` 的文件,并把它保存在 **Preferences** 窗口中 **Folders** 选项下的 **Script** 中指定的 `script` 文件夹下。就我而言,是在 `$HOME/.config/GIMP/2.10/scripts`。 在 `chalk.scm` 文件中,写入下面的内容: - ``` (define (chalk filename grow-pixels spread-amount percentage) -   (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) -          (drawable (car (gimp-image-get-active-layer image))) -          (new-filename (string-append "modified_" filename))) -     (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) -     (gimp-selection-grow image grow-pixels) -     (gimp-context-set- '(0 0 0)) -     (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) -     (gimp-selection-none image) -     (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) -     (gimp-drawable-invert drawable TRUE) -     (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) -     (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) -     (gimp-image-delete image))) + (let* ((image (car (gimp-file-load RUN-NONINTERACTIVE filename filename))) + (drawable (car (gimp-image-get-active-layer image))) + (new-filename (string-append "modified_" filename))) + (gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) + (gimp-selection-grow image grow-pixels) + (gimp-context-set-foreground '(0 0 0)) + (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) + (gimp-selection-none image) + (plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) + (gimp-drawable-invert drawable TRUE) + (plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) + (gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) + (gimp-image-delete image))) ``` ### 定义脚本变量 -在脚本中, `(define (chalk filename grow-pixels spread-amound percentage) ...)` 函数定义了一个名叫 `chalk` 的新函数。它的函数参数是 `filename`, `grow-pixels`, `spread-amound` 和 `percentage`. 在 `define` 中的所有内容都是 `chalk` 函数的主体。你可能已经注意到,那些名字比较长的变量中间都有一个破折号来分割。这是类 Lisp 语言的惯用风格。 +在脚本中, `(define (chalk filename grow-pixels spread-amound percentage) ...)` 函数定义了一个名叫 `chalk` 的新函数。它的函数参数是 `filename`、`grow-pixels`、`spread-amound` 和 `percentage`。在 `define` 中的所有内容都是 `chalk` 函数的主体。你可能已经注意到,那些名字比较长的变量中间都有一个破折号来分割。这是类 Lisp 语言的惯用风格。 -`(let* ...)` 函数是一个特殊的函数可以让你定义一些只有在这个函数体中才有效的临时变量。临时变量有 `image`, `drawable`, 以及 `new-filename`. 它使用 `gimp-file-load` 来载入图片,这会返回它所包含的图片的一个列表。并通过 `car` 函数来选取第一项。 然后,它选择第一个活动层并将其引用存储在 `drawable` 变量中。 最后,它定义了包含图像新文件名的字符串。 - -为了帮助您更好地了解该过程,我将对其进行分解。 首先,启动带 GUI 的 GIMP,然后你可以通过依次点击 **Filters → Script-Fu → Console** 来打开 Script-Fu 控制台。 在这种情况下,不能使用 `let *`,因为变量必须是持久的。 使用 `define` 函数定义 `image` 变量,并为其提供查找图像的正确路径: +`(let* ...)` 函数是一个特殊过程procedure,可以让你定义一些只有在这个函数体中才有效的临时变量。临时变量有 `image`、`drawable` 以及 `new-filename`。它使用 `gimp-file-load` 来载入图片,这会返回它所包含的图片的一个列表。并通过 `car` 函数来选取第一项。然后,它选择第一个活动层并将其引用存储在 `drawable` 变量中。最后,它定义了包含图像新文件名的字符串。 +为了帮助你更好地了解该过程,我将对其进行分解。首先,启动带 GUI 的 GIMP,然后你可以通过依次点击 **Filters → Script-Fu → Console** 来打开 Script-Fu 控制台。 在这种情况下,不能使用 `let *`,因为变量必须是持久的。使用 `define` 函数定义 `image` 变量,并为其提供查找图像的正确路径: ``` -`(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png")))` +(define image (car (gimp-file-load RUN-NONINTERACTIVE "Fourier.png" "Fourier.png"))) ``` -似乎在 GUI 中什么也没有发生,但是图像已加载。 您需要通过以下方式来让图像显示: - +似乎在 GUI 中什么也没有发生,但是图像已加载。 你需要通过以下方式来让图像显示: ``` -`(gimp-display-new image)` +(gimp-display-new image) ``` ![GUI with the displayed image][14] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 现在,获取活动层并将其存储在 `drawable` 变量中: - ``` -`(define drawable (car (gimp-image-get-active-layer image)))` +(define drawable (car (gimp-image-get-active-layer image))) ``` 最后,定义图像的新文件名: - ``` -`(define new-filename "modified_Fourier.png")` +(define new-filename "modified_Fourier.png") ``` -运行命令后,您将在 Script-Fu 控制台中看到以下内容: +运行命令后,你将在 Script-Fu 控制台中看到以下内容: ![Script-Fu console][15] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 在对图像执行操作之前,需要定义将在脚本中作为函数参数的变量: - ``` (define grow-pixels 2) (define spread-amount 4) @@ -127,31 +115,24 @@ GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年 ### 处理图片 -现在,所有相关变量都已定义,您可以对图像进行操作了。 脚本的操作可以直接在控制台上执行。第一步是在活动层上选择黑色。 颜色被写成一个由三个数字组成的列表,即 `(list 0 0 0)` 或者是 `'(0 0 0)`: - +现在,所有相关变量都已定义,你可以对图像进行操作了。 脚本的操作可以直接在控制台上执行。第一步是在活动层上选择黑色。颜色被写成一个由三个数字组成的列表,即 `(list 0 0 0)` 或者是 `'(0 0 0)`: ``` -`(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0))` +(gimp-image-select-color image CHANNEL-OP-REPLACE drawable '(0 0 0)) ``` ![Image with the selected color][16] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 扩大选取两个像素: - ``` -`(gimp-selection-grow image grow-pixels)` +(gimp-selection-grow image grow-pixels) ``` ![Image with the selected color][17] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 将前景色设置为黑色,并用它填充选区: - ``` (gimp-context-set-foreground '(0 0 0)) (gimp-edit-bucket-fill drawable BUCKET-FILL-FG LAYER-MODE-NORMAL 100 255 TRUE 0 0) @@ -159,79 +140,61 @@ GIMP 是一个很棒的开源图像编辑器。 尽管我已经使用了多年 ![Image with the selection filled with black][18] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 删除选区: - ``` -`(gimp-selection-none image)` +(gimp-selection-none image) ``` ![Image with no selection][19] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 随机移动像素: - ``` -`(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount)` +(plug-in-spread RUN-NONINTERACTIVE image drawable spread-amount spread-amount) ``` ![Image with pixels moved around][20] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 反转图像颜色: - ``` -`(gimp-drawable-invert drawable TRUE)` +(gimp-drawable-invert drawable TRUE) ``` ![Image with pixels moved around][21] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 随机化像素: - ``` -`(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0)` +(plug-in-randomize-hurl RUN-NONINTERACTIVE image drawable percentage 1 TRUE 0) ``` ![Image with pixels moved around][22] -(Cristiano Fontana, [CC BY-SA 4.0][4]) - 将图像保存到新文件: - ``` -`(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename)` +(gimp-file-save RUN-NONINTERACTIVE image drawable new-filename new-filename) ``` ![Equations of the Fourier transform and its inverse][23] -傅立叶变换方程 (Cristiano Fontana, [CC BY-SA 4.0][4]) +*傅立叶变换方程 (Cristiano Fontana, [CC BY-SA 4.0][4])* ### 以批处理模式运行脚本 -现在您知道了脚本的功能,可以在批处理模式下运行它: - +现在你知道了脚本的功能,可以在批处理模式下运行它: ``` -`gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)'` +gimp -i -b '(chalk "Fourier.png" 2 4 3)' -b '(gimp-quit 0)' ``` -在运行 `chalk` 函数之后,它将使用 `-b` 选项调用第二个函数 `gimp-quit` 来告诉 GIMP 退出。 +在运行 `chalk` 函数之后,它将使用 `-b` 选项调用第二个函数 `gimp-quit` 来告诉 GIMP 退出。 ### 了解更多 -本教程向您展示了如何开始使用 GIMP 的内置脚本功能,并介绍了 GIMP 的 Scheme 实现的 Script-Fu。 如果您想继续前进,建议您查看官方文档及其[入门教程][9]。 如果您不熟悉 Scheme 或 Lisp,那么一开始的语法可能有点吓人,但我还是建议您尝试一下。 这可能是一个不错的惊喜。 - -Photoshop 之类的专业设计软件非常棒,但价格也很昂贵。 你会怎么做... +本教程向你展示了如何开始使用 GIMP 的内置脚本功能,并介绍了 GIMP 的 Scheme 实现:Script-Fu。如果你想继续前进,建议你查看官方文档及其[入门教程][9]。如果你不熟悉 Scheme 或 Lisp,那么一开始的语法可能有点吓人,但我还是建议你尝试一下。这可能是一个不错的惊喜。 -------------------------------------------------------------------------------- @@ -240,7 +203,7 @@ via: https://opensource.com/article/21/1/gimp-scripting 作者:[Cristiano L. Fontana][a] 选题:[lujun9972][b] 译者:[amwps290](https://github.com/amwps290) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ba6c90b36961736f6c65855ef24fac8fce5d9eb7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 23:11:43 +0800 Subject: [PATCH 137/213] PUB @amwps290 https://linux.cn/article-13093-1.html --- ...0126 Write GIMP scripts to make image processing faster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210126 Write GIMP scripts to make image processing faster.md (99%) diff --git a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md b/published/20210126 Write GIMP scripts to make image processing faster.md similarity index 99% rename from translated/tech/20210126 Write GIMP scripts to make image processing faster.md rename to published/20210126 Write GIMP scripts to make image processing faster.md index 995ad6f5de..4caa8357ff 100644 --- a/translated/tech/20210126 Write GIMP scripts to make image processing faster.md +++ b/published/20210126 Write GIMP scripts to make image processing faster.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (amwps290) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13093-1.html) [#]: subject: (Write GIMP scripts to make image processing faster) [#]: via: (https://opensource.com/article/21/1/gimp-scripting) [#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) From f0d7796c6f6d22b4104a68d55574ecb0e19c338f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 6 Feb 2021 23:59:06 +0800 Subject: [PATCH 138/213] PRF&PUB @geekpi https://linux.cn/article-13094-1.html --- ...ips for preventing notification fatigue.md | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) rename {translated/tech => published}/20210128 4 tips for preventing notification fatigue.md (69%) diff --git a/translated/tech/20210128 4 tips for preventing notification fatigue.md b/published/20210128 4 tips for preventing notification fatigue.md similarity index 69% rename from translated/tech/20210128 4 tips for preventing notification fatigue.md rename to published/20210128 4 tips for preventing notification fatigue.md index e63eeda8d2..843364bb91 100644 --- a/translated/tech/20210128 4 tips for preventing notification fatigue.md +++ b/published/20210128 4 tips for preventing notification fatigue.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13094-1.html) [#]: subject: (4 tips for preventing notification fatigue) [#]: via: (https://opensource.com/article/21/1/alert-fatigue) [#]: author: (Kevin Sonney https://opensource.com/users/ksonney) 防止通知疲劳的 4 个技巧 ====== -不要让提醒淹没自己:设置重要的提醒,让其他提醒消失。 你会感觉更好,工作效率更高。 -![Working on a team, busy worklife][1] + +> 不要让提醒淹没自己:设置重要的提醒,让其它提醒消失。你会感觉更好,工作效率更高。 + +![W】(https://img.linux.net.cn/data/attachment/album/202102/06/234924mo3okotjlv7lo3yo.jpg) 在前几年,这个年度系列涵盖了单个的应用。今年,我们除了关注 2021 年的策略外,还将关注一体化解决方案。欢迎来到 2021 年 21 天生产力的第十八天。 @@ -18,9 +20,9 @@ ![Text box offering to send notifications][2] -NOPE(Kevin Sonney, [CC BY-SA 4.0][3]) +*NOPE(Kevin Sonney, [CC BY-SA 4.0][3])* -如此多的应用、网站和服务想要提醒我们每一件小事,以至于我们很容易就把它们全部调出来。而且,如果我们不这样做,我们将开始遭受**提醒疲劳**的困扰,这时我们处于边缘的状态,只是等待下一个提醒,并生活在恐惧之中。 +如此多的应用、网站和服务想要提醒我们每一件小事,我们很容易就把它们全部调出来。而且,如果我们不这样做,我们将开始遭受**提醒疲劳**的困扰 —— 这时我们处于边缘的状态,只是等待下一个提醒,并生活在恐惧之中。 提醒疲劳在那些因工作而被随叫随到的人中非常常见。它也发生在那些 **FOMO** (错失恐惧症)的人身上,从而对每一个关键词、标签或在社交媒体上提到他们感兴趣的事情都会设置提醒。 @@ -28,31 +30,28 @@ NOPE(Kevin Sonney, [CC BY-SA 4.0][3]) ![Alert for a task][4] -我可以忽略这个,对吧?(Kevin Sonney, [CC BY-SA 4.0][3]) +*我可以忽略这个,对吧?(Kevin Sonney, [CC BY-SA 4.0][3])* 1. 弄清楚什么更适合你:视觉提醒或声音提醒。我使用视觉弹出和声音的组合,但这对我是有效的。有些人需要触觉提醒。比如手机或手表的震动。找到适合你的那一种。 - 2. 为重要的提醒指定独特的音调或视觉效果。我有一个朋友,他的工作页面有最响亮、最讨厌的铃声。这个_设计_是为了吸引他的注意力,让他看到提醒。我的显示器上有一盏灯,当我在待命时收到工作提醒时,它就会闪烁红灯,以及发送通知到我手机上。 - 3. 关掉那些其实不重要的警报。社交网络、网站和应用都希望得到你的关注。他们不会在意你是否错过会议、约会迟到,或者熬夜到凌晨4点厄运滚动。关掉那些不重要的,让那些重要的可以被看到。 + 2. 为重要的提醒指定独特的音调或视觉效果。我有一个朋友,他的工作页面的铃声最响亮、最讨厌。这旨在吸引他的注意力,让他看到提醒。我的显示器上有一盏灯,当我在待命时收到工作提醒时,它就会闪烁红灯,以及发送通知到我手机上。 + 3. 关掉那些实际上无关紧要的警报。社交网络、网站和应用都希望得到你的关注。它们不会在意你是否错过会议、约会迟到,或者熬夜到凌晨 4 点。关掉那些不重要的,让那些重要的可以被看到。 4. 每隔一段时间就改变一下。上个月有效的东西,下个月可能就不行了。我们会适应、习惯一些东西,然后我们会忽略。如果有些东西不奏效,就换个东西试试吧!它不会伤害你,即使无法解决问题,也许你也会学到一些新知识。 - ![Blue alert indicators light][5] -蓝色是没问题。红色是有问题。(Kevin Sonney, [CC BY-SA 4.0][3]) +*蓝色是没问题。红色是有问题。(Kevin Sonney, [CC BY-SA 4.0][3])* ### 开源和选择 -一个好的应用为通知提供了很多选择。我最喜欢的一个是 Android 的 Etar 日历应用。[Etar 可以从开源 F-droid 仓库中获得][6]。 +一个好的应用可以通知提供很多选择。我最喜欢的一个是 Android 的 Etar 日历应用。[Etar 可以从开源 F-droid 仓库中获得][6]。 -Etar 和许多开源应用一样,为你提供了所有的选项,尤其是通知设置。 +Etar 和许多开源应用一样,为你提供了很多选项,尤其是通知设置。 ![Etar][7] -(Seth Kenlon, [CC BY-SA 4.0][3]) - 通过 Etar,你可以激活或停用弹出式通知,设置打盹时间、打盹延迟、是否提醒你已拒绝的事件等。结合有计划的日程安排策略,你可以通过控制数字助手对你需要做的事情进行提示的频率来改变你一天的进程。 -提醒和警报真的很有用,只要我们收到重要的提醒并予以注意即可。这可能需要一些实验,但最终,少一些噪音是好事,而且更容易注意到真正需要我们注意的提醒。 +提醒和警报真的很有用,只要我们收到重要的提醒并予以注意即可。这可能需要做一些实验,但最终,少一些噪音是好事,而且更容易注意到真正需要我们注意的提醒。 -------------------------------------------------------------------------------- @@ -61,7 +60,7 @@ via: https://opensource.com/article/21/1/alert-fatigue 作者:[Kevin Sonney][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 576e508aff7d452bcc82955b989a27d5a12d6e63 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 7 Feb 2021 09:38:03 +0800 Subject: [PATCH 139/213] translated --- ...rce, Raw Image Editor for Linux Desktop.md | 83 ------------------- ...rce, Raw Image Editor for Linux Desktop.md | 83 +++++++++++++++++++ 2 files changed, 83 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md create mode 100644 translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md diff --git a/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md deleted file mode 100644 index 808b68e214..0000000000 --- a/sources/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) -[#]: via: (https://itsfoss.com/filmulator/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop -====== - -_**Brief: Filmulator is an open source raw photo editing application with library management focusing on simplicity, ease of use and streamlined workflow.**_ - -### Filmulator: Raw Image Editor for Linux (and Windows) - -There are a [bunch of raw photo editors for Linux][1]. [Filmulator][2] is one of them. Filmulator aims to make raw image editing simple by giving only the essential elements. It also adds the feature of library handling which is a plus if you are looking for a decent application for your camera images. - -For those unaware, [raw image file][3] is a minimally processed, uncompressed file. In other words, it is untouched digital file with no compression and minimal processing applied to it. Professional photographers prefer to capture photos in raw file and process it themselves. Normal people take photos from their smartphones and it is usually compressed in JPEG format or filtered. - -Let’s see what features you get in the Filmulator editor. - -### Features of Filmulator - -![Filmulator interface][4] - -Filmulator claims that it is not the typical “film effect filter” that merely copies the outward characteristics of film. Instead, Filmulator gets to the root of what makes film so appealing: the development process. - -It simulates film development process: from “exposure” of film, to the growth of “silver crystals” within each pixel, to the diffusion of “developer” both between neighboring pixels and with the bulk developer in the tank. - -Fimulator developer says that the simulation brings about the following benefits: - - * Large bright regions become darker, compressing the output dynamic range. - * Small bright regions make their surroundings darker, enhancing local contrast. - * In bright regions, saturation is enhanced, helping retain color in blue skies, brighter skin tones, and sunsets. - * In extremely saturated regions, the brightness is attenuated, helping retain detail e.g. in flowers. - - - -Here’s a comparison of a raw image processed by Filmulator to enhance colors in a natural manner without inducing color clipping. - -![][5] - -### Installing Filmulator on Ubuntu/Linux - -There is an AppImage available for Filmulator so that you can use it easily on Linux. [Using AppImage files][6] is really simple. You download it, make it executable and make it run by double-clicking on it. - -[Download Filmulator for Linux][7] - -There is also a Windows version available for Windows users. Apart from that, you can always head over to [its GitHub repository][8] and peek into its source code. - -There is a [little documentation][9] to help you get started with Fimulator. - -### Conclusion - -Fimulator’s design ideology is to have the best tool for any job, and only that one tool. This means compromising flexibility, but gaining a greatly simplified and streamlined user interface. - -I am not even an amateur photographer, let alone be a professional one. I do not own a DSLR or other high-end photography equipments. For this reason, I cannot test and share my experience on the usefulness of Filmulator. - -If you have more experience dealing with raw images, I let you try Filmulator and share your opinion on it. There is an AppImage available so you can quickly test it and see if it fits your needs or not. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/filmulator/ - -作者:[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/raw-image-tools-linux/ -[2]: https://filmulator.org/ -[3]: https://www.findingtheuniverse.com/what-is-raw-in-photography/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/Filmulate.jpg?resize=799%2C463&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/image-without-filmulator.jpeg?ssl=1 -[6]: https://itsfoss.com/use-appimage-linux/ -[7]: https://filmulator.org/download/ -[8]: https://github.com/CarVac/filmulator-gui -[9]: https://github.com/CarVac/filmulator-gui/wiki diff --git a/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md b/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md new file mode 100644 index 0000000000..6eb5f0f6e4 --- /dev/null +++ b/translated/tech/20210202 Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Filmulator is a Simple, Open Source, Raw Image Editor for Linux Desktop) +[#]: via: (https://itsfoss.com/filmulator/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +Filmulator 是一个简单的、开源的用于 Linux 桌面的 Raw 图像编辑器 +====== + +_**简介:Filmulator 是一个开源的具有库管理功能的 Raw 照片编辑应用,侧重于简单、易用和简化的工作流程。**_ + +### Filmulator:适用于 Linux(和 Windows)的 Raw 图像编辑器 + +[Linux 中有一堆 raw 照片编辑器][1]。[Filmulator][2] 就是其中之一。Filmulator 的目标是仅提供基本要素,从而使原始图像编辑变得简单。它还增加了库处理的功能,如果你正在为你的相机图像寻找一个不错的应用,这是一个加分项。 + +对于那些不知道 raw 的人来说,[raw 图像文件][3]是一个最小化处理,未压缩的文件。换句话说,它是未经压缩的数字文件,且有最小化的处理。专业摄影师更喜欢用 raw 文件拍摄照片,并自行处理。普通人从智能手机拍摄照片,它通常被压缩为 JPEG 格式或被过滤。 + +让我们来看看在 Filmulator 编辑器中会有什么功能。 + +### Filmulator 的功能 + +![Filmulator interface][4] + +Filmulator 宣称,它不是典型的“胶片效果滤镜”,这只是复制了胶片的外在特征。相反,Filmulator 从根本上解决了胶片的魅力所在:显影过程。 + +它模拟了胶片的显影过程:从胶片的“曝光”,到每个像素内“银晶”的生长,再到“显影剂”在相邻像素之间与储槽中大量显影剂的扩散。 + +Fimulator 开发者表示,这种模拟带来了以下好处: + + * 大的明亮区域变得更暗,压缩了输出动态范围。 + * 小的明亮区域使周围环境变暗,增强局部对比度。 + * 在明亮区域,饱和度得到增强,有助于保留蓝天、明亮肤色和日落的色彩。 + * 在极度饱和的区域,亮度会被减弱,有助于保留细节,例如花朵。 + + + +以下是经 Filmulator 处理后的 raw 图像的对比,以自然的方式增强色彩,而不会引起色彩剪切。 + +![][5] + +### 在 Ubuntu/Linux 上安装 Filmulator + +Filmulator 有一个 AppImage 可用,这样你就可以在 Linux 上轻松使用它。使用 [AppImage 文件][6]真的很简单。下载后,使它可执行,然后双击运行。 + +[Download Filmulator for Linux][7] + +对 Windows 用户也有一个 Windows 版本。除此之外,你还可以随时前往[它的 GitHub 仓库][8]查看它的源代码。 + +有一份[小文档][9]来帮助你开始使用 Fimulator。 + +### 总结 + +Fimulator 的设计理念是为任何工作提供最好的工具,而且只有这一个工具。这意味着牺牲了灵活性,但获得了一个大大简化和精简的用户界面。 + +我甚至不是一个业余的摄影师,更别说是一个专业的摄影师了。我没有单反或其他高端摄影设备。因此,我无法测试和分享我对 Filmulator 的实用性的经验。 + +如果你有更多处理 raw 图像的经验,请尝试下 Filmulator,并分享你的意见。有一个 AppImage 可以让你快速测试它,看看它是否适合你的需求。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/filmulator/ + +作者:[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/raw-image-tools-linux/ +[2]: https://filmulator.org/ +[3]: https://www.findingtheuniverse.com/what-is-raw-in-photography/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/Filmulate.jpg?resize=799%2C463&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/image-without-filmulator.jpeg?ssl=1 +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://filmulator.org/download/ +[8]: https://github.com/CarVac/filmulator-gui +[9]: https://github.com/CarVac/filmulator-gui/wiki \ No newline at end of file From d3978ac4fdbb5582f0a2893d8dfeda3f8a4de2e1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 7 Feb 2021 09:47:31 +0800 Subject: [PATCH 140/213] translating --- ...210127 Why I use the D programming language for scripting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md index ab63de404e..b3728050fa 100644 --- a/sources/tech/20210127 Why I use the D programming language for scripting.md +++ b/sources/tech/20210127 Why I use the D programming language for scripting.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 59c857953a1a44a4b0f80f1bd62914907e2a4768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sun, 7 Feb 2021 10:38:43 +0800 Subject: [PATCH 141/213] translating by Chao-zhi --- ...s to Fill the Void Left by Antergos in Arch Linux World.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md index b993c4d1dc..24482ad026 100644 --- a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ b/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -76,7 +76,7 @@ via: https://itsfoss.com/endeavouros/ 作者:[John Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 937133405b955f7ca20a22c6d9eaff016d5eae11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Sun, 7 Feb 2021 11:44:17 +0800 Subject: [PATCH 142/213] translate done: 20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md --- ...id Left by Antergos in Arch Linux World.md | 106 ------------------ ...id Left by Antergos in Arch Linux World.md | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md create mode 100644 translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md diff --git a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md deleted file mode 100644 index 24482ad026..0000000000 --- a/sources/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ /dev/null @@ -1,106 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) -[#]: via: (https://itsfoss.com/endeavouros/) -[#]: author: (John Paul https://itsfoss.com/author/john/) - -EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World -====== - -![][1] - -I’m sure that most of our readers are aware of the [end of the Antergos project][2]. In the wake of the announcement, the members of the Antergos community created several successors. Today, we will be looking at one of the ‘spiritual successors’ of Antergos: [EndeavourOS][3]. - -### EndeavourOS is not a fork of Antergos - -Before we start, I would like to make it very clear that EndeavourOS is not a fork of Antergos. The developers used Antergos as their inspiration to create a light Arch-based distro. - -![Endeavouros First Boot][4] - -According to the [project’s site][5], EndeavourOS came into existence because people in the Antergos community wanted to keep the spirit of Antergos alive. Their goal was simply to “have Arch installed with an easy to use installer and a friendly, helpful community to fall back on during the journey to master the system”. - -Unlike many Arch-based distros, EndeavourOS is intending to work [like vanilla Arch][5], “so no one-click solutions to install your favorite app or a bunch of preinstalled apps you’ll eventually don’t need”. For most people, especially those new to Linux and Arch, there will be a learning curve, but EndeavourOS aims to have a large friendly community where people are encouraged to ask questions and learn about their systems. - -![Endeavouros Installing][6] - -### A Work in Progress - -EndeavourOS was [first released on July 15th][7] of this year after the project was first announced on [May 23rd][8]. Unfortunately, this means that the developers were unable to incorporate all of the features that they have planned. - -For example, they want to have an online install similar to the one used by Antergos but ran into [issues with the current options][9]. “Cnchi has caused serious problems to be working outside the Antergos eco system and it needs a complete rewrite to work. The Fenix installer by RebornOS is getting more into shape, but needs more time to properly function.” For now, EndeavourOS will ship with the [Calamares installer][10]. - -[][11] - -Suggested read  Velt/OS: A Material Design-Themed Desktop Environment - -EndeavourOS will also offer [less stuff than Antergos][9]: It’s repo is smaller than Antergos though they ship with some AUR packages. Their goal is to deliver a system that’s close to Arch an not vanilla Arch. - -![Endeavouros Updating With Kalu][12] - -The developers [stated further][13]: - -> “Linux and specifically Arch are all about freedom of choice, we provide a basic install that lets you explore those choices with a small layer of convenience. We will never judge you by installing GUI apps like Pamac or even work with sandbox solutions like Flatpak or Snaps. It’s up to you what you are installing to make EndeavourOS work in your circumstances, that’s the main difference we have with Antergos or Manjaro, but like Antergos we will try to help you if you run into a problem with one of your installed packages.” - -### Experiencing EndeavourOS - -I installed EndeavourOS in [VirtualBox][14] and took a look around. When I first booted from the image, I was greeted by a little box with links to the EndeavourOS site about installing. It also has a button to install and one to manually partition the drive. The Calamares installer worked very smoothly for me. - -After I rebooted into a fresh install of EndeavourOS, I was greeted by a colorful themed XFCE desktop. I was also treated to a bunch of notification balloons. Most Arch-based distros I’ve used come with a GUI tool like [pamac][15] or [octopi][16] to keep the system up-to-date. EndeavourOS comes with [kalu][17]. (kalu stands for “Keeping Arch Linux Up-to-date”.) It checks for updated packages, Arch Linux News, updated AUR packages and more. Once it sees an update for any of those areas, it will create a notification balloon. - -I took a look through the menu to see what was installed by default. The answer is not much, not even an office suite. If they intend for EndeavourOS to be a blank canvas for anyone to create the system they want. they are headed in the right direction. - -![Endeavouros Desktop][18] - -### Final Thoughts - -EndeavourOS is still very young. The first stable release was issued only 3 weeks ago. It is missing some stuff, most importantly an online installer. That being said, it is possible to gauge where EndeavourOS will be heading. - -[][19] - -Suggested read  An Overview of Intel's Clear Linux, its Features and Installation Procedure - -While it is not an exact clone of Antergos, EndeavourOS wants to replicate the most important part of Antergos the welcoming, friendly community. All to often, the Linux community can seem to be unwelcoming and downright hostile to the beginner. I’ve seen more and more people trying to combat that negativity and bring more people into Linux. With the EndeavourOS team making that their main focus, a great distro can be the only result. - -If you are currently using Antergos, there is a way for you to [switch to EndeavourOS without performing a clean install.][20] - -If you want an exact clone of Antergos, I would recommend checking out [RebornOS][21]. They are currently working on a replacement of the Cnchi installer named Fenix. - -Have you tried EndeavourOS already? How’s your experience with it? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/endeavouros/ - -作者:[John Paul][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/john/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-logo.png?ssl=1 -[2]: https://itsfoss.com/antergos-linux-discontinued/ -[3]: https://endeavouros.com/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-first-boot.png?resize=800%2C600&ssl=1 -[5]: https://endeavouros.com/info-2/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-installing.png?resize=800%2C600&ssl=1 -[7]: https://endeavouros.com/endeavouros-first-stable-release-has-arrived/ -[8]: https://forum.antergos.com/topic/11780/endeavour-antergos-community-s-next-stage -[9]: https://endeavouros.com/what-to-expect-on-the-first-release/ -[10]: https://calamares.io/ -[11]: https://itsfoss.com/veltos-linux/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-updating-with-kalu.png?resize=800%2C600&ssl=1 -[13]: https://endeavouros.com/second-week-after-the-stable-release/ -[14]: https://itsfoss.com/install-virtualbox-ubuntu/ -[15]: https://aur.archlinux.org/packages/pamac-aur/ -[16]: https://octopiproject.wordpress.com/ -[17]: https://github.com/jjk-jacky/kalu -[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-desktop.png?resize=800%2C600&ssl=1 -[19]: https://itsfoss.com/clear-linux/ -[20]: https://forum.endeavouros.com/t/how-to-switch-from-antergos-to-endevouros/105/2 -[21]: https://rebornos.org/ diff --git a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md new file mode 100644 index 0000000000..b7966b40cf --- /dev/null +++ b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) +[#]: via: (https://itsfoss.com/endeavouros/) +[#]: author: (John Paul https://itsfoss.com/author/john/) + +EndeavourOS 的目标是填补 Antergos 在 ArchLinux 世界留下的空白 +====== + +![][1] + +我相信我们的大多数读者都知道 [Antergos 项目的终结 ][2]。在这一消息宣布之后,Antergos 社区的成员创建了几个发行版来继承 Antergos。今天,我们将着眼于 Antergos 的“精神继承人”之一:[EndeavourOS][3]。 + +### EndeavourOS 不是 Antergos 的分支 + +在我们开始之前,我想非常明确地指出,EndeavourOS 并不是一个 Antergos 的分支版本。开发者们以 Antergos 为灵感,创建了一个基于 Arch 的轻量级发行版。 + +![Endeavouros First Boot][4] + +根据[这个项目网站 ][5] 的说法,EndeavourOS 的诞生是因为 Antergos 社区的人们想要保持 Antergos 的精神。他们的目标很简单:“让 Arch 拥有一个易于使用的安装程序和一个友好、有帮助的社区,在掌握系统的过程中能够有一个社区可以依靠。” + +与许多基于 Arch 的发行版不同,EndeavourOS 打算像 [原生 Arch][5] 那样使用,“所以没有一键式安装你喜欢的应用程序或一堆你最终不需要的预装应用程序的解决方案。”对于大多数人来说,尤其是那些刚接触 Linux 和 Arch 的人,会有一个学习曲线,但 EndeavourOS 的目标是建立一个大型友好的社区,鼓励人们提出问题并了解他们的系统。 + +![Endeavouros Installing][6] + +### 正在进行的工作 + +EndeavourOS 在 [2019 年 5 月 23 日首次宣布陈立 ][8] 随后[在 7 月 15 日发布第一个版本 ][7]。不幸的是,这意味着开发人员无法将他们计划的所有功能全部整合进来。 + +例如,他们想要一个类似于 Antergos 的在线安装,但却遇到了[当前选项的问题 ][9]。“Cnchi 运行在 Antergos 生态系统之外会造成严重的问题,需要彻底重写才能发挥作用。RebornOS 的 Fenix 安装程序还没有完全成型,需要更多时间才能正常运行。”于是现在,EndeavourOS 将会和 [Calamares 安装程序 ][10] 一起发布。 + +[][11] + +推荐阅读 Velt/OS:Material Design 主题的桌面环境 + +EndeavourOS 会提供[比 Antergos 少的东西 ][9]:它的 repo 比 Antergos 小,尽管他们会附带一些 AUR 包。他们的目标是提供一个接近 Arch 却不是原生 Arch 的系统。 + +![Endeavouros Updating With Kalu][12] + +开发者[进一步声明 ][13]: + +>“Linux,特别是 Arch,核心精神是自由选择,我们提供了一个基本的安装,让你在一个精细的层面上方便地探索各项选择。我们永远不会强行为你作决定,比如为你安装 GUI 应用程序,如 Pamac,甚至采用沙盒解决方案,如 Flatpak 或 Snaps。想安装成什么样子完全取决于你,这是我们与 Antergos 或 Manjaro 的主要区别,但与 Antergos 一样,如果你安装的软件包遇到问题,我们会尽力帮助你。” + +### 体验 EndeavourOS + +我在 [VirtualBox][14] 中安装了 EndeavourOS,并且研究了一番。当我第一次启动时,我看到一个窗口,里面有关于安装的 EndeavourOS 网站的链接。它还有一个安装按钮和一个手动分区工具。Calamares 安装程序的安装过程非常顺利。 + +在我重新启动到新安装的 EndeavourOS 之后,迎接我的是一个彩色主题的 XFCE 桌面。我还收到了一堆通知消息。我使用过的大多数基于 Arch 的发行版都带有一个 GUI 包管理器,比如 [pamac][15] 或 [octopi][16],以进行系统更新。EndeavourOS 配有 [kalu][17](kalu 是 “Keeping Arch Linux Up-to-date” 的缩写)。它可以更新软件包、可以看 Archlinux 新闻、可以更新 AUR 包等等。一旦它检查到有更新,它就会显示通知消息。 + +我浏览了一下菜单,看看默认安装了什么。默认的安装并不多,连办公套件都没有。他们想让 EndeavourOS 成为一块空白画布,让任何人都可以创建他们想要的系统。他们正朝着正确的方向前进。 + +![Endeavouros Desktop][18] + +### 总结思考 + +EndeavourOS 还很年轻。第一个稳定版本都没有发布多久。它缺少一些东西,最重要的是一个在线安装程序。这就是说,我们无法估计他能够走到哪一步。 + +[][19] + +建议您阅读英特尔 Clear Linux 的概述、功能和安装过程 + +虽然它不是 Antergos 的复刻,但 EndeavourOS 希望复制 Antergos 最重要的部分——热情友好的社区。很多时候,Linux 社区对初学者似乎是不受欢迎甚至是完全敌对的。我看到越来越多的人试图与这种消极情绪作斗争,并将更多的人引入 Linux。随着 EndeavourOS 团队把焦点放在社区建设上,我相信一个伟大的发行版将会诞生。 + +如果您当前正在使用 Antergos,有一种方法可以让您[不用重装系统就切换到 EndeavourOS][20] + +如果你想要一个 Antergos 的精确复刻,我建议你去看看 [RebornOS][21]。他们目前正在开发一个名为 Fenix 的 Cnchi 安装程序的替代品。 + +你已经试过 EndeavourOS 了吗?你的感受如何? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/endeavouros/ + +作者:[John Paul][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-logo.png?ssl=1 +[2]: https://itsfoss.com/antergos-linux-discontinued/ +[3]: https://endeavouros.com/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-first-boot.png?resize=800%2C600&ssl=1 +[5]: https://endeavouros.com/info-2/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-installing.png?resize=800%2C600&ssl=1 +[7]: https://endeavouros.com/endeavouros-first-stable-release-has-arrived/ +[8]: https://forum.antergos.com/topic/11780/endeavour-antergos-community-s-next-stage +[9]: https://endeavouros.com/what-to-expect-on-the-first-release/ +[10]: https://calamares.io/ +[11]: https://itsfoss.com/veltos-linux/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-updating-with-kalu.png?resize=800%2C600&ssl=1 +[13]: https://endeavouros.com/second-week-after-the-stable-release/ +[14]: https://itsfoss.com/install-virtualbox-ubuntu/ +[15]: https://aur.archlinux.org/packages/pamac-aur/ +[16]: https://octopiproject.wordpress.com/ +[17]: https://github.com/jjk-jacky/kalu +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/08/endeavouros-desktop.png?resize=800%2C600&ssl=1 +[19]: https://itsfoss.com/clear-linux/ +[20]: https://forum.endeavouros.com/t/how-to-switch-from-antergos-to-endevouros/105/2 +[21]: https://rebornos.org/ From 752c49316ce1f46890add204ca04bd887748a267 Mon Sep 17 00:00:00 2001 From: LazyWolf Lin Date: Sun, 7 Feb 2021 22:24:40 +0800 Subject: [PATCH 143/213] Translating. --- .../tech/20200524 Diamond interface composition in Go 1.14.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200524 Diamond interface composition in Go 1.14.md b/sources/tech/20200524 Diamond interface composition in Go 1.14.md index 611bb2c39e..34ad6bd5cd 100644 --- a/sources/tech/20200524 Diamond interface composition in Go 1.14.md +++ b/sources/tech/20200524 Diamond interface composition in Go 1.14.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (LazyWolfLin) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d22c6abb537baae5ea3a1b393fc7e09d161cf3e5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 22:56:19 +0800 Subject: [PATCH 144/213] PRF @Chao-zhi --- ...id Left by Antergos in Arch Linux World.md | 40 ++++++++----------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md index b7966b40cf..185aec4bc9 100644 --- a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ b/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -1,48 +1,44 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) [#]: via: (https://itsfoss.com/endeavouros/) [#]: author: (John Paul https://itsfoss.com/author/john/) -EndeavourOS 的目标是填补 Antergos 在 ArchLinux 世界留下的空白 +EndeavourOS:填补 Antergos 在 ArchLinux 世界留下的空白 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202102/07/225558rdb85bmm6uumro71.jpg) -我相信我们的大多数读者都知道 [Antergos 项目的终结 ][2]。在这一消息宣布之后,Antergos 社区的成员创建了几个发行版来继承 Antergos。今天,我们将着眼于 Antergos 的“精神继承人”之一:[EndeavourOS][3]。 +我相信我们的大多数读者都知道 [Antergos 项目的终结][2]。在这一消息宣布之后,Antergos 社区的成员创建了几个发行版来继承 Antergos。今天,我们将着眼于 Antergos 的“精神继承人”之一:[EndeavourOS][3]。 ### EndeavourOS 不是 Antergos 的分支 -在我们开始之前,我想非常明确地指出,EndeavourOS 并不是一个 Antergos 的分支版本。开发者们以 Antergos 为灵感,创建了一个基于 Arch 的轻量级发行版。 +在我们开始之前,我想非常明确地指出,EndeavourOS 并不是一个 Antergos 的复刻版本。开发者们以 Antergos 为灵感,创建了一个基于 Arch 的轻量级发行版。 ![Endeavouros First Boot][4] -根据[这个项目网站 ][5] 的说法,EndeavourOS 的诞生是因为 Antergos 社区的人们想要保持 Antergos 的精神。他们的目标很简单:“让 Arch 拥有一个易于使用的安装程序和一个友好、有帮助的社区,在掌握系统的过程中能够有一个社区可以依靠。” +根据 [这个项目网站][5] 的说法,EndeavourOS 的诞生是因为 Antergos 社区的人们想要保持 Antergos 的精神。他们的目标很简单:“让 Arch 拥有一个易于使用的安装程序和一个友好、有帮助的社区,在掌握系统的过程中能够有一个社区可以依靠。” -与许多基于 Arch 的发行版不同,EndeavourOS 打算像 [原生 Arch][5] 那样使用,“所以没有一键式安装你喜欢的应用程序或一堆你最终不需要的预装应用程序的解决方案。”对于大多数人来说,尤其是那些刚接触 Linux 和 Arch 的人,会有一个学习曲线,但 EndeavourOS 的目标是建立一个大型友好的社区,鼓励人们提出问题并了解他们的系统。 +与许多基于 Arch 的发行版不同,EndeavourOS 打算像 [原生 Arch][5] 那样使用,“所以没有一键式安装你喜欢的应用程序的解决方案,也没有一堆你最终不需要的预装应用程序。”对于大多数人来说,尤其是那些刚接触 Linux 和 Arch 的人,会有一个学习曲线,但 EndeavourOS 的目标是建立一个大型友好的社区,鼓励人们提出问题并了解他们的系统。 ![Endeavouros Installing][6] ### 正在进行的工作 -EndeavourOS 在 [2019 年 5 月 23 日首次宣布陈立 ][8] 随后[在 7 月 15 日发布第一个版本 ][7]。不幸的是,这意味着开发人员无法将他们计划的所有功能全部整合进来。 +EndeavourOS 在 [2019 年 5 月 23 日首次宣布成立][8] 随后 [在 7 月 15 日发布第一个版本][7]。不幸的是,这意味着开发人员无法将他们计划的所有功能全部整合进来。(LCTT 译注:本文原文发表于 2019 年,而现在,EndeavourOS 还在持续活跃着。) -例如,他们想要一个类似于 Antergos 的在线安装,但却遇到了[当前选项的问题 ][9]。“Cnchi 运行在 Antergos 生态系统之外会造成严重的问题,需要彻底重写才能发挥作用。RebornOS 的 Fenix 安装程序还没有完全成型,需要更多时间才能正常运行。”于是现在,EndeavourOS 将会和 [Calamares 安装程序 ][10] 一起发布。 +例如,他们想要一个类似于 Antergos 的在线安装,但却遇到了[当前选项的问题][9]。“Cnchi 运行在 Antergos 生态系统之外会造成严重的问题,需要彻底重写才能发挥作用。RebornOS 的 Fenix 安装程序还没有完全成型,需要更多时间才能正常运行。”于是现在,EndeavourOS 将会和 [Calamares 安装程序 ][10] 一起发布。 -[][11] - -推荐阅读 Velt/OS:Material Design 主题的桌面环境 - -EndeavourOS 会提供[比 Antergos 少的东西 ][9]:它的 repo 比 Antergos 小,尽管他们会附带一些 AUR 包。他们的目标是提供一个接近 Arch 却不是原生 Arch 的系统。 +EndeavourOS 会提供 [比 Antergos 少的东西][9]:它的存储库比 Antergos 小,尽管他们会附带一些 AUR 包。他们的目标是提供一个接近 Arch 却不是原生 Arch 的系统。 ![Endeavouros Updating With Kalu][12] 开发者[进一步声明 ][13]: ->“Linux,特别是 Arch,核心精神是自由选择,我们提供了一个基本的安装,让你在一个精细的层面上方便地探索各项选择。我们永远不会强行为你作决定,比如为你安装 GUI 应用程序,如 Pamac,甚至采用沙盒解决方案,如 Flatpak 或 Snaps。想安装成什么样子完全取决于你,这是我们与 Antergos 或 Manjaro 的主要区别,但与 Antergos 一样,如果你安装的软件包遇到问题,我们会尽力帮助你。” +> “Linux,特别是 Arch,核心精神是自由选择,我们提供了一个基本的安装,让你在一个精细的层面上方便地探索各项选择。我们永远不会强行为你作决定,比如为你安装 GUI 应用程序,如 Pamac,甚至采用沙盒解决方案,如 Flatpak 或 Snaps。想安装成什么样子完全取决于你,这是我们与 Antergos 或 Manjaro 的主要区别,但与 Antergos 一样,如果你安装的软件包遇到问题,我们会尽力帮助你。” ### 体验 EndeavourOS @@ -56,19 +52,15 @@ EndeavourOS 会提供[比 Antergos 少的东西 ][9]:它的 repo 比 Antergos ### 总结思考 -EndeavourOS 还很年轻。第一个稳定版本都没有发布多久。它缺少一些东西,最重要的是一个在线安装程序。这就是说,我们无法估计他能够走到哪一步。 +EndeavourOS 还很年轻。第一个稳定版本都没有发布多久。它缺少一些东西,最重要的是一个在线安装程序。这就是说,我们无法估计他能够走到哪一步。(LCTT 译注:本文发表于 2019 年) -[][19] +虽然它不是 Antergos 的精确复刻,但 EndeavourOS 希望复制 Antergos 最重要的部分——热情友好的社区。很多时候,Linux 社区对初学者似乎是不受欢迎甚至是完全敌对的。我看到越来越多的人试图与这种消极情绪作斗争,并将更多的人引入 Linux。随着 EndeavourOS 团队把焦点放在社区建设上,我相信一个伟大的发行版将会诞生。 -建议您阅读英特尔 Clear Linux 的概述、功能和安装过程 - -虽然它不是 Antergos 的复刻,但 EndeavourOS 希望复制 Antergos 最重要的部分——热情友好的社区。很多时候,Linux 社区对初学者似乎是不受欢迎甚至是完全敌对的。我看到越来越多的人试图与这种消极情绪作斗争,并将更多的人引入 Linux。随着 EndeavourOS 团队把焦点放在社区建设上,我相信一个伟大的发行版将会诞生。 - -如果您当前正在使用 Antergos,有一种方法可以让您[不用重装系统就切换到 EndeavourOS][20] +如果你当前正在使用 Antergos,有一种方法可以让你[不用重装系统就切换到 EndeavourOS][20] 如果你想要一个 Antergos 的精确复刻,我建议你去看看 [RebornOS][21]。他们目前正在开发一个名为 Fenix 的 Cnchi 安装程序的替代品。 -你已经试过 EndeavourOS 了吗?你的感受如何? +你试过 EndeavourOS 了吗?你的感受如何? -------------------------------------------------------------------------------- @@ -77,7 +69,7 @@ via: https://itsfoss.com/endeavouros/ 作者:[John Paul][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5ee4c813a58bc5d16a07ec40a17903afa9e8cc39 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 22:56:56 +0800 Subject: [PATCH 145/213] PUB @Chao-zhi https://linux.cn/article-13096-1.html --- ...s to Fill the Void Left by Antergos in Arch Linux World.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md (99%) diff --git a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md b/published/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md similarity index 99% rename from translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md rename to published/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md index 185aec4bc9..54c752a913 100644 --- a/translated/tech/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md +++ b/published/20190810 EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13096-1.html) [#]: subject: (EndeavourOS Aims to Fill the Void Left by Antergos in Arch Linux World) [#]: via: (https://itsfoss.com/endeavouros/) [#]: author: (John Paul https://itsfoss.com/author/john/) From cc8e6da4302625ad548a9df490cdf000c53b1ec8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 23:19:04 +0800 Subject: [PATCH 146/213] PRF @geekpi --- ...ate QR codes with this open source tool.md | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210201 Generate QR codes with this open source tool.md b/translated/tech/20210201 Generate QR codes with this open source tool.md index b378c6bccc..64bacb6c85 100644 --- a/translated/tech/20210201 Generate QR codes with this open source tool.md +++ b/translated/tech/20210201 Generate QR codes with this open source tool.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Generate QR codes with this open source tool) [#]: via: (https://opensource.com/article/21/2/zint-barcode-generator) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) -用这个开源工具生成二维码 +Zint:用这个开源工具生成二维码 ====== -Zint 可以轻松生成 50 多种类型的自定义条码。 -![Working from home at a laptop][1] + +> Zint 可以轻松生成 50 多种类型的自定义条码。 + +![](https://img.linux.net.cn/data/attachment/album/202102/07/231854y8ffstg0m6l2fcmz.jpg) 二维码是一种很好的可以向人们提供信息的方式,且没有打印的麻烦和费用。大多数人的智能手机都支持二维码扫描,无论其操作系统是什么。 @@ -18,24 +20,22 @@ Zint 可以轻松生成 50 多种类型的自定义条码。 在互联网上搜索一个简单的、开源的方法来创建二维码时,我发现了 [Zint][2]。Zint 是一个优秀的开源 (GPLv3.0) 生成条码的解决方案。根据该项目的 [GitHub 仓库][3]:“Zint 是一套可以方便地对任何一种公共领域条形码标准的数据进行编码的程序,并允许你将这种功能集成到你自己的程序中。” -Zint 支持 50 多种类型的条形码,包括二维码码 (ISO 18004),你可以轻松地创建这些条形码,然后复制和粘贴到 word 文档、博客、维基和其他数字媒体中。人们可以用智能手机扫描这些二维码,快速链接到信息。 +Zint 支持 50 多种类型的条形码,包括二维码(ISO 18004),你可以轻松地创建这些条形码,然后复制和粘贴到 word 文档、博客、维基和其他数字媒体中。人们可以用智能手机扫描这些二维码,快速链接到信息。 ### 安装 Zint Zint 适用于 Linux、macOS 和 Windows。 -你可以在基于 Ubuntu 的 Linux 发行版上使用 apt 安装 Zint 命令: - +你可以在基于 Ubuntu 的 Linux 发行版上使用 `apt` 安装 Zint 命令: ``` -`$ sudo apt install zint` +$ sudo apt install zint ``` -我还想要一个图形用户界面 (GUI),所以我安装了 Zint-QT: - +我还想要一个图形用户界面(GUI),所以我安装了 Zint-QT: ``` -`$ sudo apt install zint-qt` +$ sudo apt install zint-qt ``` 请参考手册的[安装部分][4],了解 macOS 和 Windows 的说明。 @@ -46,16 +46,12 @@ Zint 适用于 Linux、macOS 和 Windows。 ![Generating QR code with Zint][5] -(Don Watkins, [CC BY-SA 4.0][6]) - Zint 的 50 多个其他条码选项包括许多国家的邮政编码、DotCode、EAN、EAN-14 和通用产品代码 (UPC)。[项目文档][2]中包含了它可以渲染的所有代码的完整列表。 你可以将任何条形码复制为 BMP 或 SVG,或者将输出保存为你应用中所需要的任何尺寸的图像文件。这是我的 77x77 像素的二维码。 ![QR code][7] -(Don Watkins, [CC BY-SA 4.0][6]) - 该项目维护了一份出色的用户手册,其中包含了在[命令行][8]和 [GUI][9] 中使用 Zint 的说明。你甚至可以[在线][10]试用 Zint。对于功能请求或错误报告,请[访问网站][11]或[发送电子邮件][12]。 -------------------------------------------------------------------------------- @@ -65,7 +61,7 @@ via: https://opensource.com/article/21/2/zint-barcode-generator 作者:[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 9d480138b8449011ff2a998a7022c478c90b2358 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 7 Feb 2021 23:19:38 +0800 Subject: [PATCH 147/213] PUB @geekpi https://linux.cn/article-13097-1.html --- .../20210201 Generate QR codes with this open source tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210201 Generate QR codes with this open source tool.md (98%) diff --git a/translated/tech/20210201 Generate QR codes with this open source tool.md b/published/20210201 Generate QR codes with this open source tool.md similarity index 98% rename from translated/tech/20210201 Generate QR codes with this open source tool.md rename to published/20210201 Generate QR codes with this open source tool.md index 64bacb6c85..bc554bf5cb 100644 --- a/translated/tech/20210201 Generate QR codes with this open source tool.md +++ b/published/20210201 Generate QR codes with this open source tool.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13097-1.html) [#]: subject: (Generate QR codes with this open source tool) [#]: via: (https://opensource.com/article/21/2/zint-barcode-generator) [#]: author: (Don Watkins https://opensource.com/users/don-watkins) From 10cfc884dd5e49ea35bbf13cd93499c48ab0ab58 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 8 Feb 2021 05:03:20 +0800 Subject: [PATCH 148/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210207=20?= =?UTF-8?q?Why=20the=20success=20of=20open=20source=20depends=20on=20empat?= =?UTF-8?q?hy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210207 Why the success of open source depends on empathy.md --- ...ccess of open source depends on empathy.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/tech/20210207 Why the success of open source depends on empathy.md diff --git a/sources/tech/20210207 Why the success of open source depends on empathy.md b/sources/tech/20210207 Why the success of open source depends on empathy.md new file mode 100644 index 0000000000..cc2219187e --- /dev/null +++ b/sources/tech/20210207 Why the success of open source depends on empathy.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why the success of open source depends on empathy) +[#]: via: (https://opensource.com/article/21/2/open-source-empathy) +[#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) + +Why the success of open source depends on empathy +====== +With heightened awareness about empathy and the inspiration to spread +it, open source productivity will grow, collaborators will lean in, and +the power of open source software development can be fully harnessed. +![Practicing empathy][1] + +Open source development's collaborative innovation and community ethos have changed the world. In [_The Open Organization_][2], Jim Whitehurst explains that success in open source is found by "thinking of people as members of a community, moving from a transactional mindset to one built on commitment." However, there is still a barrier at the core of the open source development model: Frequently, it lacks human empathy. + +Empathy is the ability to understand and share another person's feelings. In open source communities, face-to-face human interaction and collaboration are rare. Any developer experienced with a GitHub pull request (PR) or issue has received comments from people they may never meet, often halfway across the globe—and the communication can be just as distant. Modern open source development is built upon this type of asynchronous, transactional communication. So, it is no surprise that the same types of cyberbullying and other abuses people experience on social media platforms are also seen in open source communities. + +Of course, not all open source communication is counterproductive. Many people develop respect and commit to good behavioral standards in their craft. But all too often, people lack common-sense etiquette in communications and treat people like machines rather than human beings. This behavior is a barrier to realizing the open source innovation model's full potential because it turns off many would-be contributors and kills inspiration. + +### A history of hostile communications + +Hostile rhetoric in code reviews is not new to open source communities; it has been tolerated for years. The godfather of open source, Linus Torvalds, routinely [barraged][3] the Linux community when code did not meet his standards, driving contributors away. Elon University computer science professor Megan Squire used [machine learning][4] to analyze Torvalds' insults and found they numbered in the thousands during a four-year period. In 2018, Linus put himself on a timeout for bad behavior, tasked himself with learning empathy, apologized, and established a code of conduct for the Linux community. + +In 2015, [Sage Sharp][5] stepped down as the Linux kernel coordinator for the FOSS Outreach Program for Women due to a lack of personal respect, despite being technically respected. + +The impact of disparaging comments in PR reviews has a profound effect on developers. It creates trepidation in making PRs and dread at anticipated feedback, and it eats at developers' confidence in their abilities. It slows velocity by forcing engineers to strive for perfection every time, which runs counter to the agile methodology many communities have adopted. + +### How to close the empathy gap in open source + +Often, offensive comments are unintentional, and with some coaching, the author can learn how to express opinions without negative emotion. GitHub does not monitor comments on issues and PRs for abusive content; instead, it provides tools to enable communities to moderate their content. Repo owners can delete comments and lock conversations, and all contributors can report abuse and block users. + +Defining a community code of conduct establishes a safe and inclusive environment for contributors at all levels to participate and defines the process to de-escalate conflict between collaborators. + +We can overcome the empathy challenge in open source. Face-to-face debate is much more conducive to empathy than text, so opt for a video call when possible. Set an example by sharing feedback in an empathetic way. Be a coach instead of a bystander if you witness a scathing review. Speak up if you are the victim. Assess empathy skills when interviewing a candidate. Tie empathy skills to performance reviews and rewards. Define and enforce a community code of conduct, and moderate your community. + +With heightened awareness about empathy and the inspiration to spread it, open source productivity will grow, collaborators will lean in, and the power of open source software development can be fully harnessed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-empathy + +作者:[Bronagh Sorota][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bsorota +[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.redhat.com/en/explore/the-open-organization-book +[3]: https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ +[4]: http://flossdata.syr.edu/data/insults/hicssInsultsv2.pdf +[5]: https://en.wikipedia.org/wiki/Sage_Sharp From 80d14307837c8cb750f86b58851fab3ab82248a5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 8 Feb 2021 05:03:42 +0800 Subject: [PATCH 149/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210207=20?= =?UTF-8?q?3=20ways=20to=20play=20video=20games=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210207 3 ways to play video games on Linux.md --- ...207 3 ways to play video games on Linux.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20210207 3 ways to play video games on Linux.md diff --git a/sources/tech/20210207 3 ways to play video games on Linux.md b/sources/tech/20210207 3 ways to play video games on Linux.md new file mode 100644 index 0000000000..1c132ab588 --- /dev/null +++ b/sources/tech/20210207 3 ways to play video games on Linux.md @@ -0,0 +1,98 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 ways to play video games on Linux) +[#]: via: (https://opensource.com/article/21/2/linux-gaming) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +3 ways to play video games on Linux +====== +If you're ready to put down the popcorn and experience games from all +angles, start gaming on Linux. +![Gaming with penguin pawns][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. Today, I'll start with gaming. + +I used to think a "gamer" was a very specific kind of creature, carefully cataloged and classified by scientists after years of study and testing. I never classified myself as a gamer because most of the games I played were either on a tabletop (board games and pen-and-paper roleplaying games), NetHack, or Tetris. Now that games are available on everything from mobile devices, consoles, computers, and televisions, it feels like it's a good time to acknowledge that "gamers" come in all different shapes and sizes. If you want to call yourself a gamer, you can! There's no qualification exam. You don't have to know the Konami Code by heart (or even what that reference means); you don't have to buy and play "triple-A" games. If you enjoy a game from time to time, you can rightfully call yourself a gamer. And if you want to be a gamer, there's never been a better time to use Linux. + +### Welcome to the underground + +Peel back the glossy billboard ads, and underneath, you're sure to find a thriving gaming underground. It's a movement that began with the nascent gaming market before anyone believed money could be made off software that wasn't either a spreadsheet or typing tutor. Indie games have carved out a place in pop culture (believe it or not, [Minecraft, while not open source][2], started out as an indie game) in several ways, proving that in the eyes of players, gameplay comes before production value. + +There's a lot of cross-over in the indie and open source developer space. There's nothing quite like kicking back with your Linux laptop and browsing [itch.io][3] or your distribution's software repository for a little-known but precious gem of an open source game. + +There are all kinds of open source games available, including plenty of [first person shooters][4], puzzle games like [Nodulus][5], systems management games like [OpenTTD][6], racing games like [Jethook][7], tense escape campaigns like [Sauerbraten][8], and too many more to mention (with more arriving each year, thanks to great initiatives like [Open Jam][9]). + +![Jethook game screenshot][10] + +Jethook + +Overall, the experience of delving into the world of open source games is different than the immediate satisfaction of buying whatever a major game studio releases next. Games by the big studios provide plenty of visual and sonic stimuli, big-name actors, and upwards of 60 hours of gameplay. Independent and open source games aren't likely to match that, but then again, major studios can't match the sense of discovery and personal connection you get when you find a game that you just know nobody else _has ever heard of_. And they can't hope to match the sense of urgency you get when you realize that everybody in the world really, really needs to hear about the great game you've just played. + +Take some time to identify the kinds of games you enjoy the most, and then have a browse through your distribution's software repository, [Flathub][11], and open game jams. See what you can uncover and, if you like the game enough, help to promote it! + +### Proton and WINE + +Gaming on Linux doesn't stop with open source, but it is enabled by it. When Valve Software famously brought Linux back into the gaming market a few years ago by releasing their Steam client for Linux, the hope was that it would compel game studios to write code native to Linux systems. Some did, but Valve failed to push Linux as the primary platform even on their own Valve-branded gaming computers, and it seems that most studios have reverted to their old ways of Windows-only games. + +Interestingly, though, the end result has produced more open source code than probably intended. Valve's solution for Linux compatibility has been to create the [Proton][12] project, a compatibility layer to translate Windows games to Linux. At its core, Proton uses [WINE (Wine Is Not an Emulator)][13], the too-good-to-be-true reimplementation of major Windows libraries as open source. + +The game market's spoils have turned out to be a treasure trove for the open source world, and today, most games from major studios can be run on Linux as if they were native. + +Of course, if you're the type of gamer who has to have the latest title on the day of release, you can certainly expect unpleasant surprises. That's not surprising, though, because few major games are released without bugs requiring large patches a week later. Those bugs can be even worse when a game runs on Proton and WINE, so Linux gamers often benefit by refraining from early adoption. The trade-off may be worth it, though. I've played a few games that run perfectly on Proton, only to discover later from angry forum posts that it's apparently riddled with fatal errors when played on the latest version of Windows. In short, it seems that games from major studios aren't perfect, and so you can expect similar-but-different problems when playing them on Linux as you would on Windows. + +### Flatpak + +One of the most exciting developments of recent Linux history is [Flatpak][14], a cross between local containers and packaging. It's got nothing to do with gaming (or doesn't it?), but it enables Linux applications to essentially be distributed universally to any Linux distribution. This applies to gaming because there are often lots of fringe technologies used in games, and it can be pretty demanding on distribution maintainers to keep up with all the latest versions required by any given game. + +Flatpak abstracts that away from the distribution by establishing a common Flatpak-specific layer for application libraries. Distributors of flatpaks know that if a library isn't in a Flatpak SDK, then it must be included in the flatpak. It's simple and straightforward. + +Thanks to Flatpak, the Steam client runs on something obvious like Fedora and on distributions not traditionally geared toward the gaming market, like [RHEL][15] and Slackware! + +### Lutris + +If you're not eager to sign up on Steam, though, there's my preferred gaming client, [Lutris][16]. On the surface, Lutris is a simple game launcher for your system, a place you can go when you know you want to play a game but just can't decide what to launch yet. With Lutris, you can add [all the games you have on your system][17] to create your own gaming library, and then launch and play them right from the Lutris interface. Better still, Lutris contributors (like me!) regularly publish installer scripts to make it easy for you to install games you own. It's not always necessary, but it can be a nice shortcut to bypass some tedious configuration. + +Lutris can also enlist the help of _runners_, or subsystems that run games that wouldn't normally launch straight from your application menu. For instance, if you want to play console games like the open source [Warcraft Tower Defense][18], you must run an emulator, and Lutris can handle that for you (provided you have the emulator installed). Additionally, should you have a GOG.com (Good Old Games) account, Lutris can access it and import games from your library. + +There's no easier way to manage your games. + +### Play games + +Linux gaming is a fulfilling and empowering experience. I used to avoid computer gaming because I didn't feel I had much of a choice. It seemed that there were always expensive games being released, which inevitably got extreme reactions from happy and unhappy gamers alike, and then the focus shifted quickly to the next big thing. On the other hand, open source gaming has introduced me to the _people_ of the gaming world. I've met other players and developers, I've met artists and musicians, fans and promoters, and I've played an assortment of games that I never even realized existed. Some of them were barely long enough to distract me for just one afternoon, while others have provided me hours and hours of obsessive gameplay, modding, level design, and fun. + +If you're ready to put down the popcorn and experience games from all angles, start gaming on Linux. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-gaming + +作者:[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/gaming_grid_penguin.png?itok=7Fv83mHR (Gaming with penguin pawns) +[2]: https://opensource.com/alternatives/minecraft +[3]: https://itch.io/jam/open-jam-2020 +[4]: https://opensource.com/article/20/5/open-source-fps-games +[5]: https://hyperparticle.itch.io/nodulus +[6]: https://www.openttd.org/ +[7]: https://rcorre.itch.io/jethook +[8]: http://sauerbraten.org/ +[9]: https://opensource.com/article/18/9/open-jam-announcement +[10]: https://opensource.com/sites/default/files/game_0.png +[11]: http://flathub.org +[12]: https://github.com/ValveSoftware/Proton +[13]: http://winehq.org +[14]: https://opensource.com/business/16/8/flatpak +[15]: https://www.redhat.com/en/enterprise-linux-8 +[16]: http://lutris.net +[17]: https://opensource.com/article/18/10/lutris-open-gaming-platform +[18]: https://ndswtd.wordpress.com/download From 2ee752dfc933c4c595e971609a0065de79e8bbb9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 8 Feb 2021 05:04:05 +0800 Subject: [PATCH 150/213] =?UTF-8?q?=E9=80=89=E9=A2=98[talk]:=2020210207=20?= =?UTF-8?q?The=20Real=20Novelty=20of=20the=20ARPANET?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/talk/20210207 The Real Novelty of the ARPANET.md --- ...0210207 The Real Novelty of the ARPANET.md | 263 ++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 sources/talk/20210207 The Real Novelty of the ARPANET.md diff --git a/sources/talk/20210207 The Real Novelty of the ARPANET.md b/sources/talk/20210207 The Real Novelty of the ARPANET.md new file mode 100644 index 0000000000..5e60919871 --- /dev/null +++ b/sources/talk/20210207 The Real Novelty of the ARPANET.md @@ -0,0 +1,263 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (The Real Novelty of the ARPANET) +[#]: via: (https://twobithistory.org/2021/02/07/arpanet.html) +[#]: author: (Two-Bit History https://twobithistory.org) + +The Real Novelty of the ARPANET +====== + +If you run an image search for the word “ARPANET,” you will find lots of maps showing how the [government research network][1] expanded steadily across the country throughout the late ’60s and early ’70s. I’m guessing that most people reading or hearing about the ARPANET for the first time encounter one of these maps. + +Obviously, the maps are interesting—it’s hard to believe that there were once so few networked computers that their locations could all be conveyed with what is really pretty lo-fi cartography. (We’re talking 1960s overhead projector diagrams here. You know the vibe.) But the problem with the maps, drawn as they are with bold lines stretching across the continent, is that they reinforce the idea that the ARPANET’s paramount achievement was connecting computers across the vast distances of the United States for the first time. + +Today, the internet is a lifeline that keeps us tethered to each other even as an airborne virus has us all locked up indoors. So it’s easy to imagine that, if the ARPANET was the first draft of the internet, then surely the world that existed before it was entirely disconnected, since that’s where we’d be without the internet today, right? The ARPANET must have been a big deal because it connected people via computers when that hadn’t before been possible. + +That view doesn’t get the history quite right. It also undersells what made the ARPANET such a breakthrough. + +### The Debut + +The Washington Hilton stands near the top of a small rise about a mile and a half northeast of the National Mall. Its two white-painted modern facades sweep out in broad semicircles like the wings of a bird. The New York Times, reporting on the hotel’s completion in 1965, remarked that the building looks “like a sea gull perched on a hilltop nest.”[1][2] + +The hotel hides its most famous feature below ground. Underneath the driveway roundabout is an enormous ovoid event space known as the International Ballroom, which was for many years the largest pillar-less ballroom in DC. In 1967, the Doors played a concert there. In 1968, Jimi Hendrix also played a concert there. In 1972, a somewhat more sedate act took over the ballroom to put on the inaugural International Conference on Computing Communication, where a promising research project known as the ARPANET was demonstrated publicly for the first time. + +The 1972 ICCC, which took place from October 24th to 26th, was attended by about 800 people.[2][3] It brought together all of the leading researchers in the nascent field of computer networking. According to internet pioneer Bob Kahn, “if somebody had dropped a bomb on the Washington Hilton, it would have destroyed almost all of the networking community in the US at that point.”[3][4] + +Not all of the attendees were computer scientists, however. An advertisement for the conference claimed it would be “user-focused” and geared toward “lawyers, medical men, economists, and government men as well as engineers and communicators.”[4][5] Some of the conference’s sessions were highly technical, such as the session titled “Data Network Design Problems I” and its sequel session, “Data Network Design Problems II.” But most of the sessions were, as promised, focused on the potential social and economic impacts of computer networking. One session, eerily prescient today, sought to foster a discussion about how the legal system could act proactively “to safeguard the right of privacy in the computer data bank.”[5][6] + +The ARPANET demonstration was intended as a side attraction of sorts for the attendees. Between sessions, which were held either in the International Ballroom or elsewhere on the lower level of the hotel, attendees were free to wander into the Georgetown Ballroom (a smaller ballroom/conference room down the hall from the big one),[6][7] where there were 40 terminals from a variety of manufacturers set up to access the ARPANET.[7][8] These terminals were dumb terminals—they only handled input and output and could do no computation on their own. (In fact, in 1972, it’s likely that all of these terminals were hardcopy terminals, i.e. teletype machines.) The terminals were all hooked up to a computer known as a Terminal Interface Message Processor or TIP, which sat on a raised platform in the middle of the room. The TIP was a kind of archaic router specially designed to connect dumb terminals to the ARPANET. Using the terminals and the TIP, the ICCC attendees could experiment with logging on and accessing some of the computers at the 29 host sites then comprising the ARPANET.[8][9] + +To exhibit the network’s capabilities, researchers at the host sites across the country had collaborated to prepare 19 simple “scenarios” for users to experiment with. These scenarios were compiled into [a booklet][10] that was handed to conference attendees as they tentatively approached the maze of wiring and terminals.[9][11] The scenarios were meant to prove that the new technology worked but also that it was useful, because so far the ARPANET was “a highway system without cars,” and its Pentagon funders hoped that a public demonstration would excite more interest in the network.[10][12] + +The scenarios thus showed off a diverse selection of the software that could be accessed over the ARPANET: There were programming language interpreters, one for a Lisp-based language at MIT and another for a numerical computing environment called Speakeasy hosted at UCLA; there were games, including a chess program and an implementation of Conway’s Game of Life; and—perhaps most popular among the conference attendees—there were several AI chat programs, including the famous ELIZA chat program developed at MIT by Joseph Weizenbaum. + +The researchers who had prepared the scenarios were careful to list each command that users were expected to enter at their terminals. This was especially important because the sequence of commands used to connect to any given ARPANET host could vary depending on the host in question. To experiment with the AI chess program hosted on the MIT Artificial Intelligence Laboratory’s PDP-10 minicomputer, for instance, conference attendees were instructed to enter the following: + +_`[LF]`, `[SP]`, and `[CR]` below stand for the line feed, space, and carriage return keys respectively. I’ve explained each command after `//`, but this syntax was not used for the annotations in the original._ + +``` +@r [LF] // Reset the TIP +@e [SP] r [LF] // "Echo remote" setting, host echoes characters rather than TIP +@L [SP] 134 [LF] // Connect to host number 134 +:login [SP] iccXXX [CR] // Login to the MIT AI Lab's system, where "XXX" should be user's initials +:chess [CR] // Start chess program +``` + +If conference attendees were successfully able to enter those commands, their reward was the opportunity to play around with some of the most cutting-edge chess software available at the time, where the layout of the board was represented like this: + +``` +BR BN BB BQ BK BB BN BR +BP BP BP BP ** BP BP BP +-- ** -- ** -- ** -- ** +** -- ** -- BP -- ** -- +-- ** -- ** WP ** -- ** +** -- ** -- ** -- ** -- +WP WP WP WP -- WP WP WP +WR WN WB WQ WK WB WN WR +``` + +In contrast, to connect to UCLA’s IBM System/360 and run the Speakeasy numerical computing environment, conference attendees had to enter the following: + +``` +@r [LF] // Reset the TIP +@t [SP] o [SP] L [LF] // "Transmit on line feed" setting +@i [SP] L [LF] // "Insert line feed" setting, i.e. send line feed with each carriage return +@L [SP] 65 [LF] // Connect to host number 65 +tso // Connect to IBM Time-Sharing Option system +logon [SP] icX [CR] // Log in with username, where "X" should be a freely chosen digit +iccc [CR] // This is the password (so secure!) +speakez [CR] // Start Speakeasy +``` + +Successfully running that gauntlet gave attendees the power to multiply and transpose and do other operations on matrices as quickly as they could input them at their terminal: + +``` +:+! a=m*transpose(m);a [CR] +:+! eigenvals(a) [CR] +``` + +Many of the attendees were impressed by the demonstration, but not for the reasons that we, from our present-day vantage point, might assume. The key piece of context hard to keep in mind today is that, in 1972, being able to use a computer remotely, even from a different city, was not new. Teletype devices had been used to talk to distant computers for decades already. Almost a full five years before the ICCC, Bill Gates was in a Seattle high school using a teletype to run his first BASIC programs on a General Electric computer housed elsewhere in the city. Merely logging in to a host computer and running a few commands or playing a text-based game was routine. The software on display here was pretty neat, but the two scenarios I’ve told you about so far could ostensibly have been experienced without going over the ARPANET. + +Of course, something new was happening under the hood. The lawyers, policy-makers, and economists at the ICCC might have been enamored with the clever chess program and the chat bots, but the networking experts would have been more interested in two other scenarios that did a better job of demonstrating what the ARPANET project had achieved. + +The first of these scenarios involved a program called `NETWRK` running on MIT’s ITS operating system. The `NETWRK` command was the entrypoint for several subcommands that could report various aspects of the ARPANET’s operating status. The `SURVEY` subcommand reported which hosts on the network were functioning and available (they all fit on a single list), while the `SUMMARY.OF.SURVEY` subcommand aggregated the results of past `SURVEY` runs to report an “up percentage” for each host as well as how long, on average, it took for each host to respond to messages. The output of the `SUMMARY.OF.SURVEY` subcommand was a table that looked like this: + +``` +--HOST-- -#- -%-UP- -RESP- +UCLA-NMC 001 097% 00.80 +SRI-ARC 002 068% 01.23 +UCSB-75 003 059% 00.63 +... +``` + +The host number field, as you can see, has room for no more than three digits (ha!). Other `NETWRK` subcommands allowed users to look at summary of survey results over a longer historical period or to examine the log of survey results for a single host. + +The second of these scenarios featured a piece of software called the SRI-ARC Online System being developed at Stanford. This was a fancy piece of software with lots of functionality (it was the software system that Douglas Engelbart demoed in the “Mother of All Demos”), but one of the many things it could do was make use of what was essentially a file hosting service run on the host at UC Santa Barbara. From a terminal at the Washington Hilton, conference attendees could copy a file created at Stanford onto the host at UCSB simply by running a `copy` command and answering a few of the computer’s questions: + +_`[ESC]`, `[SP]`, and `[CR]` below stand for the escape, space, and carriage return keys respectively. The words in parentheses are prompts printed by the computer. The escape key is used to autocomplete the filename on the third line. The file being copied here is called `sample.txt;1`, where the trailing one indicates the file’s version number and `` indicates the directory. This was a convention for filenames used by the TENEX operating system._[11][13] + +``` +@copy +(TO/FROM UCSB) to +(FILE) sample [ESC] .TXT;1 [CR] +(CREATE/REPLACE) create +``` + +These two scenarios might not look all that different from the first two, but they were remarkable. They were remarkable because they made it clear that, on the ARPANET, humans could talk to computers but computers could also talk to _each other._ The `SURVEY` results collected at MIT weren’t collected by a human regularly logging in to each machine to check if it was up—they were collected by a program that knew how to talk to the other machines on the network. Likewise, the file transfer from Stanford to UCSB didn’t involve any humans sitting at terminals at either Stanford or UCSB—the user at a terminal in Washington DC was able to get the two computers to talk each other merely by invoking a piece of software. Even more, it didn’t matter which of the 40 terminals in the Ballroom you were sitting at, because you could view the MIT network monitoring statistics or store files at UCSB using any of the terminals with almost the same sequence of commands. + +This is what was totally new about the ARPANET. The ICCC demonstration didn’t just involve a human communicating with a distant computer. It wasn’t just a demonstration of remote I/O. It was a demonstration of software remotely communicating with other software, something nobody had seen before. + +To really appreciate why it was this aspect of the ARPANET project that was important and not the wires-across-the-country, physical connection thing that the host maps suggest (the wires were leased phone lines anyhow and were already there!), consider that, before the ARPANET project began in 1966, the ARPA offices in the Pentagon had a terminal room. Inside it were three terminals. Each connected to a different computer; one computer was at MIT, one was at UC Berkeley, and another was in Santa Monica.[12][14] It was convenient for the ARPA staff that they could use these three computers even from Washington DC. But what was inconvenient for them was that they had to buy and maintain terminals from three different manufacturers, remember three different login procedures, and familiarize themselves with three different computing environments in order to use the computers. The terminals might have been right next to each other, but they were merely extensions of the host computing systems on the other end of the wire and operated as differently as the computers did. Communicating with a distant computer was possible before the ARPANET; the problem was that the heterogeneity of computing systems limited how sophisticated the communication could be. + +### Come Together, Right Now + +So what I’m trying to drive home here is that there is an important distinction between statement A, “the ARPANET connected people in different locations via computers for the first time,” and statement B, “the ARPANET connected computer systems to each other for the first time.” That might seem like splitting hairs, but statement A elides some illuminating history in a way that statement B does not. + +To begin with, the historian Joy Lisi Rankin has shown that people were socializing in cyberspace well before the ARPANET came along. In _A People’s History of Computing in the United States_, she describes several different digital communities that existed across the country on time-sharing networks prior to or apart from the ARPANET. These time-sharing networks were not, technically speaking, computer networks, since they consisted of a single mainframe computer running computations in a basement somewhere for many dumb terminals, like some portly chthonic creature with tentacles sprawling across the country. But they nevertheless enabled most of the social behavior now connoted by the word “network” in a post-Facebook world. For example, on the Kiewit Network, which was an extension of the Dartmouth Time-Sharing System to colleges and high schools across the Northeast, high school students collaboratively maintained a “gossip file” that allowed them to keep track of the exciting goings-on at other schools, “creating social connections from Connecticut to Maine.”[13][15] Meanwhile, women at Mount Holyoke College corresponded with men at Dartmouth over the network, perhaps to arrange dates or keep in touch with boyfriends.[14][16] This was all happening in the 1960s. Rankin argues that by ignoring these early time-sharing networks we impoverish our understanding of how American digital culture developed over the last 50 years, leaving room for a “Silicon Valley mythology” that credits everything to the individual genius of a select few founding fathers. + +As for the ARPANET itself, if we recognize that the key challenge was connecting the computer _systems_ and not just the physical computers, then that might change what we choose to emphasize when we tell the story of the innovations that made the ARPANET possible. The ARPANET was the first ever packet-switched network, and lots of impressive engineering went into making that happen. I think it’s a mistake, though, to say that the ARPANET was a breakthrough because it was the first packet-switched network and then leave it at that. The ARPANET was meant to make it easier for computer scientists across the country to collaborate; that project was as much about figuring out how different operating systems and programs written in different languages would interface with each other than it was about figuring out how to efficiently ferry data back and forth between Massachusetts and California. So the ARPANET was the first packet-switched network, but it was also an amazing standards success story—something I find especially interesting given [how][17] [many][18] [times][19] I’ve written about failed standards on this blog. + +Inventing the protocols for the ARPANET was an afterthought even at the time, so naturally the job fell to a group made up largely of graduate students. This group, later known as the Network Working Group, met for the first time at UC Santa Barbara in August of 1968.[15][20] There were 12 people present at that first meeting, most of whom were representatives from the four universities that were to be the first host sites on the ARPANET when the equipment was ready.[16][21] Steve Crocker, then a graduate student at UCLA, attended; he told me over a Zoom call that it was all young guys at that first meeting, and that Elmer Shapiro, who chaired the meeting, was probably the oldest one there at around 38. ARPA had not put anyone in charge of figuring out how the computers would communicate once they were connected, but it was obvious that some coordination was necessary. As the group continued to meet, Crocker kept expecting some “legitimate adult” with more experience and authority to fly out from the East Coast to take over, but that never happened. The Network Working Group had ARPA’s tacit approval—all those meetings involved lots of long road trips, and ARPA money covered the travel expenses—so they were it.[17][22] + +The Network Working Group faced a huge challenge. Nobody had ever sat down to connect computer systems together in a general-purpose way; that flew against all of the assumptions that prevailed in computing in the late 1960s: + +> The typical mainframe of the period behaved as if it were the only computer in the universe. There was no obvious or easy way to engage two diverse machines in even the minimal communication needed to move bits back and forth. You could connect machines, but once connected, what would they say to each other? In those days a computer interacted with devices that were attached to it, like a monarch communicating with his subjects. Everything connected to the main computer performed a specific task, and each peripheral device was presumed to be ready at all times for a fetch-my-slippers type command…. Computers were strictly designed for this kind of interaction; they send instructions to subordinate card readers, terminals, and tape units, and they initiate all dialogues. But if another device in effect tapped the computer on the shoulder with a signal and said, “Hi, I’m a computer too,” the receiving machine would be stumped.[18][23] + +As a result, the Network Working Group’s progress was initially slow.[19][24] The group did not settle on an “official” specification for any protocol until June, 1970, nearly two years after the group’s first meeting.[20][25] + +But by the time the ARPANET was to be shown off at the 1972 ICCC, all the key protocols were in place. A scenario like the chess scenario exercised many of them. When a user ran the command `@e r`, short for `@echo remote`, that instructed the TIP to make use of a facility in the new TELNET virtual teletype protocol to inform the remote host that it should echo the user’s input. When a user then ran the command `@L 134`, short for `@login 134`, that caused the TIP to invoke the Initial Connection Protocol with host 134, which in turn would cause the remote host to allocate all the necessary resources for the connection and drop the user into a TELNET session. (The file transfer scenario I described may well have made use of the File Transfer Protocol, though that protocol was only ready shortly before the conference.[21][26]) All of these protocols were known as “level three” protocols, and below them were the host-to-host protocol at level two (which defined the basic format for the messages the hosts should expect from each other), and the host-to-IMP protocol at level one (which defined how hosts communicated with the routing equipment they were linked to). Incredibly, the protocols all worked. + +In my view, the Network Working Group was able to get everything together in time and just generally excel at its task because it adopted an open and informal approach to standardization, as exemplified by the famous Request for Comments (RFC) series of documents. These documents, originally circulated among the members of the Network Working Group by snail mail, were a way of keeping in touch between meetings and soliciting feedback to ideas. The “Request for Comments” framing was suggested by Steve Crocker, who authored the first RFC and supervised the RFC mailing list in the early years, in an attempt to emphasize the open-ended and collaborative nature of what the group was trying to do. That framing, and the availability of the documents themselves, made the protocol design process into a melting pot of contributions and riffs on other people’s contributions where the best ideas could emerge without anyone losing face. The RFC process was a smashing success and is still used to specify internet standards today, half a century later. + +It’s this legacy of the Network Working Group that I think we should highlight when we talk about ARPANET’s impact. Though today one of the most magical things about the internet is that it can connect us with people on the other side of the planet, it’s only slightly facetious to say that that technology has been with us since the 19th century. Physical distance was conquered well before the ARPANET by the telegraph. The kind of distance conquered by the ARPANET was instead the logical distance between the operating systems, character codes, programming languages, and organizational policies employed at each host site. Implementing the first packet-switched network was of course a major feat of engineering that should also be mentioned, but the problem of agreeing on standards to connect computers that had never been designed to play nice with each other was the harder of the two big problems involved in building the ARPANET—and its solution was the most miraculous part of the ARPANET story. + +In 1981, ARPA issued a “Completion Report” reviewing the first decade of the ARPANET’s history. In a section with the belabored title, “Technical Aspects of the Effort Which Were Successful and Aspects of the Effort Which Did Not Materialize as Originally Envisaged,” the authors wrote: + +> Possibly the most difficult task undertaken in the development of the ARPANET was the attempt—which proved successful—to make a number of independent host computer systems of varying manufacture, and varying operating systems within a single manufactured type, communicate with each other despite their diverse characteristics.[22][27] + +There you have it from no less a source than the federal government of the United States. + +_If you enjoyed this post, more like it come out every four weeks! Follow [@TwoBitHistory][28] on Twitter or subscribe to the [RSS feed][29] to make sure you know when a new post is out._ + +_Previously on TwoBitHistory…_ + +> It's been too long, I know, but I finally got around to writing a new post. This one is about how REST APIs should really be known as FIOH APIs instead (Fuck It, Overload HTTP): +> +> — TwoBitHistory (@TwoBitHistory) [June 28, 2020][30] + + 1. “Hilton Hotel Opens in Capital Today.” _The New York Times_, 20 March 1965, . Accessed 7 Feb. 2021. [↩︎][31] + + 2. James Pelkey. _Entrepreneurial Capitalism and Innovation: A History of Computer Communications 1968-1988,_ Chapter 4, Section 12, 2007, . Accessed 7 Feb. 2021. [↩︎][32] + + 3. Katie Hafner and Matthew Lyon. _Where Wizards Stay Up Late: The Origins of the Internet_. New York, Simon & Schuster, 1996, p. 178. [↩︎][33] + + 4. “International Conference on Computer Communication.” _Computer_, vol. 5, no. 4, 1972, p. c2, . Accessed 7 Feb. 2021. [↩︎][34] + + 5. “Program for the International Conference on Computer Communication.” _The Papers of Clay T. Whitehead_, Box 42, . Accessed 7 Feb. 2021. [↩︎][35] + + 6. It’s actually not clear to me which room was used for the ARPANET demonstration. Lots of sources talk about a “ballroom,” but the Washington Hilton seems to consider the room with the name “Georgetown” more of a meeting room. So perhaps the demonstration was in the International Ballroom instead. But RFC 372 alludes to a booking of the “Georgetown Ballroom” for the demonstration. A floorplan of the Washington Hilton can be found [here][36]. [↩︎][37] + + 7. Hafner, p. 179. [↩︎][38] + + 8. ibid., p. 178. [↩︎][39] + + 9. Bob Metcalfe. “Scenarios for Using the ARPANET.” _Collections-Computer History Museum_, . Accessed 7 Feb. 2021. [↩︎][40] + + 10. Hafner, p. 176. [↩︎][41] + + 11. Robert H. Thomas. “Planning for ACCAT Remote Site Operations.” BBN Report No. 3677, October 1977, . Accessed 7 Feb. 2021. [↩︎][42] + + 12. Hafner, p. 12. [↩︎][43] + + 13. Joy Lisi Rankin. _A People’s History of Computing in the United States_. Cambridge, MA, Harvard University Press, 2018, p. 84. [↩︎][44] + + 14. Rankin, p. 93. [↩︎][45] + + 15. Steve Crocker. Personal interview. 17 Dec. 2020. [↩︎][46] + + 16. Crocker sent me the minutes for this meeting. The document lists everyone who attended. [↩︎][47] + + 17. Steve Crocker. Personal interview. [↩︎][48] + + 18. Hafner, p. 146. [↩︎][49] + + 19. “Completion Report / A History of the ARPANET: The First Decade.” BBN Report No. 4799, April 1981, , p. II-13. [↩︎][50] + + 20. I’m referring here to RFC 54, “Official Protocol Proffering.” [↩︎][51] + + 21. Hafner, p. 175. [↩︎][52] + + 22. “Completion Report / A History of the ARPANET: The First Decade,” p. II-29. [↩︎][53] + + + + +-------------------------------------------------------------------------------- + +via: https://twobithistory.org/2021/02/07/arpanet.html + +作者:[Two-Bit History][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://twobithistory.org +[b]: https://github.com/lujun9972 +[1]: https://en.wikipedia.org/wiki/ARPANET +[2]: tmp.pnPpRrCI3S#fn:1 +[3]: tmp.pnPpRrCI3S#fn:2 +[4]: tmp.pnPpRrCI3S#fn:3 +[5]: tmp.pnPpRrCI3S#fn:4 +[6]: tmp.pnPpRrCI3S#fn:5 +[7]: tmp.pnPpRrCI3S#fn:6 +[8]: tmp.pnPpRrCI3S#fn:7 +[9]: tmp.pnPpRrCI3S#fn:8 +[10]: https://archive.computerhistory.org/resources/access/text/2019/07/102784024-05-001-acc.pdf +[11]: tmp.pnPpRrCI3S#fn:9 +[12]: tmp.pnPpRrCI3S#fn:10 +[13]: tmp.pnPpRrCI3S#fn:11 +[14]: tmp.pnPpRrCI3S#fn:12 +[15]: tmp.pnPpRrCI3S#fn:13 +[16]: tmp.pnPpRrCI3S#fn:14 +[17]: https://twobithistory.org/2018/05/27/semantic-web.html +[18]: https://twobithistory.org/2018/12/18/rss.html +[19]: https://twobithistory.org/2020/01/05/foaf.html +[20]: tmp.pnPpRrCI3S#fn:15 +[21]: tmp.pnPpRrCI3S#fn:16 +[22]: tmp.pnPpRrCI3S#fn:17 +[23]: tmp.pnPpRrCI3S#fn:18 +[24]: tmp.pnPpRrCI3S#fn:19 +[25]: tmp.pnPpRrCI3S#fn:20 +[26]: tmp.pnPpRrCI3S#fn:21 +[27]: tmp.pnPpRrCI3S#fn:22 +[28]: https://twitter.com/TwoBitHistory +[29]: https://twobithistory.org/feed.xml +[30]: https://twitter.com/TwoBitHistory/status/1277259930555363329?ref_src=twsrc%5Etfw +[31]: tmp.pnPpRrCI3S#fnref:1 +[32]: tmp.pnPpRrCI3S#fnref:2 +[33]: tmp.pnPpRrCI3S#fnref:3 +[34]: tmp.pnPpRrCI3S#fnref:4 +[35]: tmp.pnPpRrCI3S#fnref:5 +[36]: https://www3.hilton.com/resources/media/hi/DCAWHHH/en_US/pdf/DCAWH.Floorplans.Apr25.pdf +[37]: tmp.pnPpRrCI3S#fnref:6 +[38]: tmp.pnPpRrCI3S#fnref:7 +[39]: tmp.pnPpRrCI3S#fnref:8 +[40]: tmp.pnPpRrCI3S#fnref:9 +[41]: tmp.pnPpRrCI3S#fnref:10 +[42]: tmp.pnPpRrCI3S#fnref:11 +[43]: tmp.pnPpRrCI3S#fnref:12 +[44]: tmp.pnPpRrCI3S#fnref:13 +[45]: tmp.pnPpRrCI3S#fnref:14 +[46]: tmp.pnPpRrCI3S#fnref:15 +[47]: tmp.pnPpRrCI3S#fnref:16 +[48]: tmp.pnPpRrCI3S#fnref:17 +[49]: tmp.pnPpRrCI3S#fnref:18 +[50]: tmp.pnPpRrCI3S#fnref:19 +[51]: tmp.pnPpRrCI3S#fnref:20 +[52]: tmp.pnPpRrCI3S#fnref:21 +[53]: tmp.pnPpRrCI3S#fnref:22 From fa63a254d38db40d785fd985fb8be9f8d437cf9d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 8 Feb 2021 09:33:58 +0800 Subject: [PATCH 151/213] Rename sources/tech/20210207 Why the success of open source depends on empathy.md to sources/talk/20210207 Why the success of open source depends on empathy.md --- .../20210207 Why the success of open source depends on empathy.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210207 Why the success of open source depends on empathy.md (100%) diff --git a/sources/tech/20210207 Why the success of open source depends on empathy.md b/sources/talk/20210207 Why the success of open source depends on empathy.md similarity index 100% rename from sources/tech/20210207 Why the success of open source depends on empathy.md rename to sources/talk/20210207 Why the success of open source depends on empathy.md From 3781082e38b8792bf1dd7b7548be1a07626e367c Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 8 Feb 2021 10:01:17 +0800 Subject: [PATCH 152/213] translated --- ... Helper and Pacman Wrapper Based on Yay.md | 155 ------------------ ... Helper and Pacman Wrapper Based on Yay.md | 155 ++++++++++++++++++ 2 files changed, 155 insertions(+), 155 deletions(-) delete mode 100644 sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md create mode 100644 translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md diff --git a/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md deleted file mode 100644 index 7be70e4de5..0000000000 --- a/sources/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md +++ /dev/null @@ -1,155 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) -[#]: via: (https://itsfoss.com/paru-aur-helper/) -[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) - -Paru – A New AUR Helper and Pacman Wrapper Based on Yay -====== - -One of the [main reasons that a user chooses Arch Linux][1] or an [Arch based Linux distribution][2] is the [Arch User repository (AUR)][3]. - -Unfortunately, [pacman][4], the package manager of Arch, can’t access the AUR in a similar way to the official repositories. The packages in AUR are in the form of [PKGBUILD][5] and require a manual process to be built. - -An AUR helper can automate this process. Without any doubt [yay][6] is one of the most popular and highly favoured AUR helper. - -Recently [Morganamilo][7], one of the two developers of yay, [announced][8] that is stepping away from maintaining yay and starting his own AUR helper called [paru][9]. Paru is written in [Rust][10] compared to yay that is written in [Go][11] and its design is based on yay. - -Please note that yay hasn’t reach the end of life and is still being actively maintained by [Jguer][12]. He also [commented][13] that paru may be suitable for users that looking for a feature rich AUR helper; thus I would recommend giving it a try. - -### Installing Paru AUR helper - -To install paru, open your terminal and type the following commands one by one. - -``` -sudo pacman -S --needed base-devel -git clone https://aur.archlinux.org/paru.git -cd paru -makepkg -si -``` - -Now that you have it installed, let’s see how to use it. - -### Essential commands to use Paru AUR helper - -In my opinion these are the most essential commands of paru. You can explore more on the official repository on [GitHub][9]. - - * **paru <userinput>** : Search and install <userinput>. - * **paru —** : Alias for paru -Syu - * **paru -Sua** : Upgrade AUR packages only - * **paru -Qua** : Print available AUR updates - * **paru -Gc <userinput>** : Print the AUR comments of <userinput> - - - -### Using Paru AUR helper to its full extent - -You can access the [changelog][14] of paru on GitHub for the full changelog history or you can see the changes from yay at the [first release][15]. - -#### Enable colour in Paru - -To enable colour in paru, you have to enable it first in pacman. All the [configuration files][16] are in /etc directory. In this example, I [use Nano text editor][17] but, you may use any [terminal-based text editor][18] of your choice. - -``` -sudo nano /etc/pacman.conf -``` - -Once you open the pacman configuration file, uncomment the “Color” to enable this feature. - -![][19] - -#### **Flip search order** - -The most relevant package according to your search term is normally displayed on the top of the search result. In paru, you can flip the search order to make your search easier. - -Similar to the previous example, open the paru configuration file: - -``` -sudo nano /etc/paru.conf -``` - -Uncomment the “BottomUp” term and save the file. - -![][20] - -As you can see the order is flipped and the first package appears on the bottom. - -![][21] - -#### **Edit PKGBUILDs** (For advanced user) - -If you are an experienced Linux user, you can edit AUR packages through paru. To do so, you need to enable the feature from the paru configuration file and set the file manager of your choice. - -In this example I will use the default in the configuration file i.e. the vifm file manager. If you haven’t used it you may need to install it. - -``` -sudo pacman -S vifm -sudo nano /etc/paru.conf -``` - -Open the configuration file and uncomment as shown below. - -![][22] - -Let’s go back to the [Google Calendar][23] AUR package and try to install it. You will be prompted to review the package. Type yes and click enter. - -![][24] - -Choose the PKGBUILD from the file manager and hit enter to view the package. - -![][25] - -Any change that you make will be permanent and the next time you upgrade the package, your changes will be merged with the upstream package. - -![][26] - -### Conclusion - -Paru is another interesting addition to the [AUR helpers family][27] with a promising future. At this point I wouldn’t suggest replacing yay as it is still maintained but definitely give paru a try. You can have both of them installed to your system and come to your own conclusions. - -To get the latest [Linux news][28], subscribe to our social media to be among the first to get them whilst they are fresh! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/paru-aur-helper/ - -作者:[Dimitrios Savvopoulos][a] -选题:[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://itsfoss.com/why-arch-linux/ -[2]: https://itsfoss.com/arch-based-linux-distros/ -[3]: https://itsfoss.com/aur-arch-linux/ -[4]: https://itsfoss.com/pacman-command/ -[5]: https://wiki.archlinux.org/index.php/PKGBUILD -[6]: https://news.itsfoss.com/qt-6-released/ -[7]: https://github.com/Morganamilo -[8]: https://www.reddit.com/r/archlinux/comments/jjn1c1/paru_v100_and_stepping_away_from_yay/ -[9]: https://github.com/Morganamilo/paru -[10]: https://www.rust-lang.org/ -[11]: https://golang.org/ -[12]: https://github.com/Jguer -[13]: https://aur.archlinux.org/packages/yay/#pinned-788241 -[14]: https://github.com/Morganamilo/paru/releases -[15]: https://github.com/Morganamilo/paru/releases/tag/v1.0.0 -[16]: https://linuxhandbook.com/linux-directory-structure/#-etc-configuration-files -[17]: https://itsfoss.com/nano-editor-guide/ -[18]: https://itsfoss.com/command-line-text-editors-linux/ -[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/pacman.conf-color.png?resize=800%2C480&ssl=1 -[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup.png?resize=800%2C480&ssl=1 -[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup-2.png?resize=800%2C480&ssl=1 -[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-vifm.png?resize=732%2C439&ssl=1 -[23]: https://aur.archlinux.org/packages/gcalcli/ -[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review.png?resize=800%2C480&ssl=1 -[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-2.png?resize=800%2C480&ssl=1 -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-3.png?resize=800%2C480&ssl=1 -[27]: https://itsfoss.com/best-aur-helpers/ -[28]: https://news.itsfoss.com/ diff --git a/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md b/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md new file mode 100644 index 0000000000..5ad643b667 --- /dev/null +++ b/translated/tech/20210203 Paru - A New AUR Helper and Pacman Wrapper Based on Yay.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Paru – A New AUR Helper and Pacman Wrapper Based on Yay) +[#]: via: (https://itsfoss.com/paru-aur-helper/) +[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) + +Paru – 基于 Yay 的新 AUR 助手及 Pacman 包装器 +====== + +[用户选择 Arch Linux][1] 或 [基于 Arch 的 Linux 发行版][2]的主要原因之一就是 [Arch 用户仓库(AUR)][3]。 + +遗憾的是,[pacman][4],也就是 Arch 的包管理器,不能以类似官方仓库的方式访问 AUR。AUR 中的包是以 [PKGBUILD][5] 的形式存在的,需要手动过程来构建。 + +AUR 助手可以自动完成这个过程。毫无疑问,[yay][6] 是最受欢迎和备受青睐的 AUR 助手之一。 + +最近,yay 的两位开发者之一的 [Morganamilo][7] [宣布][8]将退出 yay 的维护工作,以开始自己的 AUR 助手 [paru][9]。Paru 是用 [Rust][10] 编写的,而 yay 是用 [Go][11] 编写的,它的设计是基于 yay 的。 + +请注意,yay 还没有结束支持,它仍然由 [Jguer][12] 积极维护。他还[评论][13]说,paru 可能适合那些寻找丰富功能的 AUR 助手的用户。因此我推荐大家尝试一下。 + +### 安装 Paru AUR 助手 + +要安装 paru,打开你的终端,逐一输入以下命令。 + +``` +sudo pacman -S --needed base-devel +git clone https://aur.archlinux.org/paru.git +cd paru +makepkg -si +``` + +现在已经安装好了,让我们来看看如何使用它。 + +### 使用 Paru AUR 助手的基本命令 + +在我看来,这些都是 paru 最基本的命令。你可以在 [GitHub][9] 的官方仓库中探索更多。 + + * **paru <用户输入>**:搜索并安装<用户输入> + * **paru -**:paru -Syu 的别名 + * **paru -Sua** :仅升级 AUR 包。 + * **paru -Qua**:打印可用的 AUR 更新 + * **paru -Gc <用户输入>**:打印<用户输入>的 AUR 评论 + + + +### 充分使用 Paru AUR 助手 + +你可以在 GitHub 上访问 paru 的[更新日志][14]来查看完整的变更日志历史,或者你可以在[首次发布][15]中查看来自 yay 的更改。 + +#### 在 Paru 中启用颜色 + +要在 paru 中启用颜色,你必须先在 pacman 中启用它。所有的[配置文件][16]都在 /etc 目录下。在此例中,我[使用 Nano 文本编辑器][17],但是,你可以选择使用任何[基于终端的文本编辑器][18]。 + +``` +sudo nano /etc/pacman.conf +``` + +打开 pacman 配置文件后,取消 “Color” 的注释,即可启用此功能。 + +![][19] + +#### **反转搜索顺序** + +根据你的搜索条件,最相关的包通常会显示在搜索结果的顶部。在 paru 中,你可以反转搜索顺序,使你的搜索更容易。 + +与前面的例子类似,打开 paru 配置文件: + +``` +sudo nano /etc/paru.conf +``` + +取消注释 “BottomUp” 项,然后保存文件。 + +![][20] + +如你所见,顺序是反转的,第一个包出现在了底部。 + +![][21] + +#### **编辑 PKGBUILD** (对于高级用户) + +如果你是一个有经验的 Linux 用户,你可以通过 paru 编辑 AUR 包。要做到这一点,你需要在 paru 配置文件中启用该功能,并设置你所选择的文件管理器。 + +在此例中,我将使用配置文件中的默认值,即 vifm 文件管理器。如果你还没有使用过它,你可能需要安装它。 + +``` +sudo pacman -S vifm +sudo nano /etc/paru.conf +``` + +打开配置文件,如下所示取消注释。 + +![][22] + +让我们回到 [Google Calendar][23] 的 AUR 包,并尝试安装它。系统会提示你审查该软件包。输入 Y 并按下回车。 + +![][24] + +从文件管理器中选择 PKGBUILD,然后按下回车查看软件包。 + +![][25] + +你所做的任何改变都将是永久性的,下次升级软件包时,你的改变将与上游软件包合并。 + +![][26] + +### 总结 + +Paru 是 [AUR 助手家族][27]的又一个有趣的新成员,前途光明。此时,我不建议更换 yay,因为它还在维护,但一定要试试 paru。你可以把它们两个都安装到你的系统中,然后得出自己的结论。 + +要获得最新的 [Linux 新闻][28],请订阅我们的社交媒体,以便在第一时间获取新闻! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/paru-aur-helper/ + +作者:[Dimitrios Savvopoulos][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/dimitrios/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/why-arch-linux/ +[2]: https://itsfoss.com/arch-based-linux-distros/ +[3]: https://itsfoss.com/aur-arch-linux/ +[4]: https://itsfoss.com/pacman-command/ +[5]: https://wiki.archlinux.org/index.php/PKGBUILD +[6]: https://news.itsfoss.com/qt-6-released/ +[7]: https://github.com/Morganamilo +[8]: https://www.reddit.com/r/archlinux/comments/jjn1c1/paru_v100_and_stepping_away_from_yay/ +[9]: https://github.com/Morganamilo/paru +[10]: https://www.rust-lang.org/ +[11]: https://golang.org/ +[12]: https://github.com/Jguer +[13]: https://aur.archlinux.org/packages/yay/#pinned-788241 +[14]: https://github.com/Morganamilo/paru/releases +[15]: https://github.com/Morganamilo/paru/releases/tag/v1.0.0 +[16]: https://linuxhandbook.com/linux-directory-structure/#-etc-configuration-files +[17]: https://itsfoss.com/nano-editor-guide/ +[18]: https://itsfoss.com/command-line-text-editors-linux/ +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/pacman.conf-color.png?resize=800%2C480&ssl=1 +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup.png?resize=800%2C480&ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-bottomup-2.png?resize=800%2C480&ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru.conf-vifm.png?resize=732%2C439&ssl=1 +[23]: https://aur.archlinux.org/packages/gcalcli/ +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review.png?resize=800%2C480&ssl=1 +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-2.png?resize=800%2C480&ssl=1 +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/01/paru-proceed-for-review-3.png?resize=800%2C480&ssl=1 +[27]: https://itsfoss.com/best-aur-helpers/ +[28]: https://news.itsfoss.com/ \ No newline at end of file From 68aa5983a3fb14d7bed57b63cbc0d0ee14e0dc75 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 8 Feb 2021 10:05:31 +0800 Subject: [PATCH 153/213] translating --- sources/tech/20210129 Manage containers with Podman Compose.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210129 Manage containers with Podman Compose.md b/sources/tech/20210129 Manage containers with Podman Compose.md index ff652c2c2d..5a4c7f1449 100644 --- a/sources/tech/20210129 Manage containers with Podman Compose.md +++ b/sources/tech/20210129 Manage containers with Podman Compose.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ecce4841aed5a8ccfc65ce9d3707c97197ff5426 Mon Sep 17 00:00:00 2001 From: Hilton Chain <26847027+rakino@users.noreply.github.com> Date: Mon, 8 Feb 2021 19:11:04 +0800 Subject: [PATCH 154/213] translated --- ...0615 LaTeX Typesetting - Part 1 (Lists).md | 128 +++++++++--------- 1 file changed, 65 insertions(+), 63 deletions(-) rename {sources => translated}/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md (50%) diff --git a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md b/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md similarity index 50% rename from sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md rename to translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md index 662a093a57..450c83807e 100644 --- a/sources/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md +++ b/translated/tech/20200615 LaTeX Typesetting - Part 1 (Lists).md @@ -1,34 +1,36 @@ -[#]: collector: (lujun9972) -[#]: translator: (rakino) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LaTeX Typesetting – Part 1 (Lists)) -[#]: via: (https://fedoramagazine.org/latex-typesetting-part-1/) -[#]: author: (Earl Ramirez https://fedoramagazine.org/author/earlramirez/) +[#]: collector: "lujun9972" +[#]: translator: "rakino" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "LaTeX Typesetting – Part 1 (Lists)" +[#]: via: "https://fedoramagazine.org/latex-typesetting-part-1/" +[#]: author: "Earl Ramirez https://fedoramagazine.org/author/earlramirez/" -LaTeX Typesetting – Part 1 (Lists) +LaTeX 排版——第 1 部分:列表 ====== ![][1] -This series builds on the previous articles: [Typeset your docs with LaTex and TeXstudio on Fedora][2] and [LaTeX 101 for beginners][3]. This first part of the series is about LaTeX lists. - -### Types of lists - -LaTeX lists are enclosed environments, and each item in the list can take a line of text to a full paragraph. There are three types of lists available in LaTeX. They are: - - * **Itemized**: unordered or bullet - * **Enumerated**: ordered - * **Description**: descriptive +本系列基于前文 [Typeset your docs with LaTex and TeXstudio on Fedora][2] 和 [LaTeX 101 for beginners][3],本文即系列的第一部分是关于 LaTeX 列表的。 -### Creating lists +### 列表类型 -To create a list, prefix each list item with the \_item_ command. Precede and follow the list of items with the \_begin_{<type>} and \_end_{<type>} commands respectively where <type> is substituted with the type of the list as illustrated in the following examples. +LaTeX 中的列表是封闭的环境,列表中的每个项目可以取一行文字到一个完整的段落。在 LaTeX 中有三种列表类型: -#### Itemized list + * **itemize**: 无序列表unordered list/项目符号列表bullet list + * **enumerate**: 有序列表ordered list + * **description**: 描述列表descriptive list + + + +### 创建列表 + +要创建一个列表,需要在每个项目前加上控制序列 \\_item_,并在项目清单前后分别加上控制序列 \\_begin_{<类型>} 和 \\_end_{<类型>}(将其中的 <类型> 替换为将要使用的列表类型),如下例: + +#### itemize(无序列表) ``` \begin{itemize} @@ -40,7 +42,7 @@ To create a list, prefix each list item with the \_item_ command. Precede and fo ![][4] -#### Enumerated list +#### enumerate(有序列表) ``` \begin{enumerate} @@ -52,7 +54,7 @@ To create a list, prefix each list item with the \_item_ command. Precede and fo ![][5] -#### Descriptive list +#### description(描述列表) ``` \begin{description} @@ -63,13 +65,13 @@ To create a list, prefix each list item with the \_item_ command. Precede and fo ![][6] -### Spacing list items +### 列表项目间距 -The default spacing can be customized by adding \_usepackage{enumitem}_ to the preamble. The _enumitem_ package enables the _noitemsep_ option and the \_itemsep_ command which you can use on your lists as illustrated below. +可以通过在导言区加入 \\_usepackage{enumitem}_ 来自定义默认的间距,宏包 _enumitem_ 启用了选项 _noitemsep_ 和控制序列 \\_itemsep_ ,可以在列表中使用他们,如下例所示: -#### Using the noitemsep option +#### 使用选项 noitemsep -Enclose the _noitemsep_ option in square brackets and place it on the \_begin_ command as shown below. This option removes the default spacing. +将选项 _noitemsep_ 封闭在方括号内,并同下文所示放在控制序列 \\_begin_ 之后,该选项将移除默认的间距。 ``` \begin{itemize}[noitemsep] @@ -81,9 +83,9 @@ Enclose the _noitemsep_ option in square brackets and place it on the \_begin_ c ![][7] -#### Using the \itemsep command +#### 使用控制序列 \itemsep -The \_itemsep_ command must be suffixed with a number to indicate how much space there should be between the list items. +控制序列 \\_itemsep_ 必须以一个数字作为后缀,用以表示列表项目之间应该有多少空间。 ``` \begin{itemize} \itemsep0.75pt @@ -94,11 +96,11 @@ The \_itemsep_ command must be suffixed with a number to indicate how much space ![][8] -### Nesting lists +### 嵌套列表 -LaTeX supports nested lists up to four levels deep as illustrated below. +LaTeX 最多最多支持四层嵌套列表,如下例: -#### Nested itemized lists +#### 嵌套无序列表 ``` \begin{itemize}[noitemsep] @@ -122,7 +124,7 @@ LaTeX supports nested lists up to four levels deep as illustrated below. ![][9] -#### Nested enumerated lists +#### 嵌套有序列表 ``` \begin{enumerate}[noitemsep] @@ -146,32 +148,32 @@ LaTeX supports nested lists up to four levels deep as illustrated below. ![][10] -### List style names for each list type +### 每种列表类型的列表样式名称 -**Enumerated** | **Itemized** +**enumerate(有序列表)** | **itemize(无序列表)** ---|--- -\alph* | $\bullet$ -\Alph* | $\cdot$ -\arabic* | $\diamond$ -\roman* | $\ast$ -\Roman* | $\circ$ -| $-$ +\alph* (小写字母) | $\bullet$ (Bullet) +\Alph* (大写字母) | $\cdot$ (Period) +\arabic* (阿拉伯数字) | $\diamond$ (Diamond) +\roman* (小写罗马数字) | $\ast$ (Asterisk) +\Roman* (大写罗马数字) | $\circ$ (Circle) +| $-$ (Dash) -### Default style by list depth +### 按嵌套深度划分的默认样式 -**Level** | **Enumerated** | **Itemized** +**嵌套深度** | **enumerate(有序列表)** | **itemize(无序列表)** ---|---|--- -1 | Number | Bullet -2 | Lowercase alphabet | Dash -3 | Roman numerals | Asterisk -4 | Uppercase alphabet | Period +1 | 阿拉伯数字 | Bullet +2 | 小写字母 | Dash +3 | 小写罗马数字 | Asterisk +4 | 大写字母 | Period -### Setting list styles +### 设置列表样式 -The below example illustrates each of the different itemiszed list styles. +下面的例子列举了无序列表的不同样式。 ``` -% Itemize style +% 无序列表样式 \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond @@ -185,14 +187,14 @@ The below example illustrates each of the different itemiszed list styles. ![][11] -There are three methods of setting list styles. They are illustrated below. These methods are listed by priority; highest priority first. A higher priority will override a lower priority if more than one is defined for a list item. +有三种设置列表样式的方式,下面将按照优先级从高到低的顺序分别举例。 -#### List styling method 1 – per item +#### 方式一:为各项目单独设置 -Enclose the name of the desired style in square brackets and place it on the \_item_ command as demonstrated below. +将需要的样式名称封闭在方括号内,并放在控制序列 \\_item_ 之后,如下例: ``` -% First method +% 方式一 \begin{itemize} \item[$\ast$] Asterisk \item[$\diamond$] Diamond @@ -204,12 +206,12 @@ Enclose the name of the desired style in square brackets and place it on the \_i \end{itemize} ``` -#### List styling method 2 – on the list +#### 方式二:为整个列表设置 -Prefix the name of the desired style with _label=_. Place the parameter, including the _label=_ prefix, in square brackets on the \_begin_ command as demonstrated below. +将需要的样式名称以 _label=_ 前缀并封闭在方括号内,放在控制序列 _\begin_ 之后,如下例: ``` -% Second method +% 方式二 \begin{enumerate}[label=\Alph*.] \item Fedora 32 \item Fedora 31 @@ -217,23 +219,23 @@ Prefix the name of the desired style with _label=_. Place the parameter, includi \end{enumerate} ``` -#### List styling method 3 – on the document +#### 方式三:为整个文档设置 -This method changes the default style for the entire document. Use the \_renewcommand_ to set the values for the labelitems. There is a different labelitem for each of the four label depths as demonstrated below. +该方式将改变整个文档的默认样式。使用 \\_renewcommand_ 来设置项目标签的值,下例分别为四个嵌套深度的项目标签设置了不同的样式。 ``` -% Third method +% 方式三 \renewcommand{\labelitemi}{$\ast$} \renewcommand{\labelitemii}{$\diamond$} \renewcommand{\labelitemiii}{$\bullet$} \renewcommand{\labelitemiv}{$-$} ``` -### Summary +### 总结 -LaTeX supports three types of lists. The style and spacing of each of the list types can be customized. More LaTeX elements will be explained in future posts. +LaTeX 支持三种列表,而每种列表的风格和间距都是可以自定义的。在以后的文章中,我们将解释更多的 LaTeX 元素。 -Additional reading about LaTeX lists can be found here: [LaTeX List Structures][12] +关于 LaTeX 列表的延伸阅读可以在这里找到:[LaTeX List Structures][12] -------------------------------------------------------------------------------- From 51ccb29b5cd76f2b0c34dfd883dcd23c75dac7b5 Mon Sep 17 00:00:00 2001 From: LazyWolfLin Date: Mon, 8 Feb 2021 22:21:27 +0800 Subject: [PATCH 155/213] Revert. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 查找资料时发现该文章已有[翻译](https://studygolang.com/articles/28992),因此取消申请。 --- .../tech/20200524 Diamond interface composition in Go 1.14.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200524 Diamond interface composition in Go 1.14.md b/sources/tech/20200524 Diamond interface composition in Go 1.14.md index 34ad6bd5cd..611bb2c39e 100644 --- a/sources/tech/20200524 Diamond interface composition in Go 1.14.md +++ b/sources/tech/20200524 Diamond interface composition in Go 1.14.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (LazyWolfLin) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 9e0bc965cacb8ff54e3d780cc8d3af15ff2d973c Mon Sep 17 00:00:00 2001 From: Percy Date: Tue, 9 Feb 2021 00:58:35 +0800 Subject: [PATCH 156/213] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87:?= =?UTF-8?q?=20Why=20the=20success=20of=20open=20source=20depends=20on=20em?= =?UTF-8?q?pathy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0210207 Why the success of open source depends on empathy.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210207 Why the success of open source depends on empathy.md b/sources/talk/20210207 Why the success of open source depends on empathy.md index cc2219187e..8ad1d941b2 100644 --- a/sources/talk/20210207 Why the success of open source depends on empathy.md +++ b/sources/talk/20210207 Why the success of open source depends on empathy.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (scvoet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c4fb5ef50baf84536d441ef6b97d898a9c669674 Mon Sep 17 00:00:00 2001 From: Percy Date: Tue, 9 Feb 2021 02:09:07 +0800 Subject: [PATCH 157/213] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87:?= =?UTF-8?q?=2020210207=20Why=20the=20success=20of=20open=20source=20depend?= =?UTF-8?q?s=20on=20empathy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ccess of open source depends on empathy.md | 58 ------------------- ...ccess of open source depends on empathy.md | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 sources/talk/20210207 Why the success of open source depends on empathy.md create mode 100644 translated/talk/20210207 Why the success of open source depends on empathy.md diff --git a/sources/talk/20210207 Why the success of open source depends on empathy.md b/sources/talk/20210207 Why the success of open source depends on empathy.md deleted file mode 100644 index 8ad1d941b2..0000000000 --- a/sources/talk/20210207 Why the success of open source depends on empathy.md +++ /dev/null @@ -1,58 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (scvoet) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why the success of open source depends on empathy) -[#]: via: (https://opensource.com/article/21/2/open-source-empathy) -[#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) - -Why the success of open source depends on empathy -====== -With heightened awareness about empathy and the inspiration to spread -it, open source productivity will grow, collaborators will lean in, and -the power of open source software development can be fully harnessed. -![Practicing empathy][1] - -Open source development's collaborative innovation and community ethos have changed the world. In [_The Open Organization_][2], Jim Whitehurst explains that success in open source is found by "thinking of people as members of a community, moving from a transactional mindset to one built on commitment." However, there is still a barrier at the core of the open source development model: Frequently, it lacks human empathy. - -Empathy is the ability to understand and share another person's feelings. In open source communities, face-to-face human interaction and collaboration are rare. Any developer experienced with a GitHub pull request (PR) or issue has received comments from people they may never meet, often halfway across the globe—and the communication can be just as distant. Modern open source development is built upon this type of asynchronous, transactional communication. So, it is no surprise that the same types of cyberbullying and other abuses people experience on social media platforms are also seen in open source communities. - -Of course, not all open source communication is counterproductive. Many people develop respect and commit to good behavioral standards in their craft. But all too often, people lack common-sense etiquette in communications and treat people like machines rather than human beings. This behavior is a barrier to realizing the open source innovation model's full potential because it turns off many would-be contributors and kills inspiration. - -### A history of hostile communications - -Hostile rhetoric in code reviews is not new to open source communities; it has been tolerated for years. The godfather of open source, Linus Torvalds, routinely [barraged][3] the Linux community when code did not meet his standards, driving contributors away. Elon University computer science professor Megan Squire used [machine learning][4] to analyze Torvalds' insults and found they numbered in the thousands during a four-year period. In 2018, Linus put himself on a timeout for bad behavior, tasked himself with learning empathy, apologized, and established a code of conduct for the Linux community. - -In 2015, [Sage Sharp][5] stepped down as the Linux kernel coordinator for the FOSS Outreach Program for Women due to a lack of personal respect, despite being technically respected. - -The impact of disparaging comments in PR reviews has a profound effect on developers. It creates trepidation in making PRs and dread at anticipated feedback, and it eats at developers' confidence in their abilities. It slows velocity by forcing engineers to strive for perfection every time, which runs counter to the agile methodology many communities have adopted. - -### How to close the empathy gap in open source - -Often, offensive comments are unintentional, and with some coaching, the author can learn how to express opinions without negative emotion. GitHub does not monitor comments on issues and PRs for abusive content; instead, it provides tools to enable communities to moderate their content. Repo owners can delete comments and lock conversations, and all contributors can report abuse and block users. - -Defining a community code of conduct establishes a safe and inclusive environment for contributors at all levels to participate and defines the process to de-escalate conflict between collaborators. - -We can overcome the empathy challenge in open source. Face-to-face debate is much more conducive to empathy than text, so opt for a video call when possible. Set an example by sharing feedback in an empathetic way. Be a coach instead of a bystander if you witness a scathing review. Speak up if you are the victim. Assess empathy skills when interviewing a candidate. Tie empathy skills to performance reviews and rewards. Define and enforce a community code of conduct, and moderate your community. - -With heightened awareness about empathy and the inspiration to spread it, open source productivity will grow, collaborators will lean in, and the power of open source software development can be fully harnessed. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/2/open-source-empathy - -作者:[Bronagh Sorota][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/bsorota -[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.redhat.com/en/explore/the-open-organization-book -[3]: https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ -[4]: http://flossdata.syr.edu/data/insults/hicssInsultsv2.pdf -[5]: https://en.wikipedia.org/wiki/Sage_Sharp diff --git a/translated/talk/20210207 Why the success of open source depends on empathy.md b/translated/talk/20210207 Why the success of open source depends on empathy.md new file mode 100644 index 0000000000..db24502474 --- /dev/null +++ b/translated/talk/20210207 Why the success of open source depends on empathy.md @@ -0,0 +1,58 @@ +[#]: collector: (lujun9972) +[#]: translator: (scvoet) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why the success of open source depends on empathy) +[#]: via: (https://opensource.com/article/21/2/open-source-empathy) +[#]: author: (Bronagh Sorota https://opensource.com/users/bsorota) + +为何开源的成功取决于同理心? +====== +随着人们对同理心认识的提高和传播的启发。 +它——开源的生产力会增长,合作者们会靠拢。 +而且,可以充分利用开源软件开发的力量。 +![践行共情][1] + +开源开发的协调创新精神和社区精神改变了世界。吉姆·怀特赫斯特(Jim Whitehurst)在[《开放式组织》][2]中解释说,开源的成功源于“将人们视为社区的一份子,从交易思维转变为基于承诺基础的思维方式”。 但是,开源开发模型的核心仍然存在障碍:它经常性地缺乏人们的同理心。 + +同理心是理解或感受他人感受的能力。在开源社区中,面对面的人际互动和协作是否罕见。任何在 GitHub 提交过请求 (Pull request) 或问题 (Issues) 的开发者都曾收到过可能来自他们可能从未见过的人的评论,这些人往往身处地球的另一端,而他们的交流也可能同样遥远。现代开源开发就是建立在这种异步、事务性的沟通基础之上。因此,人们在社交媒体平台上所经历的同类型的网络欺凌和其他虐待行为在开源社区中也不足为奇。 + +当然,并非所有开源交流都会事与愿违。许多人在工作中发展出了尊重并秉持着良好的行为标准。但是很多时候,人们的沟通也常常缺失了常识性的礼节,他们将人们像机器而非人类一般对待。这种行为是激发开源创新模型全部潜力的障碍,因为它让许多潜在的贡献者望而却步,并扼杀了灵感。 + +### 恶意交流的历史 + +代码审查中存在的敌意言论对开源社区来说并不新鲜,它多年来一直被社区所容忍。开源教父莱纳斯·托瓦尔兹 (Linus Torvalds) 经常在代码不符合他的标准时[抨击][3] Linux 社区,并将贡献者赶走。埃隆大学计算机科学教授梅根·斯奎尔(Megan Squire)借助[机器学习][4]分析了托瓦尔兹的侮辱行为,发现它们在四年内的数量高达数千次。2018 年,莱纳斯因自己的不良行为而将自己搁置,责成自己学习同理心,道歉并为 Linux 社区制定了行为准则。 + +2015 年,[赛格·夏普][5]虽然在技术上受人尊重,但因其缺乏对个人的尊重,被辞去了 FOSS 女性外展计划中的 Linux 内核协调员一职。 + +PR 审核中存在的贬低性评论对开发者会造成深远的影响。它导致开发者在提交 PR 时产生畏惧感,让他们对预期中的反馈感到恐惧。这吞噬了开发者对自己能力的信心。它逼迫工程师每次都只能追求完美,从而减缓了开发速度,这与许多社区采用的敏捷方法论背道而驰。 + +### 如何拉近开源中的共情缺口? + +通常情况下,冒犯的评论常是无意间的,而通过一些指导,作者则可以学会如何在不带负面情绪的情况下表达意见。GitHub 不会监控问题和 PR 的评论是否有滥用内容,相反,它提供了一些工具,使得社区能够对其内容进行审查。所有者可以删除评论和锁定对话,所有贡献者可以报告滥用和阻止用户。 + +制定社区行为准则可为所有级别的贡献者提供一个安全且包容的环境,并且能让所有级别的贡献者参与并定义降低协作者之间冲突的过程。 + +我们能够克服开源中存在的共情问题。面对面的辩论比文字更有利于产生共鸣,所以尽可能选择视频通话。通过共情分享反馈来树立榜样。如果你目睹了一个尖锐的评论,请做一个指导员而非旁观者。如果你是受害者,请大声说出来。在面试候选人时,评估共情能力,并将共情能力与绩效评估和奖励挂钩。界定并执行社区行为准则,并管理好你的社区。 + +随着人们对移情意识的了解的加深和灵感的传播,开源生产力将得到提升,协作者将有所作为,并且可以充分激发开源软件开发的活力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-empathy + +作者:[Bronagh Sorota][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/bsorota +[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.redhat.com/en/explore/the-open-organization-book +[3]: https://arstechnica.com/information-technology/2013/07/linus-torvalds-defends-his-right-to-shame-linux-kernel-developers/ +[4]: http://flossdata.syr.edu/data/insults/hicssInsultsv2.pdf +[5]: https://en.wikipedia.org/wiki/Sage_Sharp From cfd2739601055a3f2e6de04f353f4fb208ac741e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:03:34 +0800 Subject: [PATCH 158/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?Fedora=20Aarch64=20on=20the=20SolidRun=20HoneyComb=20LX2K?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md --- ... Aarch64 on the SolidRun HoneyComb LX2K.md | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md diff --git a/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md b/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md new file mode 100644 index 0000000000..e060ca66fa --- /dev/null +++ b/sources/tech/20210208 Fedora Aarch64 on the SolidRun HoneyComb LX2K.md @@ -0,0 +1,219 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Fedora Aarch64 on the SolidRun HoneyComb LX2K) +[#]: via: (https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/) +[#]: author: (John Boero https://fedoramagazine.org/author/boeroboy/) + +Fedora Aarch64 on the SolidRun HoneyComb LX2K +====== + +![][1] + +Photo by [Tim Mossholder][2] on [Unsplash][3] + +Almost a year has passed since the [HoneyComb][4] development kit was released by SolidRun. I remember reading about this Mini-ITX Arm workstation board being released and thinking “what a great idea.” Then I saw the price and realized this isn’t just another Raspberry Pi killer. Currently that price is $750 USD plus shipping and duty. Niche devices like the HoneyComb aren’t mass produced like the simpler Pi is, and they pack in quite a bit of high end tech. Eventually COVID lockdown boredom got the best of me and I put a build together. Adding a case and RAM, the build ended up costing about $1100 shipped to London. This is a recount of my experiences and the current state of using Fedora on this fun bit of hardware. + +First and foremost, the tech packed into this board is impressive. It’s not about to kill a Xeon workstation in raw performance but it’s going to wallop it in performance/watt efficiency. Essentially this is a powerful server in the energy footprint of a small laptop. It’s also a powerful hybrid of compute and network functionality, combining powerful network features in a carrier board with modular daughter card sporting a 16-core A72 with 2 ECC-capable DDR4 SO-DIMM slots. The carrier board comes in a few editions, giving flexibility to swap or upgrade your RAM + CPU options. I purchased the edition pictured below with 16 cores, 32GB (non-ECC), 512GB NVMe, and 4x10Gbe. For an extra $250 you can add the 100Gbe option if you’re building a 5G deployment or an ISP for a small country (bottom right of board). Imagine this jacked into a 100Gb uplink port acting as proxy, tls inspector, router, or storage for a large 10gb TOR switch. + +![][5] + +When I ordered it I didn’t fully understand the network co processor included from NXP. NXP is the company that makes the unique [LX2160A][6] CPU/SOC for this as well as configurable ports and offload engine that enable handling up to 150Gb/s of network traffic without the CPU breaking a sweat. Here is a list of options from NXP’s Layerscape user manual. + +![Configure ports in switch, LAG, MUX mode, or straight NICs.][7] + +I have a 10gb network in my home attic via a Ubiquiti ES-16-XG so I was eager to see how much this board could push. I also have a QNAP connected via 10gb which rarely manages to saturate the line, so could this also be a NAS replacement? It turned out I needed to sort out drivers and get a stable install first. Since the board has been out for a year, I had some catching up to do. SolidRun keeps an active Discord on [Developer-Ecosystem][8] which was immensely helpful as install wasn’t as straightforward as previous blogs have mentioned. I’ve always been cursed. If you’ve ever seen Pure Luck, I’m bound to hit every hardware glitch. + +![][9] + +For starters, you can add a GPU and install graphically or install via USB console. I started with a spare GPU (Radeon Pro WX2100) intending to build a headless box which in the end over-complicated things. If you need to swap parts or re-flash a BIOS via the microSD card, you’ll need to swap display, keyboard + mouse. Chaos. Much simpler just to plug into the micro USB console port and access it via /dev/ttyUSB0 for that picture-in-picture experience. It’s really great to have the open ended PCIe3-x8 slot but I’ll keep it open for now. Note that the board does not support PCIe Atomics so some devices may have compatibility issues. + +Now comes the fun part. BIOS is not built-in here. You’ll need to [build][10] from source for to your RAM speed and install via microSDHC. At first this seems annoying but then you realize that with removable BIOS installer it’s pretty hard to brick this thing. Not bad. The good news is the latest UEFI builds have worked well for me. Just remember that every time you re-flash your BIOS you’ll need to set everything up again. This was enough to boot Fedora aarch64 from USB. The board offers 64GB of eMMC flash which you can install to if you like. I immediately benched it to find it reads about 165MB/s and writes 55MB/s which is practical speed for embedded usage but I’ll definitely be installing to NVMe instead. I had an older Samsung 950 Pro in my spares from a previous Linux box but I encountered major issues with it even with the widely documented kernel param workaround: +``` + +``` + +nvme_core.default_ps_max_latency_us=0 +``` + +``` + +In the end I upgraded my main workstation so I could repurpose its existing Samsung EVO 960 for the HoneyComb which worked much better. + +After some fidgeting I was able to install Fedora but it became apparent that the integrated network ports still don’t work with the mainline kernel. The NXP tech is great but requires a custom kernel build and tooling. Some earlier blogs got around this with a USB->RJ45 Ethernet adapter which works fine. Hopefully network support will be mainlined soon, but for now I snagged a kernel SRPM from the helpful engineers on Discord. With the custom kernel the 1Gbe NIC worked fine, but it turns out the SFP+ ports need more configuration. They won’t be recognized as interfaces until you use NXP’s _restool_ utility to map ports to their usage. In this case just a runtime mapping of _dmap -> dni_ was required. This is NXP’s way of mapping a MAC to a network interface via IOCTL commands. The restool binary isn’t provided either and must be built from source. It then layers on management scripts which use cheeky $arg0 references for redirection to call the restool binary with complex arguments. + +Since I was starting to accumulate quite a few custom packages it was apparent that a COPR repo was needed to simplify this for Fedora. If you’re not familiar with COPR I think it’s one of Fedora’s finest resources. This repo contains the uefi build (currently failing build), 5.10.5 kernel built with network support, and the restool binary with supporting scripts. I also added a oneshot systemd unit to enable the SFP+ ports on boot: +``` + +``` + +systemd enable --now [dpmac@7.service][11] +systemd enable --now [dpmac@8.service][12] +systemd enable --now [dpmac@9.service][13] +systemd enable --now [dpmac@10.service][14] +``` + +``` + +Now each SPF+ port will boot configured as eth1-4, with eth0 being the 1Gb. NetworkManager will struggle unless these are consistent, and if you change the service start order the eth devices will re-order. I actually put a sleep $@ in each activation so they are consistent and don’t have locking issues. Unfortunately it adds 10 seconds to boot time. This has been fixed in the latest kernel and won’t be an issue once mainlined. + +![][15] + +I’d love to explore the built-in LAG features but this still needs to be coded into the + +restool + +options. I’ll save it for later. In the meantime I managed a single 10gb link as primary, and a 3×10 LACP Team for kicks. Eventually I changed to 4×10 LACP via copper SFP+ cables mounted in the attic. + +### Energy Efficiency + +Now with a stable environment it’s time to raise some hell. It’s really nice to see PWM support was recently added for the CPU fan, which sounds like a mini jet engine without it. Now the sound level is perfectly manageable and thermal control is automatic. Time to test drive with a power meter. Total power usage is consistently between 20-40 watts (usually in the low 20s) which is really impressive. I tried a few _tuned_ profiles which didn’t seem to have much effect on energy. If you add a power-hungry GPU or device that can obviously increase but for a dev server it’s perfect and well below the Z600 workstations I have next to it which consume 160-250 watts each when fired up. + +### Remote Access + +I’m an old soul so I still prefer KDE with Xorg and NX via X2go server. I can access SSH or a full GUI at native performance without a GPU. This lets me get a feel for performance, thermal stats, and also helps to evaluate the device as a workstation or potential VDI. The version of KDE shipped with the aarch64 server spin doesn’t seem to recognize some sensors but that seems to be because of KDE’s latest widget changes which I’d have to dig into. + +![X2go KDE session over SSH][16] + +Cockpit support is also outstanding out of the box. If SSH and X2go remote access aren’t your thing, Cockpit provides a great remote management platform with a growing list of plugins. Everything works great in my experience. + +![Cockpit behaves as expected.][17] + +All I needed to do now is shift into high gear with jumbo frames. MTU 1500 yields me an iperf of about 2-4Gbps bottlenecked at CPU0. Ain’t nobody got time for that. Set MTU 9000 and suddenly it gets the full 10Gbps both ways with time to spare on the CPU. Again, it would be nice to use the hardware assisted LAG since the device is supposed to handle up to 150Gbps duplex no sweat (with the 100Gbe QSFP option), which is nice given the Ubiquiti ES-16-XG tops out at 160Gbps full duplex (10gb/16 ports). + +### Storage + +As a storage solution this hardware provides great value in a small thermal window and energy saving footprint. I could accomplish similar performance with an old x86 box for cheap but the energy usage alone would eclipse any savings in short order. By comparison I’ve seen some consumer NAS devices offer 10Gbe and NVMe cache sharing an inadequate number of PCIe2 lanes and bottlenecked at the bus. This is fully customizable and since the energy footprint is similar to a small laptop a small UPS backup should allow full writeback cache mode for maximum performance. This would make a great oVirt NFS or iSCSI storage pool if needed. I would pair it with a nice NAS case or rack mount case with bays. Some vendors such as [Bamboo][18] are actually building server options around this platform as we speak. + +The board has 4 SATA3 ports but if I were truly going to build a NAS with this I would probably add a RAID card that makes best use of the PCIe8x slot, which thankfully is open ended. Why some hardware vendors choose to include close-ended PCIe 8x,4x slots is beyond me. Future models will ship with a physical x16 slot but only 8x electrically. Some users on the SolidRun Discord talk about bifurcation and splitting out the 8 PCIe lanes which is an option as well. Note that some of those lanes are also reserved for NVMe, SATA, and network. The CEX7 form factor and interchangeable carrier board presents interesting possibilities later as the NXP LX2160A docs claim to support up to 24 lanes. For a dev board it’s perfectly fine as-is. + +### Network Perf + +For now I’ve managed to rig up a 4×10 LACP Team with NetworkManager for full load balancing. This same setup can be done with a QSFP+ breakout cable. KDE nm Network widget still doesn’t support Teams but I can set them up via nm-connection-editor or Cockpit. Automation could be achieved with _nmcli_ and _teamdctl_. An iperf3 test shows the connection maxing out at about 13Gbps to/from the 2×10 LACP team on my workstation. I know that iperf isn’t a true indication of real-world usage but it’s fun for benchmarks and tuning nonetheless. This did in fact require a lot of tuning and at this point I feel like I could fill a book just with iperf stats. + +``` +$ iperf3 -c honeycomb -P 4 --cport 5000 -R +Connecting to host honeycomb, port 5201 +Reverse mode, remote host honeycomb is sending +[ 5] local 192.168.2.10 port 5000 connected to 192.168.2.4 port 5201 +[ 7] local 192.168.2.10 port 5001 connected to 192.168.2.4 port 5201 +[ 9] local 192.168.2.10 port 5002 connected to 192.168.2.4 port 5201 +[ 11] local 192.168.2.10 port 5003 connected to 192.168.2.4 port 5201 +[ ID] Interval Transfer Bitrate +[ 5] 1.00-2.00 sec 383 MBytes 3.21 Gbits/sec +[ 7] 1.00-2.00 sec 382 MBytes 3.21 Gbits/sec +[ 9] 1.00-2.00 sec 383 MBytes 3.21 Gbits/sec +[ 11] 1.00-2.00 sec 383 MBytes 3.21 Gbits/sec +[SUM] 1.00-2.00 sec 1.49 GBytes 12.8 Gbits/sec +- - - - - - - - - - - - - - - - - - - - - - - - - +(TRUNCATED) +- - - - - - - - - - - - - - - - - - - - - - - - - +[ 5] 2.00-3.00 sec 380 MBytes 3.18 Gbits/sec +[ 7] 2.00-3.00 sec 380 MBytes 3.19 Gbits/sec +[ 9] 2.00-3.00 sec 380 MBytes 3.18 Gbits/sec +[ 11] 2.00-3.00 sec 380 MBytes 3.19 Gbits/sec +[SUM] 2.00-3.00 sec 1.48 GBytes 12.7 Gbits/sec +- - - - - - - - - - - - - - - - - - - - - - - - - +[ ID] Interval Transfer Bitrate Retr +[ 5] 0.00-10.00 sec 3.67 GBytes 3.16 Gbits/sec 1 sender +[ 5] 0.00-10.00 sec 3.67 GBytes 3.15 Gbits/sec receiver +[ 7] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec 7 sender +[ 7] 0.00-10.00 sec 3.67 GBytes 3.15 Gbits/sec receiver +[ 9] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec 36 sender +[ 9] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec receiver +[ 11] 0.00-10.00 sec 3.69 GBytes 3.17 Gbits/sec 1 sender +[ 11] 0.00-10.00 sec 3.68 GBytes 3.16 Gbits/sec receiver +[SUM] 0.00-10.00 sec 14.7 GBytes 12.6 Gbits/sec 45 sender +[SUM] 0.00-10.00 sec 14.7 GBytes 12.6 Gbits/sec receiver + +iperf Done +``` + +### Notes on iperf3 + +I struggled with LACP Team configuration for hours, having done this before with an HP cluster on the same switch. I’d heard stories about bonds being old news with team support adding better load balancing to single TCP flows. This still seems bogus as you still can’t load balance a single flow with a team in my experience. Also LACP claims to be fully automated and easier to set up than traditional load balanced trunks but I find the opposite to be true. For all it claims to automate you still need to have hashing algorithms configured correctly at switches and host. With a few quirks along the way I once accidentally left a team in broadcast mode (not LACP) which registered duplicate packets on the iperf server and made it look like a single connection was getting double bandwidth. That mistake caused confusion as I tried to reproduce it with LACP. + +Then I finally found the LACP hash settings in Ubiquiti’s new firmware GUI. It’s hidden behind a tiny pencil icon on each LAG. I managed to set my LAGs to hash on Src+Dest IP+port when they were defaulting to MAC/port. Still I was only seeing traffic on one slave of my 2×10 team even with parallel clients. Eventually I tried parallel clients with -V and it all made sense. By default iperf3 client ports are ephemeral but they follow an even sequence: 42174, 42176, 42178, 42180, etc… If your lb hash across a pair of sequential MACs includes src+dst port but those ports are always even, you’ll never hit the other interface with an odd MAC. How crazy is that for iperf to do? I tried looking at the source for iperf3 and I don’t even see how that could be happening. Instead if you specify a client port as well as parallel clients, they use a straight sequence: 50000, 50001, 50002, 50003, etc.. With odd+even numbers in client ports, I’m finally able to LB across all interfaces in all LAG groups. This setup would scale out well with more clients on the network. + +![Proper LACP load balancing.][19] + +Everything could probably be tuned a bit better but for now it is excellent performance and it puts my QNAP to shame. I’ll continue experimenting with the network co-processor and seeing if I can enable the native LAG support for even better performance. Across the network I would expect a practical peak of about 40 Gbps raw which is great. + +![][20] + +### Virtualization + +What about virt? One of the best parts about having a 16 A72 cores is support for Aarch64 VMs at full speed using KVM, which you won’t be able to do on x86. I can use this single box to spin up a dozen or so VMs at a time for CI automation and testing, or just to test our latest HashiCorp builds with aarch64 builds on COPR. Qemu on x86 without KVM can emulate aarch64 but crawls by comparison. I’ve not yet tried to add it to an oVirt cluster yet but it’s really snappy actually and proves more cost effective than spinning up Arm VMs in a cloud. One of the use cases for this environment is NFV, and I think it fits it perfectly so long as you pair it with ECC RAM which I skipped as I’m not running anything critical. If anybody wants to test drive a VM DM me and I’ll try to get you some temp access. + +![Virtual Machines in Cockpit][21] + +### Benchmarks + +[Phoronix][22] has already done quite a few benchmarks on [OpenBenchmarking.org][23] but I wanted to rerun them with the latest versions on my own Fedora 33 build for consistency. I also wanted to compare them to my Xeons which is not really a fair comparison. Both use DDR4 with similar clock speeds – around 2Ghz but different architectures and caches obviously yield different results. Also the Xeons are dual socket which is a huge cooling advantage for single threaded workloads. You can watch one process bounce between the coolest CPU sockets. The Honeycomb doesn’t have this luxury and has a smaller fan but the clock speed is playing it safe and slow at 2Ghz so I would bet the SoC has room to run faster if cooling were adjusted. I also haven’t played with the PWM settings to adjust the fan speed up just in case. Benchmarks performed using the tuned profile network-throughput. + +Strangely some single core operations seem to actually perform better on the Honeycomb than they do on my Xeons. I tried single-threaded zstd compression with default level 3 on a a few files and found it actually performs consistently better on the Honeycomb. However using the actual pts/compress-zstd benchmark with multithreaded option turns the tables. The 16 cores still manage an impressive **2073** MB/s: +``` + +``` + +Zstd Compression 1.4.5: +   pts/compress-zstd-1.2.1 &#91;Compression Level: 3] +   Test 1 of 1 +   Estimated Trial Run Count:    3                       +   Estimated Time To Completion: 9 Minutes &#91;22:41 UTC]   +       Started Run 1 @ 22:33:02 +       Started Run 2 @ 22:33:53 +       Started Run 3 @ 22:34:37 +   Compression Level: 3: +2079.3 +2067.5 +       2073.9 +   Average: 2073.57 MB/s +``` + +``` + +For apples to oranges comparison my 2×10 core Xeon E5-2660 v3 box does **2790** MB/s, so 2073 seems perfectly respectable as a potential workstation. Paired with a midrange GPU this device would also make a great video transcoder or media server. Some users have asked about mining but I wouldn’t use one of these for mining crypto currency. The lack of PCIe atomics means certain OpenCL and CUDA features might not be supported and with only 8 PCIe lanes exposed you’re fairly limited. That said it could potentially make a great mobile ML, VR, IoT, or vision development platform. The possibilities are pretty open as the whole package is very well balanced and flexible. + +### Conclusion + +I wasn’t organized enough this year to arrange a FOSDEM visit but this is something I would have loved to talk about. I’m definitely glad I tried out. Special thanks to Jon Nettleton and the folks on SolidRun’s Discord for the help and troubleshooting. The kit is powerful and potentially replaces a lot of energy waste in my home lab. It provides a great Arm platform for development and it’s great to see how solid Fedora’s alternative architecture support is. I got my Linux start on Gentoo back in the day, but Fedora really has upped it’s arch game. I’m really glad I didn’t have to sit waiting for compilation on a proprietary platform. I look forward to the remaining patches to be mainlined into the Fedora kernel and I hope to see a few more generations use this package, especially as Apple goes all in on Arm. It will also be interesting to see what features emerge if Nvidia’s Arm acquisition goes through. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-aarch64-on-the-solidrun-honeycomb-lx2k/ + +作者:[John Boero][a] +选题:[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/boeroboy/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/02/honeycomb-fed-aarch64-816x346.jpg +[2]: https://unsplash.com/@timmossholder?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/honeycombs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: http://solid-run.com/arm-servers-networking-platforms/honeycomb-workstation/#overview +[5]: https://www.solid-run.com/wp-content/uploads/2020/11/HoneyComb-layout-front.png +[6]: https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/layerscape-processors/layerscape-lx2160a-processor:LX2160A +[7]: https://communityblog.fedoraproject.org/wp-content/uploads/2021/02/image-894x1024.png +[8]: https://discord.com/channels/620838168794497044 +[9]: https://i.imgflip.com/11c7o.gif +[10]: https://github.com/SolidRun/lx2160a_uefi +[11]: mailto:dpmac@7.service +[12]: mailto:dpmac@8.service +[13]: mailto:dpmac@9.service +[14]: mailto:dpmac@10.service +[15]: https://communityblog.fedoraproject.org/wp-content/uploads/2021/02/image-2-1024x403.png +[16]: https://communityblog.fedoraproject.org/wp-content/uploads/2021/02/Screenshot_20210202_112051-1024x713.jpg +[17]: https://fedoramagazine.org/wp-content/uploads/2021/02/image-2-1024x722.png +[18]: https://www.bamboosystems.io/b1000n/ +[19]: https://fedoramagazine.org/wp-content/uploads/2021/02/image-4-1024x245.png +[20]: http://systems.cs.columbia.edu/files/kvm-arm-logo.png +[21]: https://fedoramagazine.org/wp-content/uploads/2021/02/image-1024x717.png +[22]: https://www.phoronix.com/scan.php?page=news_item&px=SolidRun-ClearFog-ARM-ITX +[23]: https://openbenchmarking.org/result/1905313-JONA-190527343&obr_sor=y&obr_rro=y&obr_hgv=ClearFog-ITX From 7d315d3d01a692e90ae552c8b7284c82c7f116ce Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:04:50 +0800 Subject: [PATCH 159/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210209=20?= =?UTF-8?q?Viper=20Browser:=20A=20Lightweight=20Qt5-based=20Web=20Browser?= =?UTF-8?q?=20With=20A=20Focus=20on=20Privacy=20and=20Minimalism?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md --- ... With A Focus on Privacy and Minimalism.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md diff --git a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md new file mode 100644 index 0000000000..02751230d0 --- /dev/null +++ b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md @@ -0,0 +1,108 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism) +[#]: via: (https://itsfoss.com/viper-browser/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Viper Browser: A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism +====== + +_**Brief: Viper Browser is a Qt-based browser that offers a simple user experience keeping privacy in mind.**_ + +While the majority of the popular browsers run on top of Chromium, unique alternatives like [Firefox][1], [Beaker Browser][2], and some other [chrome alternatives][3] should not cease to exist. + +Especially, considering Google’s recent potential thought of stripping [Google Chrome-specific features from Chromium][4] giving an excuse of abuse. + +In the look-out for more Chrome alternatives, I came across an interesting project “[Viper Browser][5]” as per our reader’s suggestion on [Mastodon][6]. + +### Viper Browser: An Open-Source Qt5-based Browser + +_**Note**: Viper Browser is fairly a new project with a couple of contributors. It lacks certain features which I’ll be mentioning as you read on._ + +![][7] + +Viper is an interesting web browser that focuses on being a powerful yet lightweight option while utilizing [QtWebEngine][8]. + +QtWebEngine borrows the code from Chromium but it does not include the binaries and services that connect to the Google platform. + +I spent some time using it and performing some daily browsing activities and I must say that I’m quite interested. Not just because it is something simple to use (how complicated a browser can be), but it also focuses on enhancing your privacy by giving you the option to add different Ad blocking options along with some useful options. + +![][9] + +Even though I think it is not meant for everyone, it is still worth taking a look. Let me highlight the features briefly before you can proceed trying it out. + +### Features of Viper Browser + +![][10] + +I’ll list some of the key features that you can find useful: + + * Ability to manage cookies + * Multiple preset options to choose different Adblocker networks + * Simple and easy to use + * Privacy-friendly default search engine – [Startpage][11] (you can change this) + * Ability to add user scripts + * Ability to add new user agents + * Option to disable JavaScript + * Ability to prevent images from loading up + + + +In addition to all these highlights, you can easily tweak the privacy settings to remove your history, clean cookies when existing, and some more options. + +![][12] + +### Installing Viper Browser on Linux + +It just offers an AppImage file on its [releases section][13] that you can utilize to test on any Linux distribution. + +In case you need help, you may refer to our guide on [using AppImage file on Linux][14] as well. If you’re curious, you can explore more about it on [GitHub][5]. + +[Viper Browser][5] + +### My Thoughts on Using Viper Browser + +I don’t think it is something that could replace your current browser immediately but if you are interested to test out new projects that are trying to offer Chrome alternatives, this is surely one of them. + +When I tried logging in my Google account, it prevented me by mentioning that it is potentially an insecure browser or unsupported browser. So, if you rely on your Google account, it is a disappointing news. + +However, other social media platforms work just fine along with YouTube (without signing in). Netflix is not something supported but overall the browsing experience is quite fast and usable. + +You can install user scripts, but Chrome extensions aren’t supported yet. Of course, it is either intentional or something to be looked after as the development progresses considering it as a privacy-friendly web browser. + +### Wrapping Up + +Considering that this is a less-known yet something interesting for some, do you have any suggestions for us to take a look at? An open-source project that deserves coverage? + +Let me know in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/viper-browser/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://www.mozilla.org/en-US/firefox/new/ +[2]: https://itsfoss.com/beaker-browser-1-release/ +[3]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://www.bleepingcomputer.com/news/google/google-to-kill-chrome-sync-feature-in-third-party-browsers/ +[5]: https://github.com/LeFroid/Viper-Browser +[6]: https://mastodon.social/web/accounts/199851 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser.png?resize=800%2C583&ssl=1 +[8]: https://wiki.qt.io/QtWebEngine +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-setup.jpg?resize=793%2C600&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-preferences.jpg?resize=800%2C660&ssl=1 +[11]: https://www.startpage.com +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/02/viper-browser-tools.jpg?resize=800%2C262&ssl=1 +[13]: https://github.com/LeFroid/Viper-Browser/releases +[14]: https://itsfoss.com/use-appimage-linux/ From 03d94b7f4603091b1d28e7d6f9a0671223f711d9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:05:10 +0800 Subject: [PATCH 160/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?How=20to=20set=20up=20custom=20sensors=20in=20Home=20Assistant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 How to set up custom sensors in Home Assistant.md --- ...set up custom sensors in Home Assistant.md | 290 ++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 sources/tech/20210208 How to set up custom sensors in Home Assistant.md diff --git a/sources/tech/20210208 How to set up custom sensors in Home Assistant.md b/sources/tech/20210208 How to set up custom sensors in Home Assistant.md new file mode 100644 index 0000000000..074f898a93 --- /dev/null +++ b/sources/tech/20210208 How to set up custom sensors in Home Assistant.md @@ -0,0 +1,290 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to set up custom sensors in Home Assistant) +[#]: via: (https://opensource.com/article/21/2/home-assistant-custom-sensors) +[#]: author: (Steve Ovens https://opensource.com/users/stratusss) + +How to set up custom sensors in Home Assistant +====== +Dive into the YAML files to set up custom sensors in the sixth article +in this home automation series. +![Computer screen with files or windows open][1] + +In the last article in this series about home automation, I started digging into Home Assistant. I [set up a Zigbee integration][2] with a Sonoff Zigbee Bridge and installed a few add-ons, including Node-RED, File Editor, Mosquitto broker, and Samba. I wrapped up by walking through Node-RED's configuration, which I will use heavily later on in this series. The four articles before that one discussed [what Home Assistant is][3], why you may want [local control][4], some of the [communication protocols][5] for smart home components, and how to [install Home Assistant][6] in a virtual machine (VM) using libvirt. + +In this sixth article, I'll walk through the YAML configuration files. This is largely unnecessary if you are just using the integrations supported in the user interface (UI). However, there are times, particularly if you are pulling in custom sensor data, where you have to get your hands dirty with the configuration files. + +Let's dive in. + +### Examine the configuration files + +There are several potential configuration files you will want to investigate. Although everything I am about to show you _can_ be done in the main configuration.yaml file, it can help to split your configuration into dedicated files, especially with large installations. + +Below I will walk through how I configure my system. For my custom sensors, I use the ESP8266 chipset, which is very maker-friendly. I primarily use [Tasmota][7] for my custom firmware, but I also have some components running [ESPHome][8]. Configuring firmware is outside the scope of this article. For now, I will assume you set up your devices with some custom firmware (or you wrote your own with [Arduino IDE][9] ). + +#### The /config/configuration.yaml file + +Configuration.yaml is the main file Home Assistant reads. For the following, use the File Editor you installed in the previous article. If you do not see File Editor in the left sidebar, enable it by going back into the **Supervisor** settings and clicking on **File Editor**. You should see a screen like this: + +![Install File Editor][10] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +Make sure **Show in sidebar** is toggled on. I also always toggle on the **Watchdog** setting for any add-ons I use frequently. + +Once that is completed, launch File Editor. There is a folder icon in the top-left header bar. This is the navigation icon. The `/config` folder is where the configuration files you are concerned with are stored. If you click on the folder icon, you will see a few important files: + +![Configuration split files][12] + +The following is a default configuration.yaml: + +![Default Home Assistant configuration.yaml][13] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +The notation `script: !include scripts.yaml` indicates that Home Assistant should reference the contents of scripts.yaml anytime it needs the definition of a script object. You'll notice that each of these files correlates to files observed when the folder icon is clicked. + +I added three lines to my configuration.yaml: + + +``` +input_boolean: !include input_boolean.yaml +binary_sensor: !include binary_sensor.yaml +sensor: !include sensor.yaml +``` + +As a quick aside, I configured my MQTT settings (see Home Assistant's [MQTT documentation][14] for more details) in the configuration.yaml file: + + +``` +mqtt: +  discovery: true +  discovery_prefix: homeassistant +  broker: 192.168.11.11 +  username: mqtt +  password: superpassword +``` + +If you make an edit, don't forget to click on the Disk icon to save your work. + +![Save icon in Home Assistant config][15] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +#### The /config/binary_sensor.yaml file + +After you name your file in configuration.yaml, you'll have to create it. In the File Editor, click on the folder icon again. There is a small icon of a piece of paper with a **+** sign in its center. Click on it to bring up this dialog: + +![Create config file][16] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +I have three main types of [binary sensors][17]: door, motion, and power. A binary sensor has only two states: on or off. All my binary sensors send their data to MQTT. See my article on [cloud vs. local control][4] for more information about MQTT. + +My binary_sensor.yaml file looks like this: + + +``` + - platform: mqtt +    state_topic: "BRMotion/state/PIR1" +    name: "BRMotion" +    qos: 1 +    payload_on: "ON" +    payload_off: "OFF" +    device_class: motion +    +  - platform: mqtt +    state_topic: "IRBlaster/state/PROJECTOR" +    name: "ProjectorStatus" +    qos: 1 +    payload_on: "ON" +    payload_off: "OFF" +    device_class: power +    +  - platform: mqtt +    state_topic: "MainHallway/state/DOOR" +    name: "FrontDoor" +    qos: 1 +    payload_on: "open" +    payload_off: "closed" +    device_class: door +``` + +Take a look at the definitions. Since `platform` is self-explanatory, start with `state_topic`. + + * `state_topic`, as the name implies, is the topic where the device's state is published. This means anyone subscribed to the topic will be notified any time the state changes. This path is completely arbitrary, so you can name it anything you like. I tend to use the convention `location/state/object`, as this makes sense for me. I want to be able to reference all devices in a location, and for me, this layout is the easiest to remember. Grouping by device type is also a valid organizational layout. + + * `name` is the string used to reference the device inside Home Assistant. It is normally referenced by `type.name`, as seen in this card in the Home Assistant [Lovelace][18] interface: + +![Binary sensor card][19] + +(Steve Ovens, [CC BY-SA 4.0][11]) + + * `qos`, short for quality of service, refers to how an MQTT client communicates with the broker when posting to a topic. + + * `payload_on` and `payload_off` are determined by the firmware. These sections tell Home Assistant what text the device will send to indicate its current state. + + * `device_class:` There are multiple possibilities for a device class. Refer to the [Home Assistant documentation][17] for more information and a description of each type available. + + + + +#### The /config/sensor.yaml file + +This file differs from binary_sensor.yaml in one very important way: The sensors within this configuration file can have vastly different data inside their payloads. Take a look at one of the more tricky bits of sensor data, temperature. + +Here is the definition for my DHT temperature sensor: + + +``` + - platform: mqtt +    state_topic: "Steve_Desk_Sensor/tele/SENSOR" +    name: "Steve Desk Temperature" +    value_template: '{{ value_json.DHT11.Temperature }}' +    +  - platform: mqtt +    state_topic: "Steve_Desk_Sensor/tele/SENSOR" +    name: "Steve Desk Humidity" +    value_template: '{{ value_json.DHT11.Humidity }}' +``` + +You'll notice two things right from the start. First, there are two definitions for the same `state_topic`. This is because this sensor publishes three different statistics. + +Second, there is a new definition of `value_template`. Most sensors, whether custom or not, send their data inside a JSON payload. The template tells Home Assistant where the important information is in the JSON file. The following shows the raw JSON coming from my homemade sensor. (I used the program `jq` to make the JSON more readable.) + + +``` +{ +  "Time": "2020-12-23T16:59:11", +  "DHT11": { +    "Temperature": 24.8, +    "Humidity": 32.4, +    "DewPoint": 7.1 +  }, +  "BH1750": { +    "Illuminance": 24 +  }, +  "TempUnit": "C" +} +``` + +There are a few things to note here. First, as the sensor data is stored in a time-based data store, every reading has a `Time` entry. Second, there are two different sensors attached to this output. This is because I have both a DHT11 temperature sensor and a BH1750 light sensor attached to the same ESP8266 chip. Finally, my temperature is reported in Celsius. + +Hopefully, the Home Assistant definitions will make a little more sense now. `value_json` is just a standard name given to any JSON object ingested by Home Assistant. The format of the `value_template` is `value_json..`. + +For example, to retrieve the dewpoint: + + +``` +`value_template: '{{ value_json.DHT11.DewPoint}}'` +``` + +While you can dump this information to a file from within Home Assistant, I use Tasmota's `Console` to see the data it is publishing. (If you want me to do an article on Tasmota, please let me know in the comments below.) + +As a side note, I also keep tabs on my local Home Assistant resource usage. To do so, I put this in my sensor.yaml file: + + +``` + - platform: systemmonitor +    resources: +      - type: disk_use_percent +        arg: / +      - type: memory_free +      - type: memory_use +      - type: processor_use +``` + +While this is technically not a sensor, I put it here, as I think of it as a data sensor. For more information, see the Home Assistant's [system monitoring][20] documentation. + +#### The /config/input_boolean file + +This last section is pretty easy to set up, and I use it for a wide variety of applications. An input boolean is used to track the status of something. It's either on or off, home or away, etc. I use these quite extensively in my automations. + +My definitions are: + + +``` +   steve_home: +        name: steve +    steve_in_bed: +        name: 'steve in bed' +    guest_home: +    +    kitchen_override: +        name: kitchen +    kitchen_fan_override: +        name: kitchen_fan +    laundryroom_override: +        name: laundryroom +    bathroom_override: +        name: bathroom +    hallway_override:   +        name: hallway +    livingroom_override:   +        name: livingroom +    ensuite_bathroom_override: +        name: ensuite_bathroom +    steve_desk_light_override: +        name: steve_desk_light +    projector_led_override: +        name: projector_led +        +    project_power_status: +        name: 'Projector Power Status' +    tv_power_status: +        name: 'TV Power Status' +    bed_time: +        name: "It's Bedtime" +``` + +I use some of these directly in the Lovelace UI. I create little badges that I put at the top of each of the pages I have in the UI: + +![Home Assistant options in Lovelace UI][21] + +(Steve Ovens, [CC BY-SA 4.0][11]) + +These can be used to determine whether I am home, if a guest is in my house, and so on. Clicking on one of these badges allows me to toggle the boolean, and this object can be read by automations to make decisions about how the “smart devices” react to a person's presence (if at all). I'll revisit the booleans in a future article when I examine Node-RED in more detail. + +### Wrapping up + +In this article, I looked at the YAML configuration files and added a few custom sensors into the mix. You are well on the way to getting some functioning automation with Home Assistant and Node-RED. In the next article, I'll dive into some basic Node-RED flows and introduce some basic automations. + +Stick around; I've got plenty more to cover, and as always, leave a comment below if you would like me to examine something specific. If I can, I'll be sure to incorporate the answers to your questions into future articles. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/home-assistant-custom-sensors + +作者:[Steve Ovens][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/stratusss +[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://opensource.com/article/21/1/home-automation-5-homeassistant-addons +[3]: https://opensource.com/article/20/11/home-assistant +[4]: https://opensource.com/article/20/11/cloud-vs-local-home-automation +[5]: https://opensource.com/article/20/11/home-automation-part-3 +[6]: https://opensource.com/article/20/12/home-assistant +[7]: https://tasmota.github.io/docs/ +[8]: https://esphome.io/ +[9]: https://create.arduino.cc/projecthub/Niv_the_anonymous/esp8266-beginner-tutorial-project-6414c8 +[10]: https://opensource.com/sites/default/files/uploads/ha-setup22-file-editor-settings.png (Install File Editor) +[11]: https://creativecommons.org/licenses/by-sa/4.0/ +[12]: https://opensource.com/sites/default/files/uploads/ha-setup29-configuration-split-files1.png (Configuration split files) +[13]: https://opensource.com/sites/default/files/uploads/ha-setup28-configuration-yaml.png (Default Home Assistant configuration.yaml) +[14]: https://www.home-assistant.io/docs/mqtt/broker +[15]: https://opensource.com/sites/default/files/uploads/ha-setup23-configuration-yaml2.png (Save icon in Home Assistant config) +[16]: https://opensource.com/sites/default/files/uploads/ha-setup24-new-config-file.png (Create config file) +[17]: https://www.home-assistant.io/integrations/binary_sensor/ +[18]: https://www.home-assistant.io/lovelace/ +[19]: https://opensource.com/sites/default/files/uploads/ha-setup25-bindary_sensor_card.png (Binary sensor card) +[20]: https://www.home-assistant.io/integrations/systemmonitor +[21]: https://opensource.com/sites/default/files/uploads/ha-setup25-input-booleans.png (Home Assistant options in Lovelace UI) From 0cd861b5cc757cccbbf5dc7eac0088338be10bcd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:05:26 +0800 Subject: [PATCH 161/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?3=20open=20source=20tools=20that=20make=20Linux=20the=20ideal?= =?UTF-8?q?=20workstation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md --- ...s that make Linux the ideal workstation.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md diff --git a/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md new file mode 100644 index 0000000000..2fb770fa83 --- /dev/null +++ b/sources/tech/20210208 3 open source tools that make Linux the ideal workstation.md @@ -0,0 +1,76 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (3 open source tools that make Linux the ideal workstation) +[#]: via: (https://opensource.com/article/21/2/linux-workday) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +3 open source tools that make Linux the ideal workstation +====== +Linux has everything you think you need and more for you to have a +productive workday. +![Person using a laptop][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. Today, I'll share with you why Linux is a great choice for your workday. + +Everyone wants to be productive during the workday. If your workday generally involves working on documents, presentations, and spreadsheets, then you might be accustomed to a specific routine. The problem is that _usual routine_ is usually dictated by one or two specific applications, whether it's a certain office suite or a desktop OS. Of course, just because something's a habit doesn't mean it's ideal, and yet it tends to persist unquestioned, even to the point of influencing the very structure of how a business is run. + +### Working smarter + +Many office applications these days run in the cloud, so you can work with the same constraints on Linux if you really want to. However, because many of the typical big-name office applications aren't cultural expectations on Linux, you might find yourself inspired to explore other options. As anyone eager to get out of their "comfort zone" knows, this kind of subtle disruption can be surprisingly useful. All too often, you don't know what you're doing inefficiently because you haven't actually tried doing things differently. Force yourself to explore other options, and you never know what you'll find. You don't even have to know exactly what you're looking for. + +### LibreOffice + +One of the most obvious open source office stalwarts on Linux (or any other platform) is [LibreOffice][2]. It features several components, including a word processor, presentation software, a spreadsheet, relational database interface, vector drawing, and more. It can import many document formats from other popular office applications, so transitioning to LibreOffice from another tool is usually easy. + +There's more to LibreOffice than just being a great office suite, however. LibreOffice has macro support, so resourceful users can automate repetitive tasks. It also features terminal commands so you can perform many tasks without ever launching the LibreOffice interface. + +Imagine, for instance, opening 21 documents, navigating to the **File** menu, to the **Export** or **Print** menu item, and exporting the file to PDF or EPUB. That's over 84 clicks, at the very least, and probably an hour of work. Compare that to opening a folder of documents and converting all of them to PDF or EPUB with just one swift command or menu action. The conversion would run in the background while you work on other things. You'd be finished in a quarter of the time, possibly less. + + +``` +`$ libreoffice --headless --convert-to epub *.docx` +``` + +It's the little improvements that Linux encourages, not explicitly but implicitly, through its toolset and the ease with which you can customize your environment and workflow. + +### Abiword and Gnumeric + +Sometimes, a big office suite is exactly what you _don't_ need. If you prefer to keep your office work simple, you might do better with a lightweight and task-specific application. For instance, I mostly write articles in a text editor because I know all styles are discarded during conversion to HTML. But there are times when a word processor is useful, either to open a document someone has sent to me or because I want a quick and easy way to generate some nicely styled text. + +[Abiword][3] is a simple word processor with basic support for popular document formats and all the essential features you'd expect from a word processor. It isn't meant as a full office suite, and that's its best feature. While there's no such a thing as too many options, there definitely is such a thing as information overload, and that's exactly what a full office suite or word processor is sometimes guilty of. If you're looking to avoid that, then use something simple instead. + +Similarly, the [Gnumeric][4] project provides a simple spreadsheet application. Gnumeric avoids any features that aren't strictly necessary for a spreadsheet, so you still get a robust formula syntax, plenty of functions, and all the options you need for styling and manipulating cells. I don't do much with spreadsheets, so I find myself quite happy with Gnumeric on the rare occasions I need to review or process data in a ledger. + +### Pandoc + +It's possible to get even more minimal with specialized commands and document processors. The `pandoc` command specializes in document conversion. It's like the `libreoffice --headless` command, except with ten times the number of document formats to work with. You can even generate presentations with it! If part of your work is taking source text from one document and formatting it for several modes of delivery, then Pandoc is a necessity, and so you should [download our cheat sheet][5]. + +Broadly, Pandoc is representative of a completely different way of working. It gets you away from the confines of office applications. It separates you from trying to get your thoughts down into typed words and deciding what font those words ought to use, all at the same time. Working in plain text and then converting to all of your delivery targets afterward lets you work with any application you want, whether it's a notepad on your mobile device, a simple text editor on whatever computer you happen to be sitting in front of, or a text editor in the cloud. + +### Look for the alternatives + +There are lots of unexpected alternatives available for Linux. You can find them by taking a step back from what you're doing, analyzing your work process, assessing your required results, and investigating new applications that claim to do just the things you rely upon. + +Changing the tools you use, your workflow, and your daily routine can be disorienting, especially when you don't know exactly where it is you're looking to go. But the advantage to Linux is that you're afforded the opportunity to re-evaluate the assumptions you've subconsciously developed over years of computer usage. If you look hard enough for an answer, you'll eventually realize what the question was in the first place. And oftentimes, you'll end up appreciating what you learn. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-workday + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: http://libreoffice.org +[3]: https://www.abisource.com +[4]: http://www.gnumeric.org +[5]: https://opensource.com/article/20/5/pandoc-cheat-sheet From c43b9a2103953cda6baa55853346637cf3724033 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 9 Feb 2021 05:05:43 +0800 Subject: [PATCH 162/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210208=20?= =?UTF-8?q?Why=20choose=20Plausible=20for=20an=20open=20source=20alternati?= =?UTF-8?q?ve=20to=20Google=20Analytics?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md --- ... source alternative to Google Analytics.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md diff --git a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md new file mode 100644 index 0000000000..74252f60a8 --- /dev/null +++ b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -0,0 +1,83 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why choose Plausible for an open source alternative to Google Analytics) +[#]: via: (https://opensource.com/article/21/2/plausible) +[#]: author: (Ben Rometsch https://opensource.com/users/flagsmith) + +Why choose Plausible for an open source alternative to Google Analytics +====== +Plausible is gaining attention and users as a viable, effective +alternative to Google Analytics. +![Analytics: Charts and Graphs][1] + +Taking on the might of Google Analytics may seem like a big challenge. In fact, you could say it doesn't sound plausible… But that's exactly what [Plausible.io][2] has done with great success, signing up thousands of new users since 2018. + +Plausible's co-founders Uku Taht and Marko Saric recently appeared on [The Craft of Open Source][3] podcast to talk about the project and how they: + + * Created a viable alternative to Google Analytics + * Gained so much momentum in less than two years + * Achieved their goals by open sourcing the project + + + +Read on for a summary of their conversation with podcast host and Flagsmith founder Ben Rometsch. + +### How Plausible got started + +In winter 2018, Uku started coding a project that he thought was desperately needed—a viable, effective alternative to Google Analytics—after becoming disillusioned with the direction Google products were heading and the fact that all other data solutions seemed to use Google as a "data-handling middleman." + +Uku's first instinct was to focus on the analytics side of things using existing database solutions. Right away, he faced some challenges. The first attempt, using PostgreSQL, was technically naïve, as it became overwhelmed and inefficient pretty quickly. Therefore, his goal morphed into making an analytics product that can handle large quantities of data points with no discernable decline in performance. To cut a long story short, Uku succeeded, and Plausible can now ingest more than 80 million records per month. + +The first version of Plausible was released in summer 2019. In March 2020, Marko came on board to head up the project's communications and marketing side. Since then, its popularity has grown with considerable momentum. + +### Why open source? + +Uku was keen to follow the "indie hacker" route of software development: create a product, put it out there, and see how it grows. Open source makes sense in this respect because you can quickly grow a community and gain popularity. + +But Plausible didn't start out as open source. Uku was initially concerned about the software's sensitive code, such as billing codes, but he soon released that this was of no use to people without the API token. + +Now, Plausible is fully open source under [AGPL][4], which they chose instead of the MIT License. Uku explains that under an MIT License, anyone can do anything to the code without restriction. Under AGPL, if someone changes the code, they must open source their changes and contribute the code back to the community. This means that large corporations cannot take the original code, build from it, then reap all the rewards. They must share it, making for a more level playing field. For instance, if a company wanted to plug in their billing or login system, they would be legally obliged to publish the code. + +During the podcast, Uku asked me about Flagsmith's license which is currently under a BSD 3-Clause license, which is highly permissive, but I am about to move some features behind a more restrictive license. So far, the Flagsmith community has been understanding of the change as they realize this will lead to more and better features. + +### Plausible vs. Google Analytics + +Uku says, in his opinion, the spirit of open source is that the code should be open for commercial use by anyone and shared with the community, but you can keep back a closed-source API module as a proprietary add-on. In this way, Plausible and other companies can cater to different use-cases by creating and selling bespoke API add-on licenses. + +Marko is a developer by trade, but from the marketing side of things, he worked to get the project covered on sites such as Hacker News and Lobster and build a Twitter presence to help generate momentum. The buzz created by this publicity also meant that the project took off on GitHub, going from 500 to 4,300 stars. As traffic grew, Plausible appeared on GitHub's trending list, which helped its popularity snowball. + +Marko also focused heavily on publishing and promoting blog posts. This strategy paid off, as four or five posts went viral within the first six months, and he used those spikes to amplify the marketing message and accelerate growth. + +The biggest challenge in Plausible's growth was getting people to switch from Google Analytics. The project's main goal was to create a web analytics product that is useful, efficient, and accurate. It also needed to be compliant with regulations and offer a high degree of privacy for both the business and website visitors. + +Plausible is now running on more than 8,000 websites. From talking to customers, Uku estimates that around 90% of them would have run Google Analytics. + +Plausible runs on a standard software-as-a-service (SaaS) subscription model. To make things fairer, it charges per page view on a monthly basis, rather than charging per website. This can prove tricky with seasonal websites, say e-commerce sites that spike at the holidays or US election sites that spike once every four years. These can cause pricing problems under the monthly subscription model, but it generally works well for most sites. + +### Check out the podcast + +To discover more about how Uku and Marko grew the open source Plausible project at a phenomenal rate and made it into a commercial success, [listen to the podcast][3] and check out [other episodes][5] to learn more about "the ins-and-outs of the open source software community." + +Sandstorm's Jade Wang shares some of her favorite open source web apps that are self-hosted... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/plausible + +作者:[Ben Rometsch][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/flagsmith +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/analytics-graphs-charts.png?itok=sersoqbV (Analytics: Charts and Graphs) +[2]: https://plausible.io/ +[3]: https://www.flagsmith.com/podcast/02-plausible +[4]: https://www.gnu.org/licenses/agpl-3.0.en.html +[5]: https://www.flagsmith.com/podcast From b1747f58223c5da887b05ecae9bda0db2e6be141 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Feb 2021 10:39:56 +0800 Subject: [PATCH 163/213] translated --- ...he D programming language for scripting.md | 51 +++-- ...he D programming language for scripting.md | 183 ++++++++++++++++++ 2 files changed, 208 insertions(+), 26 deletions(-) create mode 100644 translated/tech/20210127 Why I use the D programming language for scripting.md diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md index b3728050fa..94cd6db038 100644 --- a/sources/tech/20210127 Why I use the D programming language for scripting.md +++ b/sources/tech/20210127 Why I use the D programming language for scripting.md @@ -7,25 +7,24 @@ [#]: via: (https://opensource.com/article/21/1/d-scripting) [#]: author: (Lawrence Aberba https://opensource.com/users/aberba) -Why I use the D programming language for scripting +我为什么要用 D 语言写脚本? ====== -The D programming language is best known as a system programming -language, but it's also a great option for scripting. +D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 ![Business woman on laptop sitting in front of window][1] -The D programming language is often advertised as a system programming language due to its static typing and metaprogramming capabilities. However, it's also a very productive scripting language. +D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 -Python is commonly chosen for scripting due to its flexibility for automating tasks and quickly prototyping ideas. This makes Python very appealing to sysadmins, [managers][2], and developers in general for automating recurring tasks that they might otherwise have to do manually. +由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 -It is reasonable to expect any other script-writing language to have these Python traits and capabilities. Here are two reasons why I believe D is a good option. +我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 -### 1\. D is easy to read and write +### 1\. D 很容易读和写 -As a C-like language, D should be familiar to most programmers. Anyone who uses JavaScript, Java, PHP, or Python will know their way around D. +作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 -If you don't already have D installed, [install a D compiler][3] so that you can [run the D code][4] in this article. You may also use the [online D editor][5]. +如果你还没有安装 D,请[安装 D 编译器][3],这样你就可以[运行本文中的 D 代码][4]。你也可以使用[在线 D 编辑器][5]。 -Here is an example of D code that reads words from a file named `words.txt` and prints them on the command line: +下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: ``` @@ -35,7 +34,7 @@ is cool ``` -Write the script in D: +用 D 语言写脚本: ``` @@ -58,21 +57,20 @@ void main(){ } ``` -This code is prefixed with a [shebang][6] that will run the code using [rdmd][7], a tool that comes with the D compiler to compile and run code. Assuming you are running Unix or Linux, before you can run this script, you must make it executable by using the `chmod` command: - +这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: ``` `chmod u+x print_words.d` ``` -Now that the script is executable, you can run it: +现在脚本是可执行的,你可以运行它: ``` `./print_words.d` ``` -This should print the following on your command line: +这将在你的命令行中打印以下内容: ``` @@ -82,9 +80,9 @@ is cool ``` -Congratulations! You've written your first D script. You can see how D enables you to chain functions in sequence to make reading the code feel natural, similar to how you think about problems in your mind. This [feature makes D my favorite programming language][8]. +恭喜你,你写了第一个 D 语言脚本。你可以看到 D 是如何让你按顺序链式调用函数,这让阅读代码的感觉很自然,类似于你在头脑中思考问题的方式。这个[功能让 D 成为我最喜欢的编程语言][8]。 -Try writing another script: A nonprofit manager has a text file of donations with each amount on separate lines. The manager wants to sum the first 10 donations and print the amounts: +试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: ``` @@ -124,13 +122,14 @@ void main() } ``` -The `!` operator used with `each` is the syntax of a [template argument][9]. +与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 -### 2\. D is great for quick prototyping +### 2\. D 是快速原型设计的好帮手 -D is flexible for hammering code together really quickly and making it work. Its standard library is rich with utility functions for performing common tasks, such as manipulating data (JSON, CSV, text, etc.). It also comes with a rich set of generic algorithms for iterating, searching, comparing, and mutating data. These cleverly crafted algorithms are oriented towards processing sequences by defining generic [range-based interfaces][10]. +D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 -The script above shows how chaining functions in D provides a gist of sequential processing and manipulating data. Another appeal of D is its growing ecosystem of third-party packages for performing common tasks. An example is how easy it is to build a simple web server using the [Vibe.d][11] web framework. Here's an example: + +上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: ``` @@ -148,13 +147,13 @@ void main() } ``` -This uses the official D package manager, [Dub][12], to fetch the vibe.d web framework from the [D package repository][13]. Dub takes care of downloading the Vibe.d package, then compiling and spinning up a web server on localhost port 8080. +它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 -### Give D a try +### 尝试一下 D 语言 -These are only a couple of reasons why you might want to use D for writing scripts. +这些只是你可能想用 D 来写脚本的几个原因。 -D is a great language for development. It's easy to install from the D download page, so download the compiler, take a look at the examples, and experience D for yourself. +D 是一种非常适合开发的语言。你可以很容易从 D 下载页面安装,因此下载编译器,看看例子,并亲自体验 D 语言。 -------------------------------------------------------------------------------- @@ -162,7 +161,7 @@ via: https://opensource.com/article/21/1/d-scripting 作者:[Lawrence Aberba][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/translated/tech/20210127 Why I use the D programming language for scripting.md b/translated/tech/20210127 Why I use the D programming language for scripting.md new file mode 100644 index 0000000000..94cd6db038 --- /dev/null +++ b/translated/tech/20210127 Why I use the D programming language for scripting.md @@ -0,0 +1,183 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why I use the D programming language for scripting) +[#]: via: (https://opensource.com/article/21/1/d-scripting) +[#]: author: (Lawrence Aberba https://opensource.com/users/aberba) + +我为什么要用 D 语言写脚本? +====== +D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 +![Business woman on laptop sitting in front of window][1] + +D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 + +由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 + +我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 + +### 1\. D 很容易读和写 + +作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 + +如果你还没有安装 D,请[安装 D 编译器][3],这样你就可以[运行本文中的 D 代码][4]。你也可以使用[在线 D 编辑器][5]。 + +下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: + + +``` +open +source +is +cool +``` + +用 D 语言写脚本: + + +``` +// file print_words.d + +#!/usr/bin/env rdmd + +// import the D standard library +import std; + +void main(){ +    // open the file +     File("./words.txt") + +         //iterate by line +        .byLine + +        // print each number +        .each!writeln; +} +``` + +这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: + +``` +`chmod u+x print_words.d` +``` + +现在脚本是可执行的,你可以运行它: + + +``` +`./print_words.d` +``` + +这将在你的命令行中打印以下内容: + + +``` +open +source +is +cool +``` + +恭喜你,你写了第一个 D 语言脚本。你可以看到 D 是如何让你按顺序链式调用函数,这让阅读代码的感觉很自然,类似于你在头脑中思考问题的方式。这个[功能让 D 成为我最喜欢的编程语言][8]。 + +试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: + + +``` +// file sum_donations.d + +#!/usr/bin/env rdmd + +import std; + +void main() +{ +    double total = 0; + +    // open the file +    File("monies.txt") + +         // iterate by line +        .byLine + +         // pick first 10 lines +        .take(10) + +        // remove new line characters (\n) +        .map!(strip) + +         // convert each to double +        .map!(to!double) + +        // add element to total +        .tee!((x) { total += x; }) + +        // print each number +        .each!writeln; + +    // print total +    writeln("total: ", total); +} +``` + +与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 + +### 2\. D 是快速原型设计的好帮手 + +D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 + + +上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: + + +``` +#!/usr/bin/env dub +/+ dub.sdl: +dependency "vibe-d" version="~>0.8.0" ++/ +void main() +{ +    import vibe.d; +    listenHTTP(":8080", (req, res) { +        res.writeBody("Hello, World: " ~ req.path); +    }); +    runApplication(); +} +``` + +它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 + +### 尝试一下 D 语言 + +这些只是你可能想用 D 来写脚本的几个原因。 + +D 是一种非常适合开发的语言。你可以很容易从 D 下载页面安装,因此下载编译器,看看例子,并亲自体验 D 语言。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/d-scripting + +作者:[Lawrence Aberba][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/aberba +[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/20/3/automating-community-management-python +[3]: https://tour.dlang.org/tour/en/welcome/install-d-locally +[4]: https://tour.dlang.org/tour/en/welcome/run-d-program-locally +[5]: https://run.dlang.io/ +[6]: https://en.wikipedia.org/wiki/Shebang_(Unix) +[7]: https://dlang.org/rdmd.html +[8]: https://opensource.com/article/20/7/d-programming +[9]: http://ddili.org/ders/d.en/templates.html +[10]: http://ddili.org/ders/d.en/ranges.html +[11]: https://vibed.org +[12]: https://dub.pm/getting_started +[13]: https://code.dlang.org From 09e5b2b9e32fce4046a672ec39856c01ec23b662 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Feb 2021 10:42:09 +0800 Subject: [PATCH 164/213] translated --- ...he D programming language for scripting.md | 183 ------------------ 1 file changed, 183 deletions(-) delete mode 100644 sources/tech/20210127 Why I use the D programming language for scripting.md diff --git a/sources/tech/20210127 Why I use the D programming language for scripting.md b/sources/tech/20210127 Why I use the D programming language for scripting.md deleted file mode 100644 index 94cd6db038..0000000000 --- a/sources/tech/20210127 Why I use the D programming language for scripting.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Why I use the D programming language for scripting) -[#]: via: (https://opensource.com/article/21/1/d-scripting) -[#]: author: (Lawrence Aberba https://opensource.com/users/aberba) - -我为什么要用 D 语言写脚本? -====== -D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 -![Business woman on laptop sitting in front of window][1] - -D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 - -由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 - -我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 - -### 1\. D 很容易读和写 - -作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 - -如果你还没有安装 D,请[安装 D 编译器][3],这样你就可以[运行本文中的 D 代码][4]。你也可以使用[在线 D 编辑器][5]。 - -下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: - - -``` -open -source -is -cool -``` - -用 D 语言写脚本: - - -``` -// file print_words.d - -#!/usr/bin/env rdmd - -// import the D standard library -import std; - -void main(){ -    // open the file -     File("./words.txt") - -         //iterate by line -        .byLine - -        // print each number -        .each!writeln; -} -``` - -这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: - -``` -`chmod u+x print_words.d` -``` - -现在脚本是可执行的,你可以运行它: - - -``` -`./print_words.d` -``` - -这将在你的命令行中打印以下内容: - - -``` -open -source -is -cool -``` - -恭喜你,你写了第一个 D 语言脚本。你可以看到 D 是如何让你按顺序链式调用函数,这让阅读代码的感觉很自然,类似于你在头脑中思考问题的方式。这个[功能让 D 成为我最喜欢的编程语言][8]。 - -试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: - - -``` -// file sum_donations.d - -#!/usr/bin/env rdmd - -import std; - -void main() -{ -    double total = 0; - -    // open the file -    File("monies.txt") - -         // iterate by line -        .byLine - -         // pick first 10 lines -        .take(10) - -        // remove new line characters (\n) -        .map!(strip) - -         // convert each to double -        .map!(to!double) - -        // add element to total -        .tee!((x) { total += x; }) - -        // print each number -        .each!writeln; - -    // print total -    writeln("total: ", total); -} -``` - -与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 - -### 2\. D 是快速原型设计的好帮手 - -D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 - - -上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: - - -``` -#!/usr/bin/env dub -/+ dub.sdl: -dependency "vibe-d" version="~>0.8.0" -+/ -void main() -{ -    import vibe.d; -    listenHTTP(":8080", (req, res) { -        res.writeBody("Hello, World: " ~ req.path); -    }); -    runApplication(); -} -``` - -它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 - -### 尝试一下 D 语言 - -这些只是你可能想用 D 来写脚本的几个原因。 - -D 是一种非常适合开发的语言。你可以很容易从 D 下载页面安装,因此下载编译器,看看例子,并亲自体验 D 语言。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/d-scripting - -作者:[Lawrence Aberba][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/aberba -[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/20/3/automating-community-management-python -[3]: https://tour.dlang.org/tour/en/welcome/install-d-locally -[4]: https://tour.dlang.org/tour/en/welcome/run-d-program-locally -[5]: https://run.dlang.io/ -[6]: https://en.wikipedia.org/wiki/Shebang_(Unix) -[7]: https://dlang.org/rdmd.html -[8]: https://opensource.com/article/20/7/d-programming -[9]: http://ddili.org/ders/d.en/templates.html -[10]: http://ddili.org/ders/d.en/ranges.html -[11]: https://vibed.org -[12]: https://dub.pm/getting_started -[13]: https://code.dlang.org From 833c8b7c6c1267010a419325147e805164a57fbd Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 9 Feb 2021 10:44:19 +0800 Subject: [PATCH 165/213] translating --- ...-based Web Browser With A Focus on Privacy and Minimalism.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md index 02751230d0..9fbc97ed85 100644 --- a/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md +++ b/sources/tech/20210209 Viper Browser- A Lightweight Qt5-based Web Browser With A Focus on Privacy and Minimalism.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 177f81d1eac6b1d59d125b7fd4dbfd2678520400 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 11:14:36 +0800 Subject: [PATCH 166/213] PRF @Chao-zhi --- ...mands in Arch-based Linux Distributions.md | 122 +++++++++--------- 1 file changed, 58 insertions(+), 64 deletions(-) diff --git a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index d33bb59f36..f40785007d 100644 --- a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -1,65 +1,63 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Getting Started With Pacman Commands in Arch-based Linux Distributions) [#]: via: (https://itsfoss.com/pacman-command/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -基于 Arch 的 Linux 发行版中 Pacman 命令入门 +Arch Linux 的 pacman 命令入门 ====== -_**简介:这本初学者指南向您展示了在 Linux 中可以使用 pacman 命令做什么,如何使用它们来查找新的软件包,安装和升级新的软件包,以及清理您的系统。**_ +> 这本初学者指南向你展示了在 Linux 中可以使用 pacman 命令做什么,如何使用它们来查找新的软件包,安装和升级新的软件包,以及清理你的系统。 -[pacman][1] 包管理器是 [Arch Linux][2] 和其他主要发行版如 Red Hat 和 Ubuntu/Debian 之间的主要区别之一。它结合了简单的二进制包格式和易于使用的[构建系统 ][3]。pacman 的目标是方便地管理软件包,无论它是来自[官方库 ][4] 还是用户自己的构建软件库。 +[pacman][1] 包管理器是 [Arch Linux][2] 和其他主要发行版如 Red Hat 和 Ubuntu/Debian 之间的主要区别之一。它结合了简单的二进制包格式和易于使用的 [构建系统][3]。`pacman` 的目标是方便地管理软件包,无论它是来自 [官方库][4] 还是用户自己构建的软件库。 -如果您曾经使用过 Ubuntu 或基于 debian 的 发行版,那么您可能使用过 apt-get 或 apt 命令。pacman 在 Arch Linux 中是同样的。如果你[刚刚安装了 Arch Linux][5],在安装 Arch Linux 后,首先要做的[几件事 ][6] 之一就是学习使用 pacman 命令。 +如果你曾经使用过 Ubuntu 或基于 debian 的发行版,那么你可能使用过 `apt-get` 或 `apt` 命令。`pacman` 在 Arch Linux 中是同样的命令。如果你 [刚刚安装了 Arch Linux][5],在安装 Arch Linux 后,首先要做的 [几件事][6] 之一就是学习使用 `pacman` 命令。 -在这个初学者指南中,我将解释一些基本的 pacman 命令的用法,你应该知道如何用这些命令来管理你的基于 Archlinux 的系统。 +在这个初学者指南中,我将解释一些基本的 `pacman` 命令的用法,你应该知道如何用这些命令来管理你的基于 Archlinux 的系统。 ### Arch Linux 用户应该知道的几个重要的 pacman 命令 -![][7] +![](https://img.linux.net.cn/data/attachment/album/202102/09/111411uqadijqdd8afgk56.jpg) -与其他包管理器一样,pacman 可以将包列表与软件库同步,它能够自动解决所有所需的依赖项,以使得用户可以通过一个简单的命令下载和安装软件。 +与其他包管理器一样,`pacman` 可以将包列表与软件库同步,它能够自动解决所有所需的依赖项,以使得用户可以通过一个简单的命令下载和安装软件。 #### 通过 pacman 安装软件 -你可以用一下形式的代码来安装一个或者多个软件包: +你可以用以下形式的代码来安装一个或者多个软件包: ``` -pacman -S _package_name1_ _package_name2_ ... +pacman -S 软件包名1 软件包名2 ... ``` -![安装一个包 ][8] +![安装一个包][8] --S 选项的意思是同步 (synchronization),它的意思是 pacman 在安装之前先与软件库进行同步。 - -pacman 数据库根据安装的原因将安装的包分为两组: - - * **显式安装**:由 pacman -S 或 -U 命令直接安装的包 - * **依赖安装**:由于被其他显式安装的包所[依赖 ][9],而被自动安装的包。 +`-S` 选项的意思是同步synchronization,它的意思是 `pacman` 在安装之前先与软件库进行同步。 +`pacman` 数据库根据安装的原因将安装的包分为两组: + * **显式安装**:由 `pacman -S` 或 `-U` 命令直接安装的包 + * **依赖安装**:由于被其他显式安装的包所 [依赖][9],而被自动安装的包。 #### 卸载已安装的软件包 卸载一个包,并且删除它的所有依赖。 ``` -pacman -R package_name_ +pacman -R 软件包名 ``` -![移除一个包 ][10] +![移除一个包][10] 删除一个包,以及其不被其他包所需要的依赖项: ``` -pacman -Rs _package_name_ +pacman -Rs 软件包名 ``` -删除所有不再需要的依赖项。比如,需要这个依赖的包已经被删除了。 +如果需要这个依赖的包已经被删除了,这条命令可以删除所有不再需要的依赖项: ``` pacman -Qdtq | pacman -Rs - @@ -67,80 +65,76 @@ pacman -Qdtq | pacman -Rs - #### 升级软件包 -Pacman 提供了一个简单的办法来[升级 Arch Linux][11]。你只需要一条命令就可以升级所有已安装的软件包。这可能需要一段时间,这取决于系统的新旧程度。 +`pacman` 提供了一个简单的办法来 [升级 Arch Linux][11]。你只需要一条命令就可以升级所有已安装的软件包。这可能需要一段时间,这取决于系统的新旧程度。 -以下命令可以同步存储库数据库 _并且_ 更新系统的所有软件包,但不包括不在软件库中的“本地安装的”包: +以下命令可以同步存储库数据库,*并且* 更新系统的所有软件包,但不包括不在软件库中的“本地安装的”包: ``` pacman -Syu ``` - * S 代表同步 - * y 代表更新本地存储库 - * u 代表系统更新 + * `S` 代表同步 + * `y` 代表更新本地存储库 + * `u` 代表系统更新 +也就是说,同步到中央软件库(主程序包数据库),刷新主程序包数据库的本地副本,然后执行系统更新(通过更新所有有更新版本可用的程序包)。 +![系统更新][12] -也就是说,同步到中央存储库(主程序包数据库),刷新主程序包数据库的本地副本,然后执行系统更新(通过更新所有有更新版本可用的程序包)。 - -![系统更新 ][12] - -注意! - -Arch Linux 用户在系统升级前,建议您访问 [Arch-Linux 主页 ][2] 查看最新消息,以了解异常更新的情况。如果系统更新需要人工干预,主页上将发布相关的新闻。您也可以订阅 [RSS feed][13] 或 [Arch 的声明邮件 ][14]。 - -在升级基础软件(如 kernel、xorg、systemd 或 glibc) 之前,请注意查看相应的 [论坛 ][15],以了解大家报告的各种问题。 - -**在 Arch 和 Manjaro 等滚动发行版中不支持仅部分升级**。这意味着,当新的库版本被推送到存储库时,存储库中的所有包都需要根据库进行升级。例如,如果两个包依赖于同一个库,则仅升级一个包可能会破坏依赖于库的旧版本的另一个包。 +> 注意! +> +> 对于 Arch Linux 用户,在系统升级前,建议你访问 [Arch-Linux 主页][2] 查看最新消息,以了解异常更新的情况。如果系统更新需要人工干预,主页上将发布相关的新闻。你也可以订阅 [RSS 源][13] 或 [Arch 的声明邮件][14]。 +> +> 在升级基础软件(如 kernel、xorg、systemd 或 glibc) 之前,请注意查看相应的 [论坛][15],以了解大家报告的各种问题。 +> +> 在 Arch 和 Manjaro 等滚动发行版中不支持**部分升级**。这意味着,当新的库版本被推送到软件库时,软件库中的所有包都需要根据库版本进行升级。例如,如果两个包依赖于同一个库,则仅升级一个包可能会破坏依赖于该库的旧版本的另一个包。 #### 用 Pacman 查找包 -Pacman 使用 -Q 选项查询本地包数据库,使用 -S 选项查询同步数据库,使用 -F 选项查询文件数据库。 +`pacman` 使用 `-Q` 选项查询本地包数据库,使用 `-S` 选项查询同步数据库,使用 `-F` 选项查询文件数据库。 -Pacman 可以在数据库中搜索包,包括包的名称和描述: +`pacman` 可以在数据库中搜索包,包括包的名称和描述: ``` -pacman -Ss _string1_ _string2_ ... +pacman -Ss 字符串1 字符串2 ... ``` -![查找一个包 ][16] +![查找一个包][16] 查找已经被安装的包: ``` -pacman -Qs _string1_ _string2_ ... +pacman -Qs 字符串1 字符串2 ... ``` -根据文件名在远程数据库中查找它所属的包: +根据文件名在远程软包中查找它所属的包: ``` -pacman -F _string1_ _string2_ ... +pacman -F 字符串1 字符串2 ... ``` 查看一个包的依赖树: ``` -pactree _package_naenter code hereme_ +pactree 软件包名 ``` #### 清除包缓存 -Pacman 将其下载的包存储在 /var/cache/Pacman/pkg/ 中,并且不会自动删除旧版本或卸载的版本。这有一些优点: - - 1。它允许[降级 ][17] 一个包,而不需要通过其他来源检索以前的版本。 - 2。已卸载的软件包可以轻松地直接从缓存文件夹重新安装。 - +`pacman` 将其下载的包存储在 `/var/cache/Pacman/pkg/` 中,并且不会自动删除旧版本或卸载的版本。这有一些优点: + 1. 它允许 [降级][17] 一个包,而不需要通过其他来源检索以前的版本。 + 2. 已卸载的软件包可以轻松地直接从缓存文件夹重新安装。 但是,有必要定期清理缓存以防止文件夹增大。 -[pacman contrib][19] 包中提供的 [paccache(8)][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: +[pacman contrib][19] 包中提供的 [paccache(80][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: ``` paccache -r ``` -![清除缓存 ][20] +![清除缓存][20] 要删除当前未安装的所有缓存包和未使用的同步数据库,请执行: @@ -148,7 +142,7 @@ paccache -r pacman -Sc ``` -要从缓存中删除所有文件,请使用 clean 选项两次,这是最激进的方法,不会在缓存文件夹中留下任何内容: +要从缓存中删除所有文件,请使用清除选项两次,这是最激进的方法,不会在缓存文件夹中留下任何内容: ``` pacman -Scc @@ -159,7 +153,7 @@ pacman -Scc 安装不是来自远程存储库的“本地”包: ``` -pacman -U _/path/to/package/package_name-version.pkg.tar.xz_ +pacman -U 本地软件包路径.pkg.tar.xz ``` 安装官方存储库中未包含的“远程”软件包: @@ -170,7 +164,7 @@ pacman -U http://www.example.com/repo/example.pkg.tar.xz ### 额外内容:用 pacman 排除常见错误 -下面是使用 pacman 管理包时可能遇到的一些常见错误。 +下面是使用 `pacman` 管理包时可能遇到的一些常见错误。 #### 提交事务失败(文件冲突) @@ -183,21 +177,21 @@ package: /path/to/file exists in filesystem Errors occurred, no packages were upgraded. ``` -这是因为 pacman 检测到文件冲突,不会为您覆盖文件。 +这是因为 `pacman` 检测到文件冲突,不会为你覆盖文件。 -解决这个问题的一个安全方法是首先检查另一个包是否拥有这个文件 (pacman-Qo\path/to/file)。如果该文件属于另一个包,请提交错误报告。如果文件不属于另一个包,请重命名“存在于文件系统中”的文件,然后重新发出 update 命令。如果一切顺利,文件可能会被删除。 +解决这个问题的一个安全方法是首先检查另一个包是否拥有这个文件(`pacman-Qo 文件路径`)。如果该文件属于另一个包,请提交错误报告。如果文件不属于另一个包,请重命名“存在于文件系统中”的文件,然后重新发出更新命令。如果一切顺利,文件可能会被删除。 -您可以显式地运行 **pacman -S –overwrite glob package**,强制 pacman 覆盖与 _glob_ 匹配的文件,而不是手动重命名并在以后删除属于所讨论的包的所有文件。 +你可以显式地运行 `pacman -S –overwrite 要覆盖的文件模式**,强制 `pacman` 覆盖与 给模式匹配的文件,而不是手动重命名并在以后删除属于该包的所有文件。 #### 提交事务失败(包无效或损坏) -在 /var/cache/pacman/pkg/ 中查找 .part 文件(部分下载的包),并将其删除。这通常是由在 pacman.conf 文件中使用自定义 XferCommand 引起的。 +在 `/var/cache/pacman/pkg/` 中查找 `.part` 文件(部分下载的包),并将其删除。这通常是由在 `pacman.conf` 文件中使用自定义 `XferCommand` 引起的。 #### 初始化事务失败(无法锁定数据库) -当 pacman 要修改包数据库时,例如安装包时,它会在 /var/lib/pacman/db.lck 处创建一个锁文件。这可以防止 pacman 的另一个实例同时尝试更改包数据库。 +当 `pacman` 要修改包数据库时,例如安装包时,它会在 `/var/lib/pacman/db.lck` 处创建一个锁文件。这可以防止 `pacman` 的另一个实例同时尝试更改包数据库。 -如果 pacman 在更改数据库时被中断,这个过时的锁文件可能仍然保留。如果您确定没有 pacman 实例正在运行,那么请删除锁文件。 +如果 `pacman` 在更改数据库时被中断,这个过时的锁文件可能仍然保留。如果你确定没有 `pacman` 实例正在运行,那么请删除锁文件。 检查进程是否持有锁定文件: @@ -211,9 +205,9 @@ lsof /var/lib/pacman/db.lck rm /var/lib/pacman/db.lck ``` -如果您发现 lsof 命令输出了使用锁文件的进程的 PID,请先杀死这个进程,然后删除锁文件。 +如果你发现 `lsof` 命令输出了使用锁文件的进程的 PID,请先杀死这个进程,然后删除锁文件。 -我希望你喜欢我对 Pacman 基础命令的解释。请在下面留言,不要忘记订阅我们的社交媒体。注意安全! +我希望你喜欢我对 `pacman` 基础命令的介绍。 -------------------------------------------------------------------------------- @@ -222,7 +216,7 @@ via: https://itsfoss.com/pacman-command/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 36746c58594919e01f015bb0a1caa58a17c1b9f5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 11:15:15 +0800 Subject: [PATCH 167/213] PUB @Chao-zhi https://linux.cn/article-13099-1.html --- ... With Pacman Commands in Arch-based Linux Distributions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md (99%) diff --git a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md similarity index 99% rename from translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md rename to published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index f40785007d..ca96c39363 100644 --- a/translated/tech/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13099-1.html) [#]: subject: (Getting Started With Pacman Commands in Arch-based Linux Distributions) [#]: via: (https://itsfoss.com/pacman-command/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) From 21a0c9bcaddc3755d2721a90fe99b96d5673f2a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 12:41:18 +0800 Subject: [PATCH 168/213] PRF --- ...ed With Pacman Commands in Arch-based Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md index ca96c39363..8171a81ede 100644 --- a/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md +++ b/published/20200419 Getting Started With Pacman Commands in Arch-based Linux Distributions.md @@ -128,7 +128,7 @@ pactree 软件包名 但是,有必要定期清理缓存以防止文件夹增大。 -[pacman contrib][19] 包中提供的 [paccache(80][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: +[pacman contrib][19] 包中提供的 [paccache(8)][18] 脚本默认情况下会删除已安装和未安装包的所有缓存版本,但最近 3 个版本除外: ``` paccache -r From 04cc3a2e7ff23fd6723f9f4a9346bbab56463660 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 13:44:16 +0800 Subject: [PATCH 169/213] PRF @geekpi --- ...he D programming language for scripting.md | 101 ++++++++---------- 1 file changed, 47 insertions(+), 54 deletions(-) diff --git a/translated/tech/20210127 Why I use the D programming language for scripting.md b/translated/tech/20210127 Why I use the D programming language for scripting.md index 94cd6db038..d2dc7759e4 100644 --- a/translated/tech/20210127 Why I use the D programming language for scripting.md +++ b/translated/tech/20210127 Why I use the D programming language for scripting.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Why I use the D programming language for scripting) @@ -9,16 +9,18 @@ 我为什么要用 D 语言写脚本? ====== -D 语言是以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 -![Business woman on laptop sitting in front of window][1] + +> D 语言以系统编程语言而闻名,但它也是编写脚本的一个很好的选择。 + +![](https://img.linux.net.cn/data/attachment/album/202102/09/134351j4m3hrhll0h38plp.jpg) D 语言由于其静态类型和元编程能力,经常被宣传为系统编程语言。然而,它也是一种非常高效的脚本语言。 -由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能不得不手动完成的重复性任务。 +由于 Python 在自动化任务和快速实现原型想法方面的灵活性,它通常被选为脚本语言。这使得 Python 对系统管理员、[管理者][2]和一般的开发人员非常有吸引力,因为它可以自动完成他们可能需要手动完成的重复性任务。 -我们有理由期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 +我们自然也可以期待任何其他的脚本编写语言具有 Python 的这些特性和能力。以下是我认为 D 是一个不错的选择的两个原因。 -### 1\. D 很容易读和写 +### 1、D 很容易读和写 作为一种类似于 C 的语言,D 应该是大多数程序员所熟悉的。任何使用 JavaScript、Java、PHP 或 Python 的人对 D 语言都很容易上手。 @@ -26,7 +28,6 @@ D 语言由于其静态类型和元编程能力,经常被宣传为系统编程 下面是一个 D 代码的例子,它从一个名为 `words.txt` 的文件中读取单词,并在命令行中打印出来: - ``` open source @@ -36,43 +37,39 @@ cool 用 D 语言写脚本: - ``` -// file print_words.d - #!/usr/bin/env rdmd +// file print_words.d // import the D standard library import std; void main(){ -    // open the file -     File("./words.txt") + // open the file + File("./words.txt") -         //iterate by line -        .byLine + //iterate by line + .byLine -        // print each number -        .each!writeln; + // print each number + .each!writeln; } ``` -这段代码的前缀是 [shebang][6],它将使用 [rdmd][7] 来运行这段代码,rdmd 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: +这段代码以 [释伴][6] 开头,它将使用 [rdmd][7] 来运行这段代码,`rdmd` 是 D 编译器自带的编译和运行代码的工具。假设你运行的是 Unix 或 Linux,在运行这个脚本之前,你必须使用` chmod` 命令使其可执行: ``` -`chmod u+x print_words.d` +chmod u+x print_words.d ``` 现在脚本是可执行的,你可以运行它: - ``` -`./print_words.d` +./print_words.d ``` 这将在你的命令行中打印以下内容: - ``` open source @@ -84,70 +81,66 @@ cool 试着再写一个脚本:一个非营利组织的管理员有一个捐款的文本文件,每笔金额都是单独的一行。管理员想把前 10 笔捐款相加,然后打印出金额: - ``` -// file sum_donations.d - #!/usr/bin/env rdmd +// file sum_donations.d import std; void main() { -    double total = 0; + double total = 0; -    // open the file -    File("monies.txt") + // open the file + File("monies.txt") -         // iterate by line -        .byLine + // iterate by line + .byLine -         // pick first 10 lines -        .take(10) + // pick first 10 lines + .take(10) -        // remove new line characters (\n) -        .map!(strip) + // remove new line characters (\n) + .map!(strip) -         // convert each to double -        .map!(to!double) + // convert each to double + .map!(to!double) -        // add element to total -        .tee!((x) { total += x; }) + // add element to total + .tee!((x) { total += x; }) -        // print each number -        .each!writeln; + // print each number + .each!writeln; -    // print total -    writeln("total: ", total); + // print total + writeln("total: ", total); } ``` 与 `each` 一起使用的 `!` 操作符是[模板参数][9]的语法。 -### 2\. D 是快速原型设计的好帮手 +### 2、D 是快速原型设计的好帮手 -D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的[基于范围的接口][10]面向处理序列。 - - -上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的第三方包的生态系统,用于执行普通任务。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: +D 是灵活的,它可以快速地将代码敲打在一起,并使其发挥作用。它的标准库中包含了丰富的实用函数,用于执行常见的任务,如操作数据(JSON、CSV、文本等)。它还带有一套丰富的通用算法,用于迭代、搜索、比较和 mutate 数据。这些巧妙的算法通过定义通用的 [基于范围的接口][10] 而按照序列进行处理。 +上面的脚本显示了 D 中的链式调用函数如何提供顺序处理和操作数据的要领。D 的另一个吸引人的地方是它不断增长的用于执行普通任务的第三方包的生态系统。一个例子是,使用 [Vibe.d][11] web 框架构建一个简单的 web 服务器很容易。下面是一个例子: ``` #!/usr/bin/env dub /+ dub.sdl: -dependency "vibe-d" version="~>0.8.0" +dependency "vibe-d" version="~>0.8.0" +/ void main() { -    import vibe.d; -    listenHTTP(":8080", (req, res) { -        res.writeBody("Hello, World: " ~ req.path); -    }); -    runApplication(); + import vibe.d; + listenHTTP(":8080", (req, res) { + res.writeBody("Hello, World: " ~ req.path); + }); + runApplication(); } ``` -它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 +它使用官方的 D 软件包管理器 [Dub][12],从 [D 软件包仓库][13]中获取 vibe.d Web 框架。Dub 负责下载 Vibe.d 包,然后在本地主机 8080 端口上编译并启动一个 web 服务器。 ### 尝试一下 D 语言 @@ -162,7 +155,7 @@ via: https://opensource.com/article/21/1/d-scripting 作者:[Lawrence Aberba][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 73b0b1d08e8152dc63337a751d33be15099ab331 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 13:44:53 +0800 Subject: [PATCH 170/213] PUB @geekpi https://linux.cn/article-13100-1.html --- ...0127 Why I use the D programming language for scripting.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210127 Why I use the D programming language for scripting.md (98%) diff --git a/translated/tech/20210127 Why I use the D programming language for scripting.md b/published/20210127 Why I use the D programming language for scripting.md similarity index 98% rename from translated/tech/20210127 Why I use the D programming language for scripting.md rename to published/20210127 Why I use the D programming language for scripting.md index d2dc7759e4..63618522ea 100644 --- a/translated/tech/20210127 Why I use the D programming language for scripting.md +++ b/published/20210127 Why I use the D programming language for scripting.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13100-1.html) [#]: subject: (Why I use the D programming language for scripting) [#]: via: (https://opensource.com/article/21/1/d-scripting) [#]: author: (Lawrence Aberba https://opensource.com/users/aberba) From b621aec005305e4f3acfbe0a180b0c861474a352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 9 Feb 2021 18:18:37 +0800 Subject: [PATCH 171/213] translating by Chao-zhi --- ...p a Tiling Makeover With Material Shell GNOME Extension.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md index b273ef33b3..47097fa9a9 100644 --- a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md +++ b/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Chao-zhi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -104,7 +104,7 @@ via: https://itsfoss.com/material-shell/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Chao-zhi](https://github.com/Chao-zhi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c875016e322f371ede1f1ac6032c2257da7b022d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=B6=85=E6=99=BA?= Date: Tue, 9 Feb 2021 21:49:00 +0800 Subject: [PATCH 172/213] translate done: 20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md --- ...ver With Material Shell GNOME Extension.md | 128 ----------------- ...ver With Material Shell GNOME Extension.md | 130 ++++++++++++++++++ 2 files changed, 130 insertions(+), 128 deletions(-) delete mode 100644 sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md create mode 100644 translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md diff --git a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md deleted file mode 100644 index 47097fa9a9..0000000000 --- a/sources/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md +++ /dev/null @@ -1,128 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (Chao-zhi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension) -[#]: via: (https://itsfoss.com/material-shell/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) - -Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension -====== - -There is something about tiling windows that attracts many people. Perhaps it looks good or perhaps it is time-saving if you are a fan of [keyboard shortcuts in Linux][1]. Or maybe it’s the challenge of using the uncommon tiling windows. - -![Tiling Windows in Linux | Image Source][2] - -From i3 to [Sway][3], there are so many tiling window managers available for Linux desktop. Configuring a tiling window manager itself requires a steep learning curve. - -This is why projects like [Regolith desktop][4] exist to give you preconfigured tiling desktop so that you can get started with tiling windows with less effort. - -Let me introduce you to a similar project named Material Shell that makes using tiling feature even easier than [Regolith][5]. - -### Material Shell GNOME Extension: Convert GNOME desktop into a tiling window manager - -[Material Shell][6] is a GNOME extension and that’s the best thing about it. This means that you don’t have to log out and log in to another desktop environment or window manager. You can enable or disable it from within your current session. - -I’ll list the features of Material Shell but it will be easier to see it in action: - -[Subscribe to our YouTube channel for more Linux videos][7] - -The project is called Material Shell because it follows the [Material Design][8] guideline and thus gives the applications an aesthetically pleasing interface. Here are its main features: - -#### Intuitive interface - -Material Shell adds a left panel for quick access. On this panel, you can find the system tray at the bottom and the search and workspaces on the top. - -All the new apps are added to the current workspace. You can create new workspace and switch to it for organizing your running apps into categories. This is the essential concept of workspace anyway. - -In Material Shell, every workspace can be visualized as a row with several apps rather than a box with several apps in it. - -#### Tiling windows - -In a workspace, you can see all your opened applications on the top all the time. By default, the applications are opened to take the entire screen like you do in GNOME desktop. You can change the layout to split it in half or multiple columns or a grid of apps using the layout changer in the top right corner. - -This video shows all the above features at a glance: - -#### Persistent layout and workspaces - -That’s not it. Material Shell also remembers the workspaces and windows you open so that you don’t have to reorganize your layout again. This is a good feature to have as it saves time if you are particular about which application goes where. - -#### Hotkeys/Keyboard shortcut - -Like any tiling windows manager, you can use keyboard shortcuts to navigate between applications and workspaces. - - * `Super+W` Navigate to the upper workspace. - * `Super+S` Navigate to the lower workspace. - * `Super+A` Focus the window at the left of the current window. - * `Super+D` Focus the window at the right of the current window. - * `Super+1`, `Super+2` … `Super+0` Navigate to specific workspace - * `Super+Q` Kill the current window focused. - * `Super+[MouseDrag]` Move window around. - * `Super+Shift+A` Move the current window to the left. - * `Super+Shift+D` Move the current window to the right. - * `Super+Shift+W` Move the current window to the upper workspace. - * `Super+Shift+S` Move the current window to the lower workspace. - - - -### Installing Material Shell - -Warning! - -Tiling windows could be confusing for many users. You should be familiar with GNOME Extensions to use it. Avoid trying it if you are absolutely new to Linux or if you are easily panicked if anything changes in your system. - -Material Shell is a GNOME extension. So, please [check your desktop environment][9] to make sure you are running _**GNOME 3.34 or higher version**_. - -I would also like to add that tiling windows could be confusing for many users. - -Apart from that, I noticed that after disabling Material Shell it removes the top bar from Firefox and the Ubuntu dock. You can get the dock back by disabling/enabling Ubuntu dock extension from the Extensions app in GNOME. I haven’t tried but I guess these problems should also go away after a system reboot. - -I hope you know [how to use GNOME extensions][10]. The easiest way is to just [open this link in the browser][11], install GNOME extension plugin and then enable the Material Shell extension. - -![][12] - -If you don’t like it, you can disable it from the same extension link you used earlier or use the GNOME Extensions app: - -![][13] - -**To tile or not?** - -I use multiple screens and I found that Material Shell doesn’t work well with multiple monitors. This is something the developer(s) can improve in the future. - -Apart from that, it’s a really easy to get started with tiling windows with Material Shell. If you try Material Shell and like it, appreciate the project by [giving it a star or sponsoring it on GitHub][14]. - -For some reasons, tiling windows are getting popular. Recently released [Pop OS 20.04][15] also added tiling window features. - -But as I mentioned previously, tiling layouts are not for everyone and it could confuse many people. - -How about you? Do you prefer tiling windows or you prefer the classic desktop layout? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/material-shell/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者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/ubuntu-shortcuts/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux-ricing-example-800x450.jpg?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/sway-window-manager/ -[4]: https://itsfoss.com/regolith-linux-desktop/ -[5]: https://regolith-linux.org/ -[6]: https://material-shell.com -[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 -[8]: https://material.io/ -[9]: https://itsfoss.com/find-desktop-environment/ -[10]: https://itsfoss.com/gnome-shell-extensions/ -[11]: https://extensions.gnome.org/extension/3357/material-shell/ -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/install-material-shell.png?resize=800%2C307&ssl=1 -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/material-shell-gnome-extension.png?resize=799%2C497&ssl=1 -[14]: https://github.com/material-shell/material-shell -[15]: https://itsfoss.com/pop-os-20-04-review/ diff --git a/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md b/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md new file mode 100644 index 0000000000..cefcca8080 --- /dev/null +++ b/translated/tech/20200922 Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension.md @@ -0,0 +1,130 @@ +[#]: collector: (lujun9972) +[#]: translator: (Chao-zhi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Give Your GNOME Desktop a Tiling Makeover With Material Shell GNOME Extension) +[#]: via: (https://itsfoss.com/material-shell/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) + +使用 Material Shell 扩展将你的 GNOME 桌面打造成平铺式风格 +====== + +平铺式窗口的特性吸引了很多人的追捧。也许是因为他很好看,也许是因为对于 [linux 快捷键 ][1] 玩家他能提高效率。又或者是因为使用不同寻常的平铺式窗口是一种挑战。 + +![Tiling Windows in Linux | Image Source][2] + +从 i3 到 [Sway][3],linux 桌面拥有各种各样的平铺式窗口管理器。配置一个平铺式窗口管理器需要一个陡峭的学习曲线。 + +这就是为什么像 [Regolith desktop][4] 这样的项目会存在,它给你提供一个已经配置好的平铺式桌面。所以你不需要做大多的准备就可以直接开始使用。 + +让我给你介绍一个相似的项目 ——Material Shell。它可以让你用上平铺式桌面,甚至比 [Regolith][5] 还简单。 + +### Material Shell 扩展:将 GNOME 桌面转变成平铺式窗口管理器 + +[Material Shell][6] 是一个 GNOME 扩展,这就是它最好的点。这意味着你不需要注销并登陆其他桌面环境。你只需要启用或关闭这个扩展就可以自如的切换你的工作环境。 + +我会列出 Material Shell 的各种特性,但是也许视频更容易让你理解: + +[Subscribe to our YouTube channel for more Linux videos][7] + +这个项目叫做 Material Shell 是因为他遵循 [Material Design][8] 原则。因此这个应用拥有一个美观的界面。这就是他最重要的一个特性。 + +#### 直观的界面 + +Material Shell 添加了一个左侧面板,可以快速访问。在此面板上,您可以在底部找到系统托盘,在顶部找到搜索和工作区。 + +所有新打开的应用都会添加到当前工作区中。您也可以创建新的工作区并切换到该工作区,以将正在运行的应用分类。其实这就是工作区最初的意义。 + +在 Material Shell 中,每个工作区都可以显示为具有多个应用程序的行列,而不是包含多个应用程序的程序框。 + +#### 平铺式窗口 + +在工作区中,你可以看到所有打开的应用程序都在顶部。默认情况下,应用程序会像在 GNOME desktop 中那样铺满整个屏幕。你可以使用右上角的布局改变器来改变布局,将其分成两半、多列或多个应用网格。 + +这段视频一目了然的显示了以上所有功能: + +<!-- 丢了个视频链接,我不知道怎么添加 --> + +#### 固定布局和工作区 + +Material Shell 会记住你打开的工作区和窗口,这样你就不必重新组织你的布局。这是一个很好的特性,因为如果您对应用程序的位置有要求的话,它可以节省时间。 + +#### 热建/快捷键 + +像任何平铺窗口管理器一样,您可以使用键盘快捷键在应用程序和工作区之间切换。 + + * `Super+W` 切换到上个工作区; + * `Super+S` 切换到下个工作区; + * `Super+A` 切换到左边的窗口; + * `Super+D` 切换到右边的窗口; + * `Super+1`,`Super+2` … `Super+0` 切换到某个指定的工作区; + * `Super+Q` 关闭当前窗口; + * `Super+[MouseDrag]` 移动窗口; + * `Super+Shift+A` 将当前窗口左移; + * `Super+Shift+D` 将当前窗口右移; + * `Super+Shift+W` 将当前窗口上移; + * `Super+Shift+S` 将当前窗口下移。 + + + +### 安装 Material Shell + +警告! + +对于大多数用户来说,平铺式窗口可能会导致混乱。你最好先熟悉如何使用 GNOME 扩展。如果你是 Linux 新手或者你害怕你的系统发生翻天覆地的变化,你应当避免使用这个扩展。 + +Material Shell 是一个 GNOME 扩展。所以,请你[检查你的桌面环境 ][9] 确保它是 _**GNOME 3.34 或者更高的版本**_。 + +我还想补充一点,平铺窗口可能会让许多用户感到困惑。 + +除此之外,我注意到在禁用 Material Shell 之后,它会导致 Firefox 和 Ubuntu dock 的顶栏消失。你可以在 GNOME 的扩展应用程序中禁用/启用 Ubuntu 的 dock 扩展来使其变回原来的样子。我想这些问题也应该在系统重启后消失,虽然我没试过。 + +我希望你知道[如何使用 GNOME 扩展 ][10]。最简单的办法就是[在浏览器中打开这个链接 ][11],安装 GNOME 扩展浏览器插件并且启用 Material Shell 扩展。 + +![][12] + +如果你不喜欢这个扩展,你也可以在同样的链接中禁用它。或者在 GNOME 扩展程序中禁用它。 + +![][13] + +**使不使用平铺式** + +我使用多个电脑屏幕,我发现 Material Shell 不适用于多个屏幕的情况。这是开发者将来可以改进的地方。 + +除了这个毛病以外,Material Shell 是个让你开始使用平铺式窗口的好东西。如果你尝试了 Material Shell 并且喜欢它,请通过[给它一个星或在 GitHub 上赞助它 ][14] 来鼓励这个项目。 + +由于某些原因,平铺窗户越来越受欢迎。最近发布的 [Pop OS 20.04][15] 也增加了平铺窗口的功能。 + +但正如我前面提到的,平铺布局并不适合所有人,它可能会让很多人感到困惑。 + +你呢?你是喜欢平铺窗口还是喜欢经典的桌面布局? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/material-shell/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[Chao-zhi](https://github.com/Chao-zhi) +校对:[校对者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/ubuntu-shortcuts/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/09/linux-ricing-example-800x450.jpg?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/sway-window-manager/ +[4]: https://itsfoss.com/regolith-linux-desktop/ +[5]: https://regolith-linux.org/ +[6]: https://material-shell.com +[7]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[8]: https://material.io/ +[9]: https://itsfoss.com/find-desktop-environment/ +[10]: https://itsfoss.com/gnome-shell-extensions/ +[11]: https://extensions.gnome.org/extension/3357/material-shell/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/install-material-shell.png?resize=800%2C307&ssl=1 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/09/material-shell-gnome-extension.png?resize=799%2C497&ssl=1 +[14]: https://github.com/material-shell/material-shell +[15]: https://itsfoss.com/pop-os-20-04-review/ From c38e90b64b9a8a2af98278f02d36f43e87eaa6d2 Mon Sep 17 00:00:00 2001 From: sanle <31087327+chensanle@users.noreply.github.com> Date: Tue, 9 Feb 2021 22:11:06 +0800 Subject: [PATCH 173/213] Update 20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md --- ...mux Command Examples To Manage Multiple Terminal Sessions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index d9ed871a10..2db2b57b40 100644 --- a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: ( chensanle ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1a01aecac5de235b467de4f4bbffc0d667dd06a3 Mon Sep 17 00:00:00 2001 From: Percy Date: Tue, 9 Feb 2021 23:08:05 +0800 Subject: [PATCH 174/213] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87:?= =?UTF-8?q?=20Where=20are=20all=20the=20IoT=20experts=20going=20to=20come?= =?UTF-8?q?=20from?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190626 Where are all the IoT experts going to come from.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md index 22a303d2f6..638f058a98 100644 --- a/sources/talk/20190626 Where are all the IoT experts going to come from.md +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (scvoet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 91837a20a8a7173fbbbd09dcc26ed20d273aa365 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 23:17:35 +0800 Subject: [PATCH 175/213] PUB @wxy https://linux.cn/article-13103-1.html --- ...1228 The Zen of Python- Why timing is everything.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) rename {translated/tech => published}/20191228 The Zen of Python- Why timing is everything.md (89%) diff --git a/translated/tech/20191228 The Zen of Python- Why timing is everything.md b/published/20191228 The Zen of Python- Why timing is everything.md similarity index 89% rename from translated/tech/20191228 The Zen of Python- Why timing is everything.md rename to published/20191228 The Zen of Python- Why timing is everything.md index 1e00ed28cb..6ebab5320a 100644 --- a/translated/tech/20191228 The Zen of Python- Why timing is everything.md +++ b/published/20191228 The Zen of Python- Why timing is everything.md @@ -1,18 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13103-1.html) [#]: subject: (The Zen of Python: Why timing is everything) [#]: via: (https://opensource.com/article/19/12/zen-python-timeliness) [#]: author: (Moshe Zadka https://opensource.com/users/moshez) -Python 之禅:为什么时间就是一切 +Python 之禅:时机最重要 ====== -> 这是 Python 之禅特别系列的一部分,重点是第十五和第十六条原则:现在与永远。 +> 这是 Python 之禅特别系列的一部分,重点是第十五和第十六条原则:现在与将来。 -!["桌子上的时钟、笔和记事本"][1] +![](https://img.linux.net.cn/data/attachment/album/202102/09/231557dkuzz22ame4ja2jj.jpg) Python 一直在不断发展。Python 社区对特性请求的渴求是无止境的,对现状也总是不满意的。随着 Python 越来越流行,这门语言的变化会影响到更多的人。 From 9b6ecd258b004709b9305b6d4386895c7a40dfb1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 23:29:15 +0800 Subject: [PATCH 176/213] APL --- ...w to tell if implementing your Python code is a good idea.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md b/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md index 4a059faafc..6eb84791b8 100644 --- a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md +++ b/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 04e44f768971109b3b92b225b3cdda990c80f333 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 9 Feb 2021 23:55:11 +0800 Subject: [PATCH 177/213] TSL&PRF --- ...menting your Python code is a good idea.md | 46 ------------------ ...menting your Python code is a good idea.md | 47 +++++++++++++++++++ 2 files changed, 47 insertions(+), 46 deletions(-) delete mode 100644 sources/tech/20191229 How to tell if implementing your Python code is a good idea.md create mode 100644 translated/tech/20191229 How to tell if implementing your Python code is a good idea.md diff --git a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md b/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md deleted file mode 100644 index 6eb84791b8..0000000000 --- a/sources/tech/20191229 How to tell if implementing your Python code is a good idea.md +++ /dev/null @@ -1,46 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to tell if implementing your Python code is a good idea) -[#]: via: (https://opensource.com/article/19/12/zen-python-implementation) -[#]: author: (Moshe Zadka https://opensource.com/users/moshez) - -How to tell if implementing your Python code is a good idea -====== -This is part of a special series about the Zen of Python focusing on the -17th and 18th principles: hard vs. easy. -![Brick wall between two people, a developer and an operations manager][1] - -A language does not exist in the abstract. Every single language feature has to be implemented in code. It is easy to promise some features, but the implementation can get hairy. Hairy implementation means more potential for bugs, and, even worse, a maintenance burden for the ages. - -The [Zen of Python][2] has answers for this conundrum. - -### If the implementation is hard to explain, it's a bad idea. - -The most important thing about programming languages is predictability. Sometimes we explain the semantics of a certain construct in terms of abstract programming models, which do not correspond exactly to the implementation. However, the best of all explanations just _explains the implementation_. - -If the implementation is hard to explain, it means the avenue is impossible. - -### If the implementation is easy to explain, it may be a good idea. - -Just because something is easy does not mean it is worthwhile. However, once it is explained, it is much easier to judge whether it is a good idea. - -This is why the second half of this principle intentionally equivocates: nothing is certain to be a good idea, but it always allows people to have that discussion. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/19/12/zen-python-implementation - -作者:[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/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager) -[2]: https://www.python.org/dev/peps/pep-0020/ diff --git a/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md b/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md new file mode 100644 index 0000000000..e468233c23 --- /dev/null +++ b/translated/tech/20191229 How to tell if implementing your Python code is a good idea.md @@ -0,0 +1,47 @@ +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to tell if implementing your Python code is a good idea) +[#]: via: (https://opensource.com/article/19/12/zen-python-implementation) +[#]: author: (Moshe Zadka https://opensource.com/users/moshez) + +如何判断实现你的 Python 代码是否是个好主意? +====== + +> 这是 Python 之禅特别系列的一部分,重点介绍第十七和十八条原则:困难和容易。 + +!["开发人员和运营经理两个人之间的砖墙"][1] + +一门语言并不是抽象存在的。每一个语言功能都必须用代码来实现。承诺一些功能是很容易的,但实现起来就会很麻烦。复杂的实现意味着更多潜在的 bug,甚至更糟糕的是,会带来日复一日的维护负担。 + +对于这个难题,[Python 之禅][2] 中有答案。 + +### 如果一个实现难以解释,那就是个坏思路If the implementation is hard to explain, it's a bad idea + +编程语言最重要的是可预测性。有时我们用抽象的编程模型来解释某个结构的语义,而这些模型与实现并不完全对应。然而,最好的解释只是*解释实现*。 + +如果该实现很难解释,那就意味着这个途径是不可能的。 + +### 如果一个实现易于解释,那它可能是一个好思路If the implementation is easy to explain, it may be a good idea + +仅仅因为某事容易,并不意味着它值得。然而,一旦解释清楚,判断它是否是一个好思路就容易得多。 + +这也是为什么这个原则的后半部分故意含糊其辞的原因:没有什么可以肯定一定是好的,但总是可以讨论一下。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/19/12/zen-python-implementation + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/devops_confusion_wall_questions.png?itok=zLS7K2JG (Brick wall between two people, a developer and an operations manager) +[2]: https://www.python.org/dev/peps/pep-0020/ From 339bbf3fc55e64cc225b88e8a5de49d6981dc0c0 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Wed, 10 Feb 2021 00:04:05 +0800 Subject: [PATCH 178/213] =?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 --- ...aybooks Quick Start Guide with Examples.md | 160 +++++++++--------- 1 file changed, 77 insertions(+), 83 deletions(-) rename {sources => translated}/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md (57%) diff --git a/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md b/translated/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md similarity index 57% rename from sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md rename to translated/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md index 8d47286681..b2e80cc517 100644 --- a/sources/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md +++ b/translated/tech/20200129 Ansible Playbooks Quick Start Guide with Examples.md @@ -1,96 +1,90 @@ -[#]: collector: (lujun9972) -[#]: translator: (MjSeven) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Ansible Playbooks Quick Start Guide with Examples) -[#]: via: (https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/) -[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/) +[#]: collector: "lujun9972" +[#]: translator: "MjSeven" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "Ansible Playbooks Quick Start Guide with Examples" +[#]: via: "https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/" +[#]: author: "Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/" -Ansible Playbooks Quick Start Guide with Examples +Ansible 剧本快速入门指南 ====== -We have already written two articles about Ansible, this is the third article. +我们已经写了两篇关于 Ansible 的文章,这是第三篇。 -If you are new to Ansible, I advise you to read the two topics below, which will teach you the basics of Ansible and what it is. +如果你是 Ansible 新手,我建议你阅读下面这两篇文章,它会教你一些 Ansible 的基础以及它是什么。 - * **Part-1: [How to Install and Configure Ansible on Linux][1]** - * **Part-2: [Ansible ad-hoc Command Quick Start Guide][2]** + * **第一篇: [在 Linux 如何安装和配置 Ansible][1]** + * **第二篇: [Ansible ad-hoc 命令快速入门指南][2]** +如果你已经阅读过了,那么在阅读本文时你才不会感到突兀。 +### 什么是 Ansible 剧本? -If you have finished them, you will feel the continuity as you read this article. +剧本比临时命令模式更强大,而且完全不同。 -### What is the Ansible Playbook? +它使用了 **"/usr/bin/ansible-playbook"** 二进制文件,并且提供丰富的特性使得复杂的任务变得更容易。 -Playbooks are much more powerful and completely different way than ad-hoc command mode. +如果你想经常运行一个任务,剧本是非常有用的。 -It uses the **“/usr/bin/ansible-playbook”** binary. It provides rich features to make complex task easier. +此外,如果你想在服务器组上执行多个任务,它也是非常有用的。 -Playbooks are very useful if you want to run a task often. +剧本由 YAML 语言编写。YAML 代表一种标记语言,它比其它常见的数据格式(如 XML 或 JSON)更容易读写。 -Also, this is useful if you want to perform multiple tasks at the same time on the group of server. - -Playbooks are written in YAML language. YAML stands for Ain’t Markup Language, which is easier for humans to read and write than other common data formats such as XML or JSON. - -The Ansible Playbook Flow Chart below will tell you its detailed structure. +下面这张 Ansible 剧本流程图将告诉你它的详细结构。 ![][3] -### Understanding the Ansible Playbooks Terminology +### 理解 Ansible 剧本的术语 - * **Control Node:** The machine where Ansible is installed. It is responsible for managing client nodes. - * **Managed Nodes:** List of hosts managed by the control node - * **Playbook:** A Playbook file contains a set of procedures used to automate a task. - * **Inventory:** The inventory file contains information about the servers you manage. - * **Task:** Each play has multiple tasks, tasks that are executed one by one against a given machine (it a host or multiple host or a group of host). - * **Module:** Modules are a unit of code that is used to gather information from the client node. - * **Role:** Roles are ways to automatically load some vars_files, tasks, and handlers based on known file structure. - * **Play:** Each playbook has multiple plays, and a play is the implementation of a particular automation from beginning to end. - * **Handlers:** This helps you reduce any service restart in a play. Lists of handler tasks are not really different from regular tasks, and changes are notified by notifiers. If the handler does not receive any notification, it will not work. + * **控制节点:** Ansible 安装的机器,它负责管理客户端节点。 + * **被控节点:** 被控制节点管理的主机列表。 + * **剧本:** 一个剧本文件,包含一组自动化任务。 + * **主机清单:*** 这个文件包含有关管理的服务器的信息。 + * **任务:** 每个剧本都有大量的任务。任务在指定机器上依次执行(一个主机或多个主机)。 + * **模块:** 模块是一个代码单元,用于从客户端节点收集信息。 + * **角色:** 角色是根据已知文件结构自动加载一些变量文件、任务和处理程序的方法。 + * **Play:** 每个剧本含有大量的 play, 一个 play 从头到尾执行一个特定的自动化。 + * **Handlers:** 它可以帮助你减少在剧本中的重启任务。处理程序任务列表实际上与常规任务没有什么不同,更改由通知程序通知。如果处理程序没有收到任何通知,它将不起作用。 +### 基本的剧本是怎样的? +下面是一个剧本的模板: -### How Does the Basic Playbook looks Like? - -Here’s how the basic playbook looks. - -``` ---- [YAML file should begin with a three dash] -- name: [Description about a script] - hosts: group [Add a host or host group] - become: true [It requires if you want to run a task as a root user] - tasks: [What action do you want to perform under task] - - name: [Enter the module options] - module: [Enter a module, which you want to perform] - module_options-1: value [Enter the module options] +```yaml +--- [YAML 文件应该以三个破折号开头] +- name: [脚本描述] + hosts: group [添加主机或主机组] + become: true [如果你想以 root 身份运行任务,则标记它] + tasks: [你想在任务下执行什么动作] + - name: [输入模块选项] + module: [输入要执行的模块] + module_options-1: value [输入模块选项] module_options-2: value . module_options-N: value ``` -### How to Understand Ansible Output +### 如何理解 Ansible 的输出 -The Ansible Playbook output comes with 4 colors, see below for color definitions. +Ansible 剧本的输出有四种颜色,下面是具体含义: - * **Green:** **ok –** If that is correct, the associated task data already exists and configured as needed. - * **Yellow: changed –** Specific data has updated or modified according to the needs of the tasks. - * **Red: FAILED –** If there is any problem while doing a task, it returns a failure message, it may be anything and you need to fix it accordingly. - * **White:** It comes with multiple parameters + * **绿色:** **ok –** 代表成功,关联的任务数据已经存在,并且已经根据需要进行了配置。 + * **黄色: 已更改 –** 指定的数据已经根据任务的需要更新或修改。 + * **红色: 失败–** 如果在执行任务时出现任何问题,它将返回一个失败消息,它可能是任何东西,你需要相应地修复它。 + * **白色:** 表示有多个参数。 +为此,创建一个剧本目录,将它们都放在同一个地方。 - -To do so, create a playbook directory to keep them all in one place. - -``` +```bash $ sudo mkdir /etc/ansible/playbooks ``` -### Playbook-1: Ansible Playbook to Install Apache Web Server on RHEL Based Systems +### 剧本-1:在 RHEL 系统上安装 Apache Web 服务器 -This sample playbook allows you to install the Apache web server on a given target node. +这个示例剧本允许你在指定的目标机器上安装 Apache Web 服务器: -``` +```bash $ sudo nano /etc/ansible/playbooks/apache.yml --- @@ -108,17 +102,17 @@ $ sudo nano /etc/ansible/playbooks/apache.yml state: started ``` -``` +```bash $ ansible-playbook apache1.yml ``` ![][3] -### How to Understand Playbook Execution in Ansible +### 如何理解 Ansible 中剧本的执行 -To check the syntax error, run the following command. If it finds no error, it only shows the given file name. If it detects any error, you will get an error as follows, but the contents may differ based on your input file. +使用以下命令来查看语法错误。如果没有发现错误,它只显示剧本文件名。如果它检测到任何错误,你将得到一个如下所示的错误,但内容可能根据你的输入文件而有所不同。 -``` +```bash $ ansible-playbook apache1.yml --syntax-check ERROR! Syntax Error while loading YAML. @@ -143,11 +137,11 @@ Should be written as: # ^--- all spaces here. ``` -Alternatively, you can check your ansible-playbook content from online using the following url @ [YAML Lint][4] +或者,你可以使用这个 URL [YAML Lint][4] 在线检查 Ansible 剧本内容。 -Run the following command to perform a **“Dry Run”**. When you run a ansible-playbook with the **“–check”** option, it does not make any changes to the remote machine. Instead, it will tell you what changes they have made rather than create them. +执行以下命令进行**“演练”**。当你运行带有 **"-check"** 选项的剧本时,它不会对远程机器进行任何修改。相反,它会告诉你它将要做什么改变但不是真的执行。 -``` +```bash $ ansible-playbook apache.yml --check PLAY [Install and Configure Apache Webserver] ******************************************************************** @@ -169,9 +163,9 @@ node1.2g.lab : ok=3 changed=2 unreachable=0 failed=0 s node2.2g.lab : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` -If you want detailed information about your ansible playbook implementation, use the **“-vv”** verbose option. It shows what it really does to gather this information. +如果你想要知道 ansible 剧本实现的详细信息,使用 **"-vv"** 选项,它会展示如何收集这些信息。 -``` +```bash $ ansible-playbook apache.yml --check -vv ansible-playbook 2.9.2 @@ -212,11 +206,11 @@ node1.2g.lab : ok=3 changed=2 unreachable=0 failed=0 s node2.2g.lab : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 ``` -### Playbook-2: Ansible Playbook to Install Apache Web Server on Ubuntu Based Systems +### 剧本-2:在 Ubuntu 系统上安装 Apache Web 服务器 -This sample playbook allows you to install the Apache web server on a given target node. +这个示例剧本允许你在指定的目标节点上安装 Apache Web 服务器。 -``` +```bash $ sudo nano /etc/ansible/playbooks/apache-ubuntu.yml --- @@ -250,13 +244,13 @@ $ sudo nano /etc/ansible/playbooks/apache-ubuntu.yml enabled: yes ``` -### Playbook-3: Ansible Playbook to Install a List of Packages on Red Hat Based Systems +### 剧本-3:在 Red Hat 系统上安装软件包列表 -This sample playbook allows you to install a list of packages on a given target node. +这个示例剧本允许你在指定的目标节点上安装软件包。 -**Method-1:** +**方法-1:** -``` +```bash $ sudo nano /etc/ansible/playbooks/packages-redhat.yml --- @@ -273,9 +267,9 @@ $ sudo nano /etc/ansible/playbooks/packages-redhat.yml - htop ``` -**Method-2:** +**方法-2:** -``` +```bash $ sudo nano /etc/ansible/playbooks/packages-redhat-1.yml --- @@ -292,9 +286,9 @@ $ sudo nano /etc/ansible/playbooks/packages-redhat-1.yml - htop ``` -**Method-3: Using Array Variable** +**方法-3: 使用数组变量** -``` +```bash $ sudo nano /etc/ansible/playbooks/packages-redhat-2.yml --- @@ -309,11 +303,11 @@ $ sudo nano /etc/ansible/playbooks/packages-redhat-2.yml with_items: "{{ packages }}" ``` -### Playbook-4: Ansible Playbook to Install Updates on Linux Systems +### 剧本-4:在 Linux 系统上安装更新 -This sample playbook allows you to install updates on your Linux systems, running Red Hat and Debian-based client nodes. +这个示例剧本允许你在基于 Red Hat 或 Debian 的 Linux 系统上安装更新。 -``` +```bash $ sudo nano /etc/ansible/playbooks/security-update.yml --- @@ -336,7 +330,7 @@ via: https://www.2daygeek.com/ansible-playbooks-quick-start-guide-with-examples/ 作者:[Magesh Maruthamuthu][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[MjSeven](https://github.com/MjSeven) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5ef2f12d609c394cc49d83df44a87e156cb70963 Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 00:17:13 +0800 Subject: [PATCH 179/213] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87:?= =?UTF-8?q?=2020190626=20Where=20are=20all=20the=20IoT=20experts=20going?= =?UTF-8?q?=20to=20come=20from?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... all the IoT experts going to come from.md | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md index 638f058a98..223001f7ee 100644 --- a/sources/talk/20190626 Where are all the IoT experts going to come from.md +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -7,50 +7,50 @@ [#]: via: (https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts-going-to-come-from.html) [#]: author: (Fredric Paul https://www.networkworld.com/author/Fredric-Paul/) -Where are all the IoT experts going to come from? +物联网专家都从何而来? ====== -The fast growth of the internet of things (IoT) is creating a need to train cross-functional experts who can combine traditional networking and infrastructure expertise with database and reporting skills. +物联网 (IoT) 的快速发展催生了对跨职能专家进行培养的需求,这些专家可以将传统的网络和基础设施专业知识与数据库和报告技能相结合。 ![Kevin \(CC0\)][1] -If the internet of things (IoT) is going to fulfill its enormous promise, it’s going to need legions of smart, skilled, _trained_ workers to make everything happen. And right now, it’s not entirely clear where those people are going to come from. +如果物联网 (IoT) 要实现其宏伟的诺言,它将需要大量聪明、熟练、**训练有素**的工人军团来实现这一切。而现在,这些人将从何而来尚不清楚。 -That’s why I was interested in trading emails with Keith Flynn, senior director of product management, R&D at asset-optimization software company [AspenTech][2], who says that when dealing with the slew of new technologies that fall under the IoT umbrella, you need people who can understand how to configure the technology and interpret the data. Flynn sees a growing need for existing educational institutions to house IoT-specific programs, as well as an opportunity for new IoT-focused private colleges, offering a well -ounded curriculum +这就是我为什么有兴趣同资产优化软件公司 [AspenTech][2] 的产品管理、R&D 研发高级总监基思·弗林 (Keith Flynn) 通邮件,他说,当处理大量属于物联网范畴的新技术时,你需要能够理解如何配置技术和解释数据的人。弗林认为,现有的教育机构对物联网特定课程的需求越来越大,这同时也给了以物联网为重点,提供了完善课程的新私立学院机会。 -“In the future,” Flynn told me, “IoT projects will differ tremendously from the general data management and automation projects of today. … The future requires a more holistic set of skills and cross-trading capabilities so that we’re all speaking the same language.” +弗林跟我说,“在未来物联网项目将与如今普遍的数据管理和自动化项目有着巨大的不同......未来需要更全面的技能和交叉交易能力,这样我们才会说同一种语言。” -**[ Also read:  [20 hot jobs ambitious IT pros should shoot for][3] ]** +**[ 参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3] ]** -With the IoT growing 30% a year, Flynn added, rather than a few specific skills, “everything from traditional deployment skills, like networking and infrastructure, to database and reporting skills and, frankly, even basic data science, need to be understood together and used together.” +弗林补充说,随着物联网每年增长 30%,将不再依赖于几个特定的技能,“从传统的部署技能(如网络和基础设施)到数据库和报告技能,坦白说,甚至是基础数据科学,都将需要一起理解和使用。” -### Calling all IoT consultants +### 召集所有物联网顾问 -“The first big opportunity for IoT-educated people is in the consulting field,” Flynn predicted. “As consulting companies adapt or die to the industry trends … having IoT-trained people on staff will help position them for IoT projects and make a claim in the new line of business: IoT consulting.” +弗林预测,“受过物联网教育的人的第一个大机会将会是在咨询领域,随着咨询公司对行业趋势的适应或淘汰......有受过物联网培训的员工将有助于他们在物联网项目中的定位,并在新的业务线中提出要求——物联网咨询。” -The problem is especially acute for startups and smaller companies. “The bigger the organization, the more likely they have a means to hire different people across different lines of skillsets,” Flynn said. “But for smaller organizations and smaller IoT projects, you need someone who can do both.” +对初创企业和小型公司而言,这个问题尤为严重。“组织越大,他们越有可能雇佣到不同技术类别的人”弗林这样说到,“但对于较小的组织和较小的物联网项目来说,你则需要一个能同时兼顾的人。” -Both? Or _everything?_ The IoT “requires a combination of all knowledge and skillsets,” Flynn said, noting that “many of the skills aren’t new, they’ve just never been grouped together or taught together before.” +两者兼而有之?还是**一应俱全?**物联网“需要将所有知识和技能组合在一起”,弗林说到,“并不是所有技能都是全新的,只是在此之前从来没有被归纳在一起或放在一起教授过。” -**[ [Looking to upgrade your career in tech? This comprehensive online course teaches you how.][4] ]** +**【[想在技术领域提升自己的事业?这个全面的在线课程会教您该怎么做。][4]】** -### The IoT expert of the future +### 未来的物联网专家 -True IoT expertise starts with foundational instrumentation and electrical skills, Flynn said, which can help workers implement new wireless transmitters and boost technology for better battery life and power consumption. +弗林表示,真正的物联网专业技术是从基础的仪器仪表和电气技能开始的,这能帮助工人发明新的无线发射器或提升技术,以提高电池寿命和功耗。 -“IT skills, like networking, IP addressing, subnet masks, cellular and satellite are also pivotal IoT needs,” Flynn said. He also sees a need for database management skills and cloud management and security expertise, “especially as things like [advanced process control] APC and sending sensor data directly to databases and data lakes become the norm.” +“IT 技能,如网络、IP 寻址、子网掩码、蜂窝和卫星也是物联网的关键需求”,弗林说。他还认为物联网需要数据库管理技能和云管理和安全专业知识,“特别是当高级过程控制 (APC) 将传感器数据直接发送到数据库和数据湖等事情成为常态时。” -### Where will IoT experts come from? +### 物联网专家又从何而来? -Flynn said standardized formal education courses would be the best way to make sure that graduates or certificate holders have the right set of skills. He even laid out a sample curriculum: “Start in chronological order with the basics like [Electrical & Instrumentation] E&I and measurement. Then teach networking, and then database administration and cloud courses should follow that. This degree could even be looped into an existing engineering course, and it would probably take two years … to complete the IoT component.” +弗林说,标准化的正规教育课程将是确保毕业生或证书持有者掌握一套正确技能的最佳途径。他甚至还列出了一个样本课程。“按时间顺序开始,从基础知识开始,比如[电气&仪表]E&I和测量。然后讲授网络知识,数据库管理和云计算课程都应在此之后开展。这个学位甚至可以循序渐进至现有的工程课程中,这可能需要两年时间......来完成物联网部分的学业。” -While corporate training could also play role, “that’s easier said than done,” Flynn warned. “Those trainings will need to be organization-specific efforts and pushes.” +虽然企业培训也能发挥作用,但实际上却是“说起来容易做起来难”,弗林这样警告,“这些培训需要针对组织的具体努力而推动。” -Of course, there are already [plenty of online IoT training courses and certificate programs][5]. But, ultimately, the responsibility lies with the workers themselves. +当然,现在市面上已经有了[大量的在线物联网培训课程和证书课程][5]。但追根到底,这一工作全都依赖于工人自身的推断。 -“Upskilling is incredibly important in this world as tech continues to transform industries,” Flynn said. “If that upskilling push doesn’t come from your employer, then online courses and certifications would be an excellent way to do that for yourself. We just need those courses to be created. ... I could even see organizations partnering with higher-education institutions that offer these courses to give their employees better access to it. Of course, the challenge with an IoT program is that it will need to constantly evolve to keep up with new advancements in tech.” +“在这个世界上,随着科技不断改变行业,提升技能是非常重要的”,弗林说,“如果这种提升技能的推动力并不是来源于你的雇主,那么在线课程和认证将会是提升你自己很好的一个方式。我们只需要创建这些课程......我甚至可以预见组织将与提供这些课程的高等教育机构合作,让他们的员工更好地开始。当然,物联网课程的挑战在于它需要不断发展以跟上科技的发展。” -**[ For more on IoT, see [tips for securing IoT on your network][6], our list of [the most powerful internet of things companies][7] and learn about the [industrial internet of things][8]. | Get regularly scheduled insights by [signing up for Network World newsletters][9]. ]** +**【有关物联网的更多信息,请参阅[在网络上确保物联网安全的提醒][6],我们的[最强大的物联网公司][7]列表,并了解[工业物联网][8]。 | 通过[注册网络世界新闻通讯][9]定期获取见解。】** -Join the Network World communities on [Facebook][10] and [LinkedIn][11] to comment on topics that are top of mind. +参与[脸书][10]和[领英][11]上的网络世界社区,对最重要的话题进行评论。 -------------------------------------------------------------------------------- @@ -58,7 +58,7 @@ via: https://www.networkworld.com/article/3404489/where-are-all-the-iot-experts- 作者:[Fredric Paul][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[Percy (@scvoet)](https://github.com/scvoet) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2dad7e9e04d9c230280ac66d2d46ab1390128d98 Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 00:17:55 +0800 Subject: [PATCH 180/213] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=AC=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20190626 Where are all the IoT experts going to come from.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/sources/talk/20190626 Where are all the IoT experts going to come from.md index 223001f7ee..8e50195bd8 100644 --- a/sources/talk/20190626 Where are all the IoT experts going to come from.md +++ b/sources/talk/20190626 Where are all the IoT experts going to come from.md @@ -18,7 +18,7 @@ 弗林跟我说,“在未来物联网项目将与如今普遍的数据管理和自动化项目有着巨大的不同......未来需要更全面的技能和交叉交易能力,这样我们才会说同一种语言。” -**[ 参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3] ]** +**【参见: [有雄心壮志的I T 专业人才应该争取的 20 个热门职位][3]】** 弗林补充说,随着物联网每年增长 30%,将不再依赖于几个特定的技能,“从传统的部署技能(如网络和基础设施)到数据库和报告技能,坦白说,甚至是基础数据科学,都将需要一起理解和使用。” From b9595d9a15e4bd5b3da4206f0aa91381fb93ee8f Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 00:37:06 +0800 Subject: [PATCH 181/213] =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190626 Where are all the IoT experts going to come from.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/talk/20190626 Where are all the IoT experts going to come from.md (100%) diff --git a/sources/talk/20190626 Where are all the IoT experts going to come from.md b/translated/talk/20190626 Where are all the IoT experts going to come from.md similarity index 100% rename from sources/talk/20190626 Where are all the IoT experts going to come from.md rename to translated/talk/20190626 Where are all the IoT experts going to come from.md From f7713ad4074acfe8a08653c34437e1f7debc93f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:04:50 +0800 Subject: [PATCH 182/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?How=20to=20Add=20Fingerprint=20Login=20in=20Ubuntu=20and=20Othe?= =?UTF-8?q?r=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md --- ...in Ubuntu and Other Linux Distributions.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/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 new file mode 100644 index 0000000000..c2cea8fdcc --- /dev/null +++ b/sources/tech/20210210 How to Add Fingerprint Login in Ubuntu and Other Linux Distributions.md @@ -0,0 +1,101 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: 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/ From 30179b7ae26a81dcc4812657b06818e4da5960ff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:05:10 +0800 Subject: [PATCH 183/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210209=20?= =?UTF-8?q?Understanding=20Linus's=20Law=20for=20open=20source=20security?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210209 Understanding Linus-s Law for open source security.md --- ...ng Linus-s Law for open source security.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20210209 Understanding Linus-s Law for open source security.md diff --git a/sources/tech/20210209 Understanding Linus-s Law for open source security.md b/sources/tech/20210209 Understanding Linus-s Law for open source security.md new file mode 100644 index 0000000000..bbaf38fdb0 --- /dev/null +++ b/sources/tech/20210209 Understanding Linus-s Law for open source security.md @@ -0,0 +1,90 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding Linus's Law for open source security) +[#]: via: (https://opensource.com/article/21/2/open-source-security) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Understanding Linus's Law for open source security +====== +Linus's Law is that given enough eyeballs, all bugs are shallow. How +does this apply to open source software security? +![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 Linux's influence on the security of open source software. + +An often-praised virtue of open source software is that its code can be reviewed (or "audited," as security professionals like to say) by anyone and everyone. However, if you actually ask many open source users when the last time they reviewed code was, you might get answers ranging from a blank stare to an embarrassed murmur. And besides, there are some really big open source applications out there, so it can be difficult to review every single line of code effectively. + +Extrapolating from these slightly uncomfortable truths, you have to wonder: When nobody looks at the code, does it really matter whether it's open or not? + +### Should you trust open source? + +We tend to make a trite assumption in hobbyist computing that open source is "more secure" than anything else. We don't often talk about what that means, what the basis of comparison is ("more" secure than what?), or how the conclusion has even been reached. It's a dangerous statement to make because it implies that as long as you call something _open source_, it automatically and magically inherits enhanced security. That's not what open source is about, and in fact, it's what open source security is very much against. + +You should never assume an application is secure unless you have personally audited and understood its code. Once you have done this, you can assign _ultimate trust_ to that application. Ultimate trust isn't a thing you do on a computer; it's something you do in your own mind: You trust software because you choose to believe that it is secure, at least until someone finds a way to exploit that software. + +You're the only person who can place ultimate trust in that code, so every user who wants that luxury must audit the code for themselves. Taking someone else's word for it doesn't count! + +So until you have audited and understood a codebase for yourself, the maximum trust level you can give to an application is a spectrum ranging from approximately, _not trustworthy at all_ to _pretty trustworthy_. There's no cheat sheet for this. It's a personal choice you must make for yourself. If you've heard from people you strongly trust that an application is secure, then you might trust that software more than you trust something for which you've gotten no trusted recommendations. + +Because you cannot audit proprietary (non-open source) code, you can never assign it _ultimate trust_. + +### Linus's Law + +The reality is, not everyone is a programmer, and not everyone who is a programmer has the time to dedicate to reviewing hundreds and hundreds of lines of code. So if you're not going to audit code yourself, then you must choose to trust (to some degree) the people who _do_ audit code. + +So exactly who does audit code, anyway? + +Linus's Law asserts that _given enough eyeballs, all bugs are shallow_, but we don't really know how many eyeballs are "enough." However, don't underestimate the number. Software is very often reviewed by more people than you might imagine. The original developer or developers obviously know the code that they've written. However, open source is often a group effort, so the longer code is open, the more software developers end up seeing it. A developer must review major portions of a project's code because they must learn a codebase to write new features for it. + +Open source packagers also get involved with many projects in order to make them available to a Linux distribution. Sometimes an application can be packaged with almost no familiarity with the code, but often a packager gets familiar with a project's code, both because they don't want to sign off on software they don't trust and because they may have to make modifications to get it to compile correctly. Bug reporters and triagers also sometimes get familiar with a codebase as they try to solve anomalies ranging from quirks to major crashes. Of course, some bug reporters inadvertently reveal code vulnerabilities not by reviewing it themselves but by bringing attention to something that obviously doesn't work as intended. Sysadmins frequently get intimately familiar with the code of an important software their users rely upon. Finally, there are security researchers who dig into code exclusively to uncover potential exploits. + +### Trust and transparency + +Some people assume that because major software is composed of hundreds of thousands of lines of code, it's basically impossible to audit. Don't be fooled by how much code it takes to make an application run. You don't actually have to read millions of lines. Code is highly structured, and exploitable flaws are rarely just a single line hidden among the millions of lines; there are usually whole functions involved. + +There are exceptions, of course. Sometimes a serious vulnerability is enabled with just one system call or by linking to one flawed library. Luckily, those kinds of errors are relatively easy to notice, thanks to the active role of security researchers and vulnerability databases. + +Some people point to bug trackers, such as the [Common Vulnerabilities and Exposures (CVE)][2] website, and deduce that it's actually as plain as day that open source isn't secure. After all, hundreds of security risks are filed against lots of open source projects, out in the open for everyone to see. Don't let that fool you, though. Just because you don't get to see the flaws in closed software doesn't mean those flaws don't exist. In fact, we know that they do because exploits are filed against them, too. The difference is that _all_ exploits against open source applications are available for developers (and users) to see so those flaws can be mitigated. That's part of the system that boosts trust in open source, and it's wholly missing from proprietary software. + +There may never be "enough" eyeballs on any code, but the stronger and more diverse the community around the code, the better chance there is to uncover and fix weaknesses. + +### Trust and people + +In open source, the probability that many developers, each working on the same project, have noticed something _not secure_ but have all remained equally silent about that flaw is considered to be low because humans rarely mutually agree to conspire in this way. We've seen how disjointed human behavior can be recently with COVID-19 mitigation: + + * We've all identified a flaw (a virus). + * We know how to prevent it from spreading (stay home). + * Yet the virus continues to spread because one or more people deviate from the mitigation plan. + + + +The same is true for bugs in software. If there's a flaw, someone noticing it will bring it to light (provided, of course, that someone sees it). + +However, with proprietary software, there can be a high probability that many developers working on a project may notice something not secure but remain equally silent because the proprietary model relies on paychecks. If a developer speaks out against a flaw, then that developer may at best hurt the software's reputation, thereby decreasing sales, or at worst, may be fired from their job. Developers being paid to work on software in secret do not tend to talk about its flaws. If you've ever worked as a developer, you've probably signed an NDA, and you've been lectured on the importance of trade secrets, and so on. Proprietary software encourages, and more often enforces, silence even in the face of serious flaws. + +### Trust and software + +Don't trust software you haven't audited. + +If you must trust software you haven't audited, then choose to trust code that's exposed to many developers who independently are likely to speak up about a vulnerability. + +Open source isn't inherently more secure than proprietary software, but the systems in place to fix it are far better planned, implemented, and staffed. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-security + +作者:[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://cve.mitre.org From 1a98ca1dc7308bd33f60a85ce095e5ae69fc9fd4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:05:44 +0800 Subject: [PATCH 184/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210209=20?= =?UTF-8?q?My=20open=20source=20disaster=20recovery=20strategy=20for=20the?= =?UTF-8?q?=20home=20office?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210209 My open source disaster recovery strategy for the home office.md --- ...r recovery strategy for the home office.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20210209 My open source disaster recovery strategy for the home office.md diff --git a/sources/tech/20210209 My open source disaster recovery strategy for the home office.md b/sources/tech/20210209 My open source disaster recovery strategy for the home office.md new file mode 100644 index 0000000000..05f2fce5b5 --- /dev/null +++ b/sources/tech/20210209 My open source disaster recovery strategy for the home office.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My open source disaster recovery strategy for the home office) +[#]: via: (https://opensource.com/article/21/2/high-availability-home-office) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) + +My open source disaster recovery strategy for the home office +====== +In the remote work era, it's more important than ever to have a disaster +recovery plan for your household infrastructure. +![Person using a laptop][1] + +I've worked from home for years, and with the COVID-19 crisis, millions more have joined me. Teachers, accountants, librarians, stockbrokers… you name it, these workers now operate full or part time from their homes. Even after the coronavirus crisis ends, many will continue working at home, at least part time. But what happens when the home worker's computer fails? Whether the device is a smartphone, tablet, laptop, or desktop—and whether the problem is hardware or software—the result might be missed workdays and lots of frustration. + +This article explores how to ensure high-availability home computing. Open source software is key. It offers device independence so that home workers can easily move between primary and backup devices. Most importantly, it gives users control of their environment, which is the surest route to high availability. This simple high-availability strategy, based on open source, is easy to modify for your needs. + +### Different strategies for different situations + +I need to emphasize one point upfront: different job functions require different solutions. Some at-home workers can use smartphones or tablets, while others rely on laptops, and still others require high-powered desktop workstations. Some can tolerate an outage of hours or even days, while others must be available without interruption. Some use company-supplied devices, and others must provide their own. Lastly, some home workers store their data in their company's cloud, while others self-manage their data. + +Obviously, no single high-availability strategy fits everyone. My strategy probably isn't "the answer" for you, but I hope it prompts you to think about the challenges involved (if you haven't already) and presents some ideas to help you prepare before disaster strikes. + +### Defining high availability + +Whatever computing device a home worker uses, high availability (HA) involves five interoperable components: + + * Device hardware + * System software + * Communications capability + * Applications + * Data + + + +The HA plan must encompass all five components to succeed. Missing any component causes HA failure. + +For example, last night, I worked on a cloud-based spreadsheet. If my communications link had failed and I couldn't access my cloud data, that would stop my work on the project… even if I had all the other HA components available in a backup computer. + +Of course, there are exceptions. Say last night's spreadsheet was stored on my local computer. If that device failed, I could have kept working as long as I had a backup computer with my data on it, even if I lacked internet access. + +To succeed as a high-availability home worker, you must first identify the components you require for your work. Once you've done that, develop a plan to continue working even if one or more components fails. + +#### Duplicate replacement + +One approach is to create a _duplicate replacement_. Having the exact same hardware, software, communications, apps, and data available on a backup device guarantees that you can work if your primary fails. This approach is simple, though it might cost more to keep a complete backup on hand. + +To economize, you might share computers with your family or flatmates. A _shared backup_ is always more cost-effective than a _dedicated backup_, so long as you have top priority on the shared computer when you need it. + +#### Functional replacement + +The alternative to duplicate replacement is a _functional replacement_. You substitute a working equivalent for the failed component. Say I'm working from my home laptop and connecting through home WiFi. My internet connection fails. Perhaps I can tether my computer to my phone and use the cell network instead. I achieve HA by replacing one technology with an equivalent. + +#### Know your requirements + +Beyond the five HA components, be sure to identify any special requirements you have. For example, if mobility is important, you might need to replace a broken laptop with another laptop, not a desktop. + +HA means identifying all the functions you need, then ensuring your HA plan covers them all. + +### Timing, planning, and testing + +You must also define your time frame for recovery. Must you be able to continue your work immediately after a failure? Or do you have the luxury of some downtime during which you can react? + +The longer your allowable downtime, the more options you have. For example, if you could miss work for several days, you could simply trot a broken device into a repair shop. No need for a backup. + +In this article, by "high availability," I mean getting back to work in very short order after a failure, perhaps less than one hour. This typically requires that you have access to a backup device that is immediately available and ready to go. While there might be occasions when you can recover your primary device in a matter of minutes—for example, by working around a failure or by quickly replacing a defective piece of hardware or software—a backup computer is normally part of the HA plan. + +HA requires planning and preparation. "Winging it" doesn't suffice; ensure your backup plan works by testing it beforehand. + +For example, say your data resides in the cloud. That data is accessible from anywhere, from any device. That sounds ideal. But what if you forget that there's a small but vital bit of data stored locally on your failed computer? If you can't access that essential data, your HA plan fails. A dry run surfaces problems like this. + +### Smartphones as backup + +Most of us in software engineering and support use laptops and desktops at home. Smartphones and tablets are useful adjuncts, but they aren't at the core of what we do. + +The main reasons are screen size and keyboard. For software work, you can't achieve the same level of productivity with a small screen and touchscreen keypad as you can with a large monitor and physical keyboard. + +If you normally use a laptop or desktop and opt for a smartphone or tablet as your backup, test it out beforehand to make sure it suffices. Here's an example of the kind of subtlety that might otherwise trip you up. Most videoconferencing platforms run on both smartphones and laptops or desktops, but their mobile apps can differ in small but important ways. And even when the platform does offer an equivalent experience (the way [Jitsi][2] does, for instance), it can be awkward to share charts, slide decks, and documents, to use a chat feature, and so on, just due to the difference in mobile form factors compared to a big computer screen and a variety of input options. + +Smartphones make convenient backup devices because nearly everyone has one. But if you designate yours as your functional replacement, then try using it for work one day to verify that it meets your needs. + +### Data accessibility + +Data access is vital when your primary device fails. Even if you back up your work data, if a device fails, you also may need credentials for VPN or SSH access, specialized software, or forms of data that might not be stored along with your day-to-day documents and directories. You must ensure that when you design a backup scheme for yourself, you include all important data and store encryption keys and other access information securely. + +The best way to keep your work data secure is to use your own service. Running [Nextcloud][3] or [Sparkleshare][4] is easy, and hosting is cheap. Both are automated: files you place in a specially designated directory are synchronized with your server. It's not exactly building your own cloud, but it's a great way to leverage the cloud for your own services. You can make the backup process seamless with tools like [Syncthing, Bacula][5], or [rdiff-backup][6]. + +Cloud storage enables you to access data from any device at any location, but cloud storage will work only if you have a live communications path to it after a failure event. And not all cloud storage meets the privacy and security specifications for all projects. If your workplace has a cloud backup solution, spend some time learning about the cloud vendor's services and find out what level of availability it promises. Check its track record in achieving it. And be sure to devise an alternate way to access your cloud if your primary communications link fails. + +### Local backups + +If you store your data on a local device, you'll be responsible for backing it up and recovering it. In that case, back up your data to an alternate device, and verify that you can restore it within your acceptable time frame. This is your _time-to-recovery_. + +You'll also need to secure that data and meet any privacy requirements your employer specifies. + +#### Acceptable loss + +Consider how much data you can afford to lose in the event of an outage. For example, if you back up your data nightly, you could lose up to a maximum of one day's work (all the work completed during the day prior to the nightly backup). This is your _backup data timeliness_. + +Open source offers many free applications for local data backup and recovery. Generally, the same applications used for remote backups can also apply to local backup plans, so take a look at the [Advanced Rsync][7] or the [Syncthing tutorial][8] articles here on Opensource.com. + +Many prefer a data strategy that combines both cloud and local storage. Store your data locally, and then use the cloud as a backup (rather than working on the cloud). Or do it the other way around (although automating the cloud to push backups to you is more difficult than automating your local machine to push backups to the cloud). Storing your data in two separate locations gives your data _geographical redundancy_, which is useful should either site become unavailable. + +With a little forethought, you can devise a simple plan to access your data regardless of any outage. + +### My high-availability strategy + +As a practical example, I'll describe my own HA approach. My goals are a time to recovery of an hour or less and backup data timeliness within a day. + +![High Availability Strategy][9] + +(Howard Fosdick, [CC BY-SA 4.0][10]) + +#### Hardware + +I use an Android smartphone for phone calls and audioconferences. I can access a backup phone from another family member if my primary fails. + +Unfortunately, my phone's small size and touch keyboard mean I can't use it as my backup computer. Instead, I rely on a few generic desktop computers that have standard, interchangeable parts. You can easily maintain such hardware with this simple [free how-to guide][11]. You don't need any hardware experience. + +Open source software makes my multibox strategy affordable. It runs so efficiently that even [10-year-old computers work fine][12] as backups for typical office work. Mine are dual-core desktops with 4GB of RAM and any disk that cleanly verifies. These are so inexpensive that you can often get them for free from recycling centers. (In my [charity work][13], I find that many people give them away as unsuitable for running current proprietary software, but they're actually in perfect working order given a flexible operating system like Linux.) + +Another way to economize is to designate another family member's computer for your shared backups. + +#### Systems software and apps + +Running open source software on top of this generic hardware enables me to achieve several benefits. First, the flexibility of open source software enables me to address any possible software failure. For example, with simple operating system commands, I can copy, move, back up, and recover the operating system, applications, and data across partitions, disks, or computers. I don't have to worry about software constraints, vendor lock-in, proprietary backup file formats, licensing or activation restrictions, or extra fees. + +Another open source benefit is that you control your operating system. If you don't have control over your own system, you could be subject to forced restarts, unexpected and unwanted updates, and forced upgrades. My relative has run into such problems more than once. Without his knowledge or consent, his computer suddenly launched a forced upgrade from Windows 7 to Windows 10, which cost him three days of lost income (and untold frustration). The lesson: Your vendor's agenda may not coincide with your own. + +All operating systems have bugs. The difference is that open source software doesn't force you to eat them. + +#### Data classification + +I use very simple techniques to make my data highly available. + +I can't use cloud services for my data due to privacy requirements. Instead, my data "master copy" resides on a USB-connected disk. I plug it into any of several computers. After every session, I back up any altered data on the computer I used. + +Of course, this approach is only feasible if your backups run quickly. For most home workers, that's easy. All you have to do is segregate your data by size and how frequently you update it. + +Isolate big files like photos, audio, and video into separate folders or partitions. Make sure you back up only the files that are new or modified, not older items that have already been backed up. + +Much of my work involves office suites. These generate small files, so I isolate each project in its own folder. For example, I stored the two dozen files I used to write this article in a single subdirectory. Backing it up is as simple as copying that folder. + +Giving a little thought to data segregation and backing up only modified files ensures quick, easy backups for most home workers. My approach is simple; it works best if you only work on a couple of projects in a session. And I can tolerate losing up to a day's work. You can easily automate a more refined backup scheme for yourself. + +For software development, I take an entirely different approach. I use software versioning, which transparently handles all software backup issues for me and coordinates with other developers. My HA planning in this area focuses just on ensuring I can access the online tool. + +#### Communications + +Like many home users, I communicate through both a cellphone network and the internet. If my internet goes down, I can use the cell network instead by tethering my laptop to my Android smartphone. + +### Learning from failure + +Using my strategy for 15 years, how have I fared? What failures have I experienced, and how did they turn out? + + 1. **Motherboard burnout:** One day, my computer wouldn't turn on. I simply moved my USB "master data" external disk to another computer and used that. I lost no data. After some investigation, I determined it was a motherboard failure, so I scrapped the computer and used it for parts. + 2. **Drive failure:** An internal disk failed while I was working. I just moved my USB master disk to a backup computer. I lost 10 minutes of data updates. After work, I created a new boot disk by copying one from another computer—flexibility that only open source software offers. I used the affected computer the next day. + 3. **Fatal software update:** An update caused a failure in an important login service. I shifted to a backup computer where I hadn't yet applied the fatal update. I lost no data. After work, I searched for help with this problem and had it solved in an hour. + 4. **Monitor burnout:** My monitor fizzled out. I just swapped in a backup display and kept working. This took 10 minutes. After work, I determined that the problem was a burned-out capacitor, so I recycled the monitor. + 5. **Power outage:** Now, here's a situation I didn't plan for! A tornado took down the electrical power in our entire town for two days. I learned that one should think through _all_ possible contingencies—including alternate work sites. + + + +### Make your plan + +If you work from home, you need to consider what will happen when your home computer fails. If not, you could experience frustrating workdays off while you scramble to fix the problem. + +Open source software is the key. It runs so efficiently on older, cheaper computers that they become affordable backup machines. It offers device independence, and it ensures that you can design solutions that work best for you. + +For most people, ensuring high availability is very simple. The trick is thinking about it in advance. Create a plan _and then test it_. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/high-availability-home-office + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://jitsi.org/downloads/ +[3]: https://opensource.com/article/20/7/nextcloud +[4]: https://opensource.com/article/19/4/file-sharing-git +[5]: https://opensource.com/article/19/3/backup-solutions +[6]: https://opensource.com/life/16/3/turn-your-old-raspberry-pi-automatic-backup-server +[7]: https://opensource.com/article/19/5/advanced-rsync +[8]: https://opensource.com/article/18/9/take-control-your-data-syncthing +[9]: https://opensource.com/sites/default/files/uploads/my_ha_strategy.png (High Availability Strategy) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: http://www.rexxinfo.org/Quick_Guide/Quick_Guide_To_Fixing_Computer_Hardware +[12]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[13]: https://www.freegeekchicago.org/ From b6bfefbd7b4052f48666890910d562098cdfe3ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 10 Feb 2021 05:05:57 +0800 Subject: [PATCH 185/213] add done: 20210209 My open source disaster recovery strategy for the home office.md --- ...20210209 Try Deno as an alternative to Node.js.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sources/tech/20210209 Try Deno as an alternative to Node.js.md diff --git a/sources/tech/20210209 Try Deno as an alternative to Node.js.md b/sources/tech/20210209 Try Deno as an alternative to Node.js.md new file mode 100644 index 0000000000..efce7c5f93 --- /dev/null +++ b/sources/tech/20210209 Try Deno as an alternative to Node.js.md @@ -0,0 +1,12 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Try Deno as an alternative to Node.js) +[#]: via: (https://opensource.com/article/21/2/deno) +[#]: author: (Bryant Son https://opensource.com/users/brson) + +Try Deno as an alternative to Node.js +====== +Deno is a secure runtime for JavaScript and TypeScript. From b81324743f4b8f5190f9d699cb5294ed2a8e00c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 10 Feb 2021 09:08:50 +0800 Subject: [PATCH 186/213] translated --- ...9 Manage containers with Podman Compose.md | 180 ----------------- ...9 Manage containers with Podman Compose.md | 184 ++++++++++++++++++ 2 files changed, 184 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20210129 Manage containers with Podman Compose.md create mode 100644 translated/tech/20210129 Manage containers with Podman Compose.md diff --git a/sources/tech/20210129 Manage containers with Podman Compose.md b/sources/tech/20210129 Manage containers with Podman Compose.md deleted file mode 100644 index 5a4c7f1449..0000000000 --- a/sources/tech/20210129 Manage containers with Podman Compose.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Manage containers with Podman Compose) -[#]: via: (https://fedoramagazine.org/manage-containers-with-podman-compose/) -[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) - -Manage containers with Podman Compose -====== - -![][1] - -Containers are awesome, allowing you to package your application along with its dependencies and run it anywhere. Starting with Docker in 2013, containers have been making the lives of software developers much easier. - -One of the downsides of Docker is it has a central daemon that runs as the root user, and this has security implications. But this is where Podman comes in handy. Podman is a [daemonless container engine][2] for developing, managing, and running OCI Containers on your Linux system in root or rootless mode. - -There are other articles on Fedora Magazine you can use to learn more about Podman. Two examples follow: - - * [Using Pods with Podman on Fedora][3] - * [Podman with Capabilities on Fedora][4] - - - -If you have worked with Docker, chances are you also know about Docker Compose, which is a tool for orchestrating several containers that might be interdependent. To learn more about Docker Compose see its [documentation][5]. - -### What is Podman Compose? - -[Podman Compose][6] is a project whose goal is to be used as an alternative to Docker Compose without needing any changes to be made in the docker-compose.yaml file. Since Podman Compose works using pods, it’s good to check a refresher definition of a pod. - -> A _Pod_ (as in a pod of whales or pea pod) is a group of one or more [containers][7], with shared storage/network resources, and a specification for how to run the containers. -> -> [Pods – Kubernetes Documentation][8] - -The basic idea behind Podman Compose is that it picks the services defined inside the _docker-compose.yaml_ file and creates a container for each service. A major difference between Docker Compose and Podman Compose is that Podman Compose adds the containers to a single pod for the whole project, and all the containers share the same network. It even names the containers the same way Docker Compose does, using the _‐‐add-host_ flag when creating the containers, as you will see in the example. - -### Installation - -Complete install instructions for Podman Compose are found on its [project page][6], and there are several ways to do it. To install the latest development version, use the following command: - -``` -pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz -``` - -Make sure you also have [Podman installed][9] since you’ll need it as well. On Fedora, to install Podman use the following command: - -``` -sudo dnf install podman -``` - -### Example: launching a WordPress site with Podman Compose - -Imagine your _docker-compose.yaml_ file is in a folder called _wpsite_. A typical _docker-compose.yaml_ (or _docker-compose.yml_) for a WordPress site looks like this: - -``` -version: "3.8" -services: - web: - image: wordpress - restart: always - volumes: - - wordpress:/var/www/html - ports: - - 8080:80 - environment: - WORDPRESS_DB_HOST: db - WORDPRESS_DB_USER: magazine - WORDPRESS_DB_NAME: magazine - WORDPRESS_DB_PASSWORD: 1maGazine! - WORDPRESS_TABLE_PREFIX: cz - WORDPRESS_DEBUG: 0 - depends_on: - - db - networks: - - wpnet - db: - image: mariadb:10.5 - restart: always - ports: - - 6603:3306 - - volumes: - - wpdbvol:/var/lib/mysql - - environment: - MYSQL_DATABASE: magazine - MYSQL_USER: magazine - MYSQL_PASSWORD: 1maGazine! - MYSQL_ROOT_PASSWORD: 1maGazine! - networks: - - wpnet -volumes: - wordpress: {} - wpdbvol: {} - -networks: - wpnet: {} -``` - -If you come from a Docker background, you know you can launch these services by running _docker-compose up_. Docker Compose will create two containers named _wpsite_web_1_ and _wpsite_db_1_, and attaches them to a network called _wpsite_wpnet_. - -Now, see what happens when you run _podman-compose up_ in the project directory. First, a pod is created named after the directory in which the command was issued. Next, it looks for any named volumes defined in the YAML file and creates the volumes if they do not exist. Then, one container is created per every service listed in the _services_ section of the YAML file and added to the pod. - -Naming of the containers is done similar to Docker Compose. For example, for your web service, a container named _wpsite_web_1_ is created. Podman Compose also adds localhost aliases to each named container. Then, containers can still resolve each other by name, although they are not on a bridge network as in Docker. To do this, use the option _–add-host_. For example, _–add-host web:localhost_. - -Note that _docker-compose.yaml_ includes a port forwarding from host port 8080 to container port 80 for the web service. You should now be able to access your fresh WordPress instance from the browser using the address __. - -![WordPress Dashboard][10] - -### Controlling the pod and containers - -To see your running containers, use _podman ps_, which shows the web and database containers along with the infra container in your pod. -``` - -``` - -CONTAINER ID  IMAGE                               COMMAND               CREATED      STATUS          PORTS                                         NAMES -a364a8d7cec7  docker.io/library/wordpress:latest  apache2-foregroun...  2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_web_1 -c447024aa104  docker.io/library/mariadb:10.5      mysqld                2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_db_1 -12b1e3418e3e  k8s.gcr.io/pause:3.2 -``` - -``` - -You can also verify that a pod has been created by Podman for this project, named after the folder in which you issued the command. -``` - -``` - -POD ID        NAME             STATUS    CREATED      INFRA ID      # OF CONTAINERS -8a08a3a7773e  wpsite           Degraded  2 hours ago  12b1e3418e3e  3 -``` - -``` - -To stop the containers, enter the following command in another command window: - -``` -podman-compose down -``` - -You can also do that by stopping and removing the pod. This essentially stops and removes all the containers and then the containing pod. So, the same thing can be achieved with these commands: - -``` -podman pod stop podname -podman pod rm podname -``` - -Note that this does not remove the volumes you defined in _docker-compose.yaml_. So, the state of your WordPress site is saved, and you can get it back by running this command: - -``` -podman-compose up -``` - -In conclusion, if you’re a Podman fan and do your container jobs with Podman, you can use Podman Compose to manage your containers in development and production. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/manage-containers-with-podman-compose/ - -作者:[Mehdi Haghgoo][a] -选题:[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/powergame/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/01/podman-compose-1-816x345.jpg -[2]: https://podman.io -[3]: https://fedoramagazine.org/podman-pods-fedora-containers/ -[4]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ -[5]: https://docs.docker.com/compose/ -[6]: https://github.com/containers/podman-compose -[7]: https://kubernetes.io/docs/concepts/containers/ -[8]: https://kubernetes.io/docs/concepts/workloads/pods/ -[9]: https://podman.io/getting-started/installation -[10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Screenshot-from-2021-01-08-06-27-29-1024x767.png diff --git a/translated/tech/20210129 Manage containers with Podman Compose.md b/translated/tech/20210129 Manage containers with Podman Compose.md new file mode 100644 index 0000000000..f020ea1a23 --- /dev/null +++ b/translated/tech/20210129 Manage containers with Podman Compose.md @@ -0,0 +1,184 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage containers with Podman Compose) +[#]: via: (https://fedoramagazine.org/manage-containers-with-podman-compose/) +[#]: author: (Mehdi Haghgoo https://fedoramagazine.org/author/powergame/) + +用 Podman Compose 管理容器 +====== + +![][1] + +容器很棒,让你可以将你的应用连同其依赖项一起打包,并在任何地方运行。从 2013 年的 Docker 开始,容器已经让软件开发者的生活变得更加轻松。 + +Docker 的一个缺点是它有一个中央守护进程,它以 root 用户的身份运行,这对安全有影响。但这正是 Podman 的用武之地。Podman 是一个 [无守护进程容器引擎][2],用于开发、管理和在你的 Linux 系统上以 root 或无 root 模式运行 OCI 容器。 + +在 Fedora Magazine 上还有其他文章,你可以用来了解更多关于 Podman 的信息。下面有两个例子: + + * [在 Fedora 上使用 Podman 的 Pod][3] + * [在 Fedora 上具有 Capabilities 的Podman][4] + + + +如果你使用过 Docker,你很可能也知道 Docker Compose,它是一个用于编排多个可能相互依赖的容器的工具。要了解更多关于 Docker Compose 的信息,请看它的[文档][5]。 + +### 什么是 Podman Compose? + +[Podman Compose][6]是一个目标作为 Docker Compose 的替代品,不需要对 docker-compose.yaml 文件进行任何修改的项目。由于 Podman Compose 使用 pod 工作,所以最好看下 pod 的最新定义。 + + +> 一个_Pod_(如一群鲸鱼或豌豆荚)是由一个或多个[容器][7]组成的组,具有共享的存储/网络资源,以及如何运行容器的规范。 +> +> [Pods - Kubernetes 文档][8] + +Podman Compose 的基本思想是,它选中 _docker-compose.yaml_ 文件里面定义的服务,为每个服务创建一个容器。Docker Compose 和 Podman Compose 的一个主要区别是,Podman Compose 将整个项目的容器添加到一个单一的 pod 中,而且所有的容器共享同一个网络。它甚至用和 Docker Compose 一样的方式命名容器,在创建容器时使用 _--add-host_ 标志,你会在例子中看到。 + + +### 安装 + +Podman Compose 的完整安装说明可以在[项目页面][6]上找到,它有几种方法。要安装最新的开发版本,使用以下命令: + +``` +pip3 install https://github.com/containers/podman-compose/archive/devel.tar.gz +``` + +确保你也安装了 [Podman][9],因为你也需要它。在 Fedora 上,使用下面的命令来安装Podman: + +``` +sudo dnf install podman +``` + +### 例子:用 Podman Compose 启动一个 WordPress 网站 + +想象一下,你的 _docker-compose.yaml_ 文件在一个叫 _wpsite_ 的文件夹里。一个典型的 WordPress 网站的 _docker-compose.yaml_ (或 _docker-compose.yml_) 文件是这样的: + +``` +version: "3.8" +services: + web: + image: wordpress + restart: always + volumes: + - wordpress:/var/www/html + ports: + - 8080:80 + environment: + WORDPRESS_DB_HOST: db + WORDPRESS_DB_USER: magazine + WORDPRESS_DB_NAME: magazine + WORDPRESS_DB_PASSWORD: 1maGazine! + WORDPRESS_TABLE_PREFIX: cz + WORDPRESS_DEBUG: 0 + depends_on: + - db + networks: + - wpnet + db: + image: mariadb:10.5 + restart: always + ports: + - 6603:3306 + + volumes: + - wpdbvol:/var/lib/mysql + + environment: + MYSQL_DATABASE: magazine + MYSQL_USER: magazine + MYSQL_PASSWORD: 1maGazine! + MYSQL_ROOT_PASSWORD: 1maGazine! + networks: + - wpnet +volumes: + wordpress: {} + wpdbvol: {} + +networks: + wpnet: {} +``` + +如果你用过 Docker,你就会知道你可运行 _docker-compose up_ 来启动这些服务。Docker Compose 会创建两个名为 _wpsite_web_1_ 和 _wpsite_db_1_ 的容器,并将它们连接到一个名为 _wpsite_wpnet_ 的网络。 + + +现在,看看当你在项目目录下运行 _podman-compose up_ 时会发生什么。首先,一个以执行命令的目录命名的 pod 被创建。接下来,它寻找 YAML 文件中定义的任何名称的卷,如果它们不存在,就创建卷。然后,在 YAML 文件的 _services_ 部分列出的每个服务都会创建一个容器,并添加到 pod 中。 + +容器的命名与 Docker Compose 类似。例如,为你的 web 服务创建一个名为 _wpsite_web_1_ 的容器。Podman Compose 还为每个命名的容器添加了 localhost 别名。之后,容器仍然可以通过名字互相解析,尽管它们并不像 Docker 那样在一个桥接网络上。要做到这一点,使用选项 _-add-host_。例如,_-add-host web:localhost_。 + +请注意,_docker-compose.yaml_ 包含了一个从主机 8080 端口到容器 80 端口的 Web 服务的端口转发。现在你应该可以通过浏览器访问新 WordPress 实例,地址为 __。 + + +![WordPress Dashboard][10] + +### 控制 pod 和容器 + +要查看正在运行的容器,使用 _podman ps_,它可以显示 web 和数据库容器以及 pod 中的 infra 容器。 +``` + +``` + +CONTAINER ID  IMAGE                               COMMAND               CREATED      STATUS          PORTS                                         NAMES +a364a8d7cec7  docker.io/library/wordpress:latest  apache2-foregroun...  2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_web_1 +c447024aa104  docker.io/library/mariadb:10.5      mysqld                2 hours ago  Up 2 hours ago  0.0.0.0:8080-&gt;80/tcp, 0.0.0.0:6603-&gt;3306/tcp  wpsite_db_1 +12b1e3418e3e  k8s.gcr.io/pause:3.2 +``` + +``` + +你也可以验证 Podman 已经为这个项目创建了一个 pod,以你执行命令的文件夹命名。 +``` + +``` + +POD ID        NAME             STATUS    CREATED      INFRA ID      # OF CONTAINERS +8a08a3a7773e  wpsite           Degraded  2 hours ago  12b1e3418e3e  3 +``` + +``` + +要停止容器,在另一个命令窗口中输入以下命令: + +``` +podman-compose down +``` + +你也可以通过停止和删除 pod 来实现。这实质上是停止并移除所有的容器,然后再删除包含的 pod。所以,同样的事情也可以通过这些命令来实现: + +``` +podman pod stop podname +podman pod rm podname +``` + +请注意,这不会删除你在 _docker-compose.yaml_ 中定义的卷。所以,你的 WordPress 网站的状态被保存下来了,你可以通过运行这个命令来恢复它。 + +``` +podman-compose up +``` + +总之,如果你是一个 Podman 粉丝,并且用 Podman 做容器工作,你可以使用 Podman Compose 来管理你的开发和生产中的容器。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/manage-containers-with-podman-compose/ + +作者:[Mehdi Haghgoo][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/powergame/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/01/podman-compose-1-816x345.jpg +[2]: https://podman.io +[3]: https://fedoramagazine.org/podman-pods-fedora-containers/ +[4]: https://fedoramagazine.org/podman-with-capabilities-on-fedora/ +[5]: https://docs.docker.com/compose/ +[6]: https://github.com/containers/podman-compose +[7]: https://kubernetes.io/docs/concepts/containers/ +[8]: https://kubernetes.io/docs/concepts/workloads/pods/ +[9]: https://podman.io/getting-started/installation +[10]: https://fedoramagazine.org/wp-content/uploads/2021/01/Screenshot-from-2021-01-08-06-27-29-1024x767.png From ca2cacb77a54cfd6467850ae6dfc12998b169d2e Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 10 Feb 2021 09:28:14 +0800 Subject: [PATCH 187/213] translating --- ...usible for an open source alternative to Google Analytics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md index 74252f60a8..463d9d9944 100644 --- a/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md +++ b/sources/tech/20210208 Why choose Plausible for an open source alternative to Google Analytics.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 626f20cbe52e3f9edc3e811e75ff62b1580e8bcf Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 10 Feb 2021 10:16:37 +0800 Subject: [PATCH 188/213] Rename sources/tech/20210209 Understanding Linus-s Law for open source security.md to sources/talk/20210209 Understanding Linus-s Law for open source security.md --- ...20210209 Understanding Linus-s Law for open source security.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210209 Understanding Linus-s Law for open source security.md (100%) diff --git a/sources/tech/20210209 Understanding Linus-s Law for open source security.md b/sources/talk/20210209 Understanding Linus-s Law for open source security.md similarity index 100% rename from sources/tech/20210209 Understanding Linus-s Law for open source security.md rename to sources/talk/20210209 Understanding Linus-s Law for open source security.md From 0f573f885588147513252d684af41b526302b7af Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 11:29:06 +0800 Subject: [PATCH 189/213] PRF @Chao-zhi --- ... Install and Use Than Arch Linux Itself.md | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md index d8d06a1e79..6fbcf50489 100644 --- a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ b/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -1,32 +1,32 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) [#]: via: (https://itsfoss.com/arch-based-linux-distros/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) -最好用的几个基于 Arch 的用户友好型 Linux 发行版,它们比 Arch Linux 更容易安装和使用 +9 个易用的基于 Arch 的用户友好型 Linux 发行版 ====== 在 Linux 社区中,[Arch Linux][1] 有一群狂热的追随者。这个轻量级的发行版以 DIY 的态度提供了最前沿的更新。 但是,Arch 的目标用户是那些更有经验的用户。因此,它通常被认为是那些技术不够(或耐心不够)的人所无法触及的。 -事实上,第一步,[安装 Arch Linux 就足以把很多人吓跑 ][2]。与大多数其他发行版不同,Arch Linux 没有一个易于使用的图形安装程序。安装过程中涉及到的磁盘分区,连接到互联网,挂载驱动器和创建文件系统等只用命令行工具来操作。 +事实上,只是最开始的步骤,[安装 Arch Linux 就足以把很多人吓跑][2]。与大多数其他发行版不同,Arch Linux 没有一个易于使用的图形安装程序。安装过程中涉及到的磁盘分区,连接到互联网,挂载驱动器和创建文件系统等只用命令行工具来操作。 对于那些不想经历复杂的安装和设置的人来说,有许多用户友好的基于 Arch 的发行版。 -在本文中,我将向您展示一些 Arch 替代发行版。这些发行版附带了图形安装程序、图形包管理器和其他工具,它们比命令行工具更容易使用。 +在本文中,我将向你展示一些 Arch 替代发行版。这些发行版附带了图形安装程序、图形包管理器和其他工具,比它们的命令行版本更容易使用。 ### 更容易设置和使用的基于 Arch 的 Linux 发行版 -![][3] +![](https://img.linux.net.cn/data/attachment/album/202102/10/112812sc42txp4eexco44x.jpg) 请注意,这不是一个排名列表。这些数字只是为了计数的目的。排第二的发行版不应该被认为比排第七的发行版好。 -#### 1\。Manjaro Linux +#### 1、Manjaro Linux ![][4] @@ -34,51 +34,51 @@ Manjaro 提供了 Arch Linux 的所有优点,同时注重用户友好性和可访问性。Manjaro 既适合新手,也适合有经验的 Linux 用户。 -**对于新手**,我们提供了一个用户友好的安装程序,系统本身的设计可以完全“开箱即用”地工作在您[最喜爱的桌面环境 ][6](DE) 或窗口管理器中。 +**对于新手**,它提供了一个用户友好的安装程序,系统本身也设计成可以在你[最喜爱的桌面环境 ][6](DE)或窗口管理器中直接“开箱即用”。 -**对于更有经验的用户,** Manjaro 还提供多种功能,以满足每个个人的口味和喜好。[Manjaro Architect][7] 提供了安装各种 Manjaro 风格的选项,并为那些想要完全自由地塑造系统的人提供了各种桌面环境、文件系统([最近推出的 ZFS][8]) 和引导程序选择。 +**对于更有经验的用户**,Manjaro 还提供多种功能,以满足每个个人的口味和喜好。[Manjaro Architect][7] 提供了安装各种 Manjaro 风格的选项,并为那些想要完全自由地塑造系统的人提供了各种桌面环境、文件系统([最近推出的 ZFS][8]) 和引导程序的选择。 -Manjaro 也是一个滚动发行的前沿发行版。然而,与 Arch 不同的是,Manjaro 首先测试更新,然后将其提供给用户。稳定在这里也很重要。 +Manjaro 也是一个滚动发布的前沿发行版。然而,与 Arch 不同的是,Manjaro 首先测试更新,然后将其提供给用户。稳定在这里也很重要。 -#### 2\。ArcoLinux +#### 2、ArcoLinux ![][9] -[ArcoLinux][10]( 以前称为 ArchMerge) 是一个基于 Arch Linux 的发行版。开发团队提供了三种变体。ArcoLinux、ArcoLinuxD 和 ArcoLinuxB。 +[ArcoLinux][10](以前称为 ArchMerge)是一个基于 Arch Linux 的发行版。开发团队提供了三种变体。ArcoLinux、ArcoLinuxD 和 ArcoLinuxB。 -ArcoLinux 是一个功能齐全的发行版,附带有 [Xfce desktop][11]、[Openbox][12] 和 [i3 window managers][13]。 +ArcoLinux 是一个功能齐全的发行版,附带有 [Xfce 桌面][11]、[Openbox][12] 和 [i3 窗口管理器][13]。 -**ArcoLinuxD** 是一个最小的发行版,包含允许高级用户安装任何桌面和应用程序的脚本。 +**ArcoLinuxD** 是一个精简的发行版,它包含了一些脚本,可以让高级用户安装任何桌面和应用程序。 **ArcoLinuxB** 是一个让用户能够构建自定义发行版的项目,同时还开发了几个带有预配置桌面的社区版本,如 Awesome、bspwm、Budgie、Cinnamon、Deepin、GNOME、MATE 和 KDE Plasma。 ArcoLinux 还提供了各种视频教程,因为它非常注重学习和获取 Linux 技能。 -#### 3\。Archlabs Linux +#### 3、Archlabs Linux ![][14] -[ArchLabs Linux][15] 是一个轻量级的滚动版 Linux 发行版,基于最基础的 Arch Linux,带有 [Openbox][16] 窗口管理器。[ArchLabs][17] 在观感设计中受到 [BunsenLabs][18] 的影响和启发,主要考虑到中级到高级用户的需求。 +[ArchLabs Linux][15] 是一个轻量级的滚动版 Linux 发行版,基于最精简的 Arch Linux,带有 [Openbox][16] 窗口管理器。[ArchLabs][17] 在观感设计中受到 [BunsenLabs][18] 的影响和启发,主要考虑到中级到高级用户的需求。 -#### 4\。Archman Linux +#### 4、Archman Linux ![][19] -[Archman][20] 是一个独立的项目。Arch Linux 发行版对于没有多少 Linux 经验的用户来说通常不是理想的操作系统。大量的背景阅读是必要的事情,以尽可能减少挫折感的意义。Archman Linux 的开发人员正试图改变这种评价。 +[Archman][20] 是一个独立的项目。Arch Linux 发行版对于没有多少 Linux 经验的用户来说通常不是理想的操作系统。要想在最小的挫折感下让事情变得更有意义,必须要有相当的背景知识。Archman Linux 的开发人员正试图改变这种评价。 -Archman 的开发基于对开发的理解,包括用户反馈和体验组件。根据我们团队过去的经验,将用户的反馈和要求融合在一起,确定路线图并完成构建工作。 +Archman 的开发是基于对开发的理解,包括用户反馈和体验组件。根据团队过去的经验,将用户的反馈和要求融合在一起,确定路线图并完成构建工作。 -#### 5\。EndeavourOS +#### 5、EndeavourOS ![][21] -当流行的基于 Arch 的发行版 [Antergos 在 2019 停止 ][22] 时,它留下了一个友好且非常有用的社区。Antergos 项目结束了,因为系统对于开发人员来说太难维护了。 +当流行的基于 Arch 的发行版 [Antergos 在 2019 结束][22] 时,它留下了一个友好且非常有用的社区。Antergos 项目结束的原因是因为该系统对于开发人员来说太难维护了。 -在发布后的几天内,一些有经验的用户通过创建一个新的发行版来填补 Antergos 留下的空白,从而维护了以前的社区。这就是 [EndeavourOS][23] 的诞生。 +在宣布结束后的几天内,一些有经验的用户通过创建一个新的发行版来填补 Antergos 留下的空白,从而维护了以前的社区。这就是 [EndeavourOS][23] 的诞生。 [EndeavourOS][24] 是轻量级的,并且附带了最少数量的预装应用程序。一块近乎空白的画布,随时可以个性化。 -#### 6\。RebornOS +#### 6、RebornOS ![][25] @@ -86,45 +86,45 @@ Archman 的开发基于对开发的理解,包括用户反馈和体验组件。 RebornOS 还声称支持 [Anbox][27],它可以在桌面 Linux 上运行 Android 应用程序。它还提供了一个简单的内核管理器 GUI 工具。 -再加上 [Pacman][28],[AUR][29],以及定制版本的 Cnchi 图形安装程序,Arch Linux 终于可以让最没有经验的用户也能够使用了。 +再加上 [Pacman][28]、[AUR][29],以及定制版本的 Cnchi 图形安装程序,Arch Linux 终于可以让最没有经验的用户也能够使用了。 -#### 7\。Chakra Linux +#### 7、Chakra Linux ![][30] 一个社区开发的 GNU/Linux 发行版,它的亮点在 KDE 和 Qt 技术。[Chakra Linux][31] 不在特定日期安排发布,而是使用“半滚动发布”系统。 -这意味着 Chakra Linux 的核心包被冻结,只更新以修复任何安全问题。这些软件包是在最新版本经过彻底测试后更新的,然后再转移到永久存储库(大约每六个月更新一次)。 +这意味着 Chakra Linux 的核心包被冻结,只在修复安全问题时才会更新。这些软件包是在最新版本经过彻底测试后更新的,然后再转移到永久软件库(大约每六个月更新一次)。 -除官方存储库外,用户还可以安装 Chakra 社区存储库 (CCR) 的软件包,该库为官方存储库中未包含的软件提供用户制作的 PKGINFOs 和 [PKGBUILD][32] 脚本,这是受 Arch 用户存储库的启发而出现的。 +除官方软件库外,用户还可以安装 Chakra 社区软件库 (CCR) 的软件包,该库为官方存储库中未包含的软件提供用户制作的 PKGINFOs 和 [PKGBUILD][32] 脚本,其灵感来自于 Arch 用户软件库(AUR)。 -#### 8\。Artix Linux +#### 8、Artix Linux ![Artix Mate Edition][33] [Artix Linux][34] 也是一个基于 Arch Linux 的滚动发行版,它使用 [OpenRC][35]、[runit][36] 或 [s6][37] 作为初始化工具而不是 [systemd][38]。 -Artix Linux 有自己的软件包存储库,但作为一个基于 pacman 的发行版,它可以使用 Arch Linux 存储库或任何其他衍生发行版的软件包,甚至可以使用显式依赖于 systemd 的软件包。也可以使用 [Arch User Repository][29](AUR)。 +Artix Linux 有自己的软件库,但作为一个基于 `pacman` 的发行版,它可以使用 Arch Linux 软件库或任何其他衍生发行版的软件包,甚至可以使用明确依赖于 systemd 的软件包。也可以使用 [Arch 用户软件库][29](AUR)。 -#### 10\。BlackArch Linux +#### 9、BlackArch Linux ![][39] -BlackArch 是一个基于 Arch Linux 的[渗透测试发行版 ][40],它提供了大量的网络安全工具。它是专门为渗透测试人员和安全研究人员创建的。该存储库包含 2400 多个[黑客和渗透测试工具 ][41],可以单独安装,也可以分组安装。BlackArch Linux 兼容现有的 Arch Linux 包。 +BlackArch 是一个基于 Arch Linux 的 [渗透测试发行版][40],它提供了大量的网络安全工具。它是专门为渗透测试人员和安全研究人员创建的。该软件库包含 2400 多个[黑客和渗透测试工具 ][41],可以单独安装,也可以分组安装。BlackArch Linux 兼容现有的 Arch Linux 包。 ### 想要真正的原版 Arch Linux 吗?可以使用图形化 Arch 安装程序简化安装 -如果您想使用原版的 Arch Linux,但又被它困难的安装所难倒。幸运的是,您可以下载一个带有图形安装程序的 Arch Linux ISO。 +如果你想使用原版的 Arch Linux,但又被它困难的安装所难倒。幸运的是,你可以下载一个带有图形安装程序的 Arch Linux ISO。 -Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基于文本的安装程序。它比原版的 Arch 安装容易得多。 +Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基于文本的安装程序。它比裸奔的 Arch 安装容易得多。 #### Anarchy Installer ![][42] -[Anarchy installer][43] 打算为新手和有经验的 Linux 用户提供一种简单而无痛苦的方式来安装 ArchLinux。在需要的时候安装,在需要的地方安装,并且以您想要的方式安装。这就是 Anarchy 的哲学。 +[Anarchy installer][43] 打算为新手和有经验的 Linux 用户提供一种简单而无痛苦的方式来安装 ArchLinux。在需要的时候安装,在需要的地方安装,并且以你想要的方式安装。这就是 Anarchy 的哲学。 -启动安装程序后,将显示一个简单的 [TUI menu][44],列出所有可用的安装程序选项。 +启动安装程序后,将显示一个简单的 [TUI 菜单][44],列出所有可用的安装程序选项。 #### Zen Installer @@ -132,13 +132,13 @@ Arch 安装程序基本上是 Arch Linux ISO 的一个相对容易使用的基 [Zen Installer][46] 为安装 Arch Linux 提供了一个完整的图形(点击式)环境。它支持安装多个桌面环境 、AUR 以及 Arch Linux 的所有功能和灵活性,并且易于图形化安装。 -ISO 将引导实时环境,然后在您连接到 internet 后下载最新稳定版本的安装程序。因此,您将始终获得最新的安装程序和更新的功能。 +ISO 将引导一个临场环境,然后在你连接到互联网后下载最新稳定版本的安装程序。因此,你将始终获得最新的安装程序和更新的功能。 ### 总结 -对于许多用户来说,基于 Arch 的发行版会是一个很好的无障碍选择,但是像 Anarchy 这样的图形化安装程序至少离原版的 Arch Linux 更近了一步。 +对于许多用户来说,基于 Arch 的发行版会是一个很好的无忧选择,而像 Anarchy 这样的图形化安装程序至少离原版的 Arch Linux 更近了一步。 -在我看来,[Arch Linux 的真正魅力在于它的安装过程 ][2] 对于 Linux 爱好者来说,这是一个学习的机会,而不是麻烦。Arch Linux 及其衍生产品有很多东西需要你去折腾,但是在折腾的过程中你就会进入到开源软件的世界,这里是神奇的新世界。下次上课见! +在我看来,[Arch Linux 的真正魅力在于它的安装过程][2],对于 Linux 爱好者来说,这是一个学习的机会,而不是麻烦。Arch Linux 及其衍生产品有很多东西需要你去折腾,但是在折腾的过程中你就会进入到开源软件的世界,这里是神奇的新世界。下次再见! -------------------------------------------------------------------------------- @@ -147,7 +147,7 @@ via: https://itsfoss.com/arch-based-linux-distros/ 作者:[Dimitrios Savvopoulos][a] 选题:[lujun9972][b] 译者:[Chao-zhi](https://github.com/Chao-zhi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 733a21d02b27867bd6f29e8281ca32604c1df67e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 11:29:40 +0800 Subject: [PATCH 190/213] PUB @Chao-zhi https://linux.cn/article-13104-1.html --- ...at are Easier to Install and Use Than Arch Linux Itself.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md (99%) diff --git a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md b/published/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md similarity index 99% rename from translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md rename to published/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md index 6fbcf50489..11c43fd1f5 100644 --- a/translated/tech/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md +++ b/published/20200607 Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (Chao-zhi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13104-1.html) [#]: subject: (Top Arch-based User Friendly Linux Distributions That are Easier to Install and Use Than Arch Linux Itself) [#]: via: (https://itsfoss.com/arch-based-linux-distros/) [#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/) From 1e9ea5fa0008a45ea4b5e2cd436346c33cc68e01 Mon Sep 17 00:00:00 2001 From: Percy Date: Wed, 10 Feb 2021 20:26:19 +0800 Subject: [PATCH 191/213] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87:?= =?UTF-8?q?=20How=20to=20Add=20Fingerprint=20Login=20in=20Ubuntu=20and=20O?= =?UTF-8?q?ther=20Linux=20Distributions.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...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..dcf6c9a3ae 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: (scvoet) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 2901af2ed62207bdaca8dd0379a03a480a10778e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 23:53:23 +0800 Subject: [PATCH 192/213] PRF @robsean --- ...nux -Essentials Explained for Beginners.md | 102 +++++++++--------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index fdf97c8359..0162615f93 100644 --- a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -1,16 +1,18 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to Run a Shell Script in Linux [Essentials Explained for Beginners]) [#]: via: (https://itsfoss.com/run-shell-script-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -如何在 Linux 中运行一个 Shell 脚本 [初学者必知] +基础:如何在 Linux 中运行一个 Shell 脚本 ====== -在 linux 中有两种运行 shell 脚本的方法。你可以使用: +![](https://img.linux.net.cn/data/attachment/album/202102/10/235325tkv7h8dvlp4makkk.jpg) + +在 Linux 中有两种运行 shell 脚本的方法。你可以使用: ``` bash script.sh @@ -22,7 +24,7 @@ bash script.sh ./script.sh ``` -这可能很简单,它解释不了多少。不要担心,我将使用示例来进行必要的解释,以便你能理解为什么在运行一个 shell 脚本时要使用给定的特定语法格式。 +这可能很简单,但没太多解释。不要担心,我将使用示例来进行必要的解释,以便你能理解为什么在运行一个 shell 脚本时要使用给定的特定语法格式。 我将使用这一行 shell 脚本来使需要解释的事情变地尽可能简单: @@ -32,43 +34,37 @@ abhishek@itsfoss:~/Scripts$ cat hello.sh echo "Hello World!" ``` -### 方法 1: 通过将文件作为参数传递给 shell 以运行 shell 脚本 +### 方法 1:通过将文件作为参数传递给 shell 以运行 shell 脚本 第一种方法涉及将脚本文件的名称作为参数传递给 shell 。 -考虑到 bash 是默认脚本,你可以像这样运行一个脚本: +考虑到 bash 是默认 shell,你可以像这样运行一个脚本: ``` bash hello.sh ``` -你知道这种方法的优点码?**你的脚本没有所需要执行权限**。非常方便快速和简单的任务。 +你知道这种方法的优点吗?**你的脚本不需要执行权限**。对于简单的任务非常方便快速。 ![在 Linux 中运行一个 Shell 脚本][1] 如果你还不熟悉,我建议你 [阅读我的 Linux 文件权限详细指南][2] 。 -记住,它需要成为一个 shell 脚本,以便你能将其作为参数传递。一个 shell 脚本是由命令组成的。如果你使用一个普通的文本文件,它将会抱怨错误的命令。 +记住,将其作为参数传递的需要是一个 shell 脚本。一个 shell 脚本是由命令组成的。如果你使用一个普通的文本文件,它将会抱怨错误的命令。 ![运行一个文本文件为脚本][3] 在这种方法中,**你要明确地具体指定你想使用 bash 作为脚本的解释器** 。 -Shell 只是一个程序,并且 bash 只是 Shell 的一个实施。这里有其它的 shell 程序,像 ksh ,[zsh][4] ,等等。如果你安装有其它的 shell ,你也可以使用它们来代替 bash 。 +shell 只是一个程序,并且 bash 只是 Shell 的一种实现。还有其它的 shell 程序,像 ksh 、[zsh][4] 等等。如果你安装有其它的 shell ,你也可以使用它们来代替 bash 。 例如,我已安装了 zsh ,并使用它来运行相同的脚本: ![使用 Zsh 来执行 Shell 脚本][5] -**建议阅读:** +### 方法 2:通过具体指定 shell 脚本的路径来执行脚本 -![][6] - -#### [如何在 Linux 终端中一次运行多个 Linux 命令 [初学者必知提示]][7] - -### 方法 2: 通过具体指定 shell 脚本的路径来执行脚本 - -另外一种运行一个 shell 脚本的方法是通过提供它的路径。但是为使这变地可能,你的文件必须是可执行的。否则,当你尝试执行脚本时,你将会得到 “拒绝访问” 错误。 +另外一种运行一个 shell 脚本的方法是通过提供它的路径。但是要这样做之前,你的文件必须是可执行的。否则,当你尝试执行脚本时,你将会得到 “权限被拒绝” 的错误。 因此,你首先需要确保你的脚本有可执行权限。你可以 [使用 chmod 命令][8] 来给予你自己脚本的这种权限,像这样: @@ -76,23 +72,23 @@ Shell 只是一个程序,并且 bash 只是 Shell 的一个实施。这里有 chmod u+x script.sh ``` -在你的脚本是可执行的后,你需要的全部工作是输入文件的名称及其绝对路径或相对路径。大多数情况下,你都在同一个目录中,因此你可以像这样使用它: +使你的脚本是可执行之后,你只需输入文件的名称及其绝对路径或相对路径。大多数情况下,你都在同一个目录中,因此你可以像这样使用它: ``` ./script.sh ``` -如果你不与你的脚本在同一个目录中,你可以具体指定脚本的绝对路径或相对路径: +如果你与你的脚本不在同一个目录中,你可以具体指定脚本的绝对路径或相对路径: ![在其它的目录中运行 Shell 脚本][9] -#### 在脚本前的这个 ./ 是非常重要的。(当你与脚本在同一个目录中) +在脚本前的这个 `./` 是非常重要的(当你与脚本在同一个目录中)。 ![][10] -为什么当你在同一个目录下,却不能使用脚本名称?这是因为你的 Linux 系统会在 PATH 变量中查找具体指定的几个选定目录中的可执行的文件来运行。 +为什么当你在同一个目录下,却不能使用脚本名称?这是因为你的 Linux 系统会在 `PATH` 环境变量中指定的几个目录中查找可执行的文件来运行。 -这里是我的系统的 PATH 变量的值: +这里是我的系统的 `PATH` 环境变量的值: ``` abhishek@itsfoss:~$ echo $PATH @@ -101,48 +97,46 @@ abhishek@itsfoss:~$ echo $PATH 这意味着在下面目录中具有可执行权限的任意文件都可以在系统的任何位置运行: - * /home/abhishek/.local/bin - * /usr/local/sbin - * /usr/local/bin - * /usr/sbin - * /usr/bin - * /sbin - * /bin - * /usr/games - * /usr/local/games - * /snap/bin + * `/home/abhishek/.local/bin` + * `/usr/local/sbin` + * `/usr/local/bin` + * `/usr/sbin` + * `/usr/bin` + * `/sbin` + * `/bin` + * `/usr/games` + * `/usr/local/games` + * `/snap/bin` - - -Linux 命令(像 ls ,cat 等)的二进制文件或可执行文件都位于这些目录中的其中一个目录。这就是为什么你可以在你系统的任何位置通过使用命令的名称来运作这些命令的原因。看看,ls 命令就是位于 /usr/bin 目录中。 +Linux 命令(像 `ls`、`cat` 等)的二进制文件或可执行文件都位于这些目录中的其中一个。这就是为什么你可以在你系统的任何位置通过使用命令的名称来运作这些命令的原因。看看,`ls` 命令就是位于 `/usr/bin` 目录中。 ![][11] -当你使用脚本而不具体指定其绝对路径或相对路径时,系统将不能在 PATH 变量中找到涉及的脚本。 +当你使用脚本而不具体指定其绝对路径或相对路径时,系统将不能在 `PATH` 环境变量中找到提及的脚本。 -#### 为什么大多数 shell 脚本在其头部包含 #! /bin/bash ? - -记得我提过 shell 只是一个程序,并且有不同实现的 shell 程序。 - -当你使用 #! /bin/bash 时,你是具体指定 bash 作为解释器来运行脚本。如果你不这样做,并且以 ./script.sh 的方式运行一个脚本,它通常会在你正在运行的 shell 中运行。 - -有问题吗?可能会有。看看,大多数的 shell 语法是大多数种类的 shell 中通用的,但是有一些语法可能会有所不同。 - -例如,在 bash和 zsh 中数组的行为是不同的。在 zsh 中,数组索引是从 1 开始的,而不是从 0 开始。 - -![Bash Vs Zsh][12] - -使用 #! /bin/bash 标示该级别是 bash 脚本,并且应该使用bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 #! /bin/zsh 的方式来标示其是 zsh 脚本 - -在 #! 和 /bin/bash 之间的空格是没有影响的。你也可以使用 #!/bin/bash 。 +> 为什么大多数 shell 脚本在其头部包含 #! /bin/bash ? +> +> 记得我提过 shell 只是一个程序,并且有 shell 程序的不同实现。 +> +> 当你使用 `#! /bin/bash` 时,你是具体指定 bash 作为解释器来运行脚本。如果你不这样做,并且以 `./script.sh` 的方式运行一个脚本,它通常会在你正在运行的 shell 中运行。 +> +> 有问题吗?可能会有。看看,大多数的 shell 语法是大多数种类的 shell 中通用的,但是有一些语法可能会有所不同。 +> +> 例如,在 bash 和 zsh 中数组的行为是不同的。在 zsh 中,数组索引是从 1 开始的,而不是从 0 开始。 +> +>![Bash Vs Zsh][12] +> +> 使用 `#! /bin/bash` 来标识该脚本是 bash 脚本,并且应该使用 bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 `#! /bin/zs`h 的方式来标识其是 zsh 脚本。 +> +> 在 `#!` 和 `/bin/bash` 之间的空格是没有影响的。你也可以使用 `#!/bin/bash` 。 ### 它有帮助吗? 我希望这篇文章能够增加你的 Linux 知识。如果你还有问题或建议,请留下评论。 -专家用户可能依然会挑出我丢失的东西。但是这类初学者话题的问题不容易找到信息和避免过多或过少的细节之间的平衡。 +专家用户可能依然会挑出我遗漏的东西。但这种初级题材的问题是,要找到信息的平衡点,避免细节过多或过少,并不容易。 -如果你对学习 bash 脚本感兴趣,在我们的以系统管理为中心的网站 [Linux Handbook][14] 上,我们有一个 [完整的 Bash 初学者系列][13] 。如果你想要,你也可以 [购买附加练习题的电子书][15] ,以支持 Linux Handbook。 +如果你对学习 bash 脚本感兴趣,在我们专注于系统管理的网站 [Linux Handbook][14] 上,我们有一个 [完整的 Bash 初学者系列][13] 。如果你想要,你也可以 [购买带有附加练习的电子书][15] ,以支持 Linux Handbook。 -------------------------------------------------------------------------------- @@ -151,7 +145,7 @@ via: https://itsfoss.com/run-shell-script-linux/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[robsean](https://github.com/robsean) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a3eec4548240439c356377593b8757069bb4ae4d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 23:54:02 +0800 Subject: [PATCH 193/213] PUB @robsean https://linux.cn/article-13106-1.html --- ...ell Script in Linux -Essentials Explained for Beginners.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md (99%) diff --git a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md similarity index 99% rename from translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md rename to published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index 0162615f93..c9db63357d 100644 --- a/translated/tech/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (robsean) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13106-1.html) [#]: subject: (How to Run a Shell Script in Linux [Essentials Explained for Beginners]) [#]: via: (https://itsfoss.com/run-shell-script-linux/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) From fdb03b465898a5810c2bed477de73fb439874f49 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 10 Feb 2021 23:57:54 +0800 Subject: [PATCH 194/213] PRF --- ...Shell Script in Linux -Essentials Explained for Beginners.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md index c9db63357d..f2c5fd298c 100644 --- a/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md +++ b/published/20210128 How to Run a Shell Script in Linux -Essentials Explained for Beginners.md @@ -126,7 +126,7 @@ Linux 命令(像 `ls`、`cat` 等)的二进制文件或可执行文件都位 > >![Bash Vs Zsh][12] > -> 使用 `#! /bin/bash` 来标识该脚本是 bash 脚本,并且应该使用 bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 `#! /bin/zs`h 的方式来标识其是 zsh 脚本。 +> 使用 `#! /bin/bash` 来标识该脚本是 bash 脚本,并且应该使用 bash 作为脚本的解释器来运行,而不受在系统上正在使用的 shell 的影响。如果你使用 zsh 的特殊语法,你可以通过在脚本的第一行添加 `#! /bin/zsh` 的方式来标识其是 zsh 脚本。 > > 在 `#!` 和 `/bin/bash` 之间的空格是没有影响的。你也可以使用 `#!/bin/bash` 。 From 17bba84abf7087ff354e255254e7cc56ef496b34 Mon Sep 17 00:00:00 2001 From: left Date: Thu, 11 Feb 2021 01:29:53 +0800 Subject: [PATCH 195/213] docs(tech): translate tmux --- ...es To Manage Multiple Terminal Sessions.md | 287 ++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md diff --git a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md new file mode 100644 index 0000000000..c86b644830 --- /dev/null +++ b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -0,0 +1,287 @@ +[#]: collector: (lujun9972) +[#]: translator: ( chensanle ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) +[#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) +[#]: author: (sk https://www.ostechnix.com/author/sk/) + +基于 Tmux 的多会话终端管理示例 +====== + +![tmux 命令示例][1] + +我们已经了解到如何通过 [**GNU Screen**][2] 进行多会话管理。今天,我们将要领略另一个著名的命令行实用工具 **“Tmux”** 来管理会话。类似 GNU Screen,tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 免费、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 + +### Linux 下安装 Tmux + +Tmux 可以在绝大多数的 Linux 官方仓库下获取。 + +在 Arch Linux 或它的变种系统下,执行下列命令来安装: + +``` +$ sudo pacman -S tmux +``` + +Debian、Ubuntu 或 Linux Mint: + +``` +$ sudo apt-get install tmux +``` + +Fedora: +``` +$ sudo dnf install tmux +``` + +RHEL 和 CentOS: +``` +$ sudo yum install tmux +``` + +SUSE/openSUSE: +``` +$ sudo zypper install tmux +``` + +以上,我们已经完成 Tmux 的安装。之后我们继续看看其他的 Tmux 示例。 + +### Tmux 命令示例: 多会话管理 + +Tmux 默认所有命令的前置命令都是 **Ctrl+b**,使用前牢记这个快捷键即可。 +* * * + +**注意** **Screen** 的前置命令都是 **Ctrl+a**. + +* * * + +##### 创建 Tmux 会话 + +在终端中运行如下命令创建 Tmux 会话并附着进入: + +``` +tmux +``` + +抑或, + +``` +tmux new +``` + +Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. +一旦进入 Tmux 会话,你将看到一个 **绿色的栏目沉在底部** 如下图所示。 + +![][3] + +创建 Tmux 会话 + +这个绿色的栏目能很容易提示,当前你是否身处 Tmux 会话当中。 + +##### 退出 Tmux 会话 + +退出当前 Tmux 会话仅需要使用 **Ctrl+b** 和 **d**。无需同时触发这两个快捷键,依次按下 “Ctrl+b” 和 “d” 即可。 + +退出当前会话后,你将能看到如下输出。 +``` +[detached (from session 0)] +``` + +##### 创建有名会话 + +如果使用多个会话,你很可能会混淆运行在多个会话中的应用程序。这种情况下,我们需要会话并赋予名称。譬如需要 web 相关服务的会话,就创建一个名称为 **“webserver”**(或任意一个其他名称) 的 Tmux 会话。 + +``` +tmux new -s webserver +``` + +这里是 Tmux 的有名会话 + +![][4] + +拥有自定义名称的 Tmux 会话 + +当你能够看到上述截图,这个 Tmux 会话的名称已经被标注为 **webserver**。如此,你可以在多个会话中,轻易的区分应用程序的所在。 + +退出会话,轻按 **Ctrl+b** 和 **d**。 + +##### 查看 Tmux 会话清单 + +查看 Tmux 会话清单,执行: + +``` +tmux ls +``` + +示例输出: + +![][5] + +如你所见,我们开启了两个 Tmux 会话。 + +##### 创建非附着会话 + +有时候,你可能想要简单创建会话,但是并不想自动切入该会话。 + +创建一个非附着会话,并赋予名称 **“ostechnix”**,运行: + +``` +tmux new -s ostechnix -d +``` + +上述命令将会创建一个名为 “ostechnix” 的会话,但是并不会附着进入。 + +你可以通过使用 “tmux ls” 命令验证: + +![][6] + +##### 进入 Tmux 会话 + +通过如下命令,你可以进入最后一个被创建的会话: + +``` +tmux attach +``` + +Or, + +``` +tmux a +``` + +如果你想进入任意一个指定的有名会话,譬如 “ostechnix”,运行: + +``` +tmux attach -t ostechnix +``` + +或者,简写为: + +``` +tmux a -t ostechnix +``` + +##### 关闭 Tmux 会话 + +当你完成或者不再需要 Tmux 会话,你可以通过如下命令关闭: + +``` +tmux kill-session -t ostechnix +``` + +当身处该会话时,使用 **Ctrl+b** 以及 **x**。点击 “y” 来关闭会话 + +可以通过 “tmux ls” 命令验证。 + +关闭所有 Tmux 服务下的所有会话,运行: + +``` +tmux kill-server +``` + +谨慎!这将终止所有 Tmux 会话,并不会产生任何警告,即便会话存在运行中的任务。 + +如果不存在活跃的 Tmux 会话,将看到如下输出: + +``` +$ tmux ls +no server running on /tmp/tmux-1000/default +``` + +##### 分离 Tmux 窗口 + +分割窗口成多个小窗口,在 Tmux 中,这个叫做 “Tmux panes”(Tmux 窗格)。每个窗格中可以同时运行多个不同的程序。每个窗格可以在不影响其他窗格的前提下可以调整大小、移动位置和控制关闭。我们可以水平、垂直或者二者混合的方式切割屏幕。 + +**水平切割窗格** + +欲水平切割窗格,使用 **Ctrl+b** 和 **“**(半个双引号)。 + +![][7] + +使用组合键进一步切割面板。 + +**垂直切割窗格** + +垂直切割面板,使用 **Ctrl+b** 和 **%** + +![][8] + +垂直切割 Tmux 窗格 + +**水平、垂直混合切割窗格** + +我们也可以同时采用水平和垂直的方案切割窗格。看看如下截图: + +![][9] + +分割 Tmux 窗格 + +受限,我通过 **Ctrl+b “** 水平分割,之后通过 **Ctrl+b** 垂直分割下方的窗格。 + +如你所见,每个窗格下我运行了不同的程序。 + +**切换窗格** + +通过 **Ctrl+b** 和 **方向键(上下左右)** 切换窗格。 + +**发送命令给所有窗格** + +之前的案例中,我们在每个窗格中运行了三个不同命令。其实,也可以发送相同的命令给所有窗格。 + +为此,使用 **Ctrl+b** 然后键入如下命令,之后按压 ENTER: + +``` +:setw synchronize-panes +``` + +现在在任意窗格中键入任何命令。你讲看到相同命令影响了所有窗格。 + +**Swap panes** +**交换窗格** + +使用 **Ctrl+b** 和 **o** 交换窗格。 + +**展示窗格数量** + +使用 **Ctrl+b** 和 **q** 展示窗格数量。 + +**终止窗格** + +要关闭窗格,直接键入 **exit** 并且使用 ENTER 键。或者,按压 **Ctrl+b** 和 **x**。你会看到确认信息。按压 **”y“** 关闭窗格。 + +![][10] + +关闭窗格。 + +这个阶段下,你已经获得了基本的 Tmux 技能来进行多会话管理,更多细节,参阅 man 页面。 + +``` +$ man tmux +``` + +GNU Screen 和 Tmux 工具都能透过 SSH 很好的管理远程服务器。学习 Screen 和 Tmux 命令,像个行家一样,彻底通过这些工具管理远程服务器。 + +-------------------------------------------------------------------------------- + +via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ + +作者:[sk][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.ostechnix.com/author/sk/ +[b]: https://github.com/lujun9972 +[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-720x340.png +[2]: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ +[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-session.png +[4]: https://www.ostechnix.com/wp-content/uploads/2019/06/Named-Tmux-session.png +[5]: https://www.ostechnix.com/wp-content/uploads/2019/06/List-Tmux-sessions.png +[6]: https://www.ostechnix.com/wp-content/uploads/2019/06/Create-detached-sessions.png +[7]: https://www.ostechnix.com/wp-content/uploads/2019/06/Horizontal-split.png +[8]: https://www.ostechnix.com/wp-content/uploads/2019/06/Vertical-split.png +[9]: https://www.ostechnix.com/wp-content/uploads/2019/06/Split-Panes.png +[10]: https://www.ostechnix.com/wp-content/uploads/2019/06/Kill-panes.png From f5c8f5b34ab1fab97731b598cc50b4549f7da4b6 Mon Sep 17 00:00:00 2001 From: left Date: Thu, 11 Feb 2021 01:32:05 +0800 Subject: [PATCH 196/213] a --- ...es To Manage Multiple Terminal Sessions.md | 296 ------------------ 1 file changed, 296 deletions(-) delete mode 100644 sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md diff --git a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md deleted file mode 100644 index 2db2b57b40..0000000000 --- a/sources/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ /dev/null @@ -1,296 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( chensanle ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) -[#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) -[#]: author: (sk https://www.ostechnix.com/author/sk/) - -Tmux Command Examples To Manage Multiple Terminal Sessions -====== - -![tmux command examples][1] - -We’ve already learned to use [**GNU Screen**][2] to manage multiple Terminal sessions. Today, we will see yet another well-known command-line utility named **“Tmux”** to manage Terminal sessions. Similar to GNU Screen, Tmux is also a Terminal multiplexer that allows us to create number of terminal sessions and run more than one programs or processes at the same time inside a single Terminal window. Tmux is free, open source and cross-platform program that supports Linux, OpenBSD, FreeBSD, NetBSD and Mac OS X. In this guide, we will discuss most-commonly used Tmux commands in Linux. - -### Installing Tmux in Linux - -Tmux is available in the official repositories of most Linux distributions. - -On Arch Linux and its variants, run the following command to install it. - -``` -$ sudo pacman -S tmux -``` - -On Debian, Ubuntu, Linux Mint: - -``` -$ sudo apt-get install tmux -``` - -On Fedora: - -``` -$ sudo dnf install tmux -``` - -On RHEL and CentOS: - -``` -$ sudo yum install tmux -``` - -On SUSE/openSUSE: - -``` -$ sudo zypper install tmux -``` - -Well, we have just installed Tmux. Let us go ahead and see some examples to learn how to use Tmux. - -### Tmux Command Examples To Manage Multiple Terminal Sessions - -The default prefix shortcut to all commands in Tmux is **Ctrl+b**. Just remember this keyboard shortcut when using Tmux. - -* * * - -**Note:** The default prefix to all **Screen** commands is **Ctrl+a**. - -* * * - -##### Creating Tmux sessions - -To create a new Tmux session and attach to it, run the following command from the Terminal: - -``` -tmux -``` - -Or, - -``` -tmux new -``` - -Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. - -![][3] - -New Tmux session - -It is very handy to verify whether you’re inside a Tmux session or not. - -##### Detaching from Tmux sessions - -To detach from a current Tmux session, just press **Ctrl+b** and **d**. You don’t need to press this both Keyboard shortcut at a time. First press “Ctrl+b” and then press “d”. - -Once you’re detached from a session, you will see an output something like below. - -``` -[detached (from session 0)] -``` - -##### Creating named sessions - -If you use multiple sessions, you might get confused which programs are running on which sessions. In such cases, you can just create named sessions. For example if you wanted to perform some activities related to web server in a session, just create the Tmux session with a custom name, for example **“webserver”** (or any name of your choice). - -``` -tmux new -s webserver -``` - -Here is the new named Tmux session. - -![][4] - -Tmux session with a custom name - -As you can see in the above screenshot, the name of the Tmux session is **webserver**. This way you can easily identify which program is running on which session. - -To detach, simply press **Ctrl+b** and **d**. - -##### List Tmux sessions - -To view the list of open Tmux sessions, run: - -``` -tmux ls -``` - -Sample output: - -![][5] - -List Tmux sessions - -As you can see, I have two open Tmux sessions. - -##### Creating detached sessions - -Sometimes, you might want to simply create a session and don’t want to attach to it automatically. - -To create a new detached session named **“ostechnix”** , run: - -``` -tmux new -s ostechnix -d -``` - -The above command will create a new Tmux session called “ostechnix”, but won’t attach to it. - -You can verify if the session is created using “tmux ls” command: - -![][6] - -Create detached Tmux sessions - -##### Attaching to Tmux sessions - -You can attach to the last created session by running this command: - -``` -tmux attach -``` - -Or, - -``` -tmux a -``` - -If you want to attach to any specific named session, for example “ostechnix”, run: - -``` -tmux attach -t ostechnix -``` - -Or, shortly: - -``` -tmux a -t ostechnix -``` - -##### Kill Tmux sessions - -When you’re done and no longer required a Tmux session, you can kill it at any time with command: - -``` -tmux kill-session -t ostechnix -``` - -To kill when attached, press **Ctrl+b** and **x**. Hit “y” to kill the session. - -You can verify if the session is closed with “tmux ls” command. - -To Kill Tmux server along with all Tmux sessions, run: - -``` -tmux kill-server -``` - -Be careful! This will terminate all Tmux sessions even if there are any running jobs inside the sessions without any warning. - -When there were no running Tmux sessions, you will see the following output: - -``` -$ tmux ls -no server running on /tmp/tmux-1000/default -``` - -##### Split Tmux Session Windows - -Tmux has an option to split a single Tmux session window into multiple smaller windows called **Tmux panes**. This way we can run different programs on each pane and interact with all of them simultaneously. Each pane can be resized, moved and closed without affecting the other panes. We can split a Tmux window either horizontally or vertically or both at once. - -**Split panes horizontally** - -To split a pane horizontally, press **Ctrl+b** and **”** (single quotation mark). - -![][7] - -Split Tmux pane horizontally - -Use the same key combination to split the panes further. - -**Split panes vertically** - -To split a pane vertically, press **Ctrl+b** and **%**. - -![][8] - -Split Tmux panes vertically - -**Split panes horizontally and vertically** - -We can also split a pane horizontally and vertically at the same time. Take a look at the following screenshot. - -![][9] - -Split Tmux panes - -First, I did a horizontal split by pressing **Ctrl+b “** and then split the lower pane vertically by pressing **Ctrl+b %**. - -As you see in the above screenshot, I am running three different programs on each pane. - -**Switch between panes** - -To switch between panes, press **Ctrl+b** and **Arrow keys (Left, Right, Up, Down)**. - -**Send commands to all panes** - -In the previous example, we run three different commands on each pane. However, it is also possible to run send the same commands to all panes at once. - -To do so, press **Ctrl+b** and type the following command and hit ENTER: - -``` -:setw synchronize-panes -``` - -Now type any command on any pane. You will see that the same command is reflected on all panes. - -**Swap panes** - -To swap panes, press **Ctrl+b** and **o**. - -**Show pane numbers** - -Press **Ctrl+b** and **q** to show pane numbers. - -**Kill panes** - -To kill a pane, simply type **exit** and ENTER key. Alternatively, press **Ctrl+b** and **x**. You will see a confirmation message. Just press **“y”** to close the pane. - -![][10] - -Kill Tmux panes - -At this stage, you will get a basic idea of Tmux and how to use it to manage multiple Terminal sessions. For more details, refer man pages. - -``` -$ man tmux -``` - -Both GNU Screen and Tmux utilities can be very helpful when managing servers remotely via SSH. Learn Screen and Tmux commands thoroughly to manage your remote servers like a pro. - --------------------------------------------------------------------------------- - -via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/ - -作者:[sk][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.ostechnix.com/author/sk/ -[b]: https://github.com/lujun9972 -[1]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-720x340.png -[2]: https://www.ostechnix.com/screen-command-examples-to-manage-multiple-terminal-sessions/ -[3]: https://www.ostechnix.com/wp-content/uploads/2019/06/Tmux-session.png -[4]: https://www.ostechnix.com/wp-content/uploads/2019/06/Named-Tmux-session.png -[5]: https://www.ostechnix.com/wp-content/uploads/2019/06/List-Tmux-sessions.png -[6]: https://www.ostechnix.com/wp-content/uploads/2019/06/Create-detached-sessions.png -[7]: https://www.ostechnix.com/wp-content/uploads/2019/06/Horizontal-split.png -[8]: https://www.ostechnix.com/wp-content/uploads/2019/06/Vertical-split.png -[9]: https://www.ostechnix.com/wp-content/uploads/2019/06/Split-Panes.png -[10]: https://www.ostechnix.com/wp-content/uploads/2019/06/Kill-panes.png From 0eea524592b52f8bec30651d6e2a6473480cfd75 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 11 Feb 2021 05:04:35 +0800 Subject: [PATCH 197/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?Manage=20your=20budget=20on=20Linux=20with=20this=20open=20sour?= =?UTF-8?q?ce=20finance=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md --- ...inux with this open source finance tool.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md diff --git a/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md b/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md new file mode 100644 index 0000000000..d671e6cbf2 --- /dev/null +++ b/sources/tech/20210210 Manage your budget on Linux with this open source finance tool.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage your budget on Linux with this open source finance tool) +[#]: via: (https://opensource.com/article/21/2/linux-skrooge) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Manage your budget on Linux with this open source finance tool +====== +Make managing your finances easier with Skrooge, an open source +budgeting tool. +![2 cents penny money currency][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 is about personal financial management. + +Personal finances can be difficult to manage. It can be frustrating and even scary when you don't have enough money to get by without financial assistance, and it can be surprisingly overwhelming when you do have the money you need but no clear notion of where it all goes each month. To make matters worse, we're often told to "make a budget" as if declaring the amount of money you can spend each month will somehow manifest the money you need. The bottom line is that making a budget is hard, and not meeting your financial goals is discouraging. But it's still important, and Linux has several tools that can help make the task manageable. + +### Money management + +As with anything else in life, we all have our own ways of keeping track of our money. I used to take a simple and direct approach: My paycheck was deposited into an account, and I'd withdraw some percentage in cash. Once the cash was gone from my wallet, I had to wait until the next payday to spend anything. It only took one day of missing out on lunch to learn that I had to take my goals seriously, and I adjusted my spending behavior accordingly. For the simple lifestyle I had at the time, it was an effective means of keeping myself honest with my income, but it didn't translate well to online business transactions, long-term utility contracts, investments, and so on. + +As I continue to refine the way I track my finances, I've learned that personal accounting is always an evolving process. We each have unique financial circumstances, which inform what kind of solution we can or should use to track our income and debt. If you're out of work, then your budgeting goal is likely to spend as little as possible. If you're working but paying off a student loan, then your goal probably favors sending money to the bank. And if you're working but planning for retirement, then you're probably trying to save as much as you can. + +The thing to remember about a budget is that it's meant to compare your financial reality with your financial _goals_. You can't avoid some expenses, but after those, you get to set your own priorities. If you don't hit your goals, you can adjust your own behavior or rewrite your goals so that they better reflect reality. Adapting your financial plan doesn't mean you've failed. It just means that your initial projection wasn't accurate. During hard times, you may not be able to hit any budget goals, but if you keep up with your budget, you'll learn a lot about what it takes financially to maintain your current lifestyle (whatever it may be). Over time, you can learn to adjust settings you may never have realized were available to you. For instance, people are moving to rural towns for the lower cost of living now that remote work is a widely accepted option. It's pretty stunning to see how such a lifestyle shift can alter your budget reports. + +The point is that budgeting is an often undervalued activity, and in no small part because it's daunting. It's important to realize that you can budget, no matter your level of expertise or interest in finances. Whether you [just use a LibreOffice spreadsheet][2], or try a dedicated financial application, you can set goals, track your own behavior, and learn a lot of valuable lessons that could eventually pay dividends. + +### Open source accounting + +There are several dedicated [personal finance applications for Linux][3], including [HomeBank][4], [Money Manager EX][5], [GNUCash][6], [KMyMoney][7], and [Skrooge][8]. All of these applications are essentially ledgers, a place you can retreat to at the end of each month (or whenever you look at your accounts), import data from your bank, and review how your expenditures align with whatever budget you've set for yourself. + +![Skrooge interface with financial data displayed][9] + +Skrooge + +I use Skrooge as my personal budget tracker. It's an easy application to set up, even with multiple bank accounts. Skrooge, as with most open source finance apps, can import multiple file formats, so my workflow goes something like this: + + 1. Log in to my banks. + 2. Export the month's bank statement as QIF files. + 3. Open Skrooge. + 4. Import the QIF files. Each gets assigned to their appropriate accounts automatically. + 5. Review my expenditures compared to the budget goals I've set for myself. If I've gone over, then I dock next month's goals (so that I'll ideally spend less to make up the difference). If I've come in under my goal, then I move the excess to December's budget (so I'll have more to spend at the end of the year). + + + +I only track a subset of the household budget in Skrooge. Skrooge makes that process easy through a dynamic database that allows me to categorize multiple transactions at once with custom tags. This makes it easy for me to extract my personal expenditures from general household and utility expenses, and I can leverage these categories when reviewing the autogenerated reports Skrooge provides. + +![Skrooge budget pie chart][10] + +Skrooge budget pie chart + +Most importantly, the popular Linux financial apps allow me to manage my budget the way that works best for me. For instance, my partner prefers to use a LibreOffice spreadsheet, but with very little effort, I can extract a CSV file from the household budget, import it into Skrooge, and use an updated set of data. There's no lock-in, no incompatibility. The system is flexible and agile, allowing us to adapt our budget and our method of tracking expenses as we learn more about effective budgeting and about what life has in store. + +### Open choice + +Money markets worldwide differ, and the way we each interact with them also defines what tools we can use. Ultimately, your choice of what to use for your finances is a decision you must make based on your own requirements. And one thing open source does particularly well is provide its users the freedom of choice. + +When setting my own financial goals, I appreciate that I can use whatever application fits in best with my style of personal computing. I get to retain control of how I process the data in my life, even when it's data I don't necessarily enjoy having to process. Linux and its amazing set of applications make it just a little less of a chore. + +Try some financial apps on Linux and see if you can inspire yourself to set some goals and save money! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/linux-skrooge + +作者:[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/Medical%20Costs%20Transparency_1.jpg?itok=CkZ_J88m (2 cents penny money currency) +[2]: https://opensource.com/article/20/3/libreoffice-templates +[3]: https://opensource.com/life/17/10/personal-finance-tools-linux +[4]: http://homebank.free.fr/en/index.php +[5]: https://www.moneymanagerex.org/download +[6]: https://opensource.com/article/20/2/gnucash +[7]: https://kmymoney.org/download.html +[8]: https://apps.kde.org/en/skrooge +[9]: https://opensource.com/sites/default/files/skrooge.jpg +[10]: https://opensource.com/sites/default/files/skrooge-pie_0.jpg From 15b228f50116268753a0c28f5acd308a5419c389 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 11 Feb 2021 05:04:56 +0800 Subject: [PATCH 198/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?Configure=20multi-tenancy=20with=20Kubernetes=20namespaces?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md --- ...ulti-tenancy with Kubernetes namespaces.md | 368 ++++++++++++++++++ 1 file changed, 368 insertions(+) create mode 100644 sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md diff --git a/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md b/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md new file mode 100644 index 0000000000..5ced955007 --- /dev/null +++ b/sources/tech/20210210 Configure multi-tenancy with Kubernetes namespaces.md @@ -0,0 +1,368 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Configure multi-tenancy with Kubernetes namespaces) +[#]: via: (https://opensource.com/article/21/2/kubernetes-namespaces) +[#]: author: (Mike Calizo https://opensource.com/users/mcalizo) + +Configure multi-tenancy with Kubernetes namespaces +====== +Namespaces provide basic building blocks of access control for +applications, users, or groups of users. +![shapes of people symbols][1] + +Most enterprises want a multi-tenancy platform to run their cloud-native applications because it helps manage resources, costs, and operational efficiency and control [cloud waste][2]. + +[Kubernetes][3] is the leading open source platform for managing containerized workloads and services. It gained this reputation because of its flexibility in allowing operators and developers to establish automation with declarative configuration. But there is a catch: Because Kubernetes grows rapidly, the old problem of velocity becomes an issue. The bigger your adoption, the more issues and resource waste you discover. + +### An example of scale + +Imagine your company started small with its Kubernetes adoption by deploying a variety of internal applications. It has multiple project streams running with multiple developers dedicated to each project stream. + +In a scenario like this, you need to make sure your cluster administrator has full control over the cluster to manage its resources and implement cluster policy and security standards. In a way, the admin is herding the cluster's users to use best practices. A namespace is very useful in this instance because it enables different teams to share a single cluster where computing resources are subdivided into multiple teams. + +While namespaces are your first step to Kubernetes multi-tenancy, they are not good enough on their own. There are a number of Kubernetes primitives you need to consider so that you can administer your cluster properly and put it into a production-ready implementation. + +The Kubernetes primitives for multi-tenancy are: + + 1. **RBAC:** Role-based access control for Kubernetes + 2. **Network policies:** To isolate traffic between namespaces + 3. **Resource quotas:** To control fair access to cluster resources + + + +This article explores how to use Kubernetes namespaces and some basic RBAC configurations to partition a single Kubernetes cluster and take advantage of this built-in Kubernetes tooling. + +### What is a Kubernetes namespace? + +Before digging into how to use namespaces to prepare your Kubernetes cluster to become multi-tenant-ready, you need to know what namespaces are. + +A [namespace][4] is a Kubernetes object that partitions a Kubernetes cluster into multiple virtual clusters. This is done with the aid of [Kubernetes names and IDs][5]. Namespaces use the Kubernetes name object, which means that each object inside a namespace gets a unique name and ID across the cluster to allow virtual partitioning. + +### How namespaces help in multi-tenancy + +Namespaces are one of the Kubernetes primitives you can use to partition your cluster into multiple virtual clusters to allow multi-tenancy. Each namespace is isolated from every other user's, team's, or application's namespace. This isolation is essential in multi-tenancy so that updates and changes in applications, users, and teams are contained within the specific namespace. (Note that namespace does not provide network segmentation.) + +Before moving ahead, verify the default namespace in a working Kubernetes cluster: + + +``` +[root@master ~]# kubectl get namespace +NAME              STATUS   AGE +default           Active   3d +kube-node-lease   Active   3d +kube-public       Active   3d +kube-system       Active   3d +``` + +Then create your first namespace, called **test**: + + +``` +[root@master ~]# kubectl create namespace test +namespace/test created +``` + +Verify the newly created namespace: + + +``` +[root@master ~]# kubectl get namespace +NAME              STATUS   AGE +default           Active   3d +kube-node-lease   Active   3d +kube-public       Active   3d +kube-system       Active   3d +test              Active   10s +[root@master ~]# +``` + +Describe the newly created namespace: + + +``` +[root@master ~]# kubectl describe namespace test +Name:         test +Labels:       <none> +Annotations:  <none> +Status:       Active +No resource quota. +No LimitRange resource. +``` + +To delete a namespace: + + +``` +[root@master ~]# kubectl delete namespace test +namespace "test" deleted +``` + +Your new namespace is active, but it doesn't have any labels, annotations, or quota-limit ranges defined. However, now that you know how to create and describe and delete a namespace, I'll show how you can use a namespace to virtually partition a Kubernetes cluster. + +### Partitioning clusters using namespace and RBAC + +Deploy the following simple application to learn how to partition a cluster using namespace and isolate an application and its related objects from "other" users. + +First, verify the namespace you will use. For simplicity, use the **test** namespace you created above: + + +``` +[root@master ~]# kubectl get namespaces +NAME              STATUS   AGE +default           Active   3d +kube-node-lease   Active   3d +kube-public       Active   3d +kube-system       Active   3d +test              Active   3h +``` + +Then deploy a simple application called **test-app** inside the test namespace by using the following configuration: + + +``` +apiVersion: v1 +kind: Pod +metadata: +  name: test-app                 ⇒ name of the application +  namespace: test                ⇒ the namespace where the app runs +  labels: +     app: test-app                      ⇒ labels for the app +spec: +  containers: +  - name: test-app +    image: nginx:1.14.2         ⇒ the image we used for the app. +    ports: +    - containerPort: 80 +``` + +Deploy it: + + +``` +$ kubectl create -f test-app.yaml +    pod/test-app created +``` + +Then verify the application pod was created: + + +``` +$ kubectl get pods -n test +  NAME       READY   STATUS    RESTARTS   AGE +  test-app   1/1     Running   0          18s +``` + +Now that the running application is inside the **test** namespace, test a use case where: + + * **auth-user** can edit and view all the objects inside the test namespace + * **un-auth-user** can only view the namespace + + + +I pre-created the users for you to test. If you want to know how I created the users inside Kubernetes, view the commands [here][6]. + + +``` +$ kubectl config view -o jsonpath='{.users[*].name}' +  auth-user +  kubernetes-admin +  un-auth-user +``` + +With this set up, create a Kubernetes [Role and RoleBindings][7] to isolate the target namespace **test** to allow **auth-user** to view and edit objects inside the namespace and not allow **un-auth-user** to access or view the objects inside the **test** namespace. + +Start by creating a ClusterRole and a Role. These objects are a list of verbs (action) permitted on specific resources and namespaces. + +Create a ClusterRole: + + +``` +$ cat clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: ClusterRole +metadata: +  name: list-deployments +  namespace: test +rules: +  - apiGroups: [ apps ] +    resources: [ deployments ] +    verbs: [ get, list ] +``` + +Create a Role: + + +``` +$ cat role.yaml +apiVersion: rbac.authorization.k8s.io/v1beta1 +kind: Role +metadata: +  name: list-deployments +  namespace: test +rules: +  - apiGroups: [ apps ] +    resources: [ deployments ] +    verbs: [ get, list ] +``` + +Apply the Role: + + +``` +$ kubectl create -f role.yaml +roles.rbac.authorization.k8s.io "list-deployments" created +``` + +Use the same command to create a ClusterRole: + + +``` +$ kubectl create -f clusterrole.yaml + +$ kubectl get role -n test +  NAME               CREATED AT +  list-deployments   2021-01-18T00:54:00Z +``` + +Verify the Roles: + + +``` +$ kubectl describe roles -n test +  Name:         list-deployments +  Labels:       <none> +  Annotations:  <none> +  PolicyRule: +    Resources         Non-Resource URLs  Resource Names  Verbs +    ---------         -----------------  --------------  ----- +    deployments.apps  []                 []              [get list] +``` + +Remember that you must create RoleBindings by namespace, not by user. This means you need to create two role bindings for user **auth-user**. + +Here are the sample RoleBinding YAML files to permit **auth-user** to edit and view. + +**To edit:** + + +``` +$ cat rolebinding-auth-edit.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: +  name: auth-user-edit +  namespace: test +subjects: +\- kind: User +  name: auth-user +  apiGroup: rbac.authorization.k8s.io +roleRef: +  kind: ClusterRole +  name: edit +  apiGroup: rbac.authorization.k8s.io +``` + +**To view:** + + +``` +$ cat rolebinding-auth-view.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: +  name: auth-user-view +  namespace: test +subjects: +\- kind: User +  name: auth-user +  apiGroup: rbac.authorization.k8s.io +roleRef: +  kind: ClusterRole +  name: view +  apiGroup: rbac.authorization.k8s.io +``` + +Create these YAML files: + + +``` +$ kubectl create rolebinding-auth-view.yaml +$ kubectl create rolebinding-auth-edit.yaml +``` + +Verify if the RoleBindings were successfully created: + + +``` +$ kubectl get rolebindings -n test +NAME             ROLE               AGE +auth-user-edit   ClusterRole/edit   48m +auth-user-view   ClusterRole/view   47m +``` + +With the requirements set up, test the cluster partitioning: + + +``` +[root@master]$ sudo su un-auth-user +[un-auth-user@master ~]$ kubect get pods -n test +[un-auth-user@master ~]$ kubectl get pods -n test +Error from server (Forbidden): pods is forbidden: User "un-auth-user" cannot list resource "pods" in API group "" in the namespace "test" +``` + +Log in as **auth-user**: + + +``` +[root@master ]# sudo su auth-user +[auth-user@master auth-user]$ kubectl get pods -n test +NAME       READY   STATUS    RESTARTS   AGE +test-app   1/1     Running   0          3h8m +[auth-user@master un-auth-user]$ + +[auth-user@master auth-user]$ kubectl edit pods/test-app -n test +Edit cancelled, no changes made. +``` + +You can view and edit the objects inside the **test** namespace. How about viewing the cluster nodes? + + +``` +[auth-user@master auth-user]$ kubectl get nodes +Error from server (Forbidden): nodes is forbidden: User "auth-user" cannot list resource "nodes" in API group "" at the cluster scope +[auth-user@master auth-user]$ +``` + +You can't because the role bindings for user **auth-user** dictate they have access to view or edit objects only inside the **test** namespace. + +### Enable access control with namespaces + +Namespaces provide basic building blocks of access control using RBAC and isolation for applications, users, or groups of users. But using namespaces alone as your multi-tenancy solution is not enough in an enterprise implementation. It is recommended that you use other Kubernetes multi-tenancy primitives to attain further isolation and implement proper security. + +Namespaces can provide some basic isolation in your Kubernetes cluster; therefore, it is important to consider them upfront, especially when planning a multi-tenant cluster. Namespaces also allow you to logically segregate and assign resources to individual users, teams, or applications. + +By using namespaces, you can increase resource efficiencies by enabling a single cluster to be used for a diverse set of workloads. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/kubernetes-namespaces + +作者:[Mike Calizo][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mcalizo +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/Open%20Pharma.png?itok=GP7zqNZE (shapes of people symbols) +[2]: https://devops.com/the-cloud-is-booming-but-so-is-cloud-waste/ +[3]: https://opensource.com/resources/what-is-kubernetes +[4]: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ +[5]: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ +[6]: https://www.adaltas.com/en/2019/08/07/users-rbac-kubernetes/ +[7]: https://kubernetes.io/docs/reference/access-authn-authz/rbac/ From 2435a8306c80266c1769dac28afe63fd5337d489 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 11 Feb 2021 05:05:15 +0800 Subject: [PATCH 199/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210210=20?= =?UTF-8?q?Draw=20Mandelbrot=20fractals=20with=20GIMP=20scripting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md --- ...Mandelbrot fractals with GIMP scripting.md | 370 ++++++++++++++++++ 1 file changed, 370 insertions(+) create mode 100644 sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md diff --git a/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md b/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md new file mode 100644 index 0000000000..d38f3fb54d --- /dev/null +++ b/sources/tech/20210210 Draw Mandelbrot fractals with GIMP scripting.md @@ -0,0 +1,370 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Draw Mandelbrot fractals with GIMP scripting) +[#]: via: (https://opensource.com/article/21/2/gimp-mandelbrot) +[#]: author: (Cristiano L. Fontana https://opensource.com/users/cristianofontana) + +Draw Mandelbrot fractals with GIMP scripting +====== +Create complex mathematical images with GIMP's Script-Fu language. +![Painting art on a computer screen][1] + +The GNU Image Manipulation Program ([GIMP][2]) is my go-to solution for image editing. Its toolset is very powerful and convenient, except for doing [fractals][3], which is one thing you cannot draw by hand easily. These are fascinating mathematical constructs that have the characteristic of being [self-similar][4]. In other words, if they are magnified in some areas, they will look remarkably similar to the unmagnified picture. Besides being interesting, they also make very pretty pictures! + +![Portion of a Mandelbrot fractal using GIMPs Coldfire palette][5] + +Portion of a Mandelbrot fractal using GIMP's Coldfire palette (Cristiano Fontana, [CC BY-SA 4.0][6]) + +GIMP can be automated with [Script-Fu][7] to do [batch processing of images][8] or create complicated procedures that are not practical to do by hand; drawing fractals falls in the latter category. This tutorial will show how to draw a representation of the [Mandelbrot fractal][9] using GIMP and Script-Fu. + +![Mandelbrot set drawn using GIMP's Firecode palette][10] + +Portion of a Mandelbrot fractal using GIMP's Firecode palette. (Cristiano Fontana, [CC BY-SA 4.0][6]) + +![Rotated and magnified portion of the Mandelbrot set using Firecode.][11] + +Rotated and magnified portion of the Mandelbrot set using the Firecode palette. (Cristiano Fontana, [CC BY-SA 4.0][6]) + +In this tutorial, you will write a script that creates a layer in an image and draws a representation of the Mandelbrot set with a colored environment around it. + +### What is the Mandelbrot set? + +Do not panic! I will not go into too much detail here. For the more math-savvy, the Mandelbrot set is defined as the set of [complex numbers][12] _a_ for which the succession + +_zn+1 = zn2 + a_ + +does not diverge when starting from _z₀ = 0_. + +In reality, the Mandelbrot set is the fancy-looking black blob in the pictures; the nice-looking colors are outside the set. They represent how many iterations are required for the magnitude of the succession of numbers to pass a threshold value. In other words, the color scale shows how many steps are required for the succession to pass an upper-limit value. + +### GIMP's Script-Fu + +[Script-Fu][7] is the scripting language built into GIMP. It is an implementation of the [Scheme programming language][13]. + +If you want to get more acquainted with Scheme, GIMP's documentation offers an [in-depth tutorial][14]. I also wrote an article about [batch processing images][8] using Script-Fu. Finally, the Help menu offers a Procedure Browser with very extensive documentation with all of Script-Fu's functions described in detail. + +![GIMP Procedure Browser][15] + +(Cristiano Fontana, [CC BY-SA 4.0][6]) + +Scheme is a Lisp-like language, so a major characteristic is that it uses a [prefix notation][16] and a [lot of parentheses][17]. Functions and operators are applied to a list of operands by prefixing them: + + +``` +(function-name operand operand ...) + +(+ 2 3) +↳ Returns 5 + +(list 1 2 3 5) +↳ Returns a list containing 1, 2, 3, and 5 +``` + +### Write the script + +You can write your first script and save it to the **Scripts** folder found in the preferences window under **Folders → Scripts**. Mine is at `$HOME/.config/GIMP/2.10/scripts`. Write a file called `mandelbrot.scm` with: + + +``` +; Complex numbers implementation +(define (make-rectangular x y) (cons x y)) +(define (real-part z) (car z)) +(define (imag-part z) (cdr z)) + +(define (magnitude z) +  (let ((x (real-part z)) +        (y (imag-part z))) +    (sqrt (+ (* x x) (* y y))))) + +(define (add-c a b) +  (make-rectangular (+ (real-part a) (real-part b)) +                    (+ (imag-part a) (imag-part b)))) + +(define (mul-c a b) +  (let ((ax (real-part a)) +        (ay (imag-part a)) +        (bx (real-part b)) +        (by (imag-part b))) +    (make-rectangular (- (* ax bx) (* ay by)) +                      (+ (* ax by) (* ay bx))))) + +; Definition of the function creating the layer and drawing the fractal +(define (script-fu-mandelbrot image palette-name threshold domain-width domain-height offset-x offset-y) +  (define num-colors (car (gimp-palette-get-info palette-name))) +  (define colors (cadr (gimp-palette-get-colors palette-name))) + +  (define width (car (gimp-image-width image))) +  (define height (car (gimp-image-height image))) + +  (define new-layer (car (gimp-layer-new image +                                         width height +                                         RGB-IMAGE +                                         "Mandelbrot layer" +                                         100 +                                         LAYER-MODE-NORMAL))) + +  (gimp-image-add-layer image new-layer 0) +  (define drawable new-layer) +  (define bytes-per-pixel (car (gimp-drawable-bpp drawable))) + +  ; Fractal drawing section. +  ; Code from: +  (define (iterations a z i) +    (let ((z′ (add-c (mul-c z z) a))) +       (if (or (= i num-colors) (> (magnitude z′) threshold)) +          i +          (iterations a z′ (+ i 1))))) + +  (define (iter->color i) +    (if (>= i num-colors) +        (list->vector '(0 0 0)) +        (list->vector (vector-ref colors i)))) + +  (define z0 (make-rectangular 0 0)) + +  (define (loop x end-x y end-y) +    (let* ((real-x (- (* domain-width (/ x width)) offset-x)) +           (real-y (- (* domain-height (/ y height)) offset-y)) +           (a (make-rectangular real-x real-y)) +           (i (iterations a z0 0)) +           (color (iter->color i))) +      (cond ((and (< x end-x) (< y end-y)) (gimp-drawable-set-pixel drawable x y bytes-per-pixel color) +                                           (loop (+ x 1) end-x y end-y)) +            ((and (>= x end-x) (< y end-y)) (gimp-progress-update (/ y end-y)) +                                            (loop 0 end-x (+ y 1) end-y))))) +  (loop 0 width 0 height) + +  ; These functions refresh the GIMP UI, otherwise the modified pixels would be evident +  (gimp-drawable-update drawable 0 0 width height) +  (gimp-displays-flush) +) + +(script-fu-register +  "script-fu-mandelbrot"          ; Function name +  "Create a Mandelbrot layer"     ; Menu label +                                  ; Description +  "Draws a Mandelbrot fractal on a new layer. For the coloring it uses the palette identified by the name provided as a string. The image boundaries are defined by its domain width and height, which correspond to the image width and height respectively. Finally the image is offset in order to center the desired feature." +  "Cristiano Fontana"             ; Author +  "2021, C.Fontana. GNU GPL v. 3" ; Copyright +  "27th Jan. 2021"                ; Creation date +  "RGB"                           ; Image type that the script works on +  ;Parameter    Displayed            Default +  ;type         label                values +  SF-IMAGE      "Image"              0 +  SF-STRING     "Color palette name" "Firecode" +  SF-ADJUSTMENT "Threshold value"    '(4 0 10 0.01 0.1 2 0) +  SF-ADJUSTMENT "Domain width"       '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "Domain height"      '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "X offset"           '(2.25 -20 20 0.1 1 4 0) +  SF-ADJUSTMENT "Y offset"           '(1.50 -20 20 0.1 1 4 0) +) +(script-fu-menu-register "script-fu-mandelbrot" "<Image>/Layer/") +``` + +I will go through the script to show you what it does. + +### Get ready to draw the fractal + +Since this image is all about complex numbers, I wrote a quick and dirty implementation of complex numbers in Script-Fu. I defined the complex numbers as [pairs][18] of real numbers. Then I added the few functions needed for the script. I used [Racket's documentation][19] as inspiration for function names and roles: + + +``` +(define (make-rectangular x y) (cons x y)) +(define (real-part z) (car z)) +(define (imag-part z) (cdr z)) + +(define (magnitude z) +  (let ((x (real-part z)) +        (y (imag-part z))) +    (sqrt (+ (* x x) (* y y))))) + +(define (add-c a b) +  (make-rectangular (+ (real-part a) (real-part b)) +                    (+ (imag-part a) (imag-part b)))) + +(define (mul-c a b) +  (let ((ax (real-part a)) +        (ay (imag-part a)) +        (bx (real-part b)) +        (by (imag-part b))) +    (make-rectangular (- (* ax bx) (* ay by)) +                      (+ (* ax by) (* ay bx))))) +``` + +### Draw the fractal + +The new function is called `script-fu-mandelbrot`. The best practice for writing a new function is to call it `script-fu-something` so that it can be identified in the Procedure Browser easily. The function requires a few parameters: an `image` to which it will add a layer with the fractal, the `palette-name` identifying the color palette to be used, the `threshold` value to stop the iteration, the `domain-width` and `domain-height` that identify the image boundaries, and the `offset-x` and `offset-y` to center the image to the desired feature. The script also needs some other parameters that it can deduce from the GIMP interface: + + +``` +(define (script-fu-mandelbrot image palette-name threshold domain-width domain-height offset-x offset-y) +  (define num-colors (car (gimp-palette-get-info palette-name))) +  (define colors (cadr (gimp-palette-get-colors palette-name))) + +  (define width (car (gimp-image-width image))) +  (define height (car (gimp-image-height image))) + +  ... +``` + +Then it creates a new layer and identifies it as the script's `drawable`. A "drawable" is the element you want to draw on: + + +``` +(define new-layer (car (gimp-layer-new image +                                       width height +                                       RGB-IMAGE +                                       "Mandelbrot layer" +                                       100 +                                       LAYER-MODE-NORMAL))) + +(gimp-image-add-layer image new-layer 0) +(define drawable new-layer) +(define bytes-per-pixel (car (gimp-drawable-bpp drawable))) +``` + +For the code determining the pixels' color, I used the [Racket][20] example on the [Rosetta Code][21] website. It is not the most optimized algorithm, but it is simple to understand. Even a non-mathematician like me can understand it. The `iterations` function determines how many steps the succession requires to pass the threshold value. To cap the iterations, I am using the number of colors in the palette. In other words, if the threshold is too high or the succession does not grow, the calculation stops at the `num-colors` value. The `iter->color` function transforms the number of iterations into a color using the provided palette. If the iteration number is equal to `num-colors`, it uses black because this means that the succession is probably bound and that pixel is in the Mandelbrot set: + + +``` +; Fractal drawing section. +; Code from: +(define (iterations a z i) +  (let ((z′ (add-c (mul-c z z) a))) +     (if (or (= i num-colors) (> (magnitude z′) threshold)) +        i +        (iterations a z′ (+ i 1))))) + +(define (iter->color i) +  (if (>= i num-colors) +      (list->vector '(0 0 0)) +      (list->vector (vector-ref colors i)))) +``` + +Because I have the feeling that Scheme users do not like to use loops, I implemented the function looping over the pixels as a recursive function. The `loop` function reads the starting coordinates and their upper boundaries. At each pixel, it defines some temporary variables with the `let*` function: `real-x` and `real-y` are the real coordinates of the pixel in the complex plane, according to the parameters; the `a` variable is the starting point for the succession; the `i` is the number of iterations; and finally `color` is the pixel color. Each pixel is colored with the `gimp-drawable-set-pixel` function that is an internal GIMP procedure. The peculiarity is that it is not undoable, and it does not trigger the image to refresh. Therefore, the image will not be updated during the operation. To play nice with the user, at the end of each row of pixels, it calls the `gimp-progress-update` function, which updates a progress bar in the user interface: + + +``` +(define z0 (make-rectangular 0 0)) + +(define (loop x end-x y end-y) +  (let* ((real-x (- (* domain-width (/ x width)) offset-x)) +         (real-y (- (* domain-height (/ y height)) offset-y)) +         (a (make-rectangular real-x real-y)) +         (i (iterations a z0 0)) +         (color (iter->color i))) +    (cond ((and (< x end-x) (< y end-y)) (gimp-drawable-set-pixel drawable x y bytes-per-pixel color) +                                         (loop (+ x 1) end-x y end-y)) +          ((and (>= x end-x) (< y end-y)) (gimp-progress-update (/ y end-y)) +                                          (loop 0 end-x (+ y 1) end-y))))) +(loop 0 width 0 height) +``` + +At the calculation's end, the function needs to inform GIMP that it modified the `drawable`, and it should refresh the interface because the image is not "automagically" updated during the script's execution: + + +``` +(gimp-drawable-update drawable 0 0 width height) +(gimp-displays-flush) +``` + +### Interact with the user interface + +To use the `script-fu-mandelbrot` function in the graphical user interface (GUI), the script needs to inform GIMP. The `script-fu-register` function informs GIMP about the parameters required by the script and provides some documentation: + + +``` +(script-fu-register +  "script-fu-mandelbrot"          ; Function name +  "Create a Mandelbrot layer"     ; Menu label +                                  ; Description +  "Draws a Mandelbrot fractal on a new layer. For the coloring it uses the palette identified by the name provided as a string. The image boundaries are defined by its domain width and height, which correspond to the image width and height respectively. Finally the image is offset in order to center the desired feature." +  "Cristiano Fontana"             ; Author +  "2021, C.Fontana. GNU GPL v. 3" ; Copyright +  "27th Jan. 2021"                ; Creation date +  "RGB"                           ; Image type that the script works on +  ;Parameter    Displayed            Default +  ;type         label                values +  SF-IMAGE      "Image"              0 +  SF-STRING     "Color palette name" "Firecode" +  SF-ADJUSTMENT "Threshold value"    '(4 0 10 0.01 0.1 2 0) +  SF-ADJUSTMENT "Domain width"       '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "Domain height"      '(3 0 10 0.1 1 4 0) +  SF-ADJUSTMENT "X offset"           '(2.25 -20 20 0.1 1 4 0) +  SF-ADJUSTMENT "Y offset"           '(1.50 -20 20 0.1 1 4 0) +) +``` + +Then the script tells GIMP to put the new function in the Layer menu with the label "Create a Mandelbrot layer": + + +``` +`(script-fu-menu-register "script-fu-mandelbrot" "/Layer/")` +``` + +Having registered the function, you can visualize it in the Procedure Browser. + +![script-fu-mandelbrot function][22] + +(Cristiano Fontana, [CC BY-SA 4.0][6]) + +### Run the script + +Now that the function is ready and registered, you can draw the Mandelbrot fractal! First, create a square image and run the script from the Layers menu. + +![script running][23] + +(Cristiano Fontana, [CC BY-SA 4.0][6]) + +The default values are a good starting set to obtain the following image. The first time you run the script, create a very small image (e.g., 60x60 pixels) because this implementation is slow! It took several hours for my computer to create the following image in full 1920x1920 pixels. As I mentioned earlier, this is not the most optimized algorithm; rather, it was the easiest for me to understand. + +![Mandelbrot set drawn using GIMP's Firecode palette][10] + +Portion of a Mandelbrot fractal using GIMP's Firecode palette. (Cristiano Fontana, [CC BY-SA 4.0][6]) + +### Learn more + +This tutorial showed how to use GIMP's built-in scripting features to draw an image created with an algorithm. These images show GIMP's powerful set of tools that can be used for artistic applications and mathematical images. + +If you want to move forward, I suggest you look at the official documentation and its [tutorial][14]. As an exercise, try modifying this script to draw a [Julia set][24], and please share the resulting image in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/gimp-mandelbrot + +作者:[Cristiano L. Fontana][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/cristianofontana +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen) +[2]: https://www.gimp.org/ +[3]: https://en.wikipedia.org/wiki/Fractal +[4]: https://en.wikipedia.org/wiki/Self-similarity +[5]: https://opensource.com/sites/default/files/uploads/mandelbrot_portion.png (Portion of a Mandelbrot fractal using GIMPs Coldfire palette) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://docs.gimp.org/en/gimp-concepts-script-fu.html +[8]: https://opensource.com/article/21/1/gimp-scripting +[9]: https://en.wikipedia.org/wiki/Mandelbrot_set +[10]: https://opensource.com/sites/default/files/uploads/mandelbrot.png (Mandelbrot set drawn using GIMP's Firecode palette) +[11]: https://opensource.com/sites/default/files/uploads/mandelbrot_portion2.png (Rotated and magnified portion of the Mandelbrot set using Firecode.) +[12]: https://en.wikipedia.org/wiki/Complex_number +[13]: https://en.wikipedia.org/wiki/Scheme_(programming_language) +[14]: https://docs.gimp.org/en/gimp-using-script-fu-tutorial.html +[15]: https://opensource.com/sites/default/files/uploads/procedure_browser_0.png (GIMP Procedure Browser) +[16]: https://en.wikipedia.org/wiki/Polish_notation +[17]: https://xkcd.com/297/ +[18]: https://www.gnu.org/software/guile/manual/html_node/Pairs.html +[19]: https://docs.racket-lang.org/reference/generic-numbers.html?q=make-rectangular#%28part._.Complex_.Numbers%29 +[20]: https://racket-lang.org/ +[21]: https://rosettacode.org/wiki/Mandelbrot_set#Racket +[22]: https://opensource.com/sites/default/files/uploads/mandelbrot_documentation.png (script-fu-mandelbrot function) +[23]: https://opensource.com/sites/default/files/uploads/script_working.png (script running) +[24]: https://en.wikipedia.org/wiki/Julia_set From 47db2eccaf7a95d8f8b421b4bf891b6cf5063a8e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 11 Feb 2021 10:11:46 +0800 Subject: [PATCH 200/213] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chensanle 感谢你,完成了第一篇翻译贡献! --- ...es To Manage Multiple Terminal Sessions.md | 148 ++++++++++-------- 1 file changed, 83 insertions(+), 65 deletions(-) diff --git a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index c86b644830..bafdf14ad6 100644 --- a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: ( chensanle ) -[#]: reviewer: ( ) +[#]: translator: (chensanle) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) @@ -10,11 +10,11 @@ 基于 Tmux 的多会话终端管理示例 ====== -![tmux 命令示例][1] +![](https://img.linux.net.cn/data/attachment/album/202102/11/101058ffso6wzzw94wm2ng.jpg) -我们已经了解到如何通过 [**GNU Screen**][2] 进行多会话管理。今天,我们将要领略另一个著名的命令行实用工具 **“Tmux”** 来管理会话。类似 GNU Screen,tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 免费、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 +我们已经了解到如何通过 [GNU Screen][2] 进行多会话管理。今天,我们将要领略另一个著名的管理会话的命令行实用工具 **Tmux**。类似 GNU Screen,Tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 自由、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 -### Linux 下安装 Tmux +### Linux 下安装 tmux Tmux 可以在绝大多数的 Linux 官方仓库下获取。 @@ -24,39 +24,38 @@ Tmux 可以在绝大多数的 Linux 官方仓库下获取。 $ sudo pacman -S tmux ``` -Debian、Ubuntu 或 Linux Mint: +Debian、Ubuntu 或 Linux Mint: ``` $ sudo apt-get install tmux ``` -Fedora: +Fedora: ``` $ sudo dnf install tmux ``` -RHEL 和 CentOS: +RHEL 和 CentOS: + ``` $ sudo yum install tmux ``` SUSE/openSUSE: + ``` $ sudo zypper install tmux ``` -以上,我们已经完成 Tmux 的安装。之后我们继续看看其他的 Tmux 示例。 +以上,我们已经完成 Tmux 的安装。之后我们继续看看一些 Tmux 示例。 ### Tmux 命令示例: 多会话管理 -Tmux 默认所有命令的前置命令都是 **Ctrl+b**,使用前牢记这个快捷键即可。 -* * * +Tmux 默认所有命令的前置命令都是 `Ctrl+b`,使用前牢记这个快捷键即可。 -**注意** **Screen** 的前置命令都是 **Ctrl+a**. +> **注意**:**Screen** 的前置命令都是 `Ctrl+a`. -* * * - -##### 创建 Tmux 会话 +#### 创建 Tmux 会话 在终端中运行如下命令创建 Tmux 会话并附着进入: @@ -70,43 +69,43 @@ tmux tmux new ``` -Once you are inside the Tmux session, you will see a **green bar at the bottom** as shown in the screenshot below. -一旦进入 Tmux 会话,你将看到一个 **绿色的栏目沉在底部** 如下图所示。 +一旦进入 Tmux 会话,你将看到一个 **沉在底部的绿色的边栏**,如下图所示。 ![][3] -创建 Tmux 会话 +*创建 Tmux 会话* -这个绿色的栏目能很容易提示,当前你是否身处 Tmux 会话当中。 +这个绿色的边栏能很容易提示你当前是否身处 Tmux 会话当中。 -##### 退出 Tmux 会话 +#### 退出 Tmux 会话 -退出当前 Tmux 会话仅需要使用 **Ctrl+b** 和 **d**。无需同时触发这两个快捷键,依次按下 “Ctrl+b” 和 “d” 即可。 +退出当前 Tmux 会话仅需要使用 `Ctrl+b` 和 `d`。无需同时触发这两个快捷键,依次按下 `Ctrl+b` 和 `d` 即可。 + +退出当前会话后,你将能看到如下输出: -退出当前会话后,你将能看到如下输出。 ``` [detached (from session 0)] ``` -##### 创建有名会话 +#### 创建有名会话 -如果使用多个会话,你很可能会混淆运行在多个会话中的应用程序。这种情况下,我们需要会话并赋予名称。譬如需要 web 相关服务的会话,就创建一个名称为 **“webserver”**(或任意一个其他名称) 的 Tmux 会话。 +如果使用多个会话,你很可能会混淆运行在多个会话中的应用程序。这种情况下,我们需要会话并赋予名称。譬如需要 web 相关服务的会话,就创建一个名称为 “webserver”(或任意一个其他名称) 的 Tmux 会话。 ``` tmux new -s webserver ``` -这里是 Tmux 的有名会话 +这里是新的 Tmux 有名会话: ![][4] -拥有自定义名称的 Tmux 会话 +*拥有自定义名称的 Tmux 会话* -当你能够看到上述截图,这个 Tmux 会话的名称已经被标注为 **webserver**。如此,你可以在多个会话中,轻易的区分应用程序的所在。 +如你所见上述截图,这个 Tmux 会话的名称已经被标注为 “webserver”。如此,你可以在多个会话中,轻易的区分应用程序的所在。 -退出会话,轻按 **Ctrl+b** 和 **d**。 +退出会话,轻按 `Ctrl+b` 和 `d`。 -##### 查看 Tmux 会话清单 +#### 查看 Tmux 会话清单 查看 Tmux 会话清单,执行: @@ -118,13 +117,15 @@ tmux ls ![][5] +*列出 Tmux 会话* + 如你所见,我们开启了两个 Tmux 会话。 -##### 创建非附着会话 +#### 创建非附着会话 有时候,你可能想要简单创建会话,但是并不想自动切入该会话。 -创建一个非附着会话,并赋予名称 **“ostechnix”**,运行: +创建一个非附着会话,并赋予名称 “ostechnix”,运行: ``` tmux new -s ostechnix -d @@ -132,25 +133,27 @@ tmux new -s ostechnix -d 上述命令将会创建一个名为 “ostechnix” 的会话,但是并不会附着进入。 -你可以通过使用 “tmux ls” 命令验证: +你可以通过使用 `tmux ls` 命令验证: ![][6] -##### 进入 Tmux 会话 +*创建非附着会话* -通过如下命令,你可以进入最后一个被创建的会话: +#### 附着进入 Tmux 会话 + +通过如下命令,你可以附着进入最后一个被创建的会话: ``` tmux attach ``` -Or, +抑或, ``` tmux a ``` -如果你想进入任意一个指定的有名会话,譬如 “ostechnix”,运行: +如果你想附着进入任意一个指定的有名会话,譬如 “ostechnix”,运行: ``` tmux attach -t ostechnix @@ -162,7 +165,7 @@ tmux attach -t ostechnix tmux a -t ostechnix ``` -##### 关闭 Tmux 会话 +#### 关闭 Tmux 会话 当你完成或者不再需要 Tmux 会话,你可以通过如下命令关闭: @@ -170,9 +173,9 @@ tmux a -t ostechnix tmux kill-session -t ostechnix ``` -当身处该会话时,使用 **Ctrl+b** 以及 **x**。点击 “y” 来关闭会话 +当身处该会话时,使用 `Ctrl+b` 以及 `x`。点击 `y` 来关闭会话。 -可以通过 “tmux ls” 命令验证。 +可以通过 `tmux ls` 命令验证。 关闭所有 Tmux 服务下的所有会话,运行: @@ -189,70 +192,85 @@ $ tmux ls no server running on /tmp/tmux-1000/default ``` -##### 分离 Tmux 窗口 +#### 切割 Tmux 窗口 -分割窗口成多个小窗口,在 Tmux 中,这个叫做 “Tmux panes”(Tmux 窗格)。每个窗格中可以同时运行多个不同的程序。每个窗格可以在不影响其他窗格的前提下可以调整大小、移动位置和控制关闭。我们可以水平、垂直或者二者混合的方式切割屏幕。 +切割窗口成多个小窗口,在 Tmux 中,这个叫做 “Tmux 窗格”。每个窗格中可以同时运行不同的程序,并同时与所有的窗格进行交互。每个窗格可以在不影响其他窗格的前提下可以调整大小、移动位置和控制关闭。我们可以以水平、垂直或者二者混合的方式切割屏幕。 -**水平切割窗格** +##### 水平切割窗格 -欲水平切割窗格,使用 **Ctrl+b** 和 **“**(半个双引号)。 +欲水平切割窗格,使用 `Ctrl+b` 和 `"`(半个双引号)。 ![][7] -使用组合键进一步切割面板。 +##### 水平切割 Tmux 窗格 -**垂直切割窗格** +可以使用组合键进一步切割面板。 -垂直切割面板,使用 **Ctrl+b** 和 **%** +##### 垂直切割窗格 + +垂直切割面板,使用 `Ctrl+b` 和 `%`。 ![][8] -垂直切割 Tmux 窗格 +*垂直切割 Tmux 窗格* -**水平、垂直混合切割窗格** +##### 水平、垂直混合切割窗格 我们也可以同时采用水平和垂直的方案切割窗格。看看如下截图: ![][9] -分割 Tmux 窗格 +*切割 Tmux 窗格* -受限,我通过 **Ctrl+b “** 水平分割,之后通过 **Ctrl+b** 垂直分割下方的窗格。 +首先,我通过 `Ctrl+b` `"` 水平切割,之后通过 `Ctrl+b` `%` 垂直切割下方的窗格。 如你所见,每个窗格下我运行了不同的程序。 -**切换窗格** +##### 切换窗格 -通过 **Ctrl+b** 和 **方向键(上下左右)** 切换窗格。 +通过 `Ctrl+b` 和方向键(上下左右)切换窗格。 -**发送命令给所有窗格** +##### 发送命令给所有窗格 之前的案例中,我们在每个窗格中运行了三个不同命令。其实,也可以发送相同的命令给所有窗格。 -为此,使用 **Ctrl+b** 然后键入如下命令,之后按压 ENTER: +为此,使用 `Ctrl+b` 然后键入如下命令,之后按下回车: ``` :setw synchronize-panes ``` -现在在任意窗格中键入任何命令。你讲看到相同命令影响了所有窗格。 +现在在任意窗格中键入任何命令。你将看到相同命令影响了所有窗格。 -**Swap panes** -**交换窗格** +##### 交换窗格 -使用 **Ctrl+b** 和 **o** 交换窗格。 +使用 `Ctrl+b` 和 `o` 交换窗格。 -**展示窗格数量** +##### 展示窗格号 -使用 **Ctrl+b** 和 **q** 展示窗格数量。 +使用 `Ctrl+b` 和 `q` 展示窗格号。 -**终止窗格** +##### 终止窗格 -要关闭窗格,直接键入 **exit** 并且使用 ENTER 键。或者,按压 **Ctrl+b** 和 **x**。你会看到确认信息。按压 **”y“** 关闭窗格。 +要关闭窗格,直接键入 `exit` 并且按下回车键。或者,按下 `Ctrl+b` 和 `x`。你会看到确认信息。按下 `y` 关闭窗格。 ![][10] -关闭窗格。 +*关闭窗格* + +##### 放大和缩小 Tmux 窗格 + +我们可以将 Tmux 窗格放大到当前终端窗口的全尺寸,以获得更好的文本可视性,并查看更多的内容。当你需要更多的空间或专注于某个特定的任务时,这很有用。在完成该任务后,你可以将 Tmux 窗格缩小(取消放大)到其正常位置。更多详情请看以下链接。 + +- [如何缩放 Tmux 窗格以提高文本可见度?](https://ostechnix.com/how-to-zoom-tmux-panes-for-better-text-visibility/) + +#### 自动启动 Tmux 会话 + +当通过 SSH 与远程系统工作时,在 Tmux 会话中运行一个长期运行的进程总是一个好的做法。因为,它可以防止你在网络连接突然中断时失去对运行进程的控制。避免这个问题的一个方法是自动启动 Tmux 会话。更多详情,请参考以下链接。 + +- [通过 SSH 登录远程系统时自动启动 Tmux 会话](https://ostechnix.com/autostart-tmux-session-on-remote-system-when-logging-in-via-ssh/) + +### 总结 这个阶段下,你已经获得了基本的 Tmux 技能来进行多会话管理,更多细节,参阅 man 页面。 @@ -268,8 +286,8 @@ via: https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal 作者:[sk][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chensanle](https://github.com/chensanle) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8b9da65f156b9924acdced819c3dcef298ac512f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 11 Feb 2021 10:13:01 +0800 Subject: [PATCH 201/213] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chensanle 本文首发:https://linux.cn/article-13107-1.html 你的 LCTT 专页:https://linux.cn/lctt/chensanle --- ...Command Examples To Manage Multiple Terminal Sessions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md (98%) diff --git a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md similarity index 98% rename from translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md rename to published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index bafdf14ad6..fe8b92c8f3 100644 --- a/translated/tech/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chensanle) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13107-1.html) [#]: subject: (Tmux Command Examples To Manage Multiple Terminal Sessions) [#]: via: (https://www.ostechnix.com/tmux-command-examples-to-manage-multiple-terminal-sessions/) [#]: author: (sk https://www.ostechnix.com/author/sk/) @@ -14,7 +14,7 @@ 我们已经了解到如何通过 [GNU Screen][2] 进行多会话管理。今天,我们将要领略另一个著名的管理会话的命令行实用工具 **Tmux**。类似 GNU Screen,Tmux 是一个帮助我们在单一终端窗口中创建多个会话,同一时间内同时运行多个应用程序或进程的终端复用工具。Tmux 自由、开源并且跨平台,支持 Linux、OpenBSD、FreeBSD、NetBSD 以及 Mac OS X。本文将讨论 Tmux 在 Linux 系统下的高频用法。 -### Linux 下安装 tmux +### Linux 下安装 Tmux Tmux 可以在绝大多数的 Linux 官方仓库下获取。 From a7d5eed136a3d94725e3c20cab69ed0f66b3b738 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 11 Feb 2021 10:20:46 +0800 Subject: [PATCH 202/213] PRF --- ...mux Command Examples To Manage Multiple Terminal Sessions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md index fe8b92c8f3..c80af774f7 100644 --- a/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md +++ b/published/20190610 Tmux Command Examples To Manage Multiple Terminal Sessions.md @@ -202,7 +202,7 @@ no server running on /tmp/tmux-1000/default ![][7] -##### 水平切割 Tmux 窗格 +*水平切割 Tmux 窗格* 可以使用组合键进一步切割面板。 From c88f23fc856b36ca89308f384fe0f66f5d735c1d Mon Sep 17 00:00:00 2001 From: RiaXu <1257021170@qq.com> Date: Thu, 11 Feb 2021 16:50:54 +0800 Subject: [PATCH 203/213] Update 20190404 Add translation. --- ...s Optane for data center memory caching.md | 73 ------------------- ...s Optane for data center memory caching.md | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 sources/tech/20190404 Intel formally launches Optane for data center memory caching.md create mode 100644 translated/tech/20190404 Intel formally launches Optane for data center memory caching.md diff --git a/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md b/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md deleted file mode 100644 index c81ef9a51d..0000000000 --- a/sources/tech/20190404 Intel formally launches Optane for data center memory caching.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (ShuyRoy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Intel formally launches Optane for data center memory caching) -[#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) -[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) - -Intel formally launches Optane for data center memory caching -====== - -### Intel formally launched the Optane persistent memory product line, which includes 3D Xpoint memory technology. The Intel-only solution is meant to sit between DRAM and NAND and to speed up performance. - -![Intel][1] - -As part of its [massive data center event][2] on Tuesday, Intel formally launched the Optane persistent memory product line. It had been out for a while, but the current generation of Xeon server processors could not fully utilize it. The new Xeon 8200 and 9200 lines take full advantage of it. - -And since Optane is an Intel product (co-developed with Micron), that means AMD and Arm server processors are out of luck. - -As I have [stated in the past][3], Optane DC Persistent Memory uses 3D Xpoint memory technology that Intel developed with Micron Technology. 3D Xpoint is a non-volatile memory type that is much faster than solid-state drives (SSD), almost at the speed of DRAM, but it has the persistence of NAND flash. - -**[ Read also:[Why NVMe? Users weigh benefits of NVMe-accelerated flash storage][4] and [IDC’s top 10 data center predictions][5] | Get regularly scheduled insights [Sign up for Network World newsletters][6] ]** - -The first 3D Xpoint products were SSDs called Intel’s ["ruler,"][7] because they were designed in a long, thin format similar to the shape of a ruler. They were designed that way to fit in 1u server carriages. As part of Tuesday’s announcement, Intel introduced the new Intel SSD D5-P4326 'Ruler' SSD, using four-cell or QLC 3D NAND memory, with up to 1PB of storage in a 1U design. - -Optane DC Persistent Memory will be available in DIMM capacities of 128GB on up to 512GB initially. That’s two to four times what you can get with DRAM, said Navin Shenoy, executive vice president and general manager of Intel’s Data Center Group, who keynoted the event. - -“We expect system capacity in a server system to scale to 4.5 terabytes per socket or 36 TB in an 8-socket system. That’s three times larger than what we were able to do with the first-generation of Xeon Scalable,” he said. - -## Intel Optane memory uses and speed - -Optane runs in two different modes: Memory Mode and App Direct Mode. Memory mode is what I have been describing to you, where Optane memory exists “above” the DRAM and acts as a cache. In App Direct mode, the DRAM and Optane DC Persistent Memory are pooled together to maximize the total capacity. Not every workload is ideal for this kind of configuration, so it should be used in applications that are not latency-sensitive. The primary use case for Optane, as Intel is promoting it, is Memory Mode. - -**[[Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][8] ]** - -When 3D Xpoint was initially announced a few years back, Intel claimed it was 1,000 times faster than NAND, with 1000 times the endurance, and 10 times the density potential of DRAM. Well that was a little exaggerated, but it does have some intriguing elements. - -Optane memory, when used in 256B contiguous 4 cacheline, can achieve read speeds of 8.3GB/sec and write speeds of 3.0GB/sec. Compare that with the read/write speed of 500 or so MB/sec for a SATA SSD, and you can see the performance gain. Optane, remember, is feeding memory, so it caches frequently accessed SSD content. - -This is the key takeaware of Optane DC. It will keep very large data sets very close to memory, and hence the CPU, with low latency while at the same time minimizing the need to access the slower storage subsystem, whether it’s SSD or HDD. It now offers the possibility of putting multiple terabytes of data very close to the CPU for much faster access. - -## One challenge with Optane memory - -The only real challenge is that Optane goes into DIMM slots, which is where memory goes. Now some motherboards come with as many as 16 DIMM slots per CPU socket, but that’s still board real estate that the customer and OEM provider will need to balance out: Optane vs. memory. There are some Optane drives in PCI Express format, which alleviate the memory crowding on the motherboard. - -3D Xpoint also offers higher endurance than traditional NAND flash memory due to the way it writes data. Intel promises a five-year warranty with its Optane, while a lot of SSDs offer only three years. - -Join the Network World communities on [Facebook][9] and [LinkedIn][10] to comment on topics that are top of mind. - --------------------------------------------------------------------------------- - -via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all - -作者:[Andy Patrizio][a] -选题:[lujun9972][b] -译者:[RiaXu](https://github.com/ShuyRoy) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.networkworld.com/author/Andy-Patrizio/ -[b]: https://github.com/lujun9972 -[1]: https://images.idgesg.net/images/article/2018/06/intel-optane-persistent-memory-100760427-large.jpg -[2]: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html -[3]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html -[4]: https://www.networkworld.com/article/3290421/why-nvme-users-weigh-benefits-of-nvme-accelerated-flash-storage.html -[5]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb -[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb -[7]: https://www.theregister.co.uk/2018/02/02/ruler_and_miniruler_ssd_formats_look_to_banish_diskstyle_drives/ -[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 -[9]: https://www.facebook.com/NetworkWorld/ -[10]: https://www.linkedin.com/company/network-world diff --git a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md new file mode 100644 index 0000000000..5d258ab61f --- /dev/null +++ b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: (ShuyRoy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Intel formally launches Optane for data center memory caching) +[#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) +[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) + +英特尔正式推出Optane:用于数据中心内存缓存 +====== + +### 英特尔正式推出包含3D Xpoint 内存技术的傲腾持久内存产品线。英特尔的这个解决方案将傲腾持久内存放置在DRAM和NAND中间,以此来提升性能。 + +![Intel][1] + +英特尔在周二(2019年4月2日)的[大数据中心活动][2]中正式推出傲腾持久内存产品线。傲腾持久内存已经问世了一段时间,但是目前的Xeon服务器处理器还不能充分利用它。而新的Xeon8200和9200可以充分利用傲腾持久内存的优势。 + +由于傲腾是英特尔的产品(与美光合作开发),所以意味着AMD和ARM的服务器处理器不能够支持它。 + +正如[我之前所说的][3],傲腾DC持久内存采用与美光合作研发的3D Xpoint内存技术。3D Xpoint是一种比SSD更快的非易失性内存,速度几乎与DRAM相近,而且它具有NAND flash的持久性。 + +**[ 小编推荐:[为什么是NVMe?用户会权衡基于NVMe加速的闪存的优点。][4] 和 [IDC的十大数据中心预测][5] | 定期更新的新闻[请注册网络世界通信][6] ]** + +第一个3D Xpoint产品是被称为英特尔“尺子”的SSD,因为它们被设计成细长的样子,很像尺子的形状。他们被设计得能够适合1u的服务器托架。在周二发布的公告中,英特尔推出了新的利用四-cell或者QLC 3D NAND 内存的英特尔SSD D5-P4325[“尺子”][7]SSD,可以在1u的服务器托架上放1PB的存储。 + +傲腾DC持久内存的可用容量最初可以通过使用128GB的DIMM达到512GB。这次活动的关键人物——英特尔数据中心集团执行副总裁及总经理Navin Shenoy说:“傲腾DC持久内存可达到的容量是DRAM的2到4倍。” + +他说:“我们希望服务器系统的容量可以扩展到每个插槽4.5TB或者8个插槽36TB,这是我们第一代Xeon可扩展芯片的3倍。” + +## 英特尔傲腾内存的使用和速度 + +傲腾有两种不同的运行模式:内存模式和APP直连模式。内存模式是将DRAM放在傲腾内存之上,将DRAM作为傲腾内存的缓存。APP直连模式是将DRAM和傲腾持久内存一起作为内存来最大化总容量。并不是每个工作负载都适合这种配置,所以应该在对延迟不敏感的应用程序中使用。正如英特尔推广的那样,傲腾的主要使用情景是内存模式。 + +**[[通过PluralSight上的7部分线上课程来获得苹果技术合作者的认证。][8] ]** + +几年前,当3D Xpoint最初发布时,英特尔宣称傲腾的速度是NAND的1000倍,忍耐力是NAND的1000倍,密度是DRAM的10倍。这虽然有点夸张,但这些因素确实很令人着迷。 + +在256B的连续4个缓存行中使用傲腾内存可以达到8.3GB/秒的读速度和3.0GB/秒的写速度。与SATA SSD的500MB/秒左右的读/写速度相比,可以看到性能有很大提升。请记住,傲腾充当内存,所以它会缓存被频繁访问的SSD中的内容。 + +这是了解傲腾DC的关键。它能将非常大的数据集存储在离内存非常近的位置,因此具有很低延迟的CPU可以最小化访问较慢的存储子系统的访问延迟,无论存储是SSD还是HDD。现在,它提供了将很多TB的数据放在离CPU很近的位置,以获得更快的访问速度。 + +## 傲腾内存的一个挑战 + +唯一真正的挑战是傲腾然后插进内存所在的DIMM插槽。现在有些主板的每个CPU有16个插槽,但是这仍然是客户和设备制造商之间需要平衡的:傲腾VS内存。有一些傲腾驱动采用了PCIe接口进行连接,可以减轻主板上内存的拥挤。 + +3D Xpoint由于它写数据的方式,提供了比传统的NAND flash更高的耐久力。英特尔承诺傲腾提供5年保修期,而很多SSD只提供3年保修期。 + +加入Facebook[Facebook][9]和LinkedIn[LinkedIn][10]上的网络世界社区,对你最关心的话题发表评论吧。 + +-------------------------------------------------------------------------------- + +via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all + +作者:[Andy Patrizio][a] +选题:[lujun9972][b] +译者:[RiaXu](https://github.com/ShuyRoy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.networkworld.com/author/Andy-Patrizio/ +[b]: https://github.com/lujun9972 +[1]: https://images.idgesg.net/images/article/2018/06/intel-optane-persistent-memory-100760427-large.jpg +[2]: https://www.networkworld.com/article/3386142/intel-unveils-an-epic-response-to-amds-server-push.html +[3]: https://www.networkworld.com/article/3279271/intel-launches-optane-the-go-between-for-memory-and-storage.html +[4]: https://www.networkworld.com/article/3290421/why-nvme-users-weigh-benefits-of-nvme-accelerated-flash-storage.html +[5]: https://www.networkworld.com/article/3242807/data-center/top-10-data-center-predictions-idc.html#nww-fsb +[6]: https://www.networkworld.com/newsletters/signup.html#nww-fsb +[7]: https://www.theregister.co.uk/2018/02/02/ruler_and_miniruler_ssd_formats_look_to_banish_diskstyle_drives/ +[8]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11 +[9]: https://www.facebook.com/NetworkWorld/ +[10]: https://www.linkedin.com/company/network-world From 2905ff9ff34aef7019cd6e438a79a0f21a659846 Mon Sep 17 00:00:00 2001 From: sanle <31087327+chensanle@users.noreply.github.com> Date: Thu, 11 Feb 2021 20:21:50 +0800 Subject: [PATCH 204/213] Update 20200223 The Zen of Go.md --- sources/tech/20200223 The Zen of Go.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200223 The Zen of Go.md b/sources/tech/20200223 The Zen of Go.md index c4143aed32..249c3790cd 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: ( ) +[#]: translator: ( chensanle ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From f46297d21f8feaf2516b9d84cce646aa0d03efa0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:03:11 +0800 Subject: [PATCH 205/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?Unikraft:=20Pushing=20Unikernels=20into=20the=20Mainstream?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md --- ... Pushing Unikernels into the Mainstream.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md diff --git a/sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md b/sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md new file mode 100644 index 0000000000..e9eb57d18e --- /dev/null +++ b/sources/tech/20210211 Unikraft- Pushing Unikernels into the Mainstream.md @@ -0,0 +1,115 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Unikraft: Pushing Unikernels into the Mainstream) +[#]: via: (https://www.linux.com/featured/unikraft-pushing-unikernels-into-the-mainstream/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) + +Unikraft: Pushing Unikernels into the Mainstream +====== + +![][1] + +Unikernels have been around for many years and are famous for providing excellent performance in boot times, throughput, and memory consumption, to name a few metrics [1]. Despite their apparent potential, unikernels have not yet seen a broad level of deployment due to three main drawbacks: + + * **Hard to build**: Putting a unikernel image together typically requires expert, manual work that needs redoing for each application. Also, many unikernel projects are not, and don’t aim to be, POSIX compliant, and so significant porting effort is required to have standard applications and frameworks run on them. + * **Hard to extract high performance**: Unikernel projects don’t typically expose high-performance APIs; extracting high performance often requires expert knowledge and modifications to the code. + * **Little or no tool ecosystem**: Assuming you have an image to run, deploying it and managing it is often a manual operation. There is little integration with major DevOps or orchestration frameworks. + + + +While not all unikernel projects suffer from all of these issues (e.g., some provide some level of POSIX compliance but the performance is lacking, others target a single programming language and so are relatively easy to build but their applicability is limited), we argue that no single project has been able to successfully address all of them, hindering any significant level of deployment. For the past three years, Unikraft ([www.unikraft.org][2]), a Linux Foundation project under the Xen Project’s auspices, has had the explicit aim to change this state of affairs to bring unikernels into the mainstream.  + +If you’re interested, read on, and please be sure to check out: + + * The [replay of our two FOSDEM talks][3] [2,3] and the [virtual stand ][4] + * Our website (unikraft.org) and source code (). + * Our upcoming source code release, 0.5 Tethys (more information at ) + * [unikraft.io][5], for industrial partners interested in Unikraft PoCs (or [info@unikraft.io][6]) + + + +### High Performance + +To provide developers with the ability to obtain high performance easily, Unikraft exposes a set of composable, performance-oriented APIs. The figure below shows Unikraft’s architecture: all components are libraries with their own **Makefile** and **Kconfig** configuration files, and so can be added to the unikernel build independently of each other. + +![][7] + +**Figure 1. Unikraft ‘s fully modular architecture showing high-performance APIs** + +APIs are also micro-libraries that can be easily enabled or disabled via a Kconfig menu; Unikraft unikernels can compose which APIs to choose to best cater to an application’s needs. For example, an RCP-style application might turn off the **uksched** API (➃ in the figure) to implement a high performance, run-to-completion event loop; similarly, an application developer can easily select an appropriate memory allocator (➅) to obtain maximum performance, or to use multiple different ones within the same unikernel (e.g., a simple, fast memory allocator for the boot code, and a standard one for the application itself).  + +![][8] | ![][9] +---|--- +**Figure 2. Unikraft memory consumption vs. other unikernel projects and Linux** | **Figure 3. Unikraft NGINX throughput versus other unikernels, Docker, and Linux/KVM.** + +  + +These APIs, coupled with the fact that all Unikraft’s components are fully modular, results in high performance. Figure 2, for instance, shows Unikraft having lower memory consumption than other unikernel projects (HermiTux, Rump, OSv) and Linux (Alpine); and Figure 3 shows that Unikraft outperforms them in terms of NGINX requests per second, reaching 90K on a single CPU core. + +Further, we are working on (1) a performance profiler tool to be able to quickly identify potential bottlenecks in Unikraft images and (2) a performance test tool that can automatically run a large set of performance experiments, varying different configuration options to figure out optimal configurations. + +### Ease of Use, No Porting Required + +Forcing users to port applications to a unikernel to obtain high performance is a showstopper. Arguably, a system is only as good as the applications (or programming languages, frameworks, etc.) can run. Unikraft aims to achieve good POSIX compatibility; one way of doing so is supporting a **libc** (e.g., **musl)**, along with a large set of Linux syscalls.  + +![][10] + +**Figure 4. Only a certain percentage of syscalls are needed to support a wide range of applications** + +While there are over 300 of these, many of them are not needed to run a large set of applications; as shown in Figure 1 (taken from [5]). Having in the range of 145, for instance, is enough to support 50% of all libraries and applications in a Ubuntu distribution (many of which are irrelevant to unikernels, such as desktop applications). As of this writing, Unikraft supports over 130 syscalls and a number of mainstream applications (e.g., SQLite, Nginx, Redis), programming languages and runtime environments such as C/C++, Go, Python, Ruby, Web Assembly, and Lua, not to mention several different hypervisors (KVM, Xen, and Solo5) and ARM64 bare-metal support. + +### Ecosystem and DevOps + +Another apparent downside of unikernel projects is the almost total lack of integration with existing, major DevOps and orchestration frameworks. Working towards the goal of integration, in the past year, we created the **kraft** tool, allowing users to choose an application and a target platform simply (e.g., KVM on x86_64) and take care of building the image running it. + +Beyond this, we have several sub-projects ongoing to support in the coming months: + + * **Kubernetes**: If you’re already using Kubernetes in your deployments, this work will allow you to deploy much leaner, fast Unikraft images _transparently._ + * **Cloud Foundry**: Similarly, users relying on Cloud Foundry will be able to generate Unikraft images through it, once again transparently. + * **Prometheus**: Unikernels are also notorious for having very primitive or no means for monitoring running instances. Unikraft is targeting Prometheus support to provide a wide range of monitoring capabilities.  + + + +In all, we believe Unikraft is getting closer to bridging the gap between unikernel promise and actual deployment. We are very excited about this year’s upcoming features and developments, so please feel free to drop us a line if you have any comments, questions, or suggestions at [**info@unikraft.io**][6]. + +_**About the author: [Dr. Felipe Huici][11] is Chief Researcher, Systems and Machine Learning Group, NEC Laboratories Europe GmbH**_ + +### References + +[1] Unikernels Rethinking Cloud Infrastructure. + +[2] Is the Time Ripe for Unikernels to Become Mainstream with Unikraft? FOSDEM 2021 Microkernel developer room. + +[3] Severely Debloating Cloud Images with Unikraft. FOSDEM 2021 Virtualization and IaaS developer room. + +[4] Welcome to the Unikraft Stand! + +[5] A study of modern Linux API usage and compatibility: what to support when you’re supporting. Eurosys 2016. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/featured/unikraft-pushing-unikernels-into-the-mainstream/ + +作者:[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/02/unikraft.svg +[2]: http://www.unikraft.org +[3]: https://video.fosdem.org/2021/stands/unikraft/ +[4]: https://stands.fosdem.org/stands/unikraft/ +[5]: http://www.unikraft.io +[6]: mailto:info@unikraft.io +[7]: https://www.linux.com/wp-content/uploads/2021/02/unikraft1.png +[8]: https://www.linux.com/wp-content/uploads/2021/02/unikraft2.png +[9]: https://www.linux.com/wp-content/uploads/2021/02/unikraft3.png +[10]: https://www.linux.com/wp-content/uploads/2021/02/unikraft4.png +[11]: https://www.linkedin.com/in/felipe-huici-47a559127/ From 66aeb4daab10da951c7de35f8217aee83183ecd5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:03:31 +0800 Subject: [PATCH 206/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?Getting=20to=20Know=20the=20Cryptocurrency=20Open=20Patent=20Al?= =?UTF-8?q?liance=20(COPA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md --- ...ptocurrency Open Patent Alliance (COPA).md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md diff --git a/sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md b/sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md new file mode 100644 index 0000000000..86df7cf688 --- /dev/null +++ b/sources/tech/20210211 Getting to Know the Cryptocurrency Open Patent Alliance (COPA).md @@ -0,0 +1,92 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Getting to Know the Cryptocurrency Open Patent Alliance (COPA)) +[#]: via: (https://www.linux.com/news/getting-to-know-the-cryptocurrency-open-patent-alliance-copa/) +[#]: author: (Linux.com Editorial Staff https://www.linux.com/author/linuxdotcom/) + +Getting to Know the Cryptocurrency Open Patent Alliance (COPA) +====== + +### ![][1] + +### Why is there a need for a patent protection alliance for cryptocurrency technologies? + +With the recent surge in popularity of cryptocurrencies and related technologies, Square felt an industry group was needed to protect against litigation and other threats against core cryptocurrency technology and ensure the ecosystem remains vibrant and open for developers and companies. + +The same way [Open Invention Network][2] (OIN) and [LOT Network][3] add a layer of patent protection to inter-company collaboration on open source technologies, COPA aims to protect open source cryptocurrency technology. Feeling safe from the threat of lawsuits is a precursor to good collaboration. + + * Locking up foundational cryptocurrency technologies in patents stifles innovation and adoption of cryptocurrency in novel and useful applications. + * The offensive use of patents threatens the growth and free availability of cryptocurrency technologies. Many smaller companies and developers do not own patents and cannot deter or defend threats adequately. + + + +By joining COPA, a member can feel secure it can innovate in the cryptocurrency space without fear of litigation between other members.  + +### What is Square’s involvement in COPA? + +Square’s core purpose is economic empowerment, and they see cryptocurrency as a core technological pillar. Square helped start and fund COPA with the hope that by encouraging innovation in the cryptocurrency space, more useful ideas and products would get created. COPA management has now diversified to an independent board of technology and regulatory experts, and Square maintains a minority presence. + +### Do we need cryptocurrency patents to join COPA?  + +No! Anyone can join and benefit from being a member of COPA, regardless of whether they have patents or not. There is no barrier to entry – members can be individuals, start-ups, small companies, or large corporations. Here is how COPA works: + + * First, COPA members pledge never to use their crypto-technology patents against anyone, except for defensive reasons, effectively making their patents freely available for all. + * Second, members pool all of their crypto-technology patents together to form a shared patent library, which provides a forum to allow members to reasonably negotiate lending patents to one another for defensive purposes. + * The patent pledge and the shared patent library work in tandem to help drive down the incidence and threat of patent litigation, benefiting the cryptocurrency community as a whole.  + * Additionally, COPA monitors core technologies and entities that support cryptocurrency and does its best to research and help address litigation threats against community members. + + + +### What types of companies should join COPA? + + * Financial services companies and technology companies working in regulated industries that use distributed ledger or cryptocurrency technology + * Companies or individuals who are interested in collaborating on developing cryptocurrency products or who hold substantial investments in cryptocurrency + + + +### What companies have joined COPA so far? + + * Square, Inc. + * Blockchain Commons + * Carnes Validadas + * Request Network + * Foundation Devices + * ARK + * SatoshiLabs + * Transparent Systems + * Horizontal Systems + * VerifyChain + * Blockstack + * Protocol Labs + * Cloudeya Ltd. + * Mercury Cash + * Bithyve + * Coinbase + * Blockstream + * Stakenet + + + +### How to join + +Please express interest and get access to our membership agreement here: + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/getting-to-know-the-cryptocurrency-open-patent-alliance-copa/ + +作者:[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/02/copa-linuxdotcom.jpg +[2]: https://openinventionnetwork.com/ +[3]: https://lotnet.com/ From 7d2a9a0bb989ab40e5434f41bde726c06c364ebd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:03:48 +0800 Subject: [PATCH 207/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?Understanding=20Open=20Governance=20Networks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 Understanding Open Governance Networks.md --- ... Understanding Open Governance Networks.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210211 Understanding Open Governance Networks.md diff --git a/sources/tech/20210211 Understanding Open Governance Networks.md b/sources/tech/20210211 Understanding Open Governance Networks.md new file mode 100644 index 0000000000..771947bb39 --- /dev/null +++ b/sources/tech/20210211 Understanding Open Governance Networks.md @@ -0,0 +1,100 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding Open Governance Networks) +[#]: via: (https://www.linux.com/news/understanding-open-governance-networks/) +[#]: author: (The Linux Foundation https://www.linuxfoundation.org/en/blog/understanding-open-governance-networks/) + +Understanding Open Governance Networks +====== + +![][1] + +Throughout the modern business era, industries and commercial operations have shifted substantially to digital processes. Whether you look at EDI as a means to exchange invoices or cloud-based billing and payment solutions today, businesses have steadily been moving towards increasing digital operations. In the last few years, we’ve seen the promises of digital transformation come alive, particularly in [industries that have shifted to software-defined models][2]. The next step of this journey will involve enabling digital transactions through decentralized networks. + +A fundamental adoption issue will be figuring out who controls and decides how a decentralized network is governed. It may seem oxymoronic at first, but decentralized networks still need governance. A future may hold autonomously self-governing decentralized networks, but this model is not accepted in industries today. The governance challenge with a decentralized network technology lies in who and how participants in a network will establish and maintain policies, network operations, on/offboarding of participants, setting fees, configurations, and software changes and are among the issues that will have to be decided to achieve a successful network. No company wants to participate or take a dependency on a network that is controlled or run by a competitor, potential competitor, or any single stakeholder at all for that matter. + +Earlier this year, [we presented a solution for Open Governance Networks][3] that enable an industry or ecosystem to govern itself in an open, inclusive, neutral, and participatory model. You may be surprised to learn that it’s based on best practices in open governance we’ve developed over decades of facilitating the world’s most successful and competitive open source projects. + +### The Challenge + +For the last few years, a running technology joke has been “describe your problem, and someone will tell you blockchain is the solution.” There have been many other concerns raised and confusion created, as overnight headlines hyped cryptocurrency schemes. Despite all this, behind the scenes, and all along, sophisticated companies understood a distributed ledger technology would be a powerful enabler for tackling complex challenges in an industry, or even a section of an industry. + +At the Linux Foundation, we focused on enabling those organizations to collaborate on open source enterprise blockchain technologies within our Hyperledger community. That community has driven collaboration on every aspect of enterprise blockchain technology, including identity, security, and transparency. Like other Linux Foundation projects, these enterprise blockchain communities are open, collaborative efforts. We have had many vertical industry participants engage, from retail, automotive, aerospace, banking, and others participate with real industry challenges they needed to solve. And in this subset of cases, enterprise blockchain is the answer. + +The technology is ready. Enterprise blockchain has been through many proof-of-concept implementations, and we’ve already seen that many organizations have shifted to production deployments. A few notable examples are: + + * [Trust Your Supplier Network][4] 25 major corporate members from Anheuser-Busch InBev to UPS In production since September 2019. + * [Foodtrust][5] Launched Aug 2017 with ten members, now being used by all major retailers. + * [Honeywell][6] 50 vendors with storefronts in the new marketplace. In its first year, GoDirect Trade processed more than $5 million in online transactions. + + + +However, just because we have the technology doesn’t mean we have the appropriate conditions to solve adoption challenges. A certain set of challenges about networks’ governance have become a “last mile” problem for industry adoption. While there are many examples of successful production deployments and multi-stakeholder engagements for commercial enterprise blockchains already, specific adoption scenarios have been halted over uncertainty, or mistrust, over who and how a blockchain network will be governed. + +To precisely state the issue, in many situations, company A does not want to be dependent on, or trust, company B to control a network. For specific solutions that require broad industry participation to succeed, you can name any industry, and there will be company A and company B. + +We think the solution to this challenge will be Open Governance Networks. + +### The Linux Foundation vision of the Open Governance Network + +An Open Governance Network is a distributed ledger service, composed of nodes, operated under the policies and directions of an inclusive set of industry stakeholders. + +Open Governance Networks will set the policies and rules for participation in a decentralized ledger network that acts as an industry utility for transactions and data sharing among participants that have permissions on the network. The Open Governance Network model allows any organization to participate. Those organizations that want to be active in sharing the operational costs will benefit from having a representative say in the policies and rules for the network itself. The software underlying the Open Governance Network will be open source software, including the configurations and build tools so that anyone can validate whether a network node complies with the appropriate policies. + +Many who have worked with the Linux Foundation will realize an open, neutral, and participatory governance model under a nonprofit structure that has already been thriving for decades in successful open source software communities. All we’re doing here is taking the same core principles of what makes open governance work for open source software, open standards, and open collaboration and applying those principles to managing a distributed ledger. This is a model that the Linux Foundation has used successfully in other communities, such as the [Let’s Encrypt][7] certificate authority. + +Our ecosystem members trust the Linux Foundation to help solve this last mile problem using open governance under a neutral nonprofit entity. This is one solution to the concerns about neutrality and distributed control. In pan-industry use cases, it is generally not acceptable for one participant in the network to have power in any way that could be used as an advantage over someone else in the industry.  The control of a ledger is a valuable asset, and competitive organizations generally have concerns in allowing one entity to control this asset. If not hosted in a neutral environment for the community’s benefit, network control can become a leverage point over network users. + +We see this neutrality of control challenge as the primary reason why some privately held networks have struggled to gain widespread adoption. In order to encourage participation, industry leaders are looking for a neutral governance structure, and the Linux Foundation has proven the open governance models accomplish that exceptionally well. + +This neutrality of control issue is very similar to the rationale for public utilities. Because the economic model mirrors a public utility, we debated calling these “industry utility networks.” In our conversations, we have learned industry participants are open to sharing the cost burden to stand up and maintain a utility. Still, they want a low-cost, not profit-maximizing model. That is why our nonprofit model makes the most sense. + +It’s also not a public utility in that each network we foresee today would be restricted in participation to those who have a stake in the network, not any random person in the world. There’s a layer of human trust that our communities have been enabling on top of distributed networks, which started with the [Trust over IP Foundation][8]. + +Unlike public cryptocurrency networks where anyone can view the ledger or submit proposed transactions, industries have a natural need to limit access to legitimate parties in their industry. With minor adjustments to address the need for policies for transactions on the network, we believe a similar governance model applied to distributed ledger ecosystems can resolve concerns about the neutrality of control. + +### Understanding LF Open Governance Networks + +Open Governance Networks can be reduced to the following building block components: + + * Business Governance: Networks need a decision-making body to establish core policies (e.g., network policies), make funding and budget decisions, contracting with a network manager, and other business matters necessary for the network’s success. The Linux Foundation establishes a governing board to manage the business governance. + * Technical Governance: Networks will require software. A technical open source community will openly maintain the software, specifications, or configuration decisions implemented by the network nodes. The Linux Foundation establishes a technical steering committee to oversee technical projects, configurations, working groups, etc. + * Transaction Entity: Networks will require a transaction entity that will a) act as counterparty to agreements with parties transacting on the network, b) collect fees from participants, and c) execute contracts for operational support (e.g., hiring a network manager). + + + +Of these building blocks, the Linux Foundation already offers its communities the Business and Technical Governance needed for Open Governance Networks. The final component is the new, LF Open Governance Networks. + +LF Open Governance Networks will enable our communities to establish their own Open Governance Network and have an entity to process agreements and collect transaction fees. This new entity is a Delaware nonprofit, a nonstock corporation that will maximize utility and not profit. Through agreements with the Linux Foundation, LF Governance Networks will be available to Open Governance Networks hosted at the Linux Foundation. + +If you’re interested in learning more about hosting an Open Governance Network at the Linux Foundation, please contact us at **[governancenetworks@linuxfoundation.org][9]** + +The post [Understanding Open Governance Networks][10] appeared first on [Linux Foundation][11]. + +-------------------------------------------------------------------------------- + +via: https://www.linux.com/news/understanding-open-governance-networks/ + +作者:[The Linux Foundation][a] +选题:[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.linuxfoundation.org/en/blog/understanding-open-governance-networks/ +[b]: https://github.com/lujun9972 +[1]: https://www.linux.com/wp-content/uploads/2021/02/understanding-opengovnetworks.png +[2]: https://www.linuxfoundation.org/blog/2020/09/software-defined-vertical-industries-transformation-through-open-source/ +[3]: https://www.linuxfoundation.org/blog/2020/10/introducing-the-open-governance-network-model/ +[4]: https://www.hyperledger.org/learn/publications/chainyard-case-study +[5]: https://www.hyperledger.org/learn/publications/walmart-case-study +[6]: https://www.hyperledger.org/learn/publications/honeywell-case-study +[7]: https://letsencrypt.org/ +[8]: https://trustoverip.org/ +[9]: mailto:governancenetworks@linuxfoundation.org +[10]: https://www.linuxfoundation.org/en/blog/understanding-open-governance-networks/ +[11]: https://www.linuxfoundation.org/ From 459ea6c349ccab19965639e79d9bc3e7833fc3ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:04:53 +0800 Subject: [PATCH 208/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?31=20open=20source=20text=20editors=20you=20need=20to=20try?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 31 open source text editors you need to try.md --- ...pen source text editors you need to try.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20210211 31 open source text editors you need to try.md diff --git a/sources/tech/20210211 31 open source text editors you need to try.md b/sources/tech/20210211 31 open source text editors you need to try.md new file mode 100644 index 0000000000..d9ca620bf4 --- /dev/null +++ b/sources/tech/20210211 31 open source text editors you need to try.md @@ -0,0 +1,182 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (31 open source text editors you need to try) +[#]: via: (https://opensource.com/article/21/2/open-source-text-editors) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +31 open source text editors you need to try +====== +Looking for a new text editor? Here are 31 options to consider. +![open source button on keyboard][1] + +Computers are text-based, so the more things you do with them, the more you find yourself needing a text-editing application. And the more time you spend in a text editor, the more likely you are to demand more from whatever you use. + +If you're looking for a good text editor, you'll find that Linux has plenty to offer. Whether you want to work in the terminal, on your desktop, or in the cloud, you can literally try a different editor every day for a month (or one a month for almost three years) in your relentless search for the perfect typing experience. + +### Vim-like editors + +![][2] + + * [Vi][3] ships with every Linux, BSD, Solaris, and macOS installation. It's the quintessential Unix text editor, with its unique combination of editing modes and super-efficient single-key shortcuts. The original Vi editor was an application written by Bill Joy, creator of the C shell. Modern incarnations of Vi, most notably Vim, have added many features, including multiple levels of undo, better navigation while in insert mode, line folding, syntax highlighting, plugin support, and much more. It takes practice (it even has its own tutor application, vimtutor.) + * [Kakoune][4] is a Vim-inspired application with a familiar, minimalistic interface, short keyboard shortcuts, and separate editing and insert modes. It looks and feels a lot like Vi at first, but with its own unique style, both in design and function. As a special bonus, it features an implementation of the Clippy interface. + + + +### emacs editors + +![][5] + + * The original free emacs, and one of the first official applications of the GNU project that started the Free Software movement, [GNU Emacs][6] is a wildly popular text editor. It's great for sysadmins, developers, and everyday users alike, with loads of features and seemingly endless extensions. Once you start using Emacs, you might find it difficult to think of a reason to close it because it's just that versatile! + * If you like Emacs but find GNU Emacs too bloated, then you might like [Jove][7]. Jove is a terminal-based emacs editor. It's easy to use, but if you're new to emacsen (the plural of emacs), Jove is also easy to learn, thanks to the teachjove command. + * Another lightweight emacs editor, [Jed][8] is a simple incarnation of a macro-based workflow. One thing that sets it apart from other editors is its use of [S-Lang][9], a C-like scripting language providing extensibility options to developers more comfortable with C than with Lisp. + + + +### Interactive editors + +![][10] + + * [GNU nano][11] takes a bold stance on terminal-based text editing: it provides a menu. Yes, this humble editor takes a cue from GUI editors by telling the user exactly which key they need to press to perform a specific function. This is a refreshing take on user experience, so it's no wonder that it's nano, not Vi, that's set as the default editor for "user-friendly" distributions. + * [JOE][12] is based on an old text-editing application called WordStar. If you're not familiar with Wordstar, JOE can also mimic Emacs or GNU nano. By default, it's a good compromise between something relatively mysterious like Emacs or Vi and the always-on verbosity of GNU Nano (for example, it tells you how to activate an onscreen help display, but it's not on by default). + * The excellent [e3][13] application is a tiny text editor with five built-in keyboard shortcut schemes to emulate Emacs, Vi, nano, NEdit, and WordStar. In other words, no matter what terminal-based editor you are used to, you're likely to feel right at home with e3. + + + +### ed and more + + * The [ed][14] line editor is part of the [POSIX][15] and Open Group's standard definition of a Unix-based operating system. You can count on it being installed on nearly every Linux or Unix system you'll ever encounter. It's tiny, terse, and tip-top. + * Building upon ed, the [Sed][16] stream editor is popular both for its functionality and its syntax. Most Linux users learn at least one sed command when searching for the easiest and fastest way to update a line in a config file, but it's worth taking a closer look. Sed is a powerful command with lots of useful subcommands. Get to know it better, and you may find yourself open text editor applications a lot less frequently. + * You don't always need a text editor to edit text. The [heredoc][17] (or Here Doc) system, available in any POSIX terminal, allows you to type text directly into your open terminal and then pipes what you type into a text file. It's not the most robust editing experience, but it is versatile and always available. + + + +### Minimalist editors + +![][18] + +If your idea of a good text editor is a word processor except without all the processing, you're probably looking for one of these classics. These editors let you write and edit text with minimal interference and minimal assistance. What features they do offer are often centered around markup, Markdown, or code. Some have names that follow a certain pattern: + + * [Gedit][19] from the GNOME team + * [medit][20] for a classic GNOME feel + * [Xedit][21] uses only the most basic X11 libraries + * [jEdit][22] for Java aficionados + + + +A similar experience is available for KDE users: + + * [Kate][23] is an unassuming editor with all the features you need. + * [KWrite][24] hides a ton of useful features in a deceptively simple, easy-to-use interface. + + + +And there are a few for other platforms: + + * [Notepad++][25] is a popular Windows application, while Notepadqq takes a similar approach for Linux. + * [Pe][26] is for Haiku OS (the reincarnation of that quirky child of the '90s, BeOS). + * [FeatherPad][27] is a basic editor for Linux but with some support for macOS and Haiku. If you're a Qt hacker looking to port code, take a look! + + + +### IDEs + +![][28] + +There's quite a crossover between text editors and integrated development environments (IDEs). The latter really is just the former with lots of code-specific features added on. If you use an IDE regularly, you might find an XML or Markdown editor lurking in your extension manager: + + * [NetBeans][29] is a handy text editor for Java users. + * [Eclipse][30] offers a robust editing suite with lots of extensions to give you the tools you need. + + + +### Cloud-based editors + +![][31] + +Working in the cloud? You can write there too, you know. + + * [Etherpad][32] is a text editor app that runs on the web. There are free and independent instances for you to use, or you can set up your own. + * [Nextcloud][33] has a thriving app scene and includes both a built-in text editor and a third-party Markdown editor with live preview. + + + +### Newer editors + +![][34] + +Everybody has an idea about what makes a text editor perfect. For that reason, new editors are released each year. Some reimplement classic old ideas in a new and exciting way, some have unique takes on the user experience, and some focus on specific needs. + + * [Atom][35] is an all-purpose modern text editor from GitHub featuring lots of extensions and Git integration. + * [Brackets][36] is an editor from Adobe for web developers. + * [Focuswriter][37] seeks to help you focus on writing with helpful features like a distraction-free fullscreen mode, optional typewriter sound effects, and beautiful configuration options. + * [Howl][38] is a progressive, dynamic editor based on Lua and Moonscript. + * [Norka][39] and [KJots][40] mimic a notebook with each document representing a "page" in your "binder." You can take individual pages out of your notebook through export functions. + + + +### DIY editor + +![][41] + +As the saying does _NOT_ go: Why use somebody else's application when you can write your own? Linux has over 30 text editors available, so probably the last thing it really needs is another one. Then again, part of the fun of open source is the ability to experiment. + +If you're looking for an excuse to learn how to program, making your own text editor is a great way to get started. You can achieve the basics in about 100 lines of code, and the more you use it, the more you'll be inspired to learn more so you can make improvements. Ready to get started? Go and [create your own text editor][42]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/open-source-text-editors + +作者:[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/button_push_open_keyboard_file_organize.png?itok=KlAsk1gx (open source button on keyboard) +[2]: https://opensource.com/sites/default/files/kakoune-screenshot.png +[3]: https://opensource.com/article/20/12/vi-text-editor +[4]: https://opensource.com/article/20/12/kakoune +[5]: https://opensource.com/sites/default/files/jed.png +[6]: https://opensource.com/article/20/12/emacs +[7]: https://opensource.com/article/20/12/jove-emacs +[8]: https://opensource.com/article/20/12/jed +[9]: https://www.jedsoft.org/slang +[10]: https://opensource.com/sites/default/files/uploads/nano-31_days-nano-opensource.png +[11]: https://opensource.com/article/20/12/gnu-nano +[12]: https://opensource.com/article/20/12/31-days-text-editors-joe +[13]: https://opensource.com/article/20/12/e3-linux +[14]: https://opensource.com/article/20/12/gnu-ed +[15]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[16]: https://opensource.com/article/20/12/sed +[17]: https://opensource.com/article/20/12/heredoc +[18]: https://opensource.com/sites/default/files/uploads/gedit-31_days_gedit-opensource.jpg +[19]: https://opensource.com/article/20/12/gedit +[20]: https://opensource.com/article/20/12/medit +[21]: https://opensource.com/article/20/12/xedit +[22]: https://opensource.com/article/20/12/jedit +[23]: https://opensource.com/article/20/12/kate-text-editor +[24]: https://opensource.com/article/20/12/kwrite-kde-plasma +[25]: https://opensource.com/article/20/12/notepad-text-editor +[26]: https://opensource.com/article/20/12/31-days-text-editors-pe +[27]: https://opensource.com/article/20/12/featherpad +[28]: https://opensource.com/sites/default/files/uploads/eclipse-31_days-eclipse-opensource.png +[29]: https://opensource.com/article/20/12/netbeans +[30]: https://opensource.com/article/20/12/eclipse +[31]: https://opensource.com/sites/default/files/uploads/etherpad_0.jpg +[32]: https://opensource.com/article/20/12/etherpad +[33]: https://opensource.com/article/20/12/31-days-text-editors-nextcloud-markdown-editor +[34]: https://opensource.com/sites/default/files/uploads/atom-31_days-atom-opensource.png +[35]: https://opensource.com/article/20/12/atom +[36]: https://opensource.com/article/20/12/brackets +[37]: https://opensource.com/article/20/12/focuswriter +[38]: https://opensource.com/article/20/12/howl +[39]: https://opensource.com/article/20/12/norka +[40]: https://opensource.com/article/20/12/kjots +[41]: https://opensource.com/sites/default/files/uploads/this-time-its-personal-31_days_yourself-opensource.png +[42]: https://opensource.com/article/20/12/31-days-text-editors-one-you-write-yourself From 9d55422d2bff15b0f5946089289e98372bedb032 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 12 Feb 2021 05:05:08 +0800 Subject: [PATCH 209/213] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210211=20?= =?UTF-8?q?What's=20new=20with=20ownCloud=20in=202021=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210211 What-s new with ownCloud in 2021.md --- ...210211 What-s new with ownCloud in 2021.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20210211 What-s new with ownCloud in 2021.md diff --git a/sources/tech/20210211 What-s new with ownCloud in 2021.md b/sources/tech/20210211 What-s new with ownCloud in 2021.md new file mode 100644 index 0000000000..aa6507c932 --- /dev/null +++ b/sources/tech/20210211 What-s new with ownCloud in 2021.md @@ -0,0 +1,180 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What's new with ownCloud in 2021?) +[#]: via: (https://opensource.com/article/21/2/owncloud) +[#]: author: (Martin Loschwitz https://opensource.com/users/martinloschwitzorg) + +What's new with ownCloud in 2021? +====== +The open source file sharing and syncing platform gets a total overhaul +based on Go and Vue.js and eliminates the need for a database. +![clouds in the sky with blue pattern][1] + +The newest version of ownCloud, [ownCloud Infinite Scale][2] (OCIS), is a complete rewrite of the venerable open source enterprise file sharing and syncing software stack. It features a new backend written in Go, a frontend in Vue.js, and many changes, including eliminating the need for a database. This scalable, modular approach replaces ownCloud's PHP, database, and [POSIX][3] filesystem and promises up to 10 times better performance. + +Traditionally, ownCloud was centered around the idea of having a POSIX-compatible filesystem to store data uploaded by users—different versions of the data and trash files, as well as configuration files and logs. By default, an ownCloud user's files were found in a path on their ownCloud instance, like `/var/www` or `/srv/www` (a web server's document root). + +Every admin who has maintained an ownCloud instance knows that they grow massive; today, they usually start out much larger than ownCloud was originally designed for. One of the largest ownCloud instances is Australia's Academic and Research Network (AARNet), a company that stores more than 100,000 users' data. + +### Let's 'Go' for microservices + +ownCloud's developers determined that rewriting the codebase with [Go][4] could bring many advantages over PHP. Even when computer programs appear to be one monolithic piece of code, most are split into different components internally. The web servers that are usually deployed with ownCloud (such as Apache) are an excellent example. Internally, one function handles TCP/IP connections, another function might handle SSL, and yet another piece of code executes the requested PHP files and delivers the results to the end user. All of those events must happen in a certain order. + +ownCloud's developers wanted the new version to serve multiple steps concurrently so that events can happen simultaneously. Software capable of handling requests in parallel doesn't have to wait around for one process to finish before the next can begin, so they can deliver results faster. Concurrency is one of the reasons Go is so popular in containerized micro-architecture applications. + +With OCIS, ownCloud is adapting to an architecture centered around the principle of microservices. OCIS is split into three tiers: storage, core, and frontend. I'll look at each of these tiers, but the only thing that really matters to people is overall performance. Users don't think about software in tiers; they just want the software to work well and work quickly. + +### Tier 1: Storage + +The storage available to the system is ownCloud's lowest tier. Performance also brings scalability; large ownCloud instances must be able to cope with the load of thousands of clients and add additional disk space if the existing storage fills up. + +Like so many other concepts today, object stores and scalable storage weren't available when ownCloud was designed. Administrators now are used to having more choices, so ownCloud permits outsourcing physical storage device handling to an external solution. While S3-based object storage, Samba-based storage, and POSIX-compatible filesystem options are still supported in OCIS, the preferred way to deploy it is with [Earth Observing System][5] (EOS) storage. + +#### EOS to the rescue + +EOS is optimized for very low latency when accessing files. It provides disk-based storage to clients through the [XRootD][6] framework but also permits other protocols to access files. ownCloud uses EOS's HTTP protocol extension to talk to the storage solution (using the HTTPS protocol). EOS also allows almost "infinite" scalability. For instance, [CERN's EOS setup][7] includes more than 200PB of disk storage and continues to grow. + +By choosing EOS, ownCloud eliminated several shortcomings of traditional storage solutions: + + * EOS doesn't have a typical single point of failure. + * All relevant services are run redundantly, including the ability to scale out and add instances of all existing services. + * EOS promises to never run out of actual disk space and comes with built-in redundancy for stored data. + + + +For large environments, ownCloud expects the administrator to deploy an EOS instance with OCIS. In exchange for the burden of maintaining a separate storage system, the admin gets the benefit of not having to worry about the OCIS instance's scalability and performance. + +#### What about small setups? + +This hints at ownCloud's assumed use case for OCIS: It's no longer a small business all-in-one server nor a small home server. ownCloud's strategy with OCIS targets large data centers. For small or home office setups, EOS is likely to be excessive and overly demanding for a single admin to manage. OCIS serves small setups through the [Reva][8] framework, which enables support for S3, Samba, and even POSIX-compatible filesystems. This is possible because EOS is not hardcoded into OCIS. Reva can't provide the same feature set as EOS, but it accomplishes most of the needs of end users and small installations. + +### Tier 2: Core + +OCIS's second tier is (due to Go) more of a collection of microservices than a singular core. Each one is responsible for handling a single task in the background (e.g., scanning for viruses). Basically, all of OCIS's functionality results from a specific microservice's work, like authenticating requests using OpenID Connect against an identity provider. In the end, that makes it a simple task to connect existing user directories—such as Active Directory Federation Services (ADFS), Azure AD, or Lightweight Directory Access Protocol (LDAP)—to ownCloud. For those that do not have an existing identity provider, ownCloud ships its own instance, effectively making ownCloud maintain its own user database. + +### Tier 3: Frontend + +OCIS's third tier, the frontend, is what the vendor calls ownCloud Web. It's a complete rewrite of the user interface and is based on the Vue.js JavaScript framework. Like the OCIS core, the web frontend is written based on microservices principles and hence allows better performance and scalability. The developers also used the opportunity to give the web interface a makeover; compared to previous ownCloud versions, the OCIS web interface looks smaller and slicker. + +OCIS's developers did an impressive job complying with modern software design principles. The fundamental problem in building applications according to the microservices approach is making the environment's individual components communicate with each other. APIs can come to the rescue, but that means every micro component must have its own well-defined API interface. + +Luckily, there are existing tools to take that burden off developers' shoulders, most notably [gRPC][9]. The idea behind gRPC is to have a set of predefined APIs that trigger actions in one component from within another. + +### Other notable design changes + +#### Tackling network traffic with Traefik + +This new application design brings some challenges to the underlying network. OCIS's developers chose the [Traefik][10] framework to tackle them. Traefik automatically load-balances different instances of microservices, manages automated SSL encryption, and allows additional deployments of firewall rules. + +The split between the backend and the frontend add advantages to OCIS. In fact, the user's actions triggered through ownCloud Web are completely decoupled from the ownCloud engine performing the task in the backend. If a user manually starts a virus check on files stored in ownCloud, they don't have to wait for the check to finish. Instead, the check happens in the background, and the user sees the results after the check is completed. This is the principle of concurrency at work. + +#### Extensions as microservices + +Like other web services, ownCloud supports extending its capabilities through extensions. OCIS doesn't change this, but it promises to tackle a well-known problem, especially with community apps. Apps of unknown origin can cause trouble in the server, hamper updates, and negatively impact the server's overall performance. + +OCIS's new, gRPC-based architecture makes it much easier to create extensions alongside existing microservices. Because the API is predefined by gRPC, developers merely need to create a microservice featuring the desired functionality that can be controlled by gRPC. Traefik, on a per-case basis, ensures that newly deployed add-ons are automatically added to the existing communication mesh. + +#### Goodbye, MySQL! + +ownCloud's switch to gRPC and microservices eliminates the need for a relational database. Instead, components that need to store metadata do it on their own. Due to Reva and the lack of a MySQL dependency, the complexity of running ownCloud in small environments is reduced considerably—an especially welcome bonus for maintainers of large-scale data centers, but nice for admins of any size installation. + +### Getting OCIS up and running + +ownCloud published a technical preview of OCIS 1.0 in December 2020, [shipping it][11] as a Docker container and binaries. More examples of getting it running are linked in the deployment section of its [GitHub repository][12]. + +#### Install with Docker + +Getting OCIS up and running with Docker containers is easy, although things can get complicated if you're new to EOS. Docker images for OCIS are available on [Docker Hub][13]. Look for the Latest tag for the current master branch. + +Any standard virtual machine from one of the big cloud providers or any entry-level server in a data center that uses a standard Linux distribution should be sufficient, provided the system has a container runtime installed. + +Assuming you have Docker or Podman installed, the command to start OCIS is simple: + + +``` +`$ docker run --rm -ti -p 9200:9200 owncloud/ocis` +``` + +That's it! OCIS is now waiting at your service on localhost port 9200. Open a web browser and navigate to `http://localhost:9200` to check it out. + +The demo accounts and passwords are `einstein:relativity`, `marie:radioactivity`, and `richard:superfluidity`. Admin accounts are `moss:vista` and `admin:admin`. If OCIS runs on a server with a resolvable hostname, it can request an SSL certificate from Let's Encrypt using Traefik. + +![OCIS contains no files at first login][14] + +(Martin Loschwitz, [CC BY-SA 4.0][15]) + +![OCIS user management interface][16] + +(Martin Loschwitz, [CC BY-SA 4.0][15]) + +#### Install with binary + +As an alternative to Docker, there also is a pre-compiled binary available. Thanks to Go, users can [download the latest binaries][17] from the Master branch. + +OCIS's binary edition expects `/var/tmp/ocis` as the default storage location, but you can change that in its configuration. You can start the OCIS server with: + + +``` +`$ ./ocis server` +``` + +Here are some of the subcommands available through the `ocis` binary: + + * `ocis health` runs a health check. A result greater than 0 indicates an error. + * `ocis list` prints all running OCIS extensions. + * `ocis run foo` starts a particular extension (`foo`, in this example). + * `ocis kill foo` stops a particular extension (`foo`, in this example). + * `ocis --help` prints a help message. + + + +The project's GitHub repository contains full [documentation][11]. + +### Setting up EOS (it's complicated) + +Following ownCloud's recommendations to deploy OCIS with EOS for large environments requires some additional steps. EOS not only adds required hardware and increases the whole environment's complexity, but it's also a slightly bigger task to set it up. CERN provides concise [EOS documentation][18] (linked from its [GitHub repository][19]), and ownCloud offers a [step-by-step guide][20]. + +In a nutshell, users have to get and start EOS and OCIS containers; configure LDAP support; and kill home, users', and metadata storage before starting them with the EOS configuration. Last but not least, the accounts service needs to be set up to work with EOS. All of these steps are "docker-compose" commands documented in the GitHub repository. The Storage Backends page on EOS also provides information on verification, troubleshooting, and a command reference for the built-in EOS shell. + +### Weighing risks and rewards + +ownCloud Infinite Scale is easy to install, faster than ever before, and better prepared for scalability. The modular design, with microservices and APIs (even for its extensions), looks promising. ownCloud is embracing new technology and developing for the future. If you run ownCloud, or if you've been thinking of trying it, there's never been a better time. Keep in mind that this is still a technology preview and is on a rolling release published every three weeks, so please report any bugs you find. + +Jos Poortvliet shares some of his favorite uses for the open source self-hosted storage platform. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/2/owncloud + +作者:[Martin Loschwitz][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/martinloschwitzorg +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern) +[2]: https://owncloud.com/infinite-scale/ +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://golang.org/ +[5]: https://en.wikipedia.org/wiki/Earth_Observing_System +[6]: https://xrootd.slac.stanford.edu/ +[7]: https://eos-web.web.cern.ch/eos-web/ +[8]: https://reva.link/ +[9]: https://en.wikipedia.org/wiki/GRPC +[10]: https://opensource.com/article/20/3/kubernetes-traefik +[11]: https://owncloud.github.io/ocis/getting-started/ +[12]: https://github.com/owncloud/ocis +[13]: https://hub.docker.com/r/owncloud/ocis +[14]: https://opensource.com/sites/default/files/uploads/ocis5.png (OCIS contains no files at first login) +[15]: https://creativecommons.org/licenses/by-sa/4.0/ +[16]: https://opensource.com/sites/default/files/uploads/ocis2.png (OCIS user management interface) +[17]: https://download.owncloud.com/ocis/ocis/ +[18]: https://eos-docs.web.cern.ch/ +[19]: https://github.com/cern-eos/eos +[20]: https://owncloud.github.io/ocis/storage-backends/eos/ From 64d9540a3ef5609e162e76a1763cee2d7009abae Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 12 Feb 2021 10:25:35 +0800 Subject: [PATCH 210/213] Rename sources/tech/20210211 Understanding Open Governance Networks.md to sources/talk/20210211 Understanding Open Governance Networks.md --- .../20210211 Understanding Open Governance Networks.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210211 Understanding Open Governance Networks.md (100%) diff --git a/sources/tech/20210211 Understanding Open Governance Networks.md b/sources/talk/20210211 Understanding Open Governance Networks.md similarity index 100% rename from sources/tech/20210211 Understanding Open Governance Networks.md rename to sources/talk/20210211 Understanding Open Governance Networks.md From c557d36d8114d9cd6547d96a6211c6e911a24c21 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 12 Feb 2021 11:19:07 +0800 Subject: [PATCH 211/213] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ShuyRoy 感谢你,完成了第一篇翻译贡献! (不过,这篇有点过时了 —— 所以我在措辞上有修改,建议下回可以选择更新、更有意思的文章) --- ...s Optane for data center memory caching.md | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md index 5d258ab61f..a58313ed61 100644 --- a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md +++ b/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md @@ -1,52 +1,48 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Intel formally launches Optane for data center memory caching) [#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) -英特尔正式推出Optane:用于数据中心内存缓存 +英特尔 Optane:用于数据中心内存缓存 ====== -### 英特尔正式推出包含3D Xpoint 内存技术的傲腾持久内存产品线。英特尔的这个解决方案将傲腾持久内存放置在DRAM和NAND中间,以此来提升性能。 +![](https://img.linux.net.cn/data/attachment/album/202102/12/111720yq1rvxcncjdsjb0g.jpg) + +> 英特尔推出了包含 3D Xpoint 内存技术的 Optane 持久内存产品线。英特尔的这个解决方案介乎于 DRAM 和 NAND 中间,以此来提升性能。 ![Intel][1] -英特尔在周二(2019年4月2日)的[大数据中心活动][2]中正式推出傲腾持久内存产品线。傲腾持久内存已经问世了一段时间,但是目前的Xeon服务器处理器还不能充分利用它。而新的Xeon8200和9200可以充分利用傲腾持久内存的优势。 +英特尔在 2019 年 4 月的[大规模数据中心活动][2]中正式推出 Optane 持久内存产品线。它已经问世了一段时间,但是目前的 Xeon 服务器处理器还不能充分利用它。而新的 Xeon8200 和 9200 系列可以充分利用 Optane 持久内存的优势。 -由于傲腾是英特尔的产品(与美光合作开发),所以意味着AMD和ARM的服务器处理器不能够支持它。 +由于 Optane 是英特尔的产品(与美光合作开发),所以意味着 AMD 和 ARM 的服务器处理器不能够支持它。 -正如[我之前所说的][3],傲腾DC持久内存采用与美光合作研发的3D Xpoint内存技术。3D Xpoint是一种比SSD更快的非易失性内存,速度几乎与DRAM相近,而且它具有NAND flash的持久性。 +正如[我之前所说的][3],OptaneDC 持久内存采用与美光合作研发的 3D Xpoint 内存技术。3D Xpoint 是一种比 SSD 更快的非易失性内存,速度几乎与 DRAM 相近,而且它具有 NAND 闪存的持久性。 -**[ 小编推荐:[为什么是NVMe?用户会权衡基于NVMe加速的闪存的优点。][4] 和 [IDC的十大数据中心预测][5] | 定期更新的新闻[请注册网络世界通信][6] ]** +第一个 3D Xpoint 产品是被称为英特尔“尺子”的 SSD,因为它们被设计成细长的样子,很像尺子的形状。它们被设计这样是为了适合 1u 的服务器机架。在发布的公告中,英特尔推出了新的利用四芯或者 QLC 3D NAND 内存的英特尔 SSD D5-P4325 [尺子][7] SSD,可以在 1U 的服务器机架上放 1PB 的存储。 -第一个3D Xpoint产品是被称为英特尔“尺子”的SSD,因为它们被设计成细长的样子,很像尺子的形状。他们被设计得能够适合1u的服务器托架。在周二发布的公告中,英特尔推出了新的利用四-cell或者QLC 3D NAND 内存的英特尔SSD D5-P4325[“尺子”][7]SSD,可以在1u的服务器托架上放1PB的存储。 +OptaneDC 持久内存的可用容量最初可以通过使用 128GB 的 DIMM 达到 512GB。英特尔数据中心集团执行副总裁及总经理 Navin Shenoy 说:“OptaneDC 持久内存可达到的容量是 DRAM 的 2 到 4 倍。” -傲腾DC持久内存的可用容量最初可以通过使用128GB的DIMM达到512GB。这次活动的关键人物——英特尔数据中心集团执行副总裁及总经理Navin Shenoy说:“傲腾DC持久内存可达到的容量是DRAM的2到4倍。” +他说:“我们希望服务器系统的容量可以扩展到每个插槽 4.5TB 或者 8 个插槽 36TB,这是我们第一代 Xeon 可扩展芯片的 3 倍。” -他说:“我们希望服务器系统的容量可以扩展到每个插槽4.5TB或者8个插槽36TB,这是我们第一代Xeon可扩展芯片的3倍。” +### 英特尔Optane内存的使用和速度 -## 英特尔傲腾内存的使用和速度 +Optane 有两种不同的运行模式:内存模式和应用直连模式。内存模式是将 DRAM 放在 Optane 内存之上,将 DRAM 作为 Optane 内存的缓存。应用直连模式是将 DRAM 和 OptaneDC 持久内存一起作为内存来最大化总容量。并不是每个工作负载都适合这种配置,所以应该在对延迟不敏感的应用程序中使用。正如英特尔推广的那样,Optane 的主要使用情景是内存模式。 -傲腾有两种不同的运行模式:内存模式和APP直连模式。内存模式是将DRAM放在傲腾内存之上,将DRAM作为傲腾内存的缓存。APP直连模式是将DRAM和傲腾持久内存一起作为内存来最大化总容量。并不是每个工作负载都适合这种配置,所以应该在对延迟不敏感的应用程序中使用。正如英特尔推广的那样,傲腾的主要使用情景是内存模式。 +几年前,当 3D Xpoint 最初发布时,英特尔宣称 Optane 的速度是 NAND 的 1000 倍,耐用是 NAND 的 1000 倍,密度潜力是 DRAM 的 10 倍。这虽然有点夸张,但这些因素确实很令人着迷。 -**[[通过PluralSight上的7部分线上课程来获得苹果技术合作者的认证。][8] ]** +在 256B 的连续 4 个缓存行中使用 Optane 内存可以达到 8.3GB/秒的读速度和 3.0GB/秒的写速度。与 SATA SSD 的 500MB/秒左右的读/写速度相比,可以看到性能有很大提升。请记住,Optane 充当内存,所以它会缓存被频繁访问的 SSD 中的内容。 -几年前,当3D Xpoint最初发布时,英特尔宣称傲腾的速度是NAND的1000倍,忍耐力是NAND的1000倍,密度是DRAM的10倍。这虽然有点夸张,但这些因素确实很令人着迷。 +这是了解 OptaneDC 的关键。它能将非常大的数据集存储在离内存非常近的位置,因此具有很低延迟的 CPU 可以最小化访问较慢的存储子系统的访问延迟,无论存储是 SSD 还是 HDD。现在,它提供了一种可能性,即把多个 TB 的数据放在非常接近 CPU 的地方,以实现更快的访问。 -在256B的连续4个缓存行中使用傲腾内存可以达到8.3GB/秒的读速度和3.0GB/秒的写速度。与SATA SSD的500MB/秒左右的读/写速度相比,可以看到性能有很大提升。请记住,傲腾充当内存,所以它会缓存被频繁访问的SSD中的内容。 +### Optane 内存的一个挑战 -这是了解傲腾DC的关键。它能将非常大的数据集存储在离内存非常近的位置,因此具有很低延迟的CPU可以最小化访问较慢的存储子系统的访问延迟,无论存储是SSD还是HDD。现在,它提供了将很多TB的数据放在离CPU很近的位置,以获得更快的访问速度。 +唯一真正的挑战是 Optane 插进内存所在的 DIMM 插槽。现在有些主板的每个 CPU 有多达 16 个 DIMM 插槽,但是这仍然是客户和设备制造商之间需要平衡的电路板空间:Optane 还是内存。有一些 Optane 驱动采用了 PCIe 接口进行连接,可以减轻主板上内存的拥挤。 -## 傲腾内存的一个挑战 - -唯一真正的挑战是傲腾然后插进内存所在的DIMM插槽。现在有些主板的每个CPU有16个插槽,但是这仍然是客户和设备制造商之间需要平衡的:傲腾VS内存。有一些傲腾驱动采用了PCIe接口进行连接,可以减轻主板上内存的拥挤。 - -3D Xpoint由于它写数据的方式,提供了比传统的NAND flash更高的耐久力。英特尔承诺傲腾提供5年保修期,而很多SSD只提供3年保修期。 - -加入Facebook[Facebook][9]和LinkedIn[LinkedIn][10]上的网络世界社区,对你最关心的话题发表评论吧。 +3D Xpoint 由于它写数据的方式,提供了比传统的 NAND 闪存更高的耐用性。英特尔承诺 Optane 提供 5 年保修期,而很多 SSD 只提供 3 年保修期。 -------------------------------------------------------------------------------- @@ -55,7 +51,7 @@ via: https://www.networkworld.com/article/3387117/intel-formally-launches-optane 作者:[Andy Patrizio][a] 选题:[lujun9972][b] 译者:[RiaXu](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 793ba23ba2688862bce16322cb8cb62c85ada64e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 12 Feb 2021 11:20:08 +0800 Subject: [PATCH 212/213] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @ShuyRoy 本问首发地址:https://linux.cn/article-13109-1.html 你的 LCTT 专页:https://linux.cn/lctt/ShuyRoy --- ...formally launches Optane for data center memory caching.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190404 Intel formally launches Optane for data center memory caching.md (98%) diff --git a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md b/published/20190404 Intel formally launches Optane for data center memory caching.md similarity index 98% rename from translated/tech/20190404 Intel formally launches Optane for data center memory caching.md rename to published/20190404 Intel formally launches Optane for data center memory caching.md index a58313ed61..f07eb56caa 100644 --- a/translated/tech/20190404 Intel formally launches Optane for data center memory caching.md +++ b/published/20190404 Intel formally launches Optane for data center memory caching.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (ShuyRoy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13109-1.html) [#]: subject: (Intel formally launches Optane for data center memory caching) [#]: via: (https://www.networkworld.com/article/3387117/intel-formally-launches-optane-for-data-center-memory-caching.html#tk.rss_all) [#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/) From a595e417531e8a0a98ffc9b8680b621a9bb1ee0a Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 12 Feb 2021 15:28:41 +0800 Subject: [PATCH 213/213] Translating --- .../20210115 How to Create and Manage Archive Files in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md b/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md index d49695b76f..ee99ce7a6d 100644 --- a/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md +++ b/sources/tech/20210115 How to Create and Manage Archive Files in Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( )